@galacean/effects-threejs 2.8.0-alpha.2 → 2.8.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -3,6 +3,6 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.8.0-alpha.2
7
- */function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.three={}),t.THREE)}(this,function(t,e){"use strict";var i,r,n,a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,w,S,A,M,I,P,R,O,N,L,V,F,D,k,z,B,U,G,j,W,X,H,Y,Z,q,Q,K,J,$,tt,te,ti,tr,tn,ta,to,ts,tu,th,tl,tc,tf,td,tp,tm,tv,ty,tg,tx,tb,tT,t_,tE,tC,tw,tS,tA,tM,tI,tP,tR,tO,tN,tL,tV,tF,tD,tk,tz,tB,tU,tG,tj,tW,tX,tH,tY,tZ,tq,tQ,tK,tJ,t$,t0,t1,t2,t3,t4,t5,t6,t8,t9,t7,et,ee,ei,er,en,ea,eo,es,eu,eh,el,ec,ef,ed,ep,em,ev,ey,eg,ex,eb,eT,e_,eE,eC,ew,eS,eA,eM,eI,eP,eR,eO,eN=function(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(i){if("default"!==i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}}),e.default=t,Object.freeze(e)}(e);function eL(t,e,i,r,n,a,o){try{var s=t[a](o),u=s.value}catch(t){i(t);return}s.done?e(u):Promise.resolve(u).then(r,n)}function eV(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var a=t.apply(e,i);function o(t){eL(a,r,n,o,s,"next",t)}function s(t){eL(a,r,n,o,s,"throw",t)}o(void 0)})}}function eF(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):eF(t,e)}function eD(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function ek(t,e,i,r){var n,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o}function ez(t,e){var i,r,n,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(i)throw TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;for(var eB=new Uint8Array(16),eU=[],eG=0;eG<256;++eG)eU.push((eG+256).toString(16).slice(1));var ej={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eW(t,e){return t.includes(e)||t.push(e),t}function eX(t,e){var i=t.indexOf(e);return i>-1&&t.splice(i,1),t}function eH(t,e,i,r){if(void 0===r&&(r=1),t.buffer.byteLength<t.BYTES_PER_ELEMENT*e){var n=Math.ceil(e*r);Number.isNaN(i)||(n=Math.min(n,i));var a=new ArrayBuffer(t.BYTES_PER_ELEMENT*n),o=new t.constructor(a);return o.set(t),o}return t}var eY=Math.PI/180,eZ=180/Math.PI;function eq(t,e){return 1e-6>Math.abs(t-e)||t===1/0&&e===1/0||t===-1/0&&e===-1/0}var eQ=function(t,e,i){return(1-i)*t+i*e};function eK(t,e,i){var r=isNaN(e)?-1/0:e,n=isNaN(i)?1/0:i;return Math.min(Math.max(t,Math.min(r,n)),Math.max(r,n))}var eJ=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.setZero=function(){return this.x=0,this.y=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this},e.setFromArray=function(t,e){var i,r;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this},e.clone=function(){return new t(this.x,this.y)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t):eF(t,Array)?(this.x+=t[0],this.y+=t[1]):(this.x+=t.x,this.y+=t.y),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t):eF(t,Array)?(this.x-=t[0],this.y-=t[1]):(this.x-=t.x,this.y-=t.y),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t):eF(t,Array)?(this.x*=t[0],this.y*=t[1]):(this.x*=t.x,this.y*=t.y),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t):eF(t,Array)?(this.x/=t[0],this.y/=t[1]):(this.x/=t.x,this.y/=t.y),this},e.scale=function(t){return this.x*=t,this.y*=t,this},e.sum=function(){return this.x+this.y},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.cross=function(t){return this.x*t.y-this.y*t.x},e.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},e.equals=function(t){return this.x===t.x&&this.y===t.y},e.isZero=function(){var t=this.x,e=this.y;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)},e.toArray=function(){return[this.x,this.y]},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();eJ.ONE=new eJ(1,1),eJ.ZERO=new eJ(0,0);var e$=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=i}var e=t.prototype;return e.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this},e.setFromArray=function(t,e){var i,r,n;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.clone=function(){return new t(this.x,this.y,this.z)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t):eF(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2]):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t):eF(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2]):(this.x-=t.x,this.y-=t.y,this.z-=t.z),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t):eF(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2]):(this.x*=t.x,this.y*=t.y,this.z*=t.z),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t):eF(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2]):(this.x/=t.x,this.y/=t.y,this.z/=t.z),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.sum=function(){return this.x+this.y+this.z},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.cross=function(t){return this.crossVectors(this,t)},e.crossVectors=function(t,e){var i=t.x,r=t.y,n=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-n*o,this.y=n*a-i*s,this.z=i*o-r*a,this},e.reflect=function(t){return this.subtract(t.clone().multiply(2*this.dot(t)))},e.distance=function(t){return Math.sqrt(this.distanceSquared(t))},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.isZero=function(){var t=this.x,e=this.y,i=this.z;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)},e.toArray=function(){return[this.x,this.y,this.z]},e.toVector2=function(){return new eJ(this.x,this.y)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},e.applyEuler=function(t,e){return t.rotateVector3(this,e)},e.applyQuaternion=function(t,e){return t.rotateVector3(this,e)},e.applyMatrix=function(t,e){return t.transformPoint(this,e)},e.applyNormalMatrix=function(t,e){return t.transformNormal(this,e)},e.applyProjectionMatrix=function(t,e){return t.projectPoint(this,e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e$.X=new e$(1,0,0),e$.Y=new e$(0,1,0),e$.Z=new e$(0,0,1),e$.ONE=new e$(1,1,1),e$.ZERO=new e$(0,0,0);var e0=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this.w=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this.w=null!=(a=t[e+3])?a:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t,this.w+=t):eF(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2],this.w+=t[3]):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t,this.w-=t):eF(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2],this.w-=t[3]):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):eF(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2],this.w*=t[3]):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this.w=t.w*e.w,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t,this.w/=t):eF(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2],this.w/=t[3]):(this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.sum=function(){return this.x+this.y+this.z+this.w},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t),this.w=Math.min(this.w,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t),this.w=Math.max(this.w,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this.w=Math.abs(this.w),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.isZero=function(){var t=this.x,e=this.y,i=this.z,r=this.w;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)&&1e-6>=Math.abs(r)},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector3=function(){return new e$(this.x,this.y,this.z)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},e.applyMatrix=function(t,e){return t.transformVector4(this,e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e0.ONE=new e0(1,1,1,1),e0.ZERO=new e0(0,0,0,0);var e1=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=i,this.a=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.r=t,this.g=e,this.b=i,this.a=r,this},e.setZero=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this},e.setFromNumber=function(t){return this.r=t,this.g=t,this.b=t,this.a=t,this},e.setFromVector4=function(t){return this.r=t.x,this.g=t.y,this.b=t.z,this.a=t.w,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.r=null!=(i=t[e])?i:0,this.g=null!=(r=t[e+1])?r:0,this.b=null!=(n=t[e+2])?n:0,this.a=null!=(a=t[e+3])?a:0,this},e.setFromHSV=function(t,e,i,r){void 0===r&&(r=1);var n=i*e,a=t/60,o=n*(1-Math.abs(a%2-1)),s=0,u=0,h=0;a>=0&&a<=1?(s=n,u=o):a>=1&&a<=2?(s=o,u=n):a>=2&&a<=3?(u=n,h=o):a>=3&&a<=4?(u=o,h=n):a>=4&&a<=5?(s=o,h=n):a>=5&&a<=6&&(s=n,h=o);var l=i-n;return this.set(s+l,u+l,h+l,r)},e.setFromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length&&7!==t.length)return this;var e=parseInt(t.substring(1,3),16)/255,i=parseInt(t.substring(3,5),16)/255,r=parseInt(t.substring(5,7),16)/255,n=9===t.length?parseInt(t.substring(7,9),16)/255:1;return this.set(e,i,r,n)},e.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},e.clone=function(){return new t(this.r,this.g,this.b,this.a)},e.setElement=function(t,e){switch(t){case 0:this.r=e;break;case 1:this.g=e;break;case 2:this.b=e;break;case 3:this.a=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.r;case 1:return this.g;case 2:return this.b;case 3:return this.a;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.r+=t,this.g+=t,this.b+=t,this.a+=t):eF(t,Array)?(this.r+=t[0],this.g+=t[1],this.b+=t[2],this.a+=t[3]):(this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a),this},e.subtract=function(t){return"number"==typeof t?(this.r-=t,this.g-=t,this.b-=t,this.a-=t):eF(t,Array)?(this.r-=t[0],this.g-=t[1],this.b-=t[2],this.a-=t[3]):(this.r-=t.r,this.g-=t.g,this.b-=t.b,this.a-=t.a),this},e.multiply=function(t){return"number"==typeof t?(this.r*=t,this.g*=t,this.b*=t,this.a*=t):eF(t,Array)?(this.r*=t[0],this.g*=t[1],this.b*=t[2],this.a*=t[3]):(this.r*=t.r,this.g*=t.g,this.b*=t.b,this.a*=t.a),this},e.divide=function(t){return"number"==typeof t?(this.r/=t,this.g/=t,this.b/=t,this.a/=t):eF(t,Array)?(this.r/=t[0],this.g/=t[1],this.b/=t[2],this.a/=t[3]):(this.r/=t.r,this.g/=t.g,this.b/=t.b,this.a/=t.a),this},e.scale=function(t){return this.r*=t,this.g*=t,this.b*=t,this.a*=t,this},e.min=function(t){return"number"==typeof t?(this.r=Math.min(this.r,t),this.g=Math.min(this.g,t),this.b=Math.min(this.b,t),this.a=Math.min(this.a,t)):(this.r=Math.min(this.r,t.r),this.g=Math.min(this.g,t.g),this.b=Math.min(this.b,t.b),this.a=Math.min(this.a,t.a)),this},e.max=function(t){return"number"==typeof t?(this.r=Math.max(this.r,t),this.g=Math.max(this.g,t),this.b=Math.max(this.b,t),this.a=Math.max(this.a,t)):(this.r=Math.max(this.r,t.r),this.g=Math.max(this.g,t.g),this.b=Math.max(this.b,t.b),this.a=Math.max(this.a,t.a)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.lerp=function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this.a+=(t.a-this.a)*e,this},e.luminance=function(){return .3*this.r+.59*this.g+.11*this.b},e.equals=function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a},e.toLinear=function(){return this.r=t.gammaToLinear(this.r),this.g=t.gammaToLinear(this.g),this.b=t.gammaToLinear(this.b),this},e.toGamma=function(){return this.r=t.linearToGamma(this.r),this.g=t.linearToGamma(this.g),this.b=t.linearToGamma(this.b),this},e.toArray=function(){return[this.r,this.g,this.b,this.a]},e.toVector4=function(){return new e0(this.r,this.g,this.b,this.a)},e.toHSV=function(){var e=this.r,i=this.g,r=this.b,n=this.a,a=Math.max(e,i,r),o=Math.min(e,i,r),s=a-o,u=0,h=0;return 0!==a&&(h=s/a),a!=o&&(a==e?(u=(i-r)/s,i<r&&(u+=6)):a==i?u=(r-e)/s+2:a==r&&(u=(e-i)/s+4),u*=60),new t(u,h,a,n)},e.toHexString=function(e){void 0===e&&(e=!0);var i=t.ToHex(Math.round(255*this.r)),r=t.ToHex(Math.round(255*this.g)),n=t.ToHex(Math.round(255*this.b)),a=t.ToHex(Math.round(255*this.a));return e?"#"+i+r+n+a:"#"+i+r+n},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromHexString=function(e){return new t().setFromHexString(e)},t.fromHSV=function(e,i,r,n){return void 0===n&&(n=1),new t().setFromHSV(e,i,r,n)},t.gammaToLinear=function(t){return t<=0?0:t<=.04045?t/12.92:t<1?Math.pow((t+.055)/1.055,2.4):Math.pow(t,2.4)},t.linearToGamma=function(t){return t<=0?0:t<.0031308?12.92*t:t<1?1.055*Math.pow(t,.41666)-.055:Math.pow(t,.41666)},t.ToHex=function(t){var e=t.toString(16);return t<=15?("0"+e).toUpperCase():e.toUpperCase()},t}();function e2(t,e){var i=[0,0,0,0];if(im(t)){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:255*n]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else eF(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:t[3]]);if(e)for(var a=0;a<4;a++)i[a]/=255;return i}function e3(t,e,i){if(t.length){for(var r,n=1;n<=t.length-1;n++){var a=t[n-1],o=t[n];if(a.time<=e&&e<=o.time){r=e5(a.color.toArray(),o.color.toArray(),(e-a.time)/(o.time-a.time));break}}return r||(r=t[t.length-1].color.toArray()),i?r.map(function(t){return t/255}):r}return[0,0,0,0]}function e4(t){var e=[];if(eF(t,Array)?t.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3],o=t[4];e.push({time:e6(i),color:new e1(r,n,a,o)})}):Object.keys(t).forEach(function(i){var r=t[i],n=new e1().setFromArray(e2(r));e.push({time:e6(i),color:n})}),(e=e.sort(function(t,e){return t.time-e.time})).length){0!==e[0].time&&e.unshift({time:0,color:e[0].color.clone()});var i=e[e.length-1];1!==i.time&&e.push({time:1,color:i.color.clone()})}return e}function e5(t,e,i,r){var n=[],a=1-i;if(r)for(var o=0;o<4;o++)n[o]=t[o]*a+e[o]*i;else{for(var s=0;s<3;s++)n[s]=Math.round(Math.sqrt(t[s]*t[s]*a+e[s]*e[s]*i));n[3]=Math.round(t[3]*a+e[3]*i)}return n}function e6(t){var e=/^(-)?([\d+.]+)%$/.exec(t);return e?+e[2]/100*(e[1]?-1:1):+t}function e8(){if("object"==typeof screen&&"object"==typeof document){var t=Math.max(document.documentElement.clientWidth,window.innerWidth||0);return Math.min(screen.width/t*2,2)}return 1}e1.BLACK=new e1(0,0,0,1),e1.BLUE=new e1(0,0,1,1),e1.CLEAR=new e1(0,0,0,0),e1.CYAN=new e1(0,1,1,1),e1.GRAY=new e1(.5,.5,.5,1),e1.GREEN=new e1(0,1,0,1),e1.MAGENTA=new e1(1,0,1,1),e1.RED=new e1(1,0,0,1),e1.WHITE=new e1(1,1,1,1),e1.YELLOW=new e1(1,.92,.016,1);var e9="undefined"!=typeof window;function e7(){return!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)}function it(){return/\b[Aa]ndroid\b/.test(navigator.userAgent)}function ie(){return/\bOpenHarmony\b/.test(navigator.userAgent)}function ii(){return it()||ie()||/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)}function ir(){var t;return"undefined"!=typeof my&&(null==(t=my)?void 0:t.renderTarget)==="web"}function ia(){return"miniprogram"===window.__wxjs_environment}function io(t){var e={width:128,height:1,data:new Uint8Array(512)},i=e.data,r=e4(t);if(r.length){i.set(r[0].color.toArray(),0);for(var n=1;n<127;n++){for(var a=n/128,o=void 0,s=void 0,u=0;u<r.length&&(o=r[u],s=r[u+1],!(o.time<=a)||!(s.time>a));u++);var h=e5(o.color.toArray(),s.color.toArray(),(a-o.time)/(s.time-o.time));i.set(h,4*n)}i.set(r[r.length-1].color.toArray(),508)}return e}function is(t,e,i){return void 0===i&&(i=2),t.includes(e)||(t.push(e),1===t.length||1!==i&&iu(t,t.length-1,i)),t}function iu(t,e,i){var r=t[e];if(2!==i)for(;e>=1&&t[e-1].priority<r.priority&&(t[e]=t[e-1],0!=--e););else for(;e>=1&&t[e-1].priority>r.priority&&(t[e]=t[e-1],0!=--e););t[e]=r}function ih(t,e){if(void 0===e&&(e="item doesn't exist"),null==t)throw Error(e)}function il(t){return/^[^\d.][\w-]*$/.test(t)}function ic(t){return["%c[Galacean Effects]","color: #AA0100",""+t]}t.OrderType=void 0,(i=t.OrderType||(t.OrderType={}))[i.none=1]="none",i[i.ascending=2]="ascending",i[i.descending=3]="descending";var id={error:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).error.apply(e,[].concat(ic(t),[r])),null==tO||tO("error",t,r)},info:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).debug.apply(e,[].concat(ic(t))),null==tO||tO("info",t,r)},warn:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).warn.apply(e,[].concat(ic(t))),null==tO||tO("warn",t,r)},register:function(t){t&&iy(t)&&(tO=t)}};function ip(){}function im(t){return"string"==typeof t}t.DestroyOptions=void 0,(r=t.DestroyOptions||(t.DestroyOptions={}))[r.destroy=0]="destroy",r[r.keep=1]="keep",r[r.force=0]="force";var iv=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function iy(t){return"[object Function]"===Object.prototype.toString.call(t)}function ig(t){return"[object Object]"===Object.prototype.toString.call(t)}function ix(t){if(null===t||"object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return"function"==typeof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)}function ib(t){var e;return"object"==typeof t&&null!==t&&(null==(e=t.tagName)?void 0:e.toUpperCase())==="CANVAS"}function iT(t,e){return t+Math.random()*(e-t)}function i_(){return(function(t,e,i){if(ej.randomUUID&&!t)return ej.randomUUID();var r,n=(t=t||{}).random||(t.rng||function(){if(!tR&&!(tR="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tR(eB)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,void 0===r&&(r=0),eU[n[r+0]]+eU[n[r+1]]+eU[n[r+2]]+eU[n[r+3]]+"-"+eU[n[r+4]]+eU[n[r+5]]+"-"+eU[n[r+6]]+eU[n[r+7]]+"-"+eU[n[r+8]]+eU[n[r+9]]+"-"+eU[n[r+10]]+eU[n[r+11]]+eU[n[r+12]]+eU[n[r+13]]+eU[n[r+14]]+eU[n[r+15]]})().replace(/-/g,"")}function iE(t,e,i){void 0===e&&(e="base64File"),void 0===i&&(i="");for(var r=atob(t.split(",")[1]||t),n=[],a=0;a<r.length;a+=512){for(var o=r.slice(a,a+512),s=Array(o.length),u=0;u<o.length;u++)s[u]=o.charCodeAt(u);var h=new Uint8Array(s);n.push(h)}return new File([new Blob(n,{type:i})],e,{type:i})}function iC(t,e){e.forEach(function(e){Object.getOwnPropertyNames(e.prototype).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e.prototype,i);if(!r)throw Error("Cannot find property descriptor of class "+e);Object.defineProperty(t.prototype,i,r)})})}var iw={},iS=[];function iA(t,e){iw[t]&&id.error("Duplicate registration for plugin "+t+"."),iw[t]=e;var i=new e;i.name=t,i.initialize(),iS.push(i),iS.sort(function(t,e){return t.order-e.order})}var iM=function(){function t(){}return t.getPlugins=function(){return iS},t.initializeComposition=function(t,e){iS.forEach(function(i){return i.onCompositionConstructed(t,e)})},t.destroyComposition=function(t){iS.forEach(function(e){return e.onCompositionDestroyed(t)})},t.processAssets=function(t,e){return eV(function(){return ez(this,function(i){return[2,Promise.all(iS.map(function(i){return i.processAssets(t,e)}))]})})()},t.loadResources=function(t,e,i){iS.forEach(function(r){return r.prepareResource(t,e,i)})},t}(),iI={"alipay-downgrade":"@galacean/effects-plugin-alipay-downgrade",downgrade:"@galacean/effects-plugin-downgrade","editor-gizmo":"@galacean/effects-plugin-editor-gizmo",ffd:"@galacean/effects-plugin-ffd",ktx2:"@galacean/effects-plugin-ktx2",model:"@galacean/effects-plugin-model",video:"@galacean/effects-plugin-multimedia",audio:"@galacean/effects-plugin-multimedia","orientation-transformer":"@galacean/effects-plugin-orientation-transformer","rich-text":"@galacean/effects-plugin-rich-text",spine:"@galacean/effects-plugin-spine"};function iP(t){var e=iI[t];return e?"\n请按如下命令进行操作(Please follow the commands below to proceed):\n1、使用 npm 安装插件(Install Plugin):npm i "+e+"@latest --save\n2、导入插件(Import Plugin):import '"+e+"'":""}var iR=function(){function t(){this.order=100,this.name=""}var e=t.prototype;return e.initialize=function(){},e.processAssets=function(t,e){return eV(function(){return ez(this,function(t){return[2]})})()},e.prepareResource=function(t,e,i){},e.onCompositionConstructed=function(t,e){},e.onCompositionDestroyed=function(t){},t}();function iO(t,e){return(iO=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function iN(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&iO(t,e)}(n=tN||(tN={}))["1_0"]="1.0",n["1_1"]="1.1",n["1_2"]="1.2",n["1_3"]="1.3",n["1_5"]="1.5",n["1_8"]="1.8",n["2_0"]="2.0",n["2_1"]="2.1",n["2_2"]="2.2",n["2_3"]="2.3",n["2_4"]="2.4",n["3_0"]="3.0",n["3_1"]="3.1",n["3_2"]="3.2",n["3_3"]="3.3",n["3_4"]="3.4",n["3_5"]="3.5",n["3_6"]="3.6",n.LATEST="3.6",(a=tL||(tL={})).S="S",a.APlus="A+",a.A="A",a.BPlus="B+",a.B="B",(o=tV||(tV={}))[o.ALPHA=0]="ALPHA",o[o.ADD=1]="ADD",o[o.MULTIPLY=2]="MULTIPLY",o[o.BRIGHTNESS=3]="BRIGHTNESS",o[o.SUBTRACTION=4]="SUBTRACTION",o[o.STRONG_LIGHT=5]="STRONG_LIGHT",o[o.WEAK_LIGHT=6]="WEAK_LIGHT",o[o.SUPERPOSITION=7]="SUPERPOSITION",(s=tF||(tF={}))[s.DOUBLE=1032]="DOUBLE",s[s.FRONT=1028]="FRONT",s[s.BACK=1029]="BACK",(u=tD||(tD={}))[u.OBSCURED=2]="OBSCURED",u[u.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",(h=tk||(tk={}))[h.NONE=0]="NONE",h[h.SPHERE=1]="SPHERE",h[h.CONE=2]="CONE",h[h.HEMISPHERE=3]="HEMISPHERE",h[h.CIRCLE=4]="CIRCLE",h[h.DONUT=5]="DONUT",h[h.RECTANGLE=6]="RECTANGLE",h[h.RECTANGLE_EDGE=7]="RECTANGLE_EDGE",h[h.EDGE=8]="EDGE",h[h.TEXTURE=9]="TEXTURE",(l=tz||(tz={}))[l.GYROSCOPE=0]="GYROSCOPE",l[l.SPINE=1]="SPINE",(c=tB||(tB={}))[c.CLICK=0]="CLICK",c[c.MESSAGE=1]="MESSAGE",c[c.DRAG=2]="DRAG",(f=tU||(tU={}))[f.NONE=0]="NONE",f[f.NOTIFY=1]="NOTIFY",f[f.RESUME_PLAYER=2]="RESUME_PLAYER",f[f.REMOVE=3]="REMOVE",f[f.PAUSE=4]="PAUSE",(d=tG||(tG={})).base="0",d.sprite="1",d.particle="2",d.null="3",d.interact="4",d.plugin="5",d.camera="6",d.composition="7",d.spine="spine",d.mesh="mesh",d.tree="tree",d.text="text",d.light="light",d.skybox="skybox",d.effect="effect",d.shape="shape",d.postProcessVolume="postProcessVolume",d.node="node",d.video="video",d.audio="audio",d.richtext="richtext",(p=tj||(tj={}))[p.BILLBOARD=0]="BILLBOARD",p[p.MESH=1]="MESH",p[p.VERTICAL_BILLBOARD=2]="VERTICAL_BILLBOARD",p[p.HORIZONTAL_BILLBOARD=3]="HORIZONTAL_BILLBOARD",(m=tW||(tW={}))[m.PARTICLE_ORIGIN_CENTER=0]="PARTICLE_ORIGIN_CENTER",m[m.PARTICLE_ORIGIN_LEFT_TOP=1]="PARTICLE_ORIGIN_LEFT_TOP",m[m.PARTICLE_ORIGIN_LEFT_CENTER=2]="PARTICLE_ORIGIN_LEFT_CENTER",m[m.PARTICLE_ORIGIN_LEFT_BOTTOM=3]="PARTICLE_ORIGIN_LEFT_BOTTOM",m[m.PARTICLE_ORIGIN_CENTER_TOP=4]="PARTICLE_ORIGIN_CENTER_TOP",m[m.PARTICLE_ORIGIN_CENTER_BOTTOM=5]="PARTICLE_ORIGIN_CENTER_BOTTOM",m[m.PARTICLE_ORIGIN_RIGHT_TOP=6]="PARTICLE_ORIGIN_RIGHT_TOP",m[m.PARTICLE_ORIGIN_RIGHT_CENTER=7]="PARTICLE_ORIGIN_RIGHT_CENTER",m[m.PARTICLE_ORIGIN_RIGHT_BOTTOM=8]="PARTICLE_ORIGIN_RIGHT_BOTTOM",(v=tX||(tX={})).Opaque="Opaque",v.Transparent="Transparent",(y=tH||(tH={})).Both="Both",y.Back="Back",y.Front="Front",(g=tY||(tY={}))[g.portrait=1]="portrait",g[g.landscape=0]="landscape",(x=tZ||(tZ={}))[x.CONSTANT=0]="CONSTANT",x[x.CONSTANT_VEC2=1]="CONSTANT_VEC2",x[x.CONSTANT_VEC3=2]="CONSTANT_VEC3",x[x.CONSTANT_VEC4=3]="CONSTANT_VEC4",x[x.RANDOM=4]="RANDOM",x[x.LINE=5]="LINE",x[x.CURVE=6]="CURVE",x[x.BEZIER_PATH=7]="BEZIER_PATH",x[x.RGBA_COLOR=8]="RGBA_COLOR",x[x.GRADIENT_COLOR=9]="GRADIENT_COLOR",x[x.SHAPE_POINTS=10]="SHAPE_POINTS",x[x.SHAPE_SPLITS=11]="SHAPE_SPLITS",x[x.LINEAR_PATH=12]="LINEAR_PATH",x[x.COLORS=13]="COLORS",x[x.BINARY=20]="BINARY",x[x.BEZIER_CURVE=21]="BEZIER_CURVE",x[x.BEZIER_CURVE_PATH=22]="BEZIER_CURVE_PATH",x[x.BEZIER_CURVE_QUAT=23]="BEZIER_CURVE_QUAT",x[x.COLOR_CURVE=24]="COLOR_CURVE",x[x.VECTOR4_CURVE=25]="VECTOR4_CURVE",x[x.VECTOR2_CURVE=26]="VECTOR2_CURVE",x[x.VECTOR3_CURVE=27]="VECTOR3_CURVE",(b=tq||(tq={}))[b.AUTO=0]="AUTO",b[b.EASE=1]="EASE",b[b.EASE_IN=2]="EASE_IN",b[b.EASE_OUT=3]="EASE_OUT",b[b.LINE=4]="LINE",b[b.HOLD=5]="HOLD",b[b.LINE_OUT=6]="LINE_OUT",(T=tQ||(tQ={}))[T.destroy=0]="destroy",T[T.restart=5]="restart",T[T.forward=2]="forward",T[T.freeze=4]="freeze",(_=tK||(tK={}))[_.none=0]="none",_[_.removeParticle=1]="removeParticle",(E=tJ||(tJ={}))[E.RANDOM=0]="RANDOM",E[E.UNIDIRECTIONAL_CYCLE=1]="UNIDIRECTIONAL_CYCLE",E[E.BIDIRECTIONAL_CYCLE=2]="BIDIRECTIONAL_CYCLE",E[E.UNIFORM_BURST=3]="UNIFORM_BURST",(C=t$||(t$={})).point="point",C.spot="spot",C.directional="directional",C.ambient="ambient",(w=t0||(t0={}))[w.box=2]="box",w[w.sphere=3]="sphere",(S=t1||(t1={})).orthographic="orthographic",S.perspective="perspective",(A=t2||(t2={})).unlit="unlit",A.pbr="pbr",A.hair="hair",(M=t3||(t3={}))[M.opaque=100]="opaque",M[M.masked=101]="masked",M[M.translucent=102]="translucent",M[M.additive=103]="additive",(I=t4||(t4={})).none="none",I.uv="uv",I.normal="normal",I.basecolor="basecolor",I.alpha="alpha",I.metallic="metallic",I.roughness="roughness",I.ao="ao",I.emissive="emissive",I.diffuse="diffuse",(P=t5||(t5={}))[P.visible=0]="visible",P[P.display=1]="display",P[P.clip=2]="clip",P[P.ellipsis=3]="ellipsis",(R=t6||(t6={}))[R.autoWidth=0]="autoWidth",R[R.autoHeight=1]="autoHeight",R[R.fixed=2]="fixed",(O=t8||(t8={}))[O.top=0]="top",O[O.middle=1]="middle",O[O.bottom=2]="bottom",(N=t9||(t9={}))[N.left=0]="left",N[N.middle=1]="middle",N[N.right=2]="right",(L=t7||(t7={}))[L.top=0]="top",L[L.middle=1]="middle",L[L.bottom=2]="bottom",(V=et||(et={})).normal="normal",V.bold="bold",V.lighter="lighter",(F=ee||(ee={})).normal="normal",F.italic="italic",F.oblique="oblique";var iL={WhiteTexture:"whitetexture00000000000000000000",TransparentTexture:"transparenttexture00000000000000000000",PBRShader:"pbr00000000000000000000000000000",UnlitShader:"unlit000000000000000000000000000"};(D=ei||(ei={}))[D.Solid=0]="Solid",D[D.GradientLinear=1]="GradientLinear",D[D.GradientRadial=2]="GradientRadial",D[D.GradientAngular=3]="GradientAngular",D[D.Texture=4]="Texture",(k=er||(er={}))[k.Fill=0]="Fill",k[k.Fit=1]="Fit",k[k.Crop=2]="Crop",k[k.Tile=3]="Tile",(z=en||(en={}))[z.Custom=0]="Custom",z[z.Rectangle=1]="Rectangle",z[z.Ellipse=2]="Ellipse",z[z.Polygon=3]="Polygon",z[z.Star=4]="Star",(B=ea||(ea={}))[B.Butt=0]="Butt",B[B.Round=1]="Round",B[B.Square=2]="Square",(U=eo||(eo={}))[U.Round=0]="Round",U[U.Bevel=1]="Bevel",U[U.Miter=2]="Miter",(G=es||(es={})).AnimationClipNodeData="AnimationClipNodeData",G.BlendNodeData="BlendNodeData",G.ApplyAdditiveNodeData="ApplyAdditiveNodeData",G.LayerBlendNodeData="LayerBlendNodeData",G.StateMachineNodeData="StateMachineNodeData",G.TransitionNodeData="TransitionNodeData",G.StateNodeData="StateNodeData",G.ConstFloatNodeData="ConstFloatNodeData",G.ConstBoolNodeData="ConstBoolNodeData",G.ControlParameterBoolNodeData="ControlParameterBoolNodeData",G.ControlParameterFloatNodeData="ControlParameterFloatNodeData",G.ControlParameterTriggerNodeData="ControlParameterTriggerNodeData",G.NotNodeData="NotNodeData",G.AndNodeData="AndNodeData",G.OrNodeData="OrNodeData",G.EqualNodeData="EqualNodeData",G.GreaterNodeData="GreaterNodeData",G.LessNodeData="LessNodeData",(j=eu||(eu={})).video="video",j.image="image",(W=eh||(eh={})).video="video",W.audio="audio",(X=el||(el={})).VFXItemData="VFXItemData",X.Material="Material",X.Shader="Shader",X.Geometry="Geometry",X.Texture="Texture",X.Image="Image",X.AnimationClip="AnimationClip",X.BinaryAsset="BinaryAsset",X.TrackAsset="TrackAsset",X.TimelineAsset="TimelineAsset",X.ObjectBindingTrack="ObjectBindingTrack",X.TransformTrack="TransformTrack",X.SpriteColorTrack="SpriteColorTrack",X.ActivationTrack="ActivationTrack",X.SubCompositionTrack="SubCompositionTrack",X.FloatPropertyTrack="FloatPropertyTrack",X.ColorPropertyTrack="ColorPropertyTrack",X.Vector2PropertyTrack="Vector2PropertyTrack",X.Vector3PropertyTrack="Vector3PropertyTrack",X.Vector4PropertyTrack="Vector4PropertyTrack",X.TransformPlayableAsset="TransformPlayableAsset",X.SpriteColorPlayableAsset="SpriteColorPlayableAsset",X.ActivationPlayableAsset="ActivationPlayableAsset",X.SubCompositionPlayableAsset="SubCompositionPlayableAsset",X.FloatPropertyPlayableAsset="FloatPropertyPlayableAsset",X.ColorPropertyPlayableAsset="ColorPropertyPlayableAsset",X.Vector2PropertyPlayableAsset="Vector2PropertyPlayableAsset",X.Vector3PropertyPlayableAsset="Vector3PropertyPlayableAsset",X.Vector4PropertyPlayableAsset="Vector4PropertyPlayableAsset",X.MeshComponent="MeshComponent",X.SkyboxComponent="SkyboxComponent",X.LightComponent="LightComponent",X.CameraComponent="CameraComponent",X.ModelPluginComponent="ModelPluginComponent",X.TreeComponent="TreeComponent",X.AnimationComponent="AnimationComponent",X.SpineComponent="SpineComponent",X.VideoComponent="VideoComponent",X.AudioComponent="AudioComponent",X.RichTextComponent="RichTextComponent",X.OrientationComponent="OrientationComponent",X.ShapeComponent="ShapeComponent",X.SpriteComponent="SpriteComponent",X.ParticleSystem="ParticleSystem",X.InteractComponent="InteractComponent",X.CameraController="CameraController",X.PostProcessVolume="PostProcessVolume",X.EffectComponent="EffectComponent",X.TextComponent="TextComponent",X.AnimationGraphAsset="AnimationGraphAsset",X.CompositionComponent="CompositionComponent",X.FFDComponent="FFDComponent",X.Animator="Animator",X.TimelineClip="TimelineClip",(H=ec||(ec={}))[H.POINTS=0]="POINTS",H[H.LINES=1]="LINES",H[H.LINE_LOOP=2]="LINE_LOOP",H[H.LINE_STRIP=3]="LINE_STRIP",H[H.TRIANGLES=4]="TRIANGLES",H[H.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",H[H.TRIANGLE_FAN=6]="TRIANGLE_FAN",(Y=ef||(ef={}))[Y.Float16=0]="Float16",Y[Y.Float32=1]="Float32",Y[Y.Int8=2]="Int8",Y[Y.Int16=3]="Int16",Y[Y.Int32=4]="Int32",Y[Y.UInt8=5]="UInt8",Y[Y.UInt16=6]="UInt16",Y[Y.UInt32=7]="UInt32",(Z=ed||(ed={}))[Z.None=-1]="None",Z[Z.UInt8=0]="UInt8",Z[Z.UInt16=1]="UInt16",Z[Z.UInt32=2]="UInt32",(q=ep||(ep={})).Position="POSITION",q.Uv="TEXCOORD0",q.Uv2="TEXCOORD1",q.Normal="NORMAL",q.Tangent="TANGENT",q.Color="COLOR",q.Joints="JOINTS",q.Weights="WEIGHTS",q.PositionBS0="POSITION_BS0",q.PositionBS1="POSITION_BS1",q.PositionBS2="POSITION_BS2",q.PositionBS3="POSITION_BS3",q.PositionBS4="POSITION_BS4",q.PositionBS5="POSITION_BS5",q.PositionBS6="POSITION_BS6",q.PositionBS7="POSITION_BS7",q.NormalBS0="NORMAL_BS0",q.NormalBS1="NORMAL_BS1",q.NormalBS2="NORMAL_BS2",q.NormalBS3="NORMAL_BS3",q.TangentBS0="TANGENT_BS0",q.TangentBS1="TANGENT_BS1",q.TangentBS2="TANGENT_BS2",q.TangentBS3="TANGENT_BS3";var iV=Object.freeze({__proto__:null,LATEST_VERSION:tN.LATEST,get RenderLevel(){return tL},get BlendingMode(){return tV},get SideMode(){return tF},get ObscuredMode(){return tD},get ParticleEmitterShapeType(){return tk},get PluginType(){return tz},get InteractType(){return tB},get InteractBehavior(){return tU},get ItemType(){return tG},get RenderMode(){return tj},get ParticleOrigin(){return tW},get RenderType(){return tX},get RenderFace(){return tH},get CameraClipMode(){return tY},END_BEHAVIOR_DESTROY:0,END_BEHAVIOR_PAUSE:1,END_BEHAVIOR_FORWARD:2,END_BEHAVIOR_PAUSE_AND_DESTROY:3,END_BEHAVIOR_FREEZE:4,END_BEHAVIOR_RESTART:5,END_BEHAVIOR_DESTROY_CHILDREN:6,CAMERA_CLIP_MODE_VERTICAL:1,CAMERA_CLIP_MODE_NORMAL:0,MESSAGE_ITEM_PHRASE_BEGIN:2,MESSAGE_ITEM_PHRASE_END:1,get ValueType(){return tZ},get BezierKeyframeType(){return tq},get JSONSceneVersion(){return tN},get EndBehavior(){return tQ},get ParticleInteractionBehavior(){return tK},get ShapeArcMode(){return tJ},get LightType(){return t$},get ModelBoundingType(){return t0},get CameraType(){return t1},get MaterialType(){return t2},get MaterialBlending(){return t3},get RenderMode3D(){return t4},get TextOverflow(){return t5},get TextSizeMode(){return t6},get TextBaseline(){return t8},get TextAlignment(){return t9},get TextVerticalAlign(){return t7},get TextWeight(){return et},get FontStyle(){return ee},BuiltinObjectGUID:iL,get FillType(){return ei},get TexturePaintScaleMode(){return er},get ShapePrimitiveType(){return en},get LineCap(){return ea},get LineJoin(){return eo},get NodeDataType(){return es},get BackgroundType(){return eu},get MultimediaType(){return eh},get DataType(){return el},get GeometryType(){return ec},get VertexFormatType(){return ef},get IndexFormatType(){return ed},get VertexBufferSemantic(){return ep}});function iF(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function iD(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return iF(t,void 0);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return iF(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var ik=new Map,iz=new Map,iB={};function iU(t){return function(e,i){iB[t]&&console.warn("Class "+t+" is already registered."),iB[t]=e}}function iG(t){var e=t.constructor;if(iz.get(e))return iz.get(e);var i={};iz.set(e,i);for(var r=t,n=e;n;){var a=ik.get(n);for(var o in a)i[o]=a[o];var s=Object.getPrototypeOf(r);if((n=Object.getPrototypeOf(s).constructor)===Object)break;r=s}return i}function ij(t,e){return function(i,r){var n,a=(n=i.constructor,ik.get(n)||ik.set(n,{}),ik.get(n));a&&(a[r]||(a[r]={type:t,sourceName:e}))}}var iW=function(){function t(t){this.engine=t,this.guid=i_(),this.defination={},this.engine.addInstance(this)}var e=t.prototype;return e.getInstanceId=function(){return this.guid},e.setInstanceId=function(t){this.engine.removeInstance(this.guid),this.guid=t,this.engine.addInstance(this)},e.toData=function(){},e.fromData=function(t){void 0!==t.id&&this.setInstanceId(t.id)},e.dispose=function(){this.engine.removeInstance(this.guid)},t.is=function(e){return eF(e,t)&&"guid"in e},t}(),iX=function(){function t(){this.resources=[]}return t.prototype.getResource=function(t){return this.resources[t]},t}(),iH={};function iY(t){return function(e,i){iH[t]&&console.warn("NodeData Class "+t+" is already registered."),iH[t]=e}}var iZ=function(){function t(){this.initializationCount=0,this.lastUpdateID=-1}var e=t.prototype;return e.getNodeData=function(){return this.asset},e.isValid=function(){return!0},e.isInitialized=function(){return this.initializationCount>0},e.initialize=function(t){this.isInitialized()?this.initializationCount++:this.initializeInternal(t)},e.shutdown=function(t){if(!this.isInitialized())throw Error("Node not initialized!");0==--this.initializationCount&&this.shutdownInternal(t)},e.isNodeActive=function(t){return this.lastUpdateID===t},e.isUpdated=function(t){return this.isNodeActive(t.updateID)},e.markNodeActive=function(t){this.lastUpdateID=t.updateID},e.initializeInternal=function(t){this.initializationCount++},e.shutdownInternal=function(t){if(this.isInitialized())throw Error("Node still initialized!");this.lastUpdateID=-1},t}(),iq=function(){function t(){}var e=t.prototype;return e.load=function(t){this.index=t.index},e.createNode=function(t,e){var i=new t;return e.nodes[this.index]=i,i.asset=this,i},t}(),iQ=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.previousTime=0,e.currentTime=0,e}iN(e,t);var i=e.prototype;return i.getCurrentTime=function(){return this.currentTime},i.getPreviousTime=function(){return this.previousTime},i.getDuration=function(){return this.duration},i.getDebugInfo=function(){return{duration:this.duration,currentTime:this.currentTime,previousTime:this.previousTime}},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.previousTime=0,this.currentTime=this.previousTime,this.duration=0},e}(iZ),iK=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.setValue=function(t){},e}(iZ),iJ=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iK),i$=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iK);t.AnimationGraphAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.nodeDatas=[],e.graphDataSet=new iX,e.controlParameterIDs=[],e.parameterLookupMap=new Map,e.rootNodeIndex=-1,e}return iN(e,t),e.prototype.fromData=function(t){var i=t.nodeDatas;this.rootNodeIndex=t.rootNodeIndex,this.controlParameterIDs=t.controlParameterIDs;for(var r=t.controlParameterIDs.length,n=0;n<r;n++)this.parameterLookupMap.set(t.controlParameterIDs[n],n);this.nodeDatas=[];for(var a=0;a<i.length;a++)this.nodeDatas[a]=e.createNodeData(i[a].type),this.nodeDatas[a].load(i[a]);this.graphDataSet=new iX,this.graphDataSet.resources=[];for(var o,s=iD(t.graphDataSet.resources);!(o=s()).done;){var u=o.value,h=this.engine.findObject(u);this.graphDataSet.resources.push(h)}},e.createNodeData=function(t){var e=iH[t];if(e)return new e;throw Error("Unknown node type: "+t+".")},e}(iW),t.AnimationGraphAsset=ek([iU("AnimationGraphAsset")],t.AnimationGraphAsset),(Q=em||(em={}))[Q.Active=0]="Active",Q[Q.Inactive=1]="Inactive";var i0=function(){function t(){this.deltaTime=0,this.updateID=0,this.branchState=0}return t.prototype.update=function(t){this.deltaTime=t,this.updateID++,this.branchState=0},t}(),i1=function(){function t(){this.nodeDatas=[],this.nodes=[]}return t.prototype.getNode=function(t){return this.nodes[t]?this.nodes[t]:this.nodeDatas[t]?(this.nodeDatas[t].instantiate(this),this.nodes[t]):null},t}();function i2(){return(i2=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}t.AnimationClipNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.playRate=1,e.loopAnimation=!0,e.dataSlotIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(i3,t).animation=t.dataSet.getResource(this.dataSlotIndex)},i.load=function(e){t.prototype.load.call(this,e);var i=i2({playRate:1,loopAnimation:!0},e);this.dataSlotIndex=e.dataSlotIndex,this.playRate=i.playRate,this.loopAnimation=i.loopAnimation},e}(iq),t.AnimationClipNodeData=ek([iY(es.AnimationClipNodeData)],t.AnimationClipNodeData);var i3=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.animation=null,e.animatable=null,e}iN(e,t);var i=e.prototype;return i.evaluate=function(t,e){if(!this.animatable)return e;this.markNodeActive(t);var i=this.getNodeData();this.previousTime=this.currentTime,this.currentTime=this.previousTime+t.deltaTime/this.duration*i.playRate,i.loopAnimation?this.currentTime>1&&(this.currentTime=this.currentTime%1):this.currentTime=eK(this.currentTime,0,1);var r=this.currentTime*this.duration;return this.animatable.getPose(r,e.pose),e},i.initializeInternal=function(e){var i,r;t.prototype.initializeInternal.call(this,e),this.duration=null!=(r=null==(i=this.animation)?void 0:i.duration)?r:0,this.previousTime=this.currentTime=0,this.animation&&(this.animatable=new i4(e.skeleton,this.animation))},e}(iQ);(K=ev||(ev={}))[K.Position=0]="Position",K[K.Scale=1]="Scale",K[K.Rotation=2]="Rotation",K[K.Euler=3]="Euler";var i4=function(){function t(t,e){this.skeleton=t,this.animationClip=e,this.transformCurveInfos=[],this.floatCurveInfos=[],this.colorCurveInfos=[];for(var i,r=iD(e.positionCurves);!(i=r()).done;){var n=i.value;this.addTransformCurveInfo(n,0)}for(var a,o=iD(e.scaleCurves);!(a=o()).done;){var s=a.value;this.addTransformCurveInfo(s,1)}for(var u,h=iD(e.rotationCurves);!(u=h()).done;){var l=u.value;this.addTransformCurveInfo(l,2)}for(var c,f=iD(e.eulerCurves);!(c=f()).done;){var d=c.value;this.addTransformCurveInfo(d,3)}for(var p,m=iD(e.floatCurves);!(p=m()).done;){var v=p.value;this.addFloatCurveInfo(v)}for(var y,g=iD(e.colorCurves);!(y=g()).done;){var x=y.value;this.addColorCurveInfo(x)}}var e=t.prototype;return e.getPose=function(t,e){for(var i,r=eK(t,0,this.animationClip.duration),n=iD(this.transformCurveInfos);!(i=n()).done;){var a=i.value,o=a.curve.keyFrames.getValue(r),s=e.parentSpaceTransforms[a.boneIndex];switch(a.type){case 0:s.position.copyFrom(o);break;case 1:s.scale.copyFrom(o);break;case 2:s.rotation.copyFrom(o);break;case 3:s.euler.copyFrom(o)}}for(var u,h=iD(this.floatCurveInfos);!(u=h()).done;){var l=u.value,c=l.curve.keyFrames.getValue(r);e.floatPropertyValues[l.animatedObjectIndex]=c}for(var f,d=iD(this.colorCurveInfos);!(f=d()).done;){var p=f.value,m=p.curve.keyFrames.getValue(r);e.colorPropertyValues[p.animatedObjectIndex]=m}},e.addTransformCurveInfo=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t.path);void 0!==i&&this.transformCurveInfos.push({curve:t,boneIndex:i,type:e})},e.addFloatCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.floatCurveInfos.push({curve:t,animatedObjectIndex:e})},e.addColorCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.colorCurveInfos.push({curve:t,animatedObjectIndex:e})},t}(),i5=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setFromEuler=function(t){return t.toQuaternion(this),this},e.setFromAxisAngle=function(e,i){var r=i/2,n=Math.sin(r),a=t.tempVec0;return a.copyFrom(e).normalize(),this.x=a.x*n,this.y=a.y*n,this.z=a.z*n,this.w=Math.cos(r),this},e.setFromVector4=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.setFromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},e.setFromRotationMatrix=function(t){var e=t.elements,i=e[0],r=e[4],n=e[8],a=e[1],o=e[5],s=e[9],u=e[2],h=e[6],l=e[10],c=i+o+l;if(c>0){var f=.5/Math.sqrt(c+1);this.w=.25/f,this.x=(h-s)*f,this.y=(n-u)*f,this.z=(a-r)*f}else if(i>o&&i>l){var d=2*Math.sqrt(1+i-o-l);this.w=(h-s)/d,this.x=.25*d,this.y=(r+a)/d,this.z=(n+u)/d,this.negate()}else if(o>l){var p=2*Math.sqrt(1+o-i-l);this.w=(n-u)/p,this.x=(r+a)/p,this.y=.25*p,this.z=(s+h)/p,this.negate()}else{var m=2*Math.sqrt(1+l-i-o);this.w=(a-r)/m,this.x=(n+u)/m,this.y=(s+h)/m,this.z=.25*m,this.negate()}return this},e.setFromUnitVectors=function(t,e){var i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this.x=-t.y,this.y=t.x,this.z=0):(this.x=0,this.y=-t.z,this.z=t.y)):(this.x=t.y*e.z-t.z*e.y,this.y=t.z*e.x-t.x*e.z,this.z=t.x*e.y-t.y*e.x),this.w=i,this.normalize()},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.angleTo=function(t){return 2*Math.acos(Math.abs(eK(this.dot(t),-1,1)))},e.rotateTowards=function(t,e){var i=this.angleTo(t);return 0===i||this.slerp(t,Math.min(1,e/i)),this},e.identity=function(){return this.set(0,0,0,1)},e.invert=function(){return this.conjugate()},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.conjugate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){var t=this.length();return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t),this},e.multiply=function(t){return this.multiplyQuaternions(this,t)},e.premultiply=function(t){return this.multiplyQuaternions(t,this)},e.multiplyQuaternions=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,o=e.x,s=e.y,u=e.z,h=e.w;return this.x=i*h+a*o+r*u-n*s,this.y=r*h+a*s+n*o-i*u,this.z=n*h+a*u+i*s-r*o,this.w=a*h-i*o-r*s-n*u,this},e.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copyFrom(t);var i=this.x,r=this.y,n=this.z,a=this.w,o=a*t.w+i*t.x+r*t.y+n*t.z;if(o<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,o=-o):this.copyFrom(t),o>=1)return this.w=a,this.x=i,this.y=r,this.z=n,this;var s=1-o*o;if(s<=Number.EPSILON){var u=1-e;return this.w=u*a+e*this.w,this.x=u*i+e*this.x,this.y=u*r+e*this.y,this.z=u*n+e*this.z,this.normalize(),this}var h=Math.sqrt(s),l=Math.atan2(h,o),c=Math.sin((1-e)*l)/h,f=Math.sin(e*l)/h;return this.w=a*c+this.w*f,this.x=i*c+this.x*f,this.y=r*c+this.y*f,this.z=n*c+this.z*f,this},e.slerpQuaternions=function(t,e,i){this.copyFrom(t).slerp(e,i)},e.rotateVector3=function(t,e){var i=this.x,r=this.y,n=this.z,a=this.w,o=t.x,s=t.y,u=t.z,h=a*o+r*u-n*s,l=a*s+n*o-i*u,c=a*u+i*s-r*o,f=-i*o-r*s-n*u,d=null!=e?e:t;return d.x=h*a+-(f*i)+-(l*n)- -(c*r),d.y=l*a+-(f*r)+-(c*i)- -(h*n),d.z=c*a+-(f*n)+-(h*r)- -(l*i),d},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector4=function(t){return t.set(this.x,this.y,this.z,this.w)},e.toEuler=function(t){return t.setFromQuaternion(this)},e.toMatrix4=function(t){return t.compose(e$.ZERO,this,e$.ONE)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromAxisAngle=function(e,i){return new t().setFromAxisAngle(e,i)},t.fromVector4=function(e){return new t().setFromVector4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromRotationMatrix=function(e){return new t().setFromRotationMatrix(e)},t.fromUnitVectors=function(e,i){return new t().setFromUnitVectors(e,i)},t}();i5.tempVec0=new e$;var i6=new i5,i8=function(){},i9=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+(e.x-t.x)*i,r.y=t.y+(e.y-t.y)*i,r.z=t.z+(e.z-t.z)*i},i.blendQuaternion=function(t,e,i,r){r.copyFrom(t).slerp(e,i)},i.blendEuler=function(t,e,i,r){this.lerpEuler(t,e,i,r)},i.blendFloat=function(t,e,i){return t+(e-t)*i},i.blendColor=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i,r.a=t.a+(e.a-t.a)*i},i.lerpEuler=function(t,e,i,r){r.x=this.lerpAngle(t.x,e.x,i),r.y=this.lerpAngle(t.y,e.y,i),r.z=this.lerpAngle(t.z,e.z,i)},i.normalizeAngle=function(t){return(t%360+360)%360},i.shortestAngleDiff=function(t,e){var i=this.normalizeAngle(e)-this.normalizeAngle(t);return i>180&&(i-=360),i<-180&&(i+=360),i},i.lerpAngle=function(t,e,i){var r=this.shortestAngleDiff(t,e);return this.normalizeAngle(t+r*i)},e}(i8),i7=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+e.x*i,r.y=t.y+e.y*i,r.z=t.z+e.z*i},i.blendQuaternion=function(t,e,i,r){var n=i6.copyFrom(t).multiply(e);r.copyFrom(t).slerp(n,i)},i.blendEuler=function(t,e,i,r){this.blendVector3(t,e,i,r)},i.blendFloat=function(t,e,i){return t+e*i},i.blendColor=function(t,e,i,r){r.r=t.r+e.r*i,r.g=t.g+e.g*i,r.b=t.b+e.b*i,r.a=t.a+e.a*i},e}(i8),rt=function(){function t(){}return t.localBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.normalBlendFunction)},t.additiveBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.additiveBlendFunction)},t.localBlendInternal=function(t,e,i,r,n){for(var a=0;a<t.parentSpaceTransforms.length;a++){var o=t.parentSpaceTransforms[a],s=e.parentSpaceTransforms[a],u=r.parentSpaceTransforms[a],h=o.position,l=s.position,c=u.position;n.blendVector3(h,l,i,c);var f=o.rotation,d=s.rotation,p=u.rotation;n.blendQuaternion(f,d,i,p);var m=o.scale,v=s.scale,y=u.scale;n.blendVector3(m,v,i,y);var g=o.euler,x=s.euler,b=u.euler;n.blendEuler(g,x,i,b)}for(var T=0;T<t.floatPropertyValues.length;T++){var _=t.floatPropertyValues[T],E=e.floatPropertyValues[T];r.floatPropertyValues[T]=n.blendFloat(_,E,i)}for(var C=0;C<t.colorPropertyValues.length;C++){var w=t.colorPropertyValues[C],S=e.colorPropertyValues[C],A=r.colorPropertyValues[C];n.blendColor(w,S,i,A)}},t}();rt.normalBlendFunction=new i9,rt.additiveBlendFunction=new i7;var re=function(){function t(t){this.position=new e$,this.rotation=new i5,this.scale=new e$,this.euler=new e$,t&&(this.position.copyFrom(t.position),this.rotation.copyFrom(t.quat),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.rotation))}return t.prototype.copyFrom=function(t){return this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.euler),this},t}(),ri=function(){function t(t){this.skeleton=t,this.parentSpaceTransforms=[],this.floatPropertyValues=[],this.colorPropertyValues=[];for(var e,i=iD(t.parentSpaceTransforms);!(e=i()).done;){var r=e.value;this.parentSpaceTransforms.push(new re().copyFrom(r))}for(var n,a=iD(t.defaultFloatPropertyValues);!(n=a()).done;){var o=n.value;this.floatPropertyValues.push(o)}for(var s,u=iD(t.defaultColorPropertyValues);!(s=u()).done;){var h=s.value;this.colorPropertyValues.push(new e1().copyFrom(h))}}var e=t.prototype;return e.setPosition=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].position.copyFrom(e)},e.setRotation=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].rotation.copyFrom(e)},e.setEuler=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].euler.copyFrom(e)},e.setScale=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].scale.copyFrom(e)},e.setFloat=function(t,e){var i=this.skeleton.pathToObjectIndex.get(t);void 0!==i&&(this.floatPropertyValues[i]=e)},e.copyFrom=function(t){for(var e=0;e<this.parentSpaceTransforms.length;e++)this.parentSpaceTransforms[e].copyFrom(t.parentSpaceTransforms[e]);for(var i=0;i<this.colorPropertyValues.length;i++)this.colorPropertyValues[i].copyFrom(t.colorPropertyValues[i]);for(var r=0;r<this.floatPropertyValues.length;r++)this.floatPropertyValues[r]=t.floatPropertyValues[r]},t}(),rr=function(t){this.pose=new ri(t)};t.ApplyAdditiveNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rn,t);e.baseNode=t.getNode(this.baseNodeIndex),e.additiveNode=t.getNode(this.additiveNodeIndex),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.baseNodeIndex=e.baseNodeIndex,this.additiveNodeIndex=e.additiveNodeIndex,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(iq),t.ApplyAdditiveNodeData=ek([iY(es.ApplyAdditiveNodeData)],t.ApplyAdditiveNodeData);var rn=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNode=null,e.additiveNode=null,e.inputParameterValueNode=null,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.baseNodeResult=new rr(e.skeleton),this.additiveNodeResult=new rr(e.skeleton),null==(i=this.baseNode)||i.initialize(e),null==(r=this.additiveNode)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.baseNode)||i.shutdown(e),null==(r=this.additiveNode)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.baseNode&&!this.additiveNode?(this.baseNode.evaluate(t,this.baseNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)):this.baseNode&&this.additiveNode&&(this.baseNode.evaluate(t,this.baseNodeResult),this.additiveNode.evaluate(t,this.additiveNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)),e},i.applyAdditive=function(t,e,i,r){rt.additiveBlend(t,e,i,r)},e}(iQ);t.BlendNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(ra,t);e.source0=t.getNode(this.sourceNodeIndex0),e.source1=t.getNode(this.sourceNodeIndex1),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.sourceNodeIndex0=e.sourceNodeIndex0,this.sourceNodeIndex1=e.sourceNodeIndex1,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(iq),t.BlendNodeData=ek([iY(es.BlendNodeData)],t.BlendNodeData);var ra=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.source0=null,e.source1=null,e.inputParameterValueNode=null,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.source0Result=new rr(e.skeleton),this.source1Result=new rr(e.skeleton),null==(i=this.source0)||i.initialize(e),null==(r=this.source1)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.source0)||i.shutdown(e),null==(r=this.source1)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.source0&&!this.source1?(this.source0.evaluate(t,this.source0Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)):this.source0&&this.source1&&(this.source0.evaluate(t,this.source0Result),this.source1.evaluate(t,this.source1Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)),e},i.localBlend=function(t,e,i,r){rt.localBlend(t,e,i,r)},e}(iQ);t.AndNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(ro,t),r=iD(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(iq),t.AndNodeData=ek([iY(es.AndNodeData)],t.AndNodeData);var ro=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!0;for(var e,i=iD(this.conditionNodes);!(e=i()).done;)if(!e.value.getValue(t)){this.result=!1;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i$);t.OrNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rs,t),r=iD(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(iq),t.OrNodeData=ek([iY(es.OrNodeData)],t.OrNodeData);var rs=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!1;for(var e,i=iD(this.conditionNodes);!(e=i()).done;)if(e.value.getValue(t)){this.result=!0;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i$);t.NotNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(ru,t).inputValueNode=t.getNode(this.inputValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex},e}(iq),t.NotNodeData=ek([iY(es.NotNodeData)],t.NotNodeData);var ru=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.result=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&(this.result=!this.inputValueNode.getValue(t))),this.result},i.initializeInternal=function(e){var i;t.prototype.initializeInternal.call(this,e),null==(i=this.inputValueNode)||i.initialize(e),this.result=!1},i.shutdownInternal=function(e){var i;null==(i=this.inputValueNode)||i.shutdown(e),t.prototype.shutdownInternal.call(this,e)},e}(i$);t.ConstFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rh,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ConstFloatNodeData=ek([iY(es.ConstFloatNodeData)],t.ConstFloatNodeData);var rh=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}return iN(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(iJ);t.ConstBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rl,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ConstBoolNodeData=ek([iY(es.ConstBoolNodeData)],t.ConstBoolNodeData);var rl=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}return iN(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(i$);t.ControlParameterFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rc,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ControlParameterFloatNodeData=ek([iY(es.ControlParameterFloatNodeData)],t.ControlParameterFloatNodeData);var rc=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(iJ);t.ControlParameterBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rf,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ControlParameterBoolNodeData=ek([iY(es.ControlParameterBoolNodeData)],t.ControlParameterBoolNodeData);var rf=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i$);t.ControlParameterTriggerNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rd,t)},i.load=function(e){t.prototype.load.call(this,e)},e}(iq),t.ControlParameterTriggerNodeData=ek([iY(es.ControlParameterTriggerNodeData)],t.ControlParameterTriggerNodeData);var rd=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i$);t.LayerBlendNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNodeIndex=-1,e.layerDatas=[],e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rp,t);e.baseLayerNode=t.getNode(this.baseNodeIndex);for(var i,r=iD(this.layerDatas);!(i=r()).done;){var n=i.value;e.layers.push({inputNode:t.getNode(n.inputNodeIndex),weightValueNode:t.getNode(n.weightValueNodeIndex),weight:0})}},i.load=function(e){if(t.prototype.load.call(this,e),this.baseNodeIndex=null!=(i=e.baseNodeIndex)?i:-1,e.layerDatas)for(var i,r,n=iD(e.layerDatas);!(r=n()).done;){var a=r.value;this.layerDatas.push(i2({inputNodeIndex:-1,weightValueNodeIndex:-1},a))}},e}(iq),t.LayerBlendNodeData=ek([iY(es.LayerBlendNodeData)],t.LayerBlendNodeData);var rp=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseLayerNode=null,e.layers=[],e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.layerNodeResult=new rr(e.skeleton),null==(i=this.baseLayerNode)||i.initialize(e);for(var i,r,n=iD(this.layers);!(r=n()).done;){var a,o,s=r.value;null==(a=s.inputNode)||a.initialize(e),null==(o=s.weightValueNode)||o.initialize(e)}},i.shutdownInternal=function(e){null==(i=this.baseLayerNode)||i.shutdown(e);for(var i,r,n=iD(this.layers);!(r=n()).done;){var a,o,s=r.value;null==(a=s.inputNode)||a.shutdown(e),null==(o=s.weightValueNode)||o.shutdown(e)}t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){return this.baseLayerNode&&this.baseLayerNode.isValid()&&(this.markNodeActive(t),this.previousTime=this.baseLayerNode.getCurrentTime(),e=this.baseLayerNode.evaluate(t,e),this.currentTime=this.baseLayerNode.getCurrentTime(),this.duration=this.baseLayerNode.getDuration(),this.updateLayers(t,e)),e},i.updateLayers=function(t,e){for(var i,r=iD(this.layers);!(i=r()).done;){var n=i.value;if(n.inputNode&&n.weightValueNode){this.layerNodeResult.pose.copyFrom(e.pose),n.inputNode.evaluate(t,this.layerNodeResult);var a=n.weightValueNode.getValue(t);rt.localBlend(e.pose,this.layerNodeResult.pose,a,e.pose)}}return e},e}(iQ);t.EqualNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rm,t);e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(iq),t.EqualNodeData=ek([iY(es.EqualNodeData)],t.EqualNodeData);var rm=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.result=!1,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);this.result=e===i}return this.result},e}(i$),rv=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}return iN(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(iq);(J=ey||(ey={}))[J.GreaterThan=0]="GreaterThan",J[J.LessThan=1]="LessThan";var ry=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.comparison=0,e.result=!1,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);switch(this.comparison){case 0:this.result=e>i;break;case 1:this.result=e<i}}return this.result},e}(i$);t.GreaterNodeData=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.instantiate=function(t){var e=this.createNode(ry,t);e.comparison=0,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(rv),t.GreaterNodeData=ek([iY(es.GreaterNodeData)],t.GreaterNodeData),t.LessNodeData=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.instantiate=function(t){var e=this.createNode(ry,t);e.comparison=1,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(rv),t.LessNodeData=ek([iY(es.LessNodeData)],t.LessNodeData),t.StateMachineNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rg,t),r=iD(this.stateDatas);!(e=r()).done;){var n=e.value,a={stateNode:t.getNode(n.stateNodeIndex),transitions:[]};i.states.push(a);for(var o,s=iD(n.transitionDatas);!(o=s()).done;){var u=o.value,h={transitionNode:t.getNode(u.transitionNodeIndex),conditionNode:t.getNode(u.conditionNodeIndex),targetStateIndex:u.targetStateIndex};a.transitions.push(h)}}},i.load=function(e){t.prototype.load.call(this,e),this.stateDatas=e.stateDatas,this.defaultStateIndex=e.defaultStateIndex,this.machineName=e.machineName},e}(iq),t.StateMachineNodeData=ek([iY(es.StateMachineNodeData)],t.StateMachineNodeData);var rg=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.states=[],e.activeTransition=null,e.activeStateIndex=-1,e}iN(e,t);var i=e.prototype;return i.getCurrentStateName=function(){return this.states[this.activeStateIndex].stateNode.getNodeData().stateName},i.evaluate=function(t,e){if(this.markNodeActive(t),null!==this.activeTransition&&this.activeTransition.isComplete(t)&&(this.activeTransition.shutdown(t),this.activeTransition=null),null===this.activeTransition){var i=this.states[this.activeStateIndex].stateNode;e=i.evaluate(t,e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime()}else e=this.activeTransition.evaluate(t,e),this.duration=this.activeTransition.getDuration(),this.previousTime=this.activeTransition.getPreviousTime(),this.currentTime=this.activeTransition.getCurrentTime();return t.branchState===em.Active&&this.evaluateTransitions(t,e),e},i.evaluateTransitions=function(t,e){for(var i=this.states[this.activeStateIndex],r=-1,n=i.transitions.length,a=0;a<n;a++){var o=i.transitions[a];if(-1===o.targetStateIndex)throw Error("Invalid target state index.");if(!this.states[o.targetStateIndex].stateNode.isTransitioning()){var s=!1;if(o.transitionNode.hasExitTime){var u=i.stateNode;u.getElapsedTimeInState()/u.getDuration()>o.transitionNode.exitTime&&(s=!0)}else null!==o.conditionNode&&o.conditionNode.getValue(t)&&(s=!0);if(s){r=a;break}}}if(-1!==r){var h=i.transitions[r];h.transitionNode.initialize(t),e=null!==this.activeTransition?h.transitionNode.startTransitionFromTransition(t,e,this.activeTransition,e):h.transitionNode.startTransitionFromState(t,e,this.states[this.activeStateIndex].stateNode,e),this.activeTransition=h.transitionNode,this.shutdownTransitionConditions(t),this.activeStateIndex=h.targetStateIndex,this.initializeTransitionConditions(t),this.duration=this.states[this.activeStateIndex].stateNode.getDuration(),this.previousTime=this.states[this.activeStateIndex].stateNode.getPreviousTime(),this.currentTime=this.states[this.activeStateIndex].stateNode.getCurrentTime()}},i.selectDefaultState=function(t){return this.getNodeData().defaultStateIndex},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.activeStateIndex=this.selectDefaultState(e);var i=this.states[this.activeStateIndex].stateNode;i.initialize(e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime(),this.initializeTransitionConditions(e)},i.shutdownInternal=function(e){null!==this.activeTransition&&this.activeTransition.shutdown(e),this.shutdownTransitionConditions(e),this.states[this.activeStateIndex].stateNode.shutdown(e),this.activeStateIndex=-1,this.activeTransition=null,t.prototype.shutdownInternal.call(this,e)},i.initializeTransitionConditions=function(t){for(var e,i=iD(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.initialize(t)}},i.shutdownTransitionConditions=function(t){for(var e,i=iD(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.shutdown(t)}},e}(iQ);t.TransitionState=void 0,($=t.TransitionState||(t.TransitionState={}))[$.None=0]="None",$[$.TransitioningIn=1]="TransitioningIn",$[$.TransitioningOut=2]="TransitioningOut",t.StateNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rx,t).childNode=t.getNode(this.childNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.childNodeIndex=e.childNodeIndex,this.stateName=e.stateName},e}(iq),t.StateNodeData=ek([iY(es.StateNodeData)],t.StateNodeData);var rx=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNode=null,e.transitionState=0,e.elapsedTimeInState=0,e.isFirstStateUpdate=!1,e}iN(e,t);var i=e.prototype;return i.isTransitioning=function(){return 0!==this.transitionState},i.isTransitioningIn=function(){return 1===this.transitionState},i.isTransitioningOut=function(){return 2===this.transitionState},i.startTransitionIn=function(t){this.transitionState=1},i.startTransitionOut=function(t){this.transitionState=2},i.setTransitioningState=function(t){this.transitionState=t},i.getElapsedTimeInState=function(){return this.elapsedTimeInState},i.evaluate=function(t,e){return this.markNodeActive(t),null!==this.childNode&&this.childNode.isValid()&&(e=this.childNode.evaluate(t,e),this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime()),this.elapsedTimeInState+=t.deltaTime,this.isFirstStateUpdate=!1,e},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.transitionState=0,this.elapsedTimeInState=0,this.previousTime=this.currentTime=0,this.duration=0,null!==this.childNode&&(this.childNode.initialize(e),this.childNode.isValid()&&(this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime())),this.isFirstStateUpdate=!0},i.shutdownInternal=function(e){null!==this.childNode&&this.childNode.shutdown(e),this.transitionState=0,t.prototype.shutdownInternal.call(this,e)},e}(iQ);t.SourceType=void 0,(tt=t.SourceType||(t.SourceType={}))[tt.State=0]="State",tt[tt.Transition=1]="Transition",tt[tt.CachedPose=2]="CachedPose",t.TransitionNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.hasExitTime=!1,e.exitTime=.75,e.targetStateNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rb,t);e.targetNode=t.getNode(this.targetStateNodeIndex),e.hasExitTime=this.hasExitTime,e.exitTime=this.exitTime},i.load=function(e){t.prototype.load.call(this,e),this.duration=e.duration,this.hasExitTime=e.hasExitTime,this.exitTime=e.exitTime,this.targetStateNodeIndex=e.targetStateNodeIndex},e}(iq),t.TransitionNodeData=ek([iY(es.TransitionNodeData)],t.TransitionNodeData);var rb=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.hasExitTime=!1,t.exitTime=.75,t.transitionLength=0,t.transitionProgress=0,t.blendWeight=0,t.sourceNode=null,t.sourceType=0,t.blendedDuration=0,t}iN(i,e);var r=i.prototype;return r.evaluate=function(t,e){ih(this.sourceNode),this.markNodeActive(t),this.isSourceATransition()&&this.getSourceTransitionNode().isComplete(t)&&this.endSourceTransition(t),this.transitionProgress=this.transitionProgress+t.deltaTime/this.transitionLength,this.transitionProgress=eK(this.transitionProgress,0,1),this.calculateBlendWeight();var i=this.sourceNodeResult,r=t.branchState;t.branchState=em.Inactive,i=this.sourceNode.evaluate(t,i),t.branchState=r;var n=this.targetNode.evaluate(t,this.targetNodeResult);if(this.registerPoseTasksAndUpdateRootMotion(i,n,e),this.blendedDuration=eQ(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.blendedDuration>0){var a=t.deltaTime/this.blendedDuration;this.previousTime=this.currentTime,this.currentTime=(this.currentTime+a)%1}else this.previousTime=this.currentTime=1;return this.duration=this.targetNode.getDuration(),e},r.isComplete=function(t){return this.transitionLength<=0||this.transitionProgress+t.deltaTime/this.transitionLength>=1},r.getProgressPercentage=function(){return this.transitionProgress},r.getSourceType=function(){return this.sourceType},r.isSourceATransition=function(){return 1===this.sourceType},r.isSourceAState=function(){return 0===this.sourceType},r.startTransitionFromState=function(t,e,i,r){return this.sourceNode=i,this.sourceType=0,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.startTransitionFromTransition=function(t,e,i,r){return this.sourceNode=i,this.sourceType=1,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.getSourceStateNode=function(){return this.sourceNode},r.getSourceTransitionNode=function(){return this.sourceNode},r.notifyNewTransitionStarting=function(t,e){if(this.isSourceATransition()){var i=this.getSourceTransitionNode().targetNode;i===e&&(this.sourceType=2,i.shutdown(t),this.sourceNode=null)}else this.isSourceAState()&&this.sourceNode===e&&(this.sourceType=2,this.sourceNode.shutdown(t),this.sourceNode=null);this.isSourceATransition()&&this.getSourceTransitionNode().notifyNewTransitionStarting(t,e)},r.initializeInternal=function(t){e.prototype.initializeInternal.call(this,t),this.sourceNodeResult=new rr(t.skeleton),this.targetNodeResult=new rr(t.skeleton),this.transitionLength=this.getNodeData().duration,this.transitionProgress=0,this.blendWeight=0},r.shutdownInternal=function(i){this.targetNode.setTransitioningState(t.TransitionState.None),this.currentTime=1,this.sourceNode&&(this.isSourceATransition()&&this.endSourceTransition(i),this.sourceNode.shutdown(i),this.sourceNode=null),e.prototype.shutdownInternal.call(this,i)},r.endSourceTransition=function(e){var i,r=this.getSourceTransitionNode().targetNode;null==(i=this.sourceNode)||i.shutdown(e),this.sourceNode=r,this.sourceType=0,this.getSourceStateNode().setTransitioningState(t.TransitionState.TransitioningOut)},r.initializeTargetStateAndUpdateTransition=function(t,e,i){this.markNodeActive(t);var r=this.targetNodeResult;return 0===this.sourceType&&this.getSourceStateNode().startTransitionOut(t),this.targetNode.initialize(t),this.targetNode.startTransitionIn(t),r=this.targetNode.evaluate(t,r),this.calculateBlendWeight(),this.registerPoseTasksAndUpdateRootMotion(e,r,i),this.previousTime=0,this.currentTime=0,this.blendedDuration=eQ(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.duration=this.targetNode.getDuration(),i},r.calculateBlendWeight=function(){0===this.transitionLength?this.blendWeight=1:(this.blendWeight=this.transitionProgress,this.blendWeight=eK(this.blendWeight,0,1))},r.registerPoseTasksAndUpdateRootMotion=function(t,e,i){var r=this.blendWeight;rt.localBlend(t.pose,e.pose,r,i.pose)},i}(iQ);(te=eg||(eg={}))[te.Float=0]="Float",te[te.Color=1]="Color";var rT=function(){function t(t,e){this.rootBone=t,this.useEuler=!1,this.pathToObjectIndex=new Map,this.floatAnimatedObjects=[],this.defaultFloatPropertyValues=[],this.colorAnimatedObjects=[],this.defaultColorPropertyValues=[],this.animatedTransforms=[],this.parentSpaceTransforms=[],this.pathToBoneIndex=new Map;for(var i,r=iD(e.position);!(i=r()).done;){var n=i.value;this.addReferenceTransform(n)}for(var a,o=iD(e.rotation);!(a=o()).done;){var s=a.value;this.addReferenceTransform(s)}for(var u,h=iD(e.scale);!(u=h()).done;){var l=u.value;this.addReferenceTransform(l)}for(var c,f=iD(e.euler);!(c=f()).done;){var d=c.value;this.addReferenceTransform(d),this.useEuler=!0}for(var p=0;p<e.floats.length;p++){var m=e.floats[p];this.addRecordedProperty(m.path,m.className,m.property,0)}for(var v=0;v<e.colors.length;v++){var y=e.colors[v];this.addRecordedProperty(y.path,y.className,y.property,1)}}var e=t.prototype;return e.addReferenceTransform=function(t){if(!this.pathToBoneIndex.get(t)){var e=this.findTarget(t);e&&(this.parentSpaceTransforms.push(new re(e.transform)),this.animatedTransforms.push(e.transform),this.pathToBoneIndex.set(t,this.parentSpaceTransforms.length-1))}},e.addRecordedProperty=function(t,e,i,r){var n,a=t+e+i;if(void 0===this.pathToObjectIndex.get(a)){var o=this.findTarget(t);if(o){(n="VFXItem"===e?o:o.getComponent(iB[e]))||console.error("The "+e+" Component was not found.");for(var s=i.split("."),u=s[s.length-1],h=n,l=0;l<s.length-1;l++){var c=h[s[l]];void 0===c&&console.error("The "+s[l]+" property of "+h+" was not found."),h=c}var f={target:n,propertyPath:i,directTarget:h,propertyName:u};switch(r){case 0:this.floatAnimatedObjects.push(f),this.defaultFloatPropertyValues.push(h[u]),this.pathToObjectIndex.set(a,this.floatAnimatedObjects.length-1);break;case 1:this.colorAnimatedObjects.push(f),this.defaultColorPropertyValues.push(new e1().copyFrom(h[u])),this.pathToObjectIndex.set(a,this.colorAnimatedObjects.length-1)}}}},e.findTarget=function(t){if(""===t)return this.rootBone;for(var e,i=t.split("/"),r=this.rootBone,n=iD(i);!(e=n()).done;){var a=e.value,o=r.find(a);if(!o)return null;r=o}return r},t}(),r_=function(){function t(t,e){this.graphAsset=t,this.nodes=[],this.context=new i0;for(var i,r={position:[],scale:[],rotation:[],euler:[],floats:[],colors:[]},n=iD(t.graphDataSet.resources);!(i=n()).done;){var a=i.value;if(a){for(var o,s=iD(a.positionCurves);!(o=s()).done;){var u=o.value;r.position.push(u.path)}for(var h,l=iD(a.rotationCurves);!(h=l()).done;){var c=h.value;r.rotation.push(c.path)}for(var f,d=iD(a.scaleCurves);!(f=d()).done;){var p=f.value;r.scale.push(p.path)}for(var m,v=iD(a.eulerCurves);!(m=v()).done;){var y=m.value;r.euler.push(y.path)}for(var g,x=iD(a.floatCurves);!(g=x()).done;){var b=g.value;r.floats.push(b)}for(var T,_=iD(a.colorCurves);!(T=_()).done;){var E=T.value;r.colors.push(E)}}}this.skeleton=new rT(e,r),this.result=new rr(this.skeleton),this.context.skeleton=this.skeleton;var C=new i1;C.nodes=this.nodes,C.nodeDatas=t.nodeDatas,C.dataSet=t.graphDataSet;for(var w=0;w<t.nodeDatas.length;w++)C.nodes[w]||t.nodeDatas[w].instantiate(C);this.rootNode=this.nodes[t.rootNodeIndex]}var e=t.prototype;return e.evaluateGraph=function(t){this.context.update(t),this.rootNode.isInitialized()||this.resetGraphState(),this.rootNode&&(this.result=this.rootNode.evaluate(this.context,this.result));for(var e=0;e<this.getNumControlParameters();e++){var i=this.nodes[e];eF(i,rd)&&i.setValue(!1)}return this.result},e.isInitialized=function(){return this.rootNode&&this.rootNode.isInitialized()},e.isNodeActive=function(t){return this.isControlParameter(t)||this.nodes[t].isNodeActive(this.context.updateID)},e.getStateMachineNode=function(t){for(var e,i=null,r=iD(this.nodes);!(e=r()).done;){var n=e.value;eF(n,rg)&&n.getNodeData().machineName===t&&(i=n)}return i},e.resetGraphState=function(){this.rootNode.isInitialized()&&this.rootNode.shutdown(this.context),this.context.updateID++,this.rootNode.initialize(this.context)},e.getNumControlParameters=function(){return this.graphAsset.controlParameterIDs.length},e.getControlParameterIndex=function(t){var e=this.graphAsset.parameterLookupMap.get(t);return void 0!==e?e:(console.warn("Parameter '"+t+"' does not exist."),-1)},e.getControlParameterID=function(t){return this.graphAsset.controlParameterIDs[t]},e.setBool=function(t,e){this.setControlParameterValue(t,e)},e.setFloat=function(t,e){this.setControlParameterValue(t,e)},e.setTrigger=function(t){this.setControlParameterValue(t,!0)},e.resetTrigger=function(t){this.setControlParameterValue(t,!1)},e.getPoseNodeDebugInfo=function(t){return this.nodes[t].getDebugInfo()},e.getRuntimeNodeDebugValue=function(t){return this.nodes[t].getValue(this.context)},e.getNodeDebugInstance=function(t){return this.nodes[t]},e.isControlParameter=function(t){return t<this.getNumControlParameters()},e.setControlParameterValue=function(t,e){var i=this.getControlParameterIndex(t);-1!==i&&this.nodes[i].setValue(e)},t}();function rE(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rC(t,e,i){return e&&rE(t.prototype,e),i&&rE(t,i),t}var rw=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.isAwakeCalled=!1,e.isStartCalled=!1,e.isEnableCalled=!1,e._enabled=!0,e}iN(e,t);var i=e.prototype;return i.onAwake=function(){},i.onEnable=function(){},i.onDisable=function(){},i.onStart=function(){},i.onUpdate=function(t){},i.onLateUpdate=function(t){},i.onDestroy=function(){},i.onApplyAnimationProperties=function(){},i.enable=function(){this.item.composition&&(this.item.composition.sceneTicking.addComponent(this),this.isEnableCalled=!0),this.onEnable()},i.disable=function(){this.onDisable(),this.item.composition&&(this.isEnableCalled=!1,this.item.composition.sceneTicking.removeComponent(this))},i.setVFXItem=function(t){this.item=t,t.isDuringPlay&&(this.isAwakeCalled||(this.onAwake(),this.isAwakeCalled=!0),t.isActive&&this.enabled&&(this.start(),this.enable()))},i.fromData=function(e){t.prototype.fromData.call(this,e)},i.dispose=function(){this.isEnableCalled&&this.disable(),this.isAwakeCalled&&(this.isAwakeCalled=!1,this.onDestroy()),this.item&&eX(this.item.components,this),t.prototype.dispose.call(this)},i.start=function(){this.isStartCalled||(this.isStartCalled=!0,this.onStart())},rC(e,[{key:"transform",get:function(){return this.item.transform}},{key:"isActiveAndEnabled",get:function(){return this.item.isActive&&this.enabled}},{key:"enabled",get:function(){return this._enabled},set:function(t){this.enabled!==t&&(this._enabled=t,t?this.isActiveAndEnabled&&(this.enable(),this.isStartCalled||(this.onStart(),this.isStartCalled=!0)):this.isEnableCalled&&this.disable())}}]),e}(iW);ek([ij(void 0,void 0)],rw.prototype,"item",void 0),ek([ij(void 0,void 0)],rw.prototype,"_enabled",void 0);var rS=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.setVFXItem=function(e){t.prototype.setVFXItem.call(this,e)},i.dispose=function(){t.prototype.dispose.call(this)},e}(rw);t.Animator=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.graphInstance=null,e.graphAsset=null,e}iN(e,t);var i=e.prototype;return i.setBool=function(t,e){this.graphInstance&&this.graphInstance.setBool(t,e)},i.setFloat=function(t,e){this.graphInstance&&this.graphInstance.setFloat(t,e)},i.setTrigger=function(t){this.graphInstance&&this.graphInstance.setTrigger(t)},i.resetTrigger=function(t){this.graphInstance&&this.graphInstance.resetTrigger(t)},i.getStateMachineNode=function(t){var e=null;return this.graphInstance&&(e=this.graphInstance.getStateMachineNode(t)),e},i.onStart=function(){this.graphAsset&&(this.graphInstance=new r_(this.graphAsset,this.item))},i.onUpdate=function(t){if(this.graphInstance){for(var e=this.graphInstance.evaluateGraph(t/1e3),i=this.graphInstance.skeleton.animatedTransforms,r=0;r<i.length;r++){var n=e.pose.parentSpaceTransforms[r].position,a=e.pose.parentSpaceTransforms[r].rotation,o=e.pose.parentSpaceTransforms[r].scale,s=e.pose.parentSpaceTransforms[r].euler;i[r].setPosition(n.x,n.y,n.z),i[r].setScale(o.x,o.y,o.z),this.graphInstance.skeleton.useEuler?i[r].setRotation(s.x,s.y,s.z):i[r].setQuaternion(a.x,a.y,a.z,a.w)}for(var u=this.graphInstance.skeleton.floatAnimatedObjects,h=0;h<u.length;h++){var l=u[h],c=l.propertyName;l.directTarget[c]=e.pose.floatPropertyValues[h],eF(l.target,rw)&&l.target.onApplyAnimationProperties()}for(var f=this.graphInstance.skeleton.colorAnimatedObjects,d=0;d<f.length;d++){var p=f[d],m=p.propertyName;p.directTarget[m]=e.pose.colorPropertyValues[d],eF(p.target,rw)&&p.target.onApplyAnimationProperties()}}},i.fromData=function(t){this.graphAsset=this.engine.findObject(t.graphAsset)},e}(rw),t.Animator=ek([iU("Animator")],t.Animator);var rA=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.materials=[],e._priority=0,e}iN(e,t);var i=e.prototype;return i.render=function(t){},i.onEnable=function(){var t;null==(t=this.item.composition)||t.renderFrame.addMeshToDefaultRenderPass(this)},i.onDisable=function(){var t;null==(t=this.item.composition)||t.renderFrame.removeMeshFromDefaultRenderPass(this)},rC(e,[{key:"priority",get:function(){return this._priority},set:function(t){this._priority=t}},{key:"material",get:function(){return this.materials[0]},set:function(t){0===this.materials.length?this.materials.push(t):this.materials[0]=t}}]),e}(rw);ek([ij(void 0,void 0)],rA.prototype,"materials",void 0),ek([ij(void 0,void 0)],rA.prototype,"_priority",void 0);var rM=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.meshCollider=new a5,e.getHitTestParams=function(t){var i=e.transform.getWorldMatrix();e.meshCollider.setGeometry(e.geometry,i);var r=e.meshCollider.getBoundingBoxData();if(r)return{type:r.type,triangles:r.area}},e}iN(e,t);var i=e.prototype;return i.render=function(t){for(var e=0;e<this.materials.length;e++){var i=this.materials[e];t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),i,e)}},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},e}(rA);ek([ij(void 0,void 0)],rM.prototype,"geometry",void 0),t.EffectComponent=function(t){function e(e){var i;return(i=t.call(this,e)||this).time=0,i.name="EffectComponent",i}iN(e,t);var i=e.prototype;return i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.onUpdate=function(t){var e,i=this.time,r=null!=(e=this.material.getVector4("_Time"))?e:new e0;this.material.setVector4("_Time",r.set(i/20,i,2*i,3*i)),this.time+=t/1e3},i.fromData=function(e){t.prototype.fromData.call(this,e),this.material=this.materials[0]},e}(rM),t.EffectComponent=ek([iU(el.EffectComponent)],t.EffectComponent);var rI=new e$(0,0,0),rP=new e$(0,0,0),rR=function(){this.target=null,this.weight=1};t.PositionConstraint=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.positionAtRest=new e$(0,0,0),e.positionOffset=new e$(0,0,0),e.weight=1,e.constrainX=!0,e.constrainY=!0,e.constrainZ=!0,e.targets=[],e}iN(e,t);var i=e.prototype;return i.onStart=function(){var t=this.item.transform.getWorldPosition();this.positionAtRest.copyFrom(t)},i.onUpdate=function(t){if(0!==this.targets.length){rI.set(0,0,0);for(var e,i=0,r=iD(this.targets);!(e=r()).done;){var n=e.value;if(n.target){var a=n.target.transform.getWorldPosition(),o=n.weight;rI.x+=a.x*o,rI.y+=a.y*o,rI.z+=a.z*o,i+=o}}i>0&&(rI.x/=i,rI.y/=i,rI.z/=i),rI.x+=this.positionOffset.x,rI.y+=this.positionOffset.y,rI.z+=this.positionOffset.z,rP.set(this.lerp(this.positionAtRest.x,rI.x,this.weight),this.lerp(this.positionAtRest.y,rI.y,this.weight),this.lerp(this.positionAtRest.z,rI.z,this.weight)),rI.copyFrom(this.item.transform.getWorldPosition());var s=this.constrainX?rP.x:rI.x,u=this.constrainY?rP.y:rI.y,h=this.constrainZ?rP.z:rI.z;this.item.transform.setWorldPosition(s,u,h)}},i.addTarget=function(t,e){void 0===e&&(e=1);var i=new rR;i.target=t,i.weight=Math.max(0,Math.min(1,e)),this.targets.push(i)},i.removeTarget=function(t){var e=this.targets.findIndex(function(e){return e.target===t});-1!==e&&this.targets.splice(e,1)},i.clearTargets=function(){this.targets=[]},i.setPositionOffset=function(t,e,i){this.positionOffset.set(t,e,i)},i.setWeight=function(t){this.weight=Math.max(0,Math.min(1,t))},i.lerp=function(t,e,i){return t+(e-t)*i},i.fromData=function(e){t.prototype.fromData.call(this,e),this.positionAtRest.copyFrom(e.positionAtRest),this.positionOffset.copyFrom(e.positionOffset),this.weight=e.weight,this.constrainX=e.constrainX,this.constrainY=e.constrainY,this.constrainZ=e.constrainZ,this.targets=[];for(var i,r=iD(e.targets);!(i=r()).done;){var n=i.value,a=new rR;a.target=this.engine.findObject(n.target),a.weight=n.weight,this.targets.push(a)}},e}(rw),t.PositionConstraint=ek([iU("PositionConstraint")],t.PositionConstraint),t.PostProcessVolume=function(t){function e(e){var i;return(i=t.call(this,e)||this).bloom={threshold:0,intensity:0,active:!1},i.vignette={intensity:0,smoothness:0,roundness:0,active:!1},i.tonemapping={active:!1},i.colorAdjustments={brightness:0,saturation:0,contrast:0,active:!1},i}return iN(e,t),e.prototype.onStart=function(){var t=this.item.composition;t&&(t.renderFrame.globalVolume=this)},e}(rw),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"bloom",void 0),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"vignette",void 0),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"tonemapping",void 0),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"colorAdjustments",void 0),t.PostProcessVolume=ek([iU(el.PostProcessVolume)],t.PostProcessVolume);var rO=function(){function t(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===o&&(o=0),void 0===s&&(s=0),void 0===u&&(u=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===c&&(c=0),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===m&&(m=1),this.elements=[t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[1]=e,v[2]=i,v[3]=r,v[4]=n,v[5]=a,v[6]=o,v[7]=s,v[8]=u,v[9]=h,v[10]=l,v[11]=c,v[12]=f,v[13]=d,v[14]=p,v[15]=m,this},e.setFromRowMajorData=function(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=i,v[12]=r,v[1]=n,v[5]=a,v[9]=o,v[13]=s,v[2]=u,v[6]=h,v[10]=l,v[14]=c,v[3]=f,v[7]=d,v[11]=p,v[15]=m,this},e.setFromColumnVectors=function(t,e,i,r){return this.set(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,i.x,i.y,i.z,i.w,r.x,r.y,r.z,r.w)},e.setFromMatrix3=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1),this},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[e+i];return this},e.setFromScale=function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)},e.setFromTranslation=function(t,e,i){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1)},e.setFromRotationX=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1)},e.setFromRotationY=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1)},e.setFromRotationZ=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1)},e.setFromRotationAxis=function(e,i){var r=t.tempVec0;r.copyFrom(e).normalize();var n=Math.cos(i),a=Math.sin(i),o=1-n,s=r.x,u=r.y,h=r.z,l=o*s,c=o*u;return this.set(l*s+n,l*u+a*h,l*h-a*u,0,l*u-a*h,c*u+n,c*h+a*s,0,l*h+a*u,c*h-a*s,o*h*h+n,0,0,0,0,1)},e.setFromEuler=function(t){return t.toMatrix4(this),this},e.setFromQuaternion=function(t){return this.compose(e$.ZERO,t,e$.ONE)},e.setFromShear=function(t,e,i){return this.set(1,t,t,0,e,1,e,0,i,i,1,0,0,0,0,1)},e.setFromBasis=function(t,e,i){return this.set(t.x,t.y,t.z,0,e.x,e.y,e.z,0,i.x,i.y,i.z,0,0,0,0,1)},e.setZero=function(){for(var t=0;t<16;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},e.isIdentity=function(){var t=this.elements;return 1===t[0]&&0===t[4]&&0===t[8]&&0===t[12]&&0===t[1]&&1===t[5]&&0===t[9]&&0===t[13]&&0===t[2]&&0===t[6]&&1===t[10]&&0===t[14]&&0===t[3]&&0===t[7]&&0===t[11]&&1===t[15]},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[4*t],this.elements[4*t+1],this.elements[4*t+2],this.elements[4*t+3])},e.lookAt=function(e,i,r){var n=t.tempVec0,a=t.tempVec1,o=t.tempVec2;o.subtractVectors(e,i),o.normalize(),n.crossVectors(r,o),n.normalize(),a.crossVectors(o,n);var s=this.elements;return s[0]=n.x,s[1]=a.x,s[2]=o.x,s[3]=0,s[4]=n.y,s[5]=a.y,s[6]=o.y,s[7]=0,s[8]=n.z,s[9]=a.z,s[10]=o.z,s[11]=0,s[12]=-n.dot(e),s[13]=-a.dot(e),s[14]=-o.dot(e),s[15]=1,this},e.addScaledMatrix=function(t,e){for(var i=this.elements,r=t.elements,n=0;n<16;n++)i[n]+=r[n]*e;return this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<16;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],o=i[4],s=i[8],u=i[12],h=i[1],l=i[5],c=i[9],f=i[13],d=i[2],p=i[6],m=i[10],v=i[14],y=i[3],g=i[7],x=i[11],b=i[15],T=r[0],_=r[4],E=r[8],C=r[12],w=r[1],S=r[5],A=r[9],M=r[13],I=r[2],P=r[6],R=r[10],O=r[14],N=r[3],L=r[7],V=r[11],F=r[15];return n[0]=a*T+o*w+s*I+u*N,n[4]=a*_+o*S+s*P+u*L,n[8]=a*E+o*A+s*R+u*V,n[12]=a*C+o*M+s*O+u*F,n[1]=h*T+l*w+c*I+f*N,n[5]=h*_+l*S+c*P+f*L,n[9]=h*E+l*A+c*R+f*V,n[13]=h*C+l*M+c*O+f*F,n[2]=d*T+p*w+m*I+v*N,n[6]=d*_+p*S+m*P+v*L,n[10]=d*E+p*A+m*R+v*V,n[14]=d*C+p*M+m*O+v*F,n[3]=y*T+g*w+x*I+b*N,n[7]=y*_+g*S+x*P+b*L,n[11]=y*E+g*A+x*R+b*V,n[15]=y*C+g*M+x*O+b*F,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[4],r=t[8],n=t[12],a=t[1],o=t[5],s=t[9],u=t[13],h=t[2],l=t[6],c=t[10],f=t[14];return t[3]*(+n*s*l-r*u*l-n*o*c+i*u*c+r*o*f-i*s*f)+t[7]*(+e*s*f-e*u*c+n*a*c-r*a*f+r*u*h-n*s*h)+t[11]*(+e*u*l-e*o*f-n*a*l+i*a*f+n*o*h-i*u*h)+t[15]*(-r*o*h-e*s*l+e*o*c+r*a*l-i*a*c+i*s*h)},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.invert=function(){var t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],a=t[4],o=t[5],s=t[6],u=t[7],h=t[8],l=t[9],c=t[10],f=t[11],d=t[12],p=t[13],m=t[14],v=t[15],y=l*m*u-p*c*u+p*s*f-o*m*f-l*s*v+o*c*v,g=d*c*u-h*m*u-d*s*f+a*m*f+h*s*v-a*c*v,x=h*p*u-d*l*u+d*o*f-a*p*f-h*o*v+a*l*v,b=d*l*s-h*p*s-d*o*c+a*p*c+h*o*m-a*l*m,T=e*y+i*g+r*x+n*b;if(0===T)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var _=1/T;return t[0]=y*_,t[1]=(p*c*n-l*m*n-p*r*f+i*m*f+l*r*v-i*c*v)*_,t[2]=(o*m*n-p*s*n+p*r*u-i*m*u-o*r*v+i*s*v)*_,t[3]=(l*s*n-o*c*n-l*r*u+i*c*u+o*r*f-i*s*f)*_,t[4]=g*_,t[5]=(h*m*n-d*c*n+d*r*f-e*m*f-h*r*v+e*c*v)*_,t[6]=(d*s*n-a*m*n-d*r*u+e*m*u+a*r*v-e*s*v)*_,t[7]=(a*c*n-h*s*n+h*r*u-e*c*u-a*r*f+e*s*f)*_,t[8]=x*_,t[9]=(d*l*n-h*p*n-d*i*f+e*p*f+h*i*v-e*l*v)*_,t[10]=(a*p*n-d*o*n+d*i*u-e*p*u-a*i*v+e*o*v)*_,t[11]=(h*o*n-a*l*n-h*i*u+e*l*u+a*i*f-e*o*f)*_,t[12]=b*_,t[13]=(h*p*r-d*l*r+d*i*c-e*p*c-h*i*m+e*l*m)*_,t[14]=(d*o*r-a*p*r-d*i*s+e*p*s+a*i*m-e*o*m)*_,t[15]=(a*l*r-h*o*r+h*i*s-e*l*s-a*i*c+e*o*c)*_,this},e.extractBasis=function(t,e,i){var r=this.elements;return t.set(r[0],r[1],r[2]),e.set(r[4],r[5],r[6]),i.set(r[8],r[9],r[10]),this},e.compose=function(t,e,i,r){void 0===r&&(r=e$.ZERO);var n=this.elements,a=e.x,o=e.y,s=e.z,u=e.w,h=-r.x,l=-r.y,c=-r.z,f=a+a,d=o+o,p=s+s,m=a*f,v=a*d,y=a*p,g=o*d,x=o*p,b=s*p,T=u*f,_=u*d,E=u*p,C=i.x,w=i.y,S=i.z;return n[0]=(1-(g+b))*C,n[1]=(v+E)*C,n[2]=(y-_)*C,n[3]=0,n[4]=(v-E)*w,n[5]=(1-(m+b))*w,n[6]=(x+T)*w,n[7]=0,n[8]=(y+_)*S,n[9]=(x-T)*S,n[10]=(1-(m+g))*S,n[11]=0,n[12]=h*n[0]+l*n[4]+c*n[8]-h+t.x,n[13]=h*n[1]+l*n[5]+c*n[9]-l+t.y,n[14]=h*n[2]+l*n[6]+c*n[10]-c+t.z,this},e.decompose=function(e,i,r){var n=t.tempVec0,a=this.elements,o=n.set(a[0],a[1],a[2]).length(),s=n.set(a[4],a[5],a[6]).length(),u=n.set(a[8],a[9],a[10]).length();0>this.determinant()&&(o=-o),e.x=a[12],e.y=a[13],e.z=a[14];var h=t.tempMat0;h.copyFrom(this);var l=1/o,c=1/s,f=1/u;return h.elements[0]*=l,h.elements[1]*=l,h.elements[2]*=l,h.elements[4]*=c,h.elements[5]*=c,h.elements[6]*=c,h.elements[8]*=f,h.elements[9]*=f,h.elements[10]*=f,i.setFromRotationMatrix(h),r.x=o,r.y=s,r.z=u,this},e.getTranslation=function(t){var e=this.elements;return t.set(e[12],e[13],e[14])},e.getScale=function(t){var e=this.elements;return t.set(Math.hypot(e[0],e[1],e[2]),Math.hypot(e[4],e[5],e[6]),Math.hypot(e[8],e[9],e[10]))},e.getTransform=function(){var t=new e$,e=new i5,i=new e$;return this.decompose(t,e,i),{translation:t,rotation:e,scale:i}},e.orthographic=function(t,e,i,r,n,a){var o=1/(e-t),s=1/(i-r),u=1/(a-n),h=-(e+t)*o,l=-(i+r)*s,c=-(a+n)*u;o*=2,s*=2,u*=-2;var f=this.elements;return f[0]=o,f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[5]=s,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[10]=u,f[11]=0,f[12]=h,f[13]=l,f[14]=c,f[15]=1,this},e.perspective=function(t,e,i,r,n){var a=1/Math.tan(.5*t),o=1/(i-r),s=this.elements;return s[0]=n?a:a/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=n?a*e:a,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(r+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*r*i*o,s[15]=0,(null===r||r===1/0)&&(s[10]=-1,s[14]=-2*i),this},e.projectPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;o.x=a[0]*i+a[4]*r+a[8]*n+a[12],o.y=a[1]*i+a[5]*r+a[9]*n+a[13],o.z=a[2]*i+a[6]*r+a[10]*n+a[14];var s=a[3]*i+a[7]*r+a[11]*n+a[15];return o.multiply(1/s)},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[4]*r+a[8]*n+a[12],o.y=a[1]*i+a[5]*r+a[9]*n+a[13],o.z=a[2]*i+a[6]*r+a[10]*n+a[14],o},e.transformNormal=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[4]*r+a[8]*n,o.y=a[1]*i+a[5]*r+a[9]*n,o.z=a[2]*i+a[6]*r+a[10]*n,o.normalize()},e.transformVector4=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,o=this.elements,s=null!=e?e:t;return s.x=o[0]*i+o[4]*r+o[8]*n+o[12]*a,s.y=o[1]*i+o[5]*r+o[9]*n+o[13]*a,s.z=o[2]*i+o[6]*r+o[10]*n+o[14]*a,s.w=o[3]*i+o[7]*r+o[11]*n+o[15]*a,s},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<16;r++)if(!eq(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15]},t.fromIdentity=function(){return new t(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},t.fromLookAt=function(e,i,r){return new t().lookAt(e,i,r)},t.fromPerspective=function(e,i,r,n,a){return new t().perspective(e,i,r,n,a)},t.fromColumnVectors=function(e,i,r,n){return new t().setFromColumnVectors(e,i,r,n)},t.fromMatrix3=function(e){return new t().setFromMatrix3(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromScale=function(e,i,r){return new t().setFromScale(e,i,r)},t.fromTranslation=function(e,i,r){return new t().setFromTranslation(e,i,r)},t.fromRotationX=function(e){return new t().setFromRotationX(e)},t.fromRotationY=function(e){return new t().setFromRotationY(e)},t.fromRotationZ=function(e){return new t().setFromRotationZ(e)},t.fromRotationAxis=function(e,i){return new t().setFromRotationAxis(e,i)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromShear=function(e,i,r){return new t().setFromShear(e,i,r)},t.fromBasis=function(e,i,r){return new t().setFromBasis(e,i,r)},t.fromRowMajorData=function(e,i,r,n,a,o,s,u,h,l,c,f,d,p,m,v){return new t(e,a,h,d,i,o,l,p,r,s,c,m,n,u,f,v)},t}();rO.IDENTITY=new rO(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),rO.ZERO=new rO(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),rO.tempVec0=new e$,rO.tempVec1=new e$,rO.tempVec2=new e$,rO.tempMat0=new rO;var rN=[],rL={},rV="WebGL Constants not in global, please check your environment";function rF(){"function"==typeof WebGL2RenderingContext?rD(WebGL2RenderingContext):"undefined"!=typeof WebGLRenderingContext?(rD(WebGLRenderingContext),rD(WebGLRenderingContext.prototype)):e9?rN.push(e7()?"iOS16 lockdown mode, WebGL Constants not in global":rV):rN.push(rV),rN.length||"HALF_FLOAT"in rL||(rL.HALF_FLOAT=5131)}function rD(t){for(var e in t)/^[A-Z_]/.test(e)&&(rL[e]=t[e])}function rk(t){switch(t){case tV.ALPHA:case tV.ADD:case tV.SUBTRACTION:case tV.STRONG_LIGHT:case tV.WEAK_LIGHT:return 1;case tV.SUPERPOSITION:return 2;case tV.BRIGHTNESS:return 3;case tV.MULTIPLY:return 0;default:return 1}}function rz(t,e){switch(e){case void 0:case tV.ALPHA:t.blendFunction=[rL.ONE,rL.ONE_MINUS_SRC_ALPHA,rL.ONE,rL.ONE_MINUS_SRC_ALPHA];break;case tV.ADD:t.blendFunction=[rL.ONE,rL.ONE,rL.ONE,rL.ONE];break;case tV.SUBTRACTION:t.blendFunction=[rL.ONE,rL.ONE,rL.ZERO,rL.ONE],t.blendEquation=[rL.FUNC_REVERSE_SUBTRACT,rL.FUNC_REVERSE_SUBTRACT];break;case tV.SUPERPOSITION:t.blendFunction=[rL.ONE,rL.ONE,rL.ONE,rL.ONE];break;case tV.MULTIPLY:t.blendFunction=[rL.DST_COLOR,rL.ONE_MINUS_SRC_ALPHA,rL.DST_COLOR,rL.ONE_MINUS_SRC_ALPHA];break;case tV.BRIGHTNESS:t.blendFunction=[rL.ONE,rL.ONE_MINUS_SRC_ALPHA,rL.ONE,rL.ONE_MINUS_SRC_ALPHA];break;case tV.STRONG_LIGHT:t.blendFunction=[rL.DST_COLOR,rL.DST_ALPHA,rL.ZERO,rL.ONE];break;case tV.WEAK_LIGHT:t.blendFunction=[rL.DST_COLOR,rL.ZERO,rL.ZERO,rL.ONE];break;default:console.warn("BlendMode "+e+" not in specification, please set blend params separately.")}}function rB(t,e){e===tF.DOUBLE?t.culling=!1:(t.culling=!0,t.frontFace=rL.CW,t.cullFace=e===tF.BACK?rL.BACK:rL.FRONT)}function rU(e,i){switch(i){case void 0:e.stencilTest=!1;break;case t.MaskMode.MASK:e.stencilTest=!0,e.stencilFunc=[rL.ALWAYS,rL.ALWAYS],e.stencilOpZPass=[rL.REPLACE,rL.REPLACE];break;case t.MaskMode.OBSCURED:e.stencilTest=!0,e.stencilFunc=[rL.EQUAL,rL.EQUAL];break;case t.MaskMode.REVERSE_OBSCURED:e.stencilTest=!0,e.stencilFunc=[rL.NOTEQUAL,rL.NOTEQUAL];break;case t.MaskMode.NONE:e.stencilTest=!1;break;default:console.warn("MaskMode "+i+" not in specification, please set stencil params seperately.")}}rN.length||rF(),t.ShaderType=void 0,(ti=t.ShaderType||(t.ShaderType={}))[ti.vertex=0]="vertex",ti[ti.fragment=1]="fragment",t.MaskMode=void 0,(tr=t.MaskMode||(t.MaskMode={}))[tr.NONE=0]="NONE",tr[tr.MASK=1]="MASK",tr[tr.OBSCURED=2]="OBSCURED",tr[tr.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",t.TextureLoadAction=void 0,(tn=t.TextureLoadAction||(t.TextureLoadAction={}))[tn.whatever=0]="whatever",tn[tn.clear=2]="clear",t.TextureSourceType=void 0,(ta=t.TextureSourceType||(t.TextureSourceType={}))[ta.none=0]="none",ta[ta.data=1]="data",ta[ta.image=2]="image",ta[ta.compressed=3]="compressed",ta[ta.video=4]="video",ta[ta.canvas=5]="canvas",ta[ta.framebuffer=6]="framebuffer",ta[ta.mipmaps=7]="mipmaps";var rG=function(){function t(){this.callbacks={}}var e=t.prototype;return e.downloadJSON=function(t,e,i){this.download(t,"json",e,i)},e.downloadBinary=function(t,e,i){this.download(t,"arraybuffer",e,i)},e.downloadBlob=function(t,e,i){this.download(t,"blob",e,i)},e.downloadText=function(t,e,i){this.download(t,"text",e,i)},e.download=function(e,i,r,n){var a=this;if(void 0===i&&(i="json"),!this.start(e,r,n)){var o=new XMLHttpRequest,s=function(){a.finish(e,o.status,o.response)};o.responseType=i,o.addEventListener("load",function(){200==o.status||0==o.status&&t.trustXHRStatusZero?a.finish(e,200,o.response):s()}),o.addEventListener("error",s),o.open("GET",e,!0),o.send()}},e.start=function(t,e,i){var r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,i)}},e.finish=function(e,i,r){var n=this.callbacks[e];delete this.callbacks[e];for(var a=200==i||0==i&&t.trustXHRStatusZero?[r]:[i,r],o=a.length-1,s=n.length;o<s;o+=2)n[o].apply(null,a)},t}();rG.trustXHRStatusZero=!1;var rj=!1,rW=!1;function rX(t,e){return rH.apply(this,arguments)}function rH(){return(rH=eV(function(t,e){return ez(this,function(i){switch(i.label){case 0:if(!(rj||!e))return[3,2];return[4,rq(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rq(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rj=!0,[4,rq(t)];case 6:return[2]}})})).apply(this,arguments)}function rY(t,e){return rZ.apply(this,arguments)}function rZ(){return(rZ=eV(function(t,e){return ez(this,function(i){switch(i.label){case 0:if(!(rW||!e))return[3,2];return[4,rq(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rq(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rW=!0,[4,rq(t)];case 6:return[2]}})})).apply(this,arguments)}function rq(t){return rQ.apply(this,arguments)}function rQ(){return(rQ=eV(function(t){var e,i;return ez(this,function(r){if(e="",eF(t,HTMLImageElement)){if(t.complete)return[2,t];e=t.src}else eF(t,Blob)?(e=URL.createObjectURL(t),i=!0):"string"==typeof t&&(e=t);if(!e)throw Error("Invalid url type: "+JSON.stringify(t)+".");return[2,new Promise(function(t,r){var n=new Image;/^data:/.test(e)||(n.crossOrigin="*"),n.onload=function(){return n.onload=null,i&&URL.revokeObjectURL(e),t(n)},n.onerror=function(t){return n.onerror=null,i&&URL.revokeObjectURL(e),r("Load image fail: "+e+", reason: "+JSON.stringify(t))},n.src=e})]})})).apply(this,arguments)}function rK(t){return rJ.apply(this,arguments)}function rJ(){return(rJ=eV(function(t){return ez(this,function(e){return[2,new Promise(function(e,i){new rG().downloadBinary(t,e,function(e,r){i("Couldn't load bins "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r$(){return(r$=eV(function(t){return ez(this,function(e){return[2,new Promise(function(e,i){new rG().downloadBlob(t,e,function(e,r){i("Couldn't load blob "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r0(t){return r1.apply(this,arguments)}function r1(){return(r1=eV(function(t){var e;return ez(this,function(i){return e=document.createElement("video"),"string"==typeof t?e.src=t:e.srcObject=t,e.crossOrigin="anonymous",e.muted=!0,it()&&e.setAttribute("renderer","standard"),e.setAttribute("playsinline","playsinline"),[2,new Promise(function(t,i){var r=e.play().catch(function(t){i(t)});r?r.then(function(){return t(e)}):e.addEventListener("loadeddata",function i(){t(e),e.removeEventListener("loadeddata",i)},!0),e.addEventListener("error",function(t){i("Load video fail.")})})]})})).apply(this,arguments)}function r2(t,e){return r3.apply(this,arguments)}function r3(){return(r3=eV(function(t,e){return ez(this,function(i){switch(i.label){case 0:if(!Array.isArray(t))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,e(t[0])];case 2:case 4:return[2,i.sent()];case 3:return i.sent(),[4,e(t[1])];case 5:return[2,e(t)]}})})).apply(this,arguments)}function r4(t,e,i){return r5.apply(this,arguments)}function r5(){return(r5=eV(function(e,i,r,n){var a,o,s,u,h,l,c;return ez(this,function(f){switch(f.label){case 0:if(void 0===n&&(n=[]),34067!==e.target)return[3,2];return a=e.mipmaps,o=e.target,[4,Promise.all(a.map(function(t){return Promise.all(t.map(function(t){return t.id?r[t.id]:r6(t,i)}))}))];case 1:return s=f.sent(),[2,i2({keepImageSource:!1},e,{mipmaps:s,sourceFrom:{target:o,type:t.TextureSourceType.mipmaps}})];case 2:return u=e.mipmaps,h=e.target,[4,Promise.all(u.map(function(t){return r6(t,i)}))];case 3:return l=f.sent(),c=n[u[0][1][0]].url,[2,i2({keepImageSource:!1},e,{mipmaps:l,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{target:h,bin:c,type:t.TextureSourceType.mipmaps,mipmaps:u.map(function(t){return[t[1][1],t[1][2]]})}})];case 4:return[2]}})})).apply(this,arguments)}function r6(t,e){return r8.apply(this,arguments)}function r8(){return(r8=eV(function(t,e){var i,r,n,a,o;return ez(this,function(s){if(r=(i=t[1])[0],n=i[1],a=i[2],!(o=e[r]))throw Error("Invalid bin pointer: "+JSON.stringify(t)+".");return[2,rq(new Blob([new Uint8Array(o,n,a)]))]})})).apply(this,arguments)}var r9=1,r7=function(e){function i(t){var i;return(i=e.call(this,t)||this).destroyed=!1,i.id="Tex"+r9++,i}iN(i,e);var r=i.prototype;return r.getWidth=function(){return this.width||0},r.getHeight=function(){return this.height||0},r.uploadCurrentVideoFrame=function(){},r.offloadData=function(){},r.reloadData=function(){},r.initialize=function(){},r.assembleOptions=function(e){var i=e.target,r=void 0===i?rL.TEXTURE_2D:i,n=e.format,a=void 0===n?rL.RGBA:n;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=0),i2({minFilter:rL.NEAREST,magFilter:rL.NEAREST,wrapS:rL.CLAMP_TO_EDGE,wrapT:rL.CLAMP_TO_EDGE,target:r,format:rL.RGBA,internalFormat:a,type:rL.UNSIGNED_BYTE},e)},i.fromImage=function(e,r,n){return eV(function(){var a,o;return ez(this,function(s){switch(s.label){case 0:return[4,rq(e)];case 1:return a=s.sent(),(o=i.create(r,i2({sourceType:t.TextureSourceType.image,image:a,target:rL.TEXTURE_2D,id:i_(),flipY:!0},n))).initialize(),[2,o]}})})()},i.fromVideo=function(e,r,n){return eV(function(){var a,o;return ez(this,function(s){switch(s.label){case 0:return[4,r0(e)];case 1:return a=s.sent(),(o=i.create(r,i2({sourceType:t.TextureSourceType.video,video:a,id:i_(),flipY:!0},n))).initialize(),[2,o]}})})()},rC(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(iW);function nt(t,e,i,r){var n,a,o=e.length/i/r;return a=n=4===o||0===o?rL.RGBA:3===o?rL.RGB:2===o?rL.LUMINANCE_ALPHA:rL.LUMINANCE,r7.createWithData(t,{data:e,width:i,height:r},{type:rL.HALF_FLOAT,format:n,internalFormat:a,wrapS:rL.CLAMP_TO_EDGE,wrapT:rL.CLAMP_TO_EDGE})}var ne={type:rL.UNSIGNED_BYTE,format:rL.RGBA,internalFormat:rL.RGBA,wrapS:rL.MIRRORED_REPEAT,wrapT:rL.MIRRORED_REPEAT,minFilter:rL.NEAREST,magFilter:rL.NEAREST};function ni(e){return r7.create(e,i2({id:iL.WhiteTexture,data:{width:1,height:1,data:new Uint8Array([255,255,255,255])},sourceType:t.TextureSourceType.data},ne))}function nr(e){return r7.create(e,i2({id:iL.TransparentTexture,data:{width:1,height:1,data:new Uint8Array([0,0,0,0])},sourceType:t.TextureSourceType.data},ne))}var nn=new(function(){function t(){this.loaders=new Map,this.instances=new Map}var e=t.prototype;return e.register=function(t,e){this.loaders.has(t)&&console.warn('TextureLoader for type "'+t+'" is already registered, overwriting.'),this.loaders.set(t,e)},e.unregister=function(t){var e=this.instances.get(t);e&&(e.dispose(),this.instances.delete(t)),this.loaders.delete(t)},e.getLoader=function(t){if(this.instances.has(t))return this.instances.get(t);var e=this.loaders.get(t);if(!e)return console.error('TextureLoader for type "'+t+'" is not registered.'),null;var i=e();return this.instances.set(t,i),i},e.has=function(t){return this.loaders.has(t)},e.getRegisteredTypes=function(){return Array.from(this.loaders.keys())},e.dispose=function(){this.instances.forEach(function(t){return t.dispose()}),this.instances.clear(),this.loaders.clear()},t}()),na=function(){function e(){this.reloadPending={}}var i=e.prototype;return i.reload=function(t){var e=this;return eV(function(){var i,r;return ez(this,function(n){switch(n.label){case 0:if(i=t.id,e.reloadPending[i])return[2];if(!t.sourceFrom)return[3,2];return e.reloadPending[i]=!0,[4,e.loadSource(t.sourceFrom)];case 1:return r=n.sent(),t.updateSource(r),e.reloadPending[i]=!1,[3,3];case 2:throw Error("No source from.");case 3:return[2]}})})()},i.canOffloadTexture=function(e){if(e){var i=e.type;if(i===t.TextureSourceType.compressed||i===t.TextureSourceType.image){var r=e.target,n=e.map,a=e.url;return r===rL.TEXTURE_CUBE_MAP?"object"==typeof n&&!!n:im(a)&&a.length>0}if(i===t.TextureSourceType.mipmaps){var o=e.bin,s=e.mipmaps,u=e.target,h=e.maps,l=e.urls;return o?s.length>0:u===rL.TEXTURE_CUBE_MAP?h.every(function(t){return"object"==typeof t&&t}):l.every(function(t){return im(t)&&t.length>0})}}return!1},i.loadSource=function(e,i){var r=this;return eV(function(){var n,a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,w;return ez(this,function(S){switch(S.label){case 0:if(n=e.type,a=e.target,o=e.map,s=e.url,u=e.bin,h=e.mipmaps,l=e.urls,c=e.maps,!(a===rL.TEXTURE_CUBE_MAP&&n!==t.TextureSourceType.mipmaps))return[3,2];return[4,r.loadCubeMap(o)];case 1:return f=S.sent(),[2,i2({},i,{cube:f,target:rL.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.image,sourceFrom:{type:t.TextureSourceType.image,map:i2({},o),target:rL.TEXTURE_CUBE_MAP}})];case 2:if(n!==t.TextureSourceType.image)return[3,4];return[4,rq(s)];case 3:return d=S.sent(),[2,i2({},i,{image:d,sourceType:t.TextureSourceType.image,sourceFrom:{type:n,url:s,target:rL.TEXTURE_2D}})];case 4:if(n!==t.TextureSourceType.video)return[3,6];return[4,r0(s)];case 5:return p=S.sent(),[2,i2({},i,{video:p,sourceType:t.TextureSourceType.video})];case 6:if(n!==t.TextureSourceType.compressed)return[3,14];return[4,rK(s)];case 7:if(m=S.sent(),!(v=nn.getLoader("ktx2")))return[3,12];S.label=8;case 8:return S.trys.push([8,10,,11]),[4,v.loadFromBuffer(m)];case 9:if((y=S.sent()).sourceType===t.TextureSourceType.compressed)return[2,i2({sourceType:y.sourceType,type:y.type,target:y.target,internalFormat:y.internalFormat,format:y.format,mipmaps:y.mipmaps,minFilter:rL.LINEAR,magFilter:rL.LINEAR,sourceFrom:e},i)];return[3,11];case 10:throw g=S.sent(),Error("Failed to parse KTX2 from "+(null!=(x=null==e?void 0:e.url)?x:"buffer")+": "+(g.message||g));case 11:return[3,13];case 12:throw Error("KTX2 loader not found. Please register it first.");case 13:return[3,23];case 14:if(n!==t.TextureSourceType.mipmaps)return[3,23];if(!u)return[3,19];return[4,rK(u)];case 15:if(b=S.sent(),_=(T=null!=a?a:rL.TEXTURE_2D)===rL.TEXTURE_2D?h.slice():h.map(function(t){return t.slice()}),a!==rL.TEXTURE_CUBE_MAP)return[3,17];return[4,Promise.all(h.map(function(t){return r.loadMipmapImages(t,b)}))];case 16:return E=S.sent(),[3,18];case 17:E=r.loadMipmapImages(h,b),S.label=18;case 18:return[2,i2({},i,{mipmaps:E,target:T,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{bin:u,mipmaps:_,target:T,type:t.TextureSourceType.mipmaps}})];case 19:if(!(a===rL.TEXTURE_2D||!a))return[3,21];return[4,Promise.all(l.map(function(t){return rq(t)}))];case 20:return C=S.sent(),[2,i2({},i,{mipmaps:C,target:rL.TEXTURE_2D,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,urls:l.slice(),target:rL.TEXTURE_2D}})];case 21:if(a!==rL.TEXTURE_CUBE_MAP)return[3,23];return[4,Promise.all(c.map(function(t){return r.loadCubeMap(t)}))];case 22:return w=S.sent(),[2,i2({},i,{mipmaps:w,target:rL.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,maps:c.map(function(t){return i2({},t)}),target:rL.TEXTURE_CUBE_MAP}})];case 23:throw Error("Invalid resource type: "+n+".")}})})()},i.loadMipmapImages=function(t,e){return eV(function(){return ez(this,function(i){return[2,Promise.all(t.map(function(t){return rq(new Blob([new Uint8Array(e,t[0],t[1])]))}))]})})()},i.loadCubeMap=function(t){return eV(function(){return ez(this,function(e){return[2,Promise.all(t.map(function(t){return rq(t)}))]})})()},e}(),no=function(){function t(t){this.destroyed=!1;var e=t.name;this.name=void 0===e?"defaultDataBlock":e}var e=t.prototype;return e.setUniformValues=function(t){var e=this;Object.keys(t).forEach(function(i){e.setUniformValue(i,t[i])})},e.invalidAllFlags=function(){},e.updateUniformSubData=function(t,e,i){},t}();function ns(t){return"object"==typeof t&&t&&void 0===t.length&&eF(t,r7)}t.MaterialRenderType=void 0,(to=t.MaterialRenderType||(t.MaterialRenderType={}))[to.normal=0]="normal",to[to.transformFeedback=1]="transformFeedback";var nu=1,nh=function(t){function e(e,i){var r;if((r=t.call(this,e)||this).stringTags={},r.enabledMacros={},r.destroyed=!1,r.initialized=!1,r.shaderDirty=!0,i){var n=i.name,a=void 0===n?"Material"+nu++:n,o=i.renderType,s=i.shader;r.name=a,r.renderType=void 0===o?0:o,r.shaderSource=s,r.props=i}else r.name="Material"+nu++,r.renderType=0;return r}iN(e,t);var i=e.prototype;return i.initialize=function(){},i.createShaderVariant=function(){},i.use=function(t,e){},rC(e,[{key:"shader",get:function(){return this._shader},set:function(t){this._shader!==t&&(this._shader=t,this.shaderDirty=!0)}},{key:"mainTexture",get:function(){return this.getTexture("_MainTex")},set:function(t){this.setTexture("_MainTex",t)}},{key:"color",get:function(){return this.getColor("_Color")},set:function(t){this.setColor("_Color",t)}},{key:"blending",set:function(t){}},{key:"blendFunction",set:function(t){}},{key:"blendEquation",set:function(t){}},{key:"depthTest",set:function(t){}},{key:"depthMask",set:function(t){}},{key:"stencilTest",set:function(t){}},{key:"stencilRef",set:function(t){}},{key:"stencilFunc",set:function(t){}},{key:"stencilOpZPass",set:function(t){}},{key:"culling",set:function(t){}},{key:"frontFace",set:function(t){}},{key:"cullFace",set:function(t){}},{key:"blendColor",set:function(t){}},{key:"depthRange",set:function(t){}},{key:"depthFunc",set:function(t){}},{key:"polygonOffsetFill",set:function(t){}},{key:"polygonOffset",set:function(t){}},{key:"sampleAlphaToCoverage",set:function(t){}},{key:"stencilMask",set:function(t){}},{key:"stencilOpFail",set:function(t){}},{key:"stencilOpZFail",set:function(t){}}]),e}(iW),nl=function(){function e(e){this.engine=e,this.alphaMaskEnabled=!1,this.maskMode=t.MaskMode.NONE,this.maskable=null,this.stencilClearAction={stencilAction:t.TextureLoadAction.clear}}var i=e.prototype;return i.getRefValue=function(){return 1},i.setMaskOptions=function(e){var i=e.isMask,r=e.inverted,n=e.reference,a=e.alphaMaskEnabled;this.alphaMaskEnabled=void 0!==a&&a,void 0!==i&&i?this.maskMode=t.MaskMode.MASK:(this.maskMode=void 0!==r&&r?t.MaskMode.REVERSE_OBSCURED:t.MaskMode.OBSCURED,this.maskable=this.engine.findObject(n))},i.drawStencilMask=function(t){this.maskable&&(t.clear(this.stencilClearAction),this.maskable.drawStencilMask(t))},e}();t.FilterMode=void 0,(ts=t.FilterMode||(t.FilterMode={}))[ts.Nearest=0]="Nearest",ts[ts.Linear=1]="Linear",t.RenderTextureFormat=void 0,(tu=t.RenderTextureFormat||(t.RenderTextureFormat={}))[tu.RGBA32=0]="RGBA32",tu[tu.RGBAHalf=1]="RGBAHalf";var nc=function(){function t(){}var e=t.prototype;return e.resize=function(t,e,i,r){},e.resetColorTextures=function(t){},e.unbind=function(){},e.bind=function(){},e.getDepthTexture=function(){},e.getStencilTexture=function(){},e.getColorTextures=function(){return[]},e.dispose=function(t){},rC(t,[{key:"stencilStorage",get:function(){}},{key:"depthStorage",get:function(){}}]),t}();t.RenderPassAttachmentStorageType=void 0,(th=t.RenderPassAttachmentStorageType||(t.RenderPassAttachmentStorageType={}))[th.none=0]="none",th[th.color=1]="color",th[th.stencil_8_opaque=2]="stencil_8_opaque",th[th.depth_16_opaque=3]="depth_16_opaque",th[th.depth_stencil_opaque=4]="depth_stencil_opaque",th[th.depth_16_texture=5]="depth_16_texture",th[th.depth_24_stencil_8_texture=6]="depth_24_stencil_8_texture",t.TextureStoreAction=void 0,(tl=t.TextureStoreAction||(t.TextureStoreAction={}))[tl.store=0]="store",tl[tl.clear=2]="clear";var nf=function(){function e(e,i){if(this.destroyed=!1,i){var r=i.texture,n=i.size;if(eF(r,r7))this.texture=r,this.externalTexture=!0;else if(r){var a=r.wrapT,o=r.wrapS,s=r.minFilter,u=r.magFilter,h=r.internalFormat,l=r.format,c=void 0===l?rL.RGBA:l,f=r.type,d=void 0===f?rL.UNSIGNED_BYTE:f;this.externalTexture=!1,this.textureOptions={size:n,format:c,type:d,internalFormat:h||c,wrapT:a,wrapS:o,minFilter:s,magFilter:u,name:i.name},this.texture=r7.create(e,i2({},this.textureOptions,{sourceType:t.TextureSourceType.framebuffer,data:{width:n[0],height:n[1]}}))}}}return e.prototype.dispose=function(){this.destroyed||(this.texture.dispose(),this.destroyed=!0)},rC(e,[{key:"isDestroyed",get:function(){return this.destroyed}},{key:"storageType",get:function(){return 1}},{key:"size",get:function(){var t=this.texture;return t?[t.getWidth(),t.getHeight()]:[0,0]}},{key:"width",get:function(){return this.texture.getWidth()||0}},{key:"height",get:function(){return this.texture.getHeight()||0}}]),e}();t.RenderPassDestroyAttachmentType=void 0,(tc=t.RenderPassDestroyAttachmentType||(t.RenderPassDestroyAttachmentType={}))[tc.force=0]="force",tc[tc.keep=1]="keep",tc[tc.keepExternal=2]="keepExternal",tc[tc.destroy=0]="destroy";var nd=1,np=function(){function e(t){this.priority=0,this.name="RenderPass"+nd++,this.meshes=[],this.disposed=!1,this.framebuffer=null,this.renderer=t}var i=e.prototype;return i.addMesh=function(t){is(this.meshes,t)},i.removeMesh=function(t){eX(this.meshes,t)},i.configure=function(t){},i.execute=function(t){},i.onCameraCleanup=function(t){},i.getViewport=function(){var t,e=null==(t=this.framebuffer)?void 0:t.viewport;if(e)return e;var i=this.renderer;return i?[0,0,i.getWidth(),i.getHeight()]:[0,0,0,0]},i.dispose=function(e){if(!this.disposed){var i=(null==e?void 0:e.meshes)||void 0;i!==t.DestroyOptions.keep&&this.meshes.forEach(function(t){t.dispose(i)}),this.meshes.length=0,this.disposed=!0}},rC(e,[{key:"isDisposed",get:function(){return this.disposed}},{key:"viewport",get:function(){return this.getViewport()}}]),e}(),nm=function(e){function i(t){var i;return(i=e.call(this,t)||this).useRenderTarget=!1,i.priority=1e3,i.name="DrawObjectPass",i}iN(i,e);var r=i.prototype;return r.setup=function(t){this.useRenderTarget=t},r.configure=function(e){this.useRenderTarget&&(this.framebuffer=e.getTemporaryRT("DrawObjectPass",e.getWidth(),e.getHeight(),16,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),e.setFramebuffer(this.framebuffer))},r.execute=function(e){this.useRenderTarget&&e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear}),e.renderMeshes(this.meshes)},r.onCameraCleanup=function(t){this.useRenderTarget&&this.framebuffer&&t.releaseTemporaryRT(this.framebuffer)},i}(np);t.ShaderCompileResultStatus=void 0,(tf=t.ShaderCompileResultStatus||(t.ShaderCompileResultStatus={}))[tf.noShader=0]="noShader",tf[tf.success=1]="success",tf[tf.fail=2]="fail",tf[tf.compiling=3]="compiling",t.GLSLVersion=void 0,(td=t.GLSLVersion||(t.GLSLVersion={})).GLSL1="100",td.GLSL3="300 es";var nv=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).source=i,r}return iN(e,t),e}(iW);t.Shader=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.createVariant=function(t){var e=[];if(t)for(var i,r=iD(Object.keys(t));!(i=r()).done;){var n=i.value;e.push([n,t[n]])}var a=this.engine.getShaderLibrary().createShader(this.shaderData,e);return a.shader=this,a},i.fromData=function(e){t.prototype.fromData.call(this,e),this.shaderData=e},e}(iW),t.Shader=ek([iU(el.Shader)],t.Shader);var ny=((eb={})[rL.FLOAT]=Float32Array.BYTES_PER_ELEMENT,eb[rL.INT]=Int32Array.BYTES_PER_ELEMENT,eb[rL.SHORT]=Int16Array.BYTES_PER_ELEMENT,eb[rL.BYTE]=Int8Array.BYTES_PER_ELEMENT,eb),ng=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="",e.subMeshes=[],e}iN(e,t);var i=e.prototype;return i.initialize=function(){},i.flush=function(){},e}(iW);function nx(t){return t===rL.INT?new Int32Array(0):t===rL.SHORT?new Int16Array(0):new Float32Array(0)}(tp=eT||(eT={}))[tp.XYZ=0]="XYZ",tp[tp.XZY=1]="XZY",tp[tp.YXZ=2]="YXZ",tp[tp.YZX=3]="YZX",tp[tp.ZXY=4]="ZXY",tp[tp.ZYX=5]="ZYX";var nb=function(){function t(e,i,r,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=t.DEFAULT_ORDER),this.x=e,this.y=i,this.z=r,this.order=n}var e=t.prototype;return e.set=function(t,e,i,r){return void 0===r&&(r=this.order),this.x=t,this.y=e,this.z=i,this.order=r,this},e.setZero=function(t){return void 0===t&&(t=this.order),this.set(0,0,0,t)},e.setFromRotationMatrix4=function(t,e){void 0===e&&(e=this.order);var i=t.elements,r=i[0],n=i[4],a=i[8],o=i[1],s=i[5],u=i[9],h=i[2],l=i[6],c=i[10];switch(e){case eT.XYZ:this.y=Math.asin(eK(a,-1,1)),.9999999>Math.abs(a)?(this.x=Math.atan2(-u,c),this.z=Math.atan2(-n,r)):(this.x=Math.atan2(l,s),this.z=0);break;case eT.YXZ:this.x=Math.asin(-eK(u,-1,1)),.9999999>Math.abs(u)?(this.y=Math.atan2(a,c),this.z=Math.atan2(o,s)):(this.y=Math.atan2(-h,r),this.z=0);break;case eT.ZXY:this.x=Math.asin(eK(l,-1,1)),.9999999>Math.abs(l)?(this.y=Math.atan2(-h,c),this.z=Math.atan2(-n,s)):(this.y=0,this.z=Math.atan2(o,r));break;case eT.ZYX:this.y=Math.asin(-eK(h,-1,1)),.9999999>Math.abs(h)?(this.x=Math.atan2(l,c),this.z=Math.atan2(o,r)):(this.x=0,this.z=Math.atan2(-n,s));break;case eT.YZX:this.z=Math.asin(eK(o,-1,1)),.9999999>Math.abs(o)?(this.x=Math.atan2(-u,s),this.y=Math.atan2(-h,r)):(this.x=0,this.y=Math.atan2(a,c));break;case eT.XZY:this.z=Math.asin(-eK(n,-1,1)),.9999999>Math.abs(n)?(this.x=Math.atan2(l,s),this.y=Math.atan2(a,r)):(this.x=Math.atan2(-u,c),this.y=0);break;default:console.error("setFromRotationMatrix: unknown order: "+e)}return this.x*=eZ,this.y*=eZ,this.z*=eZ,this.order=e,this},e.setFromQuaternion=function(e,i){void 0===i&&(i=this.order);var r=t.tempMat0;return r.setFromQuaternion(e),this.setFromRotationMatrix4(r,i)},e.setFromVector3=function(t,e){return void 0===e&&(e=this.order),this.set(t.x,t.y,t.z,e)},e.setFromArray=function(t,e,i){var r,n,a,o;return void 0===e&&(e=0),void 0===i&&(i=this.order),this.x=null!=(r=t[e])?r:0,this.y=null!=(n=t[e+1])?n:0,this.z=null!=(a=t[e+2])?a:0,this.order=null!=(o=t[e+3])?o:i,this},e.clone=function(){return new t(this.x,this.y,this.z,this.order)},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.order=t.order,this},e.add=function(t){return this.order!=t.order?console.error("add euler with different order"):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addEulers=function(t,e){return t.order!=e.order?console.error("add euler with different order"):(this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.order=t.order),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.reorder=function(t){var e=new i5;return e.setFromEuler(this),this.setFromQuaternion(e,t)},e.rotateVector3=function(e,i){return t.tempQuat0.setFromEuler(this).rotateVector3(e,i)},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.order===this.order},e.toVector3=function(t){return t.set(this.x,this.y,this.z)},e.toArray=function(){return[this.x,this.y,this.z]},e.toQuaternion=function(t){var e=this.x,i=this.y,r=this.z,n=this.order,a=Math.cos(e*eY*.5),o=Math.cos(i*eY*.5),s=Math.cos(r*eY*.5),u=Math.sin(e*eY*.5),h=Math.sin(i*eY*.5),l=Math.sin(r*eY*.5);switch(n){case eT.XYZ:t.set(u*o*s+a*h*l,a*h*s-u*o*l,a*o*l+u*h*s,a*o*s-u*h*l);break;case eT.YXZ:t.set(u*o*s+a*h*l,a*h*s-u*o*l,a*o*l-u*h*s,a*o*s+u*h*l);break;case eT.ZXY:t.set(u*o*s-a*h*l,a*h*s+u*o*l,a*o*l+u*h*s,a*o*s-u*h*l);break;case eT.ZYX:t.set(u*o*s-a*h*l,a*h*s+u*o*l,a*o*l-u*h*s,a*o*s+u*h*l);break;case eT.YZX:t.set(u*o*s+a*h*l,a*h*s+u*o*l,a*o*l-u*h*s,a*o*s-u*h*l);break;case eT.XZY:t.set(u*o*s-a*h*l,a*h*s-u*o*l,a*o*l+u*h*s,a*o*s+u*h*l);break;default:console.error("unknown euler order: "+n)}return t},e.toMatrix4=function(t){var e=t.elements,i=this.x,r=this.y,n=this.z,a=this.order,o=Math.cos(i*eY),s=Math.sin(i*eY),u=Math.cos(r*eY),h=Math.sin(r*eY),l=Math.cos(n*eY),c=Math.sin(n*eY);if(a===eT.XYZ){var f=o*l,d=o*c,p=s*l,m=s*c;e[0]=u*l,e[4]=-u*c,e[8]=h,e[1]=d+p*h,e[5]=f-m*h,e[9]=-s*u,e[2]=m-f*h,e[6]=p+d*h,e[10]=o*u}else if(a===eT.YXZ){var v=u*l,y=u*c,g=h*l,x=h*c;e[0]=v+x*s,e[4]=g*s-y,e[8]=o*h,e[1]=o*c,e[5]=o*l,e[9]=-s,e[2]=y*s-g,e[6]=x+v*s,e[10]=o*u}else if(a===eT.ZXY){var b=u*l,T=u*c,_=h*l,E=h*c;e[0]=b-E*s,e[4]=-o*c,e[8]=_+T*s,e[1]=T+_*s,e[5]=o*l,e[9]=E-b*s,e[2]=-o*h,e[6]=s,e[10]=o*u}else if(a===eT.ZYX){var C=o*l,w=o*c,S=s*l,A=s*c;e[0]=u*l,e[4]=S*h-w,e[8]=C*h+A,e[1]=u*c,e[5]=A*h+C,e[9]=w*h-S,e[2]=-h,e[6]=s*u,e[10]=o*u}else if(a===eT.YZX){var M=o*u,I=o*h,P=s*u,R=s*h;e[0]=u*l,e[4]=R-M*c,e[8]=P*c+I,e[1]=c,e[5]=o*l,e[9]=-s*l,e[2]=-h*l,e[6]=I*c+P,e[10]=M-R*c}else if(a===eT.XZY){var O=o*u,N=o*h,L=s*u,V=s*h;e[0]=u*l,e[4]=-c,e[8]=h*l,e[1]=O*c+V,e[5]=o*l,e[9]=N*c-L,e[2]=L*c-N,e[6]=s*l,e[10]=V*c+O}else console.error("toMatrix4: Invalid order "+a);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,t},t.fromRotationMatrix4=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromRotationMatrix4(e,i)},t.fromQuaternion=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromQuaternion(e,i)},t.fromVector3=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromVector3(e,i)},t.fromArray=function(e,i,r){return void 0===i&&(i=0),void 0===r&&(r=t.DEFAULT_ORDER),new t().setFromArray(e,i,r)},t}();nb.DEFAULT_ORDER=eT.ZYX,nb.tempQuat0=new i5,nb.tempMat0=new rO;var nT=function(){function t(t,e,i,r,n,a,o,s,u){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===u&&(u=1),this.elements=[t,e,i,r,n,a,o,s,u]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,o,s,u){var h=this.elements;return h[0]=t,h[3]=r,h[6]=o,h[1]=e,h[4]=n,h[7]=s,h[2]=i,h[5]=a,h[8]=u,this},e.setFromRowMajorData=function(t,e,i,r,n,a,o,s,u){var h=this.elements;return h[0]=t,h[3]=e,h[6]=i,h[1]=r,h[4]=n,h[7]=a,h[2]=o,h[5]=s,h[8]=u,this},e.setFromColumnVectors=function(t,e,i){return this.set(t.x,t.y,t.z,e.x,e.y,e.z,i.x,i.y,i.z)},e.setFromMatrix4=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[e+i];return this},e.setFromQuaternion=function(t){var e=t.x,i=t.y,r=t.z,n=t.w,a=e+e,o=i+i,s=r+r,u=e*a,h=e*o,l=e*s,c=i*o,f=i*s,d=r*s,p=n*a,m=n*o,v=n*s,y=this.elements;return y[0]=1-(c+d),y[1]=h+v,y[2]=l-m,y[3]=h-v,y[4]=1-(u+d),y[5]=f+p,y[6]=l+m,y[7]=f-p,y[8]=1-(u+c),this},e.setZero=function(){for(var t=0;t<9;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,1,0,0,0,1)},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[3*t],this.elements[3*t+1],this.elements[3*t+2])},e.scale=function(t,e){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},e.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.elements,n=r[0],a=r[3],o=r[6],s=r[1],u=r[4],h=r[7];return r[0]=e*n+i*s,r[3]=e*a+i*u,r[6]=e*o+i*h,r[1]=-i*n+e*s,r[4]=-i*a+e*u,r[7]=-i*o+e*h,this},e.translate=function(t,e){var i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<9;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],o=i[3],s=i[6],u=i[1],h=i[4],l=i[7],c=i[2],f=i[5],d=i[8],p=r[0],m=r[3],v=r[6],y=r[1],g=r[4],x=r[7],b=r[2],T=r[5],_=r[8];return n[0]=a*p+o*y+s*b,n[3]=a*m+o*g+s*T,n[6]=a*v+o*x+s*_,n[1]=u*p+h*y+l*b,n[4]=u*m+h*g+l*T,n[7]=u*v+h*x+l*_,n[2]=c*p+f*y+d*b,n[5]=c*m+f*g+d*T,n[8]=c*v+f*x+d*_,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],o=t[7],s=t[2],u=t[5],h=t[8];return e*(a*h-u*o)+n*(u*r-i*h)+s*(i*o-a*r)},e.invert=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],o=t[7],s=t[2],u=t[5],h=t[8],l=h*a-u*o,c=u*r-h*i,f=o*i-a*r,d=e*l+n*c+s*f;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var p=1/d;return t[0]=l*p,t[1]=(s*o-h*n)*p,t[2]=(u*n-s*a)*p,t[3]=c*p,t[4]=(h*e-s*r)*p,t[5]=(s*i-u*e)*p,t[6]=f*p,t[7]=(n*r-o*e)*p,t[8]=(a*e-n*i)*p,this},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[3]*r+a[6]*n,o.y=a[1]*i+a[4]*r+a[7]*n,o.z=a[2]*i+a[5]*r+a[8]*n,o},e.transformNormal=function(t,e){return this.transformPoint(t,e).normalize()},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<9;r++)if(!eq(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8]},t.fromIdentity=function(){return new t(1,0,0,0,1,0,0,0,1)},t.fromColumnVectors=function(e,i,r){return new t().setFromColumnVectors(e,i,r)},t.fromMatrix4=function(e){return new t().setFromMatrix4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromRowMajorData=function(e,i,r,n,a,o,s,u,h){return new t(e,n,s,i,a,u,r,o,h)},t}(),n_=function(){function t(t,e){void 0===t&&(t=e$.ZERO),void 0===e&&(e=e$.X),this.origin=new e$,this.direction=new e$,this.origin.copyFrom(t),this.direction.copyFrom(e).normalize()}var e=t.prototype;return e.set=function(t,e){return this.origin.copyFrom(t),this.direction.copyFrom(e).normalize(),this},e.clone=function(){return new t(this.origin,this.direction)},e.copyFrom=function(t){return this.set(t.origin,t.direction)},e.recast=function(e){return this.origin.copyFrom(this.at(e,t.tempVec0)),this},e.at=function(t,e){var i=e||new e$;return i.copyFrom(this.origin),i.addScaledVector(this.direction,t)},e.equals=function(t){return this.origin.equals(t.origin)&&this.direction.equals(t.direction)},e.applyMatrix=function(t){return this.origin.applyProjectionMatrix(t),this.direction.applyNormalMatrix(t),this},e.intersectBox=function(t,e){var i,r,n,a,o,s,u=this.origin,h=u.x,l=u.y,c=u.z,f=this.direction,d=f.x,p=f.y,m=f.z,v=t.min,y=v.x,g=v.y,x=v.z,b=t.max,T=b.x,_=b.y,E=b.z,C=1/d,w=1/p,S=1/m;if(C>=0?(i=(y-h)*C,r=(T-h)*C):(i=(T-h)*C,r=(y-h)*C),w>=0?(n=(g-l)*w,a=(_-l)*w):(n=(_-l)*w,a=(g-l)*w),!(i>a)&&!(n>r)&&((n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),(n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),S>=0?(o=(x-c)*S,s=(E-c)*S):(o=(E-c)*S,s=(x-c)*S),!(i>s)&&!(o>r))&&((o>i||i!=i)&&(i=o),(s<r||r!=r)&&(r=s),!(r<0)))return i>=0?this.at(i,e):this.at(r,e)},e.intersectPlane=function(t,e){var i=t.normal,r=t.distance,n=i.dot(this.direction);if(0===n)return 0===i.dot(this.origin)+r?(e||new e$).copyFrom(this.origin):void 0;var a=-(this.origin.dot(i)+r)/n;return a>=0?this.at(a,e):void 0},e.intersectSphere=function(e,i){var r=e.center,n=t.tempVec0.subtractVectors(r,this.origin),a=n.dot(this.direction),o=n.dot(n)-a*a,s=e.radius*e.radius;if(!(o>s)){var u=Math.sqrt(s-o),h=a-u,l=a+u;if(!(l<0))return h>=0?this.at(h,i):this.at(l,i)}},e.intersectTriangle=function(e,i,r){var n,a=e.p0,o=e.p1,s=e.p2,u=t.tempVec0.subtractVectors(o,a),h=t.tempVec1.subtractVectors(s,a),l=t.tempVec2.subtractVectors(this.origin,a),c=t.tempVec3.crossVectors(u,h),f=this.direction.dot(c);if(f>0){if(r)return;n=1}else{if(!(f<0))return;n=-1,f=-f}h.crossVectors(l,h);var d=n*this.direction.dot(h);if(!(d<0)){u.cross(l);var p=n*this.direction.dot(u);if(!(p<0)&&!(d+p>f)){var m=-n*l.dot(c);if(!(m<0))return this.at(m/f,i)}}},t}();n_.tempVec0=new e$,n_.tempVec1=new e$,n_.tempVec2=new e$,n_.tempVec3=new e$;var nE=function(){function t(t,e){void 0===t&&(t=new e$(1/0,1/0,1/0)),void 0===e&&(e=new e$(-1/0,-1/0,-1/0)),this.min=t.clone(),this.max=e.clone()}var e=t.prototype;return e.set=function(t,e){return this.min.copyFrom(t),this.max.copyFrom(e),this},e.setFromArray=function(t){for(var e=Number(1/0),i=Number(1/0),r=Number(1/0),n=-1/0,a=-1/0,o=-1/0,s=0,u=t.length;s<u;s+=3){var h=t[s],l=t[s+1],c=t[s+2];h<e&&(e=h),l<i&&(i=l),c<r&&(r=c),h>n&&(n=h),l>a&&(a=l),c>o&&(o=c)}return this.min.set(e,i,r),this.max.set(n,a,o),this},e.setFromPoints=function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},e.setFromCenterAndSize=function(t,e){var i=e.clone().multiply(.5);return this.min.copyFrom(t).subtract(i),this.max.copyFrom(t).add(i),this},e.setFromObject=function(t){return this.makeEmpty(),this.expandByObject(t)},e.clone=function(){return new t().copyFrom(this)},e.copyFrom=function(t){return this.min.copyFrom(t.min),this.max.copyFrom(t.max),this},e.makeEmpty=function(){return this.min.x=this.min.y=this.min.z=Number(1/0),this.max.x=this.max.y=this.max.z=-1/0,this},e.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},e.getCenter=function(t){return void 0===t&&(t=new e$),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiply(.5)},e.getSize=function(t){return void 0===t&&(t=new e$),this.isEmpty()?t.set(0,0,0):t.subtractVectors(this.max,this.min)},e.expandByPoint=function(t){return this.min.min(t),this.max.max(t),this},e.expandByVector=function(t){return this.min.subtract(t),this.max.add(t),this},e.expandByScalar=function(t){return this.min.add(-t),this.max.add(t),this},e.expandByBox=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.expandByObject=function(e){e.updateWorldMatrix(!1,!1);var i=e.geometry;if(void 0!==i){null===i.boundingBox&&i.computeBoundingBox();var r=new t;r.copyFrom(i.boundingBox),r.applyMatrix4(e.matrixWorld),this.union(r)}for(var n=e.children,a=0,o=n.length;a<o;a++)this.expandByObject(n[a]);return this},e.containsPoint=function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},e.containsBox=function(t){return this.min.x<=t.min.x&&this.max.x>=t.max.x&&this.min.y<=t.min.y&&this.max.y>=t.max.y&&this.min.z<=t.min.z&&this.max.z>=t.max.z},e.getParameter=function(t,e){return void 0===e&&(e=new e$),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},e.intersectsBox=function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},e.intersectsSphere=function(t){var e=new e$;return this.clampPoint(t.center,e),e.distanceSquared(t.center)<=t.radius*t.radius},e.clampPoint=function(t,e){return void 0===e&&(e=new e$),e.copyFrom(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return t.clone().clamp(this.min,this.max).subtract(t).length()},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.applyMatrix4=function(t,e){if(void 0===e&&(e=new e$),this.isEmpty())return this;var i=this.getOBBPoints(t,e);return this.setFromPoints(i),this},e.getOBBPoints=function(t,e){if(void 0===e&&(e=new e$),this.isEmpty())return[];var i=[];return i[0]=new e$(this.min.x,this.min.y,this.min.z),i[1]=new e$(this.min.x,this.min.y,this.max.z),i[2]=new e$(this.min.x,this.max.y,this.min.z),i[3]=new e$(this.min.x,this.max.y,this.max.z),i[4]=new e$(this.max.x,this.min.y,this.min.z),i[5]=new e$(this.max.x,this.min.y,this.max.z),i[6]=new e$(this.max.x,this.max.y,this.min.z),i[7]=new e$(this.max.x,this.max.y,this.max.z),i.forEach(function(i){i.subtract(e),i.applyMatrix(t),i.add(e)}),i},e.getBoundingSphere=function(t){this.getCenter(t.center);var e=new e$;return t.radius=.5*this.getSize(e).length(),t},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}(),nC=function(){function t(t,e){void 0===t&&(t=e$.ZERO),void 0===e&&(e=-1),this.center=t.clone(),this.radius=e}var e=t.prototype;return e.set=function(t,e){return this.center.copyFrom(t),this.radius=e,this},e.setFromPoints=function(t,e){var i=this.center;if(void 0!==e){i.copyFrom(e);for(var r=0,n=0;n<t.length;n++)r=Math.max(r,i.distanceSquared(t[n]));this.radius=Math.sqrt(r)}else{var a=new nE().setFromPoints(t);a.getCenter(i),this.radius=a.getSize().length()/2}return this},e.copyFrom=function(t){return this.center.copyFrom(t.center),this.radius=t.radius,this},e.isEmpty=function(){return this.radius<0},e.makeEmpty=function(){return this.center.set(0,0,0),this.radius=-1,this},e.containsPoint=function(t){return t.distanceSquared(this.center)<=this.radius*this.radius},e.distanceToPoint=function(t){return t.distance(this.center)-this.radius},e.intersectsSphere=function(t){var e=this.radius+t.radius;return t.center.distanceSquared(this.center)<=e*e},e.intersectsBox=function(t){return t.intersectsSphere(this)},e.clampPoint=function(t,e){var i=this.center.distanceSquared(t);return void 0===e&&(e=new e$),e.copyFrom(t),i>this.radius*this.radius&&(e.subtract(this.center).normalize(),e.multiply(this.radius).add(this.center)),e},e.getBoundingBox=function(t){return(void 0===t&&(t=new nE),this.isEmpty())?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t},e.applyMatrix4=function(t){var e=t.elements,i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return this.center.applyMatrix(t),this.radius=this.radius*Math.sqrt(Math.max(i,r,n)),this},e.translate=function(t){return this.center.add(t),this},e.expandByPoint=function(t){var e=new e$().subtractVectors(t,this.center),i=e.lengthSquared();if(i>this.radius*this.radius){var r=Math.sqrt(i),n=(r-this.radius)*.5;this.center.add(e.multiply(n/r)),this.radius+=n}return this},e.union=function(t){var e=new e$,i=new e$;return i.subtractVectors(t.center,this.center).normalize().multiply(t.radius),this.expandByPoint(e.copyFrom(t.center).add(i)),this.expandByPoint(e.copyFrom(t.center).subtract(i)),this},e.intersect=function(t){var e=new e$().subtractVectors(this.center,t.center),i=e.length();return i>this.radius+t.radius?this.makeEmpty():(this.center=this.center.add(e.normalize().multiply(i/2)),this.radius=this.radius+t.radius-i,this)},e.equals=function(t){return t.center.equals(this.center)&&t.radius===this.radius},e.clone=function(){return new t().copyFrom(this)},t}(),nw=Object.freeze({__proto__:null,get EulerOrder(){return eT},Euler:nb,Quaternion:i5,Vector2:eJ,Vector3:e$,Vector4:e0,Matrix3:nT,Matrix4:rO,Ray:n_,PI2:2*Math.PI,DEG2RAD:eY,RAD2DEG:eZ,NumberEpsilon:1e-6,isZero:function(t){return isNaN(t)||1e-6>Math.abs(t)},isEqual:eq,damp:function(t,e,i,r){return eQ(t,e,1-Math.exp(-i*r))},lerp:eQ,degToRad:function(t){return t*eY},radToDeg:function(t){return t*eZ},clamp:eK,Color:e1,Box3:nE,Sphere:nC}),nS=1,nA=function(e){function i(t,i){var r;if((r=e.call(this,t)||this).destroyed=!1,r.visible=!0,i){var n=i.material,a=i.geometry,o=i.name,s=i.priority,u=i.worldMatrix,h=void 0===u?rO.fromIdentity():u;r.id="Mesh"+nS++,r.name=void 0===o?"<unnamed>":o,r.geometry=a,r.material=n,r.priority=void 0===s?0:s,r.worldMatrix=h}else r.id="Mesh"+nS++,r.name="<unnamed>",r.worldMatrix=rO.fromIdentity(),r._priority=0;return r}iN(i,e);var r=i.prototype;return r.setVisible=function(t){this.visible=t},r.getVisible=function(){return this.visible},r.render=function(t){!this.isDestroyed&&this.getVisible()&&t.drawGeometry(this.geometry,this.worldMatrix,this.material)},r.firstGeometry=function(){return this.geometry},r.setMaterial=function(e,i){i!==t.DestroyOptions.keep&&this.material.dispose(),this.material=e},r.restore=function(){},r.dispose=function(i){this.destroyed||((null==i?void 0:i.geometries)!==t.DestroyOptions.keep&&this.geometry.dispose(),(null==i?void 0:i.material)!==t.DestroyOptions.keep&&this.material.dispose(),this.destroyed=!0,void 0!==this.engine&&this.engine.removeMesh(this),e.prototype.dispose.call(this))},rC(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(rA),nM="precision highp float;attribute vec2 aUV;attribute vec3 aPos;varying vec2 vTexCoord;varying vec3 vParams;varying vec4 vColor;uniform vec2 _Size;uniform vec3 _Scale;uniform vec4 _Color;uniform vec4 _TexParams;uniform vec4 _TexOffset;uniform mat4 effects_MatrixVP;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;void main(){vec4 texParams=_TexParams;vTexCoord=vec2(aUV.xy*_TexOffset.zw+_TexOffset.xy);vColor=_Color;vParams=vec3(texParams.w,texParams.y,texParams.x);if(texParams.z==1.0){vec4 pos=vec4(aPos.xy*_Size,aPos.z,1.0);gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}else{mat4 view=effects_MatrixV;vec3 camRight=vec3(view[0][0],view[1][0],view[2][0]);vec3 camUp=vec3(view[0][1],view[1][1],view[2][1]);vec3 worldPosition=vec3(effects_ObjectToWorld*vec4(0.0,0.0,0.0,1.0));vec3 vertexPosition=worldPosition+camRight*aPos.x*_Size.x*_Scale.x+camUp*aPos.y*_Size.y*_Scale.y;gl_Position=effects_MatrixVP*vec4(vertexPosition,1.0);}}",nI="precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);\n#ifdef TRANSPARENT_VIDEO\nfloat halfX=vTexCoord.x*0.5;vec2 uv_rgb=vec2(halfX,vTexCoord.y);vec2 uv_alpha=vec2(halfX+0.5,vTexCoord.y);vec3 rgb=texture2D(_MainTex,uv_rgb).rgb;float alpha=max(texture2D(_MainTex,uv_alpha).r,1e-5);vec4 texColor=vec4(rgb/alpha,alpha);\n#else\nvec4 texColor=texture2D(_MainTex,vTexCoord.xy);\n#endif\ncolor=blendColor(texColor,vColor,floor(0.5+vParams.y));\n#ifdef ALPHA_CLIP\nif(color.a<0.04){discard;}\n#endif\ncolor.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}",nP="#version 100\nprecision mediump float;\n#define PATICLE_SHADER 1\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;uniform vec3 emissionColor;uniform float emissionIntensity;uniform sampler2D uMaskTex;uniform vec4 uColorParams;uniform vec2 uTexOffset;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\n#ifdef USE_SPRITE\nvarying vec4 vTexCoordBlend;\n#endif\nvarying float vSeed;\n#ifdef PREVIEW_BORDER\nuniform vec4 uPreviewColor;\n#endif\n#ifdef USE_SPRITE\nvec4 getTextureColor(sampler2D tex,vec2 texCoord){if(vTexCoordBlend.w>0.){return mix(texture2D(tex,texCoord),texture2D(tex,vTexCoordBlend.xy+texCoord),vTexCoordBlend.z);}return texture2D(tex,texCoord);}\n#else\n#define getTextureColor texture2D\n#endif\n#ifndef WEBGL2\n#define round(a) floor(0.5+a)\n#endif\nvec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}\n#ifdef PREVIEW_BORDER\nvoid main(){gl_FragColor=uPreviewColor;}\n#else\nvoid main(){vec4 color=vec4(1.0);vec4 tempColor=vColor;vec2 texOffset=uTexOffset;if(vLife<0.){discard;}if(uColorParams.x>0.0){color=getTextureColor(uMaskTex,vTexCoord);}\n#ifdef COLOR_OVER_LIFETIME\n#ifndef ENABLE_VERTEX_TEXTURE\ntempColor*=texture2D(uColorOverLifetime,vec2(vLife,0.));\n#endif\n#endif\ncolor=blendColor(color,tempColor,round(uColorParams.y));if(color.a<=0.01&&uColorParams.w>0.){float _at=texture2D(uMaskTex,vTexCoord+texOffset).a+texture2D(uMaskTex,vTexCoord+texOffset*-1.).a;if(_at<=0.02){discard;}}vec3 emission=emissionColor*pow(2.0,emissionIntensity);color=vec4(pow(pow(color.rgb,vec3(2.2))+emission,vec3(1.0/2.2)),color.a);gl_FragColor=color;}\n#endif\n",nR="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#define PATICLE_SHADER 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}const float d2r=3.141592653589793/180.;attribute vec3 aPos;attribute vec4 aOffset;attribute vec4 aColor;attribute vec3 aDirX;attribute vec3 aDirY;attribute vec3 aTranslation;attribute vec3 aRotation0;attribute vec3 aRotation1;attribute vec3 aRotation2;attribute vec3 aLinearMove;\n#ifdef USE_SPRITE\nattribute vec3 aSprite;uniform vec4 uSprite;struct UVDetail{vec2 uv0;vec3 uv1;};UVDetail getSpriteUV(vec2 uv,float lifeTime);varying vec4 vTexCoordBlend;\n#endif\n#ifdef FINAL_TARGET\nuniform vec3 uFinalTarget;uniform vec4 uForceCurve;\n#endif\nuniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;uniform mat4 effects_MatrixVP;uniform vec4 uParams;uniform vec4 uOpacityOverLifetimeValue;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nuniform vec4 uOrbXByLifetimeValue;uniform vec4 uOrbYByLifetimeValue;uniform vec4 uOrbZByLifetimeValue;uniform vec3 uOrbCenter;uniform vec4 uSizeByLifetimeValue;\n#ifdef SIZE_Y_BY_LIFE\nuniform vec4 uSizeYByLifetimeValue;\n#endif\nvarying float vLife;varying vec4 vColor;varying vec2 vTexCoord;vec3 calOrbitalMov(float _life,float _dur){vec3 orb=vec3(0.0);\n#ifdef AS_ORBITAL_MOVEMENT\n#define FUNC(a) getValueFromTime(_life,a)\n#else\n#define FUNC(a) getIntegrateFromTime0(_life,a) * _dur\n#endif\n#if ORB_VEL_X\norb.x=FUNC(uOrbXByLifetimeValue);\n#endif\n#if ORB_VEL_Y\norb.y=FUNC(uOrbYByLifetimeValue);\n#endif\n#if ORB_VEL_Z\norb.z=FUNC(uOrbZByLifetimeValue);\n#endif\n#undef FUNC\nreturn orb;}mat3 mat3FromRotation(vec3 rotation){vec3 sinR=sin(rotation*d2r);vec3 cosR=cos(rotation*d2r);return mat3(cosR.z,-sinR.z,0.,sinR.z,cosR.z,0.,0.,0.,1.)*mat3(cosR.y,0.,sinR.y,0.,1.,0.,-sinR.y,0,cosR.y)*mat3(1.,0.,0.,0,cosR.x,-sinR.x,0.,sinR.x,cosR.x);}\n#ifdef USE_SPRITE\nUVDetail getSpriteUV(vec2 uv,float lifeTime){float t=fract(clamp((lifeTime-aSprite.x)/aSprite.y,0.0,1.)*aSprite.z);float frame=uSprite.z*t;float frameIndex=max(ceil(frame)-1.,0.);float row=floor((frameIndex+0.1)/uSprite.x);float col=frameIndex-row*uSprite.x;vec2 retUV=(vec2(col,row)+uv)/uSprite.xy;UVDetail ret;if(uSprite.w>0.){float blend=frame-frameIndex;float frameIndex1=min(ceil(frame),uSprite.z-1.);float row1=floor((frameIndex1+0.1)/uSprite.x);float col1=frameIndex1-row1*uSprite.x;vec2 coord=(vec2(col1,row1)+uv)/uSprite.xy-retUV;ret.uv1=vec3(coord.x,1.-coord.y,blend);}ret.uv0=vec2(retUV.x,1.-retUV.y);return ret;}\n#endif\nvoid main(){float time=uParams.x-aOffset.z;float dur=aOffset.w;if(time<0.||time>dur){gl_Position=vec4(-3.,-3.,-3.,1.);}else{float life=clamp(time/dur,0.0,1.0);vLife=life;\n#ifdef USE_SPRITE\nUVDetail uvD=getSpriteUV(aOffset.xy,time);vTexCoord=uvD.uv0;vTexCoordBlend=vec4(uvD.uv1,uSprite.w);\n#else\nvTexCoord=aOffset.xy;\n#endif\nvColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(life,0.));\n#endif\n#endif\nvColor.a*=clamp(getValueFromTime(life,uOpacityOverLifetimeValue),0.,1.);vec3 size=vec3(vec2(getValueFromTime(life,uSizeByLifetimeValue)),1.0);\n#ifdef SIZE_Y_BY_LIFE\nsize.y=getValueFromTime(life,uSizeYByLifetimeValue);\n#endif\nmat3 aRotation=mat3(aRotation0,aRotation1,aRotation2);vec3 point=aRotation*(aDirX*size.x+aDirY*size.y);vec3 _pos=aPos+aTranslation;\n#if ORB_VEL_X + ORB_VEL_Y + ORB_VEL_Z\n_pos=mat3FromRotation(calOrbitalMov(life,dur))*(_pos-uOrbCenter);_pos+=uOrbCenter;\n#endif\n_pos.xyz+=aLinearMove;\n#ifdef FINAL_TARGET\nfloat force=getValueFromTime(life,uForceCurve);vec4 pos=vec4(mix(_pos,uFinalTarget,force),1.);\n#else\nvec4 pos=vec4(_pos,1.0);\n#endif\n#if RENDER_MODE == 1\npos.xyz+=point;pos=effects_ObjectToWorld*pos;\n#elif RENDER_MODE == 3\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[2].xyz*point.y;\n#elif RENDER_MODE == 2\npos=effects_ObjectToWorld*pos;pos.xy+=point.xy;\n#elif RENDER_MODE == 0\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[1].xyz*point.y;\n#endif\ngl_Position=effects_MatrixVP*pos;vSeed=aSeed;gl_PointSize=6.0;}}",nO="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}attribute vec4 aPos;attribute vec3 aDir;attribute vec3 aInfo;attribute vec4 aColor;attribute float aTime;\n#ifdef ATTR_TRAIL_START\nattribute float aTrailStart;\n#else\nuniform float uTrailStart[64];attribute float aTrailStartIndex;\n#endif\nuniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixVP;uniform vec4 uTextureMap;uniform float uTime;uniform vec4 uParams;uniform vec4 uColorParams;uniform vec4 uOpacityOverLifetimeValue;uniform vec4 uWidthOverTrail;\n#ifdef COLOR_OVER_TRAIL\nuniform sampler2D uColorOverTrail;\n#endif\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;void main(){vec4 _pa=effects_MatrixVP*vec4(aPos.xyz,1.);vec4 _pb=effects_MatrixVP*vec4(aPos.xyz+aDir,1.);vec2 dir=normalize(_pb.xy/_pb.w-_pa.xy/_pa.w);vec2 screen_xy=vec2(-dir.y,dir.x);vec4 pos=effects_ObjectToWorld*vec4(aPos.xyz,1.);\n#ifdef ATTR_TRAIL_START\nfloat ts=aTrailStart;\n#else\nfloat ts=uTrailStart[int(aTrailStartIndex)];\n#endif\nfloat trail=(ts-aInfo.y)/uParams.y;float width=aPos.w*getValueFromTime(trail,uWidthOverTrail)/max(abs(screen_xy.x),abs(screen_xy.y));pos.xyz+=(effects_MatrixInvV[0].xyz*screen_xy.x+effects_MatrixInvV[1].xyz*screen_xy.y)*width;float time=min((uTime-aTime)/aInfo.x,1.0);gl_Position=effects_MatrixVP*pos;vColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(time,0.));\n#endif\n#endif\n#ifdef COLOR_OVER_TRAIL\nvColor*=texture2D(uColorOverTrail,vec2(trail,0.));\n#endif\nvColor.a*=clamp(getValueFromTime(time,uOpacityOverLifetimeValue),0.,1.);vLife=time;vTexCoord=uTextureMap.xy+vec2(trail,aInfo.z)*uTextureMap.zw;vSeed=aSeed;}",nN="precision highp float;attribute vec2 aPos;varying vec2 uv;void main(){gl_Position=vec4(aPos,0.,1.0);uv=(aPos+vec2(1.0))/2.;}",nL="precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor.rgb=pow(hdrColor.rgb,vec3(2.2));vec3 finalColor=hdrColor.rgb;if(_UseBloom){vec4 bloomColor=texture2D(_GaussianTex,uv);bloomColor.rgb*=_BloomIntensity;finalColor+=bloomColor.rgb;}if(_VignetteIntensity>0.0){finalColor=ApplyVignette(finalColor,uv,_VignetteCenter,_VignetteIntensity,_VignetteRoundness,_VignetteSmoothness,_VignetteColor);}finalColor=finalColor*_Brightness;vec3 colorLog=LinearToLogC(finalColor);colorLog=(colorLog-ACEScc_MIDGRAY)*_Contrast+ACEScc_MIDGRAY;finalColor=LogCToLinear(colorLog);finalColor=max(finalColor,0.0);float luminance=0.2125*finalColor.r+0.7154*finalColor.g+0.0721*finalColor.b;vec3 luminanceColor=vec3(luminance,luminance,luminance);finalColor=(finalColor-luminanceColor)*_Saturation+luminanceColor;finalColor=max(finalColor,0.0);if(_UseToneMapping){finalColor=max(vec3(0.0),ACESToneMapping(finalColor));}float alpha=min(hdrColor.a,1.0);gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),alpha);}",nV="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussH(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[9];offsets[0]=-4.0;offsets[1]=-3.0;offsets[2]=-2.0;offsets[3]=-1.0;offsets[4]=0.0;offsets[5]=1.0;offsets[6]=2.0;offsets[7]=3.0;offsets[8]=4.0;float weights[9];weights[0]=0.01621622;weights[1]=0.05405405;weights[2]=0.12162162;weights[3]=0.19459459;weights[4]=0.22702703;weights[5]=0.19459459;weights[6]=0.12162162;weights[7]=0.05405405;weights[8]=0.01621622;for(int i=0;i<9;i++){vec2 offset=vec2(offsets[i]*2.0*(1.0/_TextureSize.x),0);color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussH(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",nF="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussV(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[5];offsets[0]=-3.23076923;offsets[1]=-1.38461538;offsets[2]=0.0;offsets[3]=1.38461538;offsets[4]=3.23076923;float weights[5];weights[0]=0.07027027;weights[1]=0.31621622;weights[2]=0.22702703;weights[3]=0.31621622;weights[4]=0.07027027;for(int i=0;i<5;i++){vec2 offset=vec2(0,offsets[i]*(1.0/_TextureSize.y));color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussV(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",nD="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform sampler2D _GaussianDownTex;uniform vec2 _GaussianDownTextureSize;float GaussWeight2D(float x,float y,float sigma){float PI=3.14159265358;float E=2.71828182846;float sigma_2=pow(sigma,2.0);float a=-(x*x+y*y)/(2.0*sigma_2);return pow(E,a)/(2.0*PI*sigma_2);}vec3 GaussNxN(sampler2D tex,vec2 uv,vec2 stride,float sigma){vec3 color=vec3(0.,0.,0.);const int r=1;float weight=0.0;for(int i=-r;i<=r;i++){for(int j=-r;j<=r;j++){float w=GaussWeight2D(float(i),float(j),sigma);vec2 coord=uv+vec2(i,j)*stride;color+=texture2D(tex,coord).rgb*w;weight+=w;}}color/=weight;return color;}void main(){vec3 lowResColor=GaussNxN(_MainTex,uv,0.5/_GaussianDownTextureSize,1.0);vec3 highResColor=GaussNxN(_GaussianDownTex,uv,1.0/_GaussianDownTextureSize,1.0);vec3 color=mix(highResColor,lowResColor,0.7);gl_FragColor=vec4(color,1.0);}",nk="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform float _Threshold;void main(){vec4 mainTex=texture2D(_MainTex,uv);mainTex.rgb=pow(mainTex.rgb,vec3(2.2));float brightness=max(mainTex.r,max(mainTex.g,mainTex.b));float w=max(0.0,brightness-_Threshold)/max(brightness,0.00001);mainTex.rgb*=w;mainTex.rgb*=mainTex.a;gl_FragColor=vec4(mainTex.rgb,1.0);}",nz={},nB=function(){function e(){}return e.registerInclude=function(t,e){nz[t]&&id.warn('The "'+t+'" shader include already exist.'),nz[t]=e},e.unRegisterInclude=function(t){delete nz[t]},e.unRegisterAllIncludes=function(){Object.keys(nz).forEach(function(t){e.unRegisterInclude(t)})},e.genFinalShaderCode=function(i){var r=i.level,n=i.shaderType,a=i.shader,o=i.macros,s=i.removeVersion,u=e.genMacroString(r,o),h=e.genShaderVersion(r),l=e.parseIncludes(a),c=e.isVersion300(l);return(l=e.removeWebGLVersion(l),2!==r||c||(l=e.convertTo300(l,n===t.ShaderType.fragment)),s)?u+l:h+u+l},e.convertTo300=function(t,i){if(t=(t=(t=t.replace(/\bvarying\b/g,i?"in":"out")).replace(/\btexture(2D|Cube)\b/g,"texture")).replace(/#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,""),i){if(t=(t=(t=t.replace(/\btexture(2D|Cube)LodEXT\b/g,"textureLod")).replace(/\btexture(2D|Cube)GradEXT\b/g,"textureGrad")).replace(/\bgl_FragDepthEXT\b/g,"gl_FragDepth"),!e.has300Output(t)){if(/\bgl_FragData\[.+?\]/g.test(t)){var r=(t=t.replace(/\bgl_FragColor\b/g,"gl_FragData[0]")).match(/\bgl_FragData\[.+?\]/g);r&&(t=e.replaceMRTShader(t,r))}else t=(t=t.replace(/void\s+?main\s*\(/g,"out vec4 glFragColor;\nvoid main(")).replace(/\bgl_FragColor\b/g,"glFragColor")}}else t=t.replace(/\battribute\b/g,"in");return t},e.parseIncludes=function(t,e){for(void 0===e&&(e=/#include <(.+)>/gm);null!==(i=e.exec(t));){var i,r=i[1],n=nz[r];if(void 0===n)throw Error("Can't find include shader name "+r);t=t.replace(i[0],n)}return t},e.genMacroString=function(t,e,i){void 0===i&&(i=!0);var r=[],n="WEBGL"+t;return(r.push("#ifndef "+n),r.push("#define "+n),r.push("#endif"),i&&r.push("#define GE_RUNTIME"),e&&e.length&&e.forEach(function(t){var e=t[0],i=t[1];!0===i?r.push("#define "+e):Number.isFinite(i)&&r.push("#define "+e+" "+i)}),r.length)?r.join("\n")+"\n":""},e.genShaderVersion=function(t){return 1===t?"#version 100\n":"#version 300 es\n"},e.isVersion300=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return(e?e[0]:"").includes("300")},e.removeWebGLVersion=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return e?t.replace(e[0],""):t},e.has300Output=function(t){return/\bout\s+(?:\w+\s+)?(?:vec4)\s+(?:\w+)\s*;/.test(t)},e.replaceMRTShader=function(t,e){for(var i=new Set,r="",n=0;n<e.length;n++){var a=e[n].match(/\bgl_FragData\[(.+?)\]/);a&&i.add(a[1])}return i.forEach(function(t){r+="layout(location="+t+") out vec4 fragOutColor"+t+";\n"}),r+="void main(",t=(t=t.replace(/\bgl_FragData\[(.+?)\]/g,"fragOutColor$1")).replace(/void\s+?main\s*\(/g,r)},e}(),nU=function(e){function i(i){var r,n=(r=e.call(this,i)||this).renderer.engine,a=ng.create(n,{mode:rL.TRIANGLE_STRIP,attributes:{aPos:{type:rL.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),o=nh.create(n,{shader:{vertex:nN,fragment:nk,glslVersion:t.GLSLVersion.GLSL1}});return o.blending=!1,o.depthTest=!1,o.culling=!1,r.screenMesh=nA.create(n,{geometry:a,material:o,priority:0}),r.priority=5e3,r.name="BloomThresholdPass",r}iN(i,e);var r=i.prototype;return r.configure=function(e){this.framebuffer=e.getTemporaryRT(this.name,e.getWidth(),e.getHeight(),0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),this.mainTexture=e.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture=this.mainTexture,e.setFramebuffer(this.framebuffer)},r.execute=function(e){e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear}),this.screenMesh.material.setTexture("_MainTex",this.mainTexture);var i,r,n,a=null!=(n=null==(r=e.renderingData.currentFrame.globalVolume)?void 0:null==(i=r.bloom)?void 0:i.threshold)?n:1;this.screenMesh.material.setFloat("_Threshold",a),e.renderMeshes([this.screenMesh])},r.onCameraCleanup=function(t){this.framebuffer&&t.releaseTemporaryRT(this.framebuffer)},r.dispose=function(t){e.prototype.dispose.call(this,t)},i}(np),nG=function(e){function i(i,r,n){(a=e.call(this,i)||this).type=r,a.level=n;var a,o=a.renderer.engine,s="PostProcess",u=ng.create(o,{name:s,mode:rL.TRIANGLE_STRIP,attributes:{aPos:{type:rL.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),h={vertex:nN,fragment:"H"===r?nV:nF,glslVersion:t.GLSLVersion.GLSL1},l=nh.create(o,{name:s,shader:h});return l.blending=!1,l.depthTest=!1,l.culling=!1,a.screenMesh=nA.create(o,{name:s,geometry:u,material:l,priority:0}),a.priority=5e3,a.name="GaussianDownPass"+r+n,a}iN(i,e);var r=i.prototype;return r.configure=function(e){var i=Math.floor(this.renderer.getWidth()/Math.pow(2,this.level+1)),r=Math.floor(this.renderer.getHeight()/Math.pow(2,this.level+1));this.framebuffer=e.getTemporaryRT(this.name,i,r,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),this.mainTexture=e.getFramebuffer().getColorTextures()[0],e.setFramebuffer(this.framebuffer)},r.execute=function(e){e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear}),this.screenMesh.material.setTexture("_MainTex",this.mainTexture),this.screenMesh.material.setVector2("_TextureSize",nY(this.mainTexture)),e.renderMeshes([this.screenMesh]),"V"===this.type&&(this.gaussianResult.texture=e.getFramebuffer().getColorTextures()[0])},r.onCameraCleanup=function(t){this.framebuffer&&t.releaseTemporaryRT(this.framebuffer)},i}(np),nj=function(e){function i(t,i){(r=e.call(this,t)||this).level=i;var r,n="PostProcess",a=r.renderer.engine,o=ng.create(a,{name:n,mode:rL.TRIANGLE_STRIP,attributes:{aPos:{type:rL.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),s=nh.create(a,{name:n,shader:{vertex:nN,fragment:nD}});return s.blending=!1,s.depthTest=!1,s.culling=!1,r.screenMesh=nA.create(a,{name:n,geometry:o,material:s,priority:0}),r.priority=5e3,r.name="GaussianUpPass"+i,r}iN(i,e);var r=i.prototype;return r.configure=function(e){var i=Math.floor(this.renderer.getWidth()/Math.pow(2,this.level-1)),r=Math.floor(this.renderer.getHeight()/Math.pow(2,this.level-1));this.framebuffer=e.getTemporaryRT(this.name,i,r,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),this.mainTexture=e.getFramebuffer().getColorTextures()[0],e.setFramebuffer(this.framebuffer)},r.execute=function(e){e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear}),this.screenMesh.material.setTexture("_MainTex",this.mainTexture),this.screenMesh.material.setTexture("_GaussianDownTex",this.gaussianDownSampleResult.texture),this.screenMesh.material.setVector2("_GaussianDownTextureSize",nY(this.gaussianDownSampleResult.texture)),e.renderMeshes([this.screenMesh])},r.onCameraCleanup=function(t){this.framebuffer&&t.releaseTemporaryRT(this.framebuffer)},i}(np),nW=function(e){function i(i,r){n=e.call(this,i)||this;var n,a="PostProcess",o=n.renderer.engine;n.sceneTextureHandle=r||new nf(o);var s=ng.create(o,{name:a,mode:rL.TRIANGLE_STRIP,attributes:{aPos:{type:rL.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),u=nh.create(o,{name:a,shader:{vertex:nN,fragment:nL,glslVersion:t.GLSLVersion.GLSL1}});return u.blending=!1,u.depthTest=!1,u.culling=!1,n.screenMesh=nA.create(o,{name:a,geometry:s,material:u,priority:0}),n.priority=5e3,n.name="ToneMappingPass",n}iN(i,e);var r=i.prototype;return r.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture||(this.sceneTextureHandle.texture=this.mainTexture),t.setFramebuffer(null)},r.execute=function(e){e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear});var i=e.renderingData.currentFrame.globalVolume,r=i2({threshold:0,intensity:0,active:!1},null==i?void 0:i.bloom),n=i2({intensity:0,smoothness:0,roundness:0,active:!1},null==i?void 0:i.vignette),a=i2({brightness:0,saturation:0,contrast:0,active:!1},null==i?void 0:i.colorAdjustments),o=i2({active:!1},null==i?void 0:i.tonemapping);this.screenMesh.material.setTexture("_SceneTex",this.sceneTextureHandle.texture),this.screenMesh.material.setFloat("_Brightness",Math.pow(2,a.brightness)),this.screenMesh.material.setFloat("_Saturation",.01*a.saturation+1),this.screenMesh.material.setFloat("_Contrast",.01*a.contrast+1),this.screenMesh.material.setInt("_UseBloom",Number(r.active)),r.active&&(this.screenMesh.material.setTexture("_GaussianTex",this.mainTexture),this.screenMesh.material.setFloat("_BloomIntensity",r.intensity)),n.intensity>0&&(this.screenMesh.material.setFloat("_VignetteIntensity",n.intensity),this.screenMesh.material.setFloat("_VignetteSmoothness",n.smoothness),this.screenMesh.material.setFloat("_VignetteRoundness",n.roundness),this.screenMesh.material.setVector2("_VignetteCenter",new eJ(.5,.5)),this.screenMesh.material.setVector3("_VignetteColor",new e$(0,0,0))),this.screenMesh.material.setInt("_UseToneMapping",Number(o.active)),e.renderMeshes([this.screenMesh])},i}(np),nX=1,nH=function(){function e(t){this.disposed=!1,this.postProcessingEnabled=!1,this.enableHDR=!0;var e=t.camera,i=t.renderer,r=t.editorTransform,n=t.globalVolume,a=t.postProcessingEnabled,o=void 0!==a&&a,s=i.engine;if(n&&(this.globalVolume=n),this.postProcessingEnabled=o,this.globalUniforms=new nZ,this.renderer=i,o&&this.enableHDR&&!this.renderer.engine.gpuCapability.detail.halfFloatTexture)throw Error("Half float texture is not supported.");this.drawObjectPass=new nm(i);var u=[this.drawObjectPass];if(this.setRenderPasses(u),o){var h=new nf(s),l=[0,0,this.renderer.getWidth()/2,this.renderer.getHeight()/2],c=Array(7),f=new nU(i);f.sceneTextureHandle=h,this.addRenderPass(f);for(var d=0;d<7;d++){c[d]=new nf(s);var p=new nG(i,"H",d),m=new nG(i,"V",d);m.gaussianResult=c[d],this.addRenderPass(p),this.addRenderPass(m),l[2]/=2,l[3]/=2}l[2]*=4,l[3]*=4;for(var v=0;v<6;v++){var y=new nj(i,7-v);y.gaussianDownSampleResult=c[5-v],this.addRenderPass(y),l[2]*=2,l[3]*=2}var g=new nW(i,h);this.addRenderPass(g)}this.name="RenderFrame"+nX++,this.camera=e,this.editorTransform=e0.fromArray(void 0===r?[1,1,0,0]:r)}var i=e.prototype;return i.setup=function(){this.drawObjectPass.setup(this.postProcessingEnabled)},i.addMeshToDefaultRenderPass=function(t){this.drawObjectPass.addMesh(t)},i.removeMeshFromDefaultRenderPass=function(t){this.drawObjectPass.removeMesh(t)},i.dispose=function(e){var i=(null==e?void 0:e.passes)?e.passes:void 0;i!==t.DestroyOptions.keep&&this._renderPasses.forEach(function(t){t.dispose(i)}),this._renderPasses.length=0,this.disposed=!0},i.setRenderPasses=function(t){this._renderPasses=t.slice()},i.addRenderPass=function(t){this._renderPasses.push(t)},i.removeRenderPass=function(t){eX(this._renderPasses,t)},rC(e,[{key:"renderPasses",get:function(){return this._renderPasses.slice()}},{key:"isDisposed",get:function(){return this.disposed}}]),e}();function nY(t){return t?new eJ(t.getWidth(),t.getHeight()):new eJ}var nZ=function(){this.floats={},this.ints={},this.vector3s={},this.vector4s={},this.matrices={},this.samplers=[],this.uniforms=[]},nq=function(){function t(t){this.size=[0,0],this.multiSample=1,this.destroyed=!1;var e=t.storageType,i=t.format,r=t.attachment;this.storageType=e,this.format=i,this.attachment=r}return rC(t,[{key:"isDestroyed",get:function(){return this.destroyed}}]),t}(),nQ=function(){function e(t){this.engine=t,this.temporaryRTs=[],this.currentFrame=0,this.maxUnusedFrames=4}var i=e.prototype;return i.flush=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=-1),this.currentFrame++;for(var i=e>=0?e:this.maxUnusedFrames,r=0;r<this.temporaryRTs.length;r++){var n=this.temporaryRTs[r];!n.isOccupied&&(t||this.currentFrame-n.lastFrameReleased>i)&&(n.RT.dispose(),this.temporaryRTs.splice(r--,1))}},i.get=function(e,i,r,n,a,o){void 0===n&&(n=0),void 0===a&&(a=t.FilterMode.Linear),void 0===o&&(o=t.RenderTextureFormat.RGBA32);for(var s,u,h,l=i+"_"+r+"_"+n+"_"+a+"_"+o,c=iD(this.temporaryRTs);!(h=c()).done;){var f=h.value;if(!f.isOccupied&&f.descriptionHash===l)return f.isOccupied=!0,f.RT.name=e,f.RT}var d=t.RenderPassAttachmentStorageType.none;a===t.FilterMode.Linear?s=rL.LINEAR:a===t.FilterMode.Nearest&&(s=rL.NEAREST),o===t.RenderTextureFormat.RGBA32?u=rL.UNSIGNED_BYTE:o===t.RenderTextureFormat.RGBAHalf&&(u=rL.HALF_FLOAT),0===n?d=t.RenderPassAttachmentStorageType.none:16===n?d=t.RenderPassAttachmentStorageType.depth_stencil_opaque:24===n&&(d=t.RenderPassAttachmentStorageType.depth_24_stencil_8_texture);var p=r7.create(this.engine,{sourceType:t.TextureSourceType.framebuffer,minFilter:s,magFilter:s,internalFormat:rL.RGBA,format:rL.RGBA,type:u}),m={RT:nc.create({name:e,storeAction:{},viewport:[0,0,i,r],attachments:[p],depthStencilAttachment:{storageType:d}},this.engine.renderer),lastFrameReleased:0,descriptionHash:l,isOccupied:!0};return this.temporaryRTs.push(m),m.RT},i.release=function(t){for(var e,i=iD(this.temporaryRTs);!(e=i()).done;){var r=e.value;if(r.RT===t){r.isOccupied=!1,r.lastFrameReleased=this.currentFrame;break}}},i.dispose=function(){for(var t,e=iD(this.temporaryRTs);!(t=e()).done;)t.value.RT.dispose()},e}(),nK="function"==typeof WebGL2RenderingContext,nJ=function(){function t(t){this.setupCapability(t)}var e=t.prototype;return e.isCompressedFormatSupported=function(t){return!!this.compressTextureCapabilityList.get(t)},e.setupCapability=function(t){var e,i,r=nK&&eF(t,WebGL2RenderingContext)?2:1,n=2===r,a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),o=t.getExtension("WEBGL_depth_texture"),s=!!t.getExtension("OES_texture_half_float_linear"),u=!!t.getExtension("OES_texture_float_linear");this.level=r,this.type=n?"webgl2":"webgl",this.vaoExt=t.getExtension("OES_vertex_array_object"),this.glAsyncCompileExt=t.getExtension("KHR_parallel_shader_compile"),this.UNSIGNED_INT_24_8=t.UNSIGNED_INT_24_8,this.drawBufferExtension=t.getExtension("WEBGL_draw_buffers"),o&&(this.UNSIGNED_INT_24_8=o.UNSIGNED_INT_24_8_WEBGL),n&&!s&&(s=n$(t,t.HALF_FLOAT)),n&&!u&&(u=n$(t,t.FLOAT)),this.internalFormatDepth16=n?t.DEPTH_COMPONENT16:t.DEPTH_COMPONENT,this.internalFormatDepth24_stencil8=n?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL;var h=n||t.getExtension("OES_texture_float")?t.FLOAT:0,l=n?WebGL2RenderingContext.HALF_FLOAT:(null==(i=t.getExtension("OES_texture_half_float"))?void 0:i.HALF_FLOAT_OES)||0;this.compressTextureCapabilityList=new Map([["WEBGL_compressed_texture_astc",!!t.getExtension("WEBGL_compressed_texture_astc")],["WEBKIT_WEBGL_compressed_texture_astc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_astc")],["WEBGL_compressed_texture_etc",!!t.getExtension("WEBGL_compressed_texture_etc")],["WEBKIT_WEBGL_compressed_texture_etc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_etc")],["WEBGL_compressed_texture_etc1",!!t.getExtension("WEBGL_compressed_texture_etc1")],["WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBGL_compressed_texture_pvrtc")||!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["WEBKIT_WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["EXT_sRGB",!!t.getExtension("EXT_sRGB")]]);var c={floatTexture:h,halfFloatTexture:l,maxSample:n?t.getParameter(t.MAX_SAMPLES):1,maxVertexUniforms:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxVertexTextures:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxFragmentUniforms:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxFragmentTextures:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),floatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):h>0&&!!t.getExtension("WEBGL_color_buffer_float"),halfFloatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):l>0&&!!t.getExtension("EXT_color_buffer_half_float"),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxShaderTexCount:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),halfFloatLinear:s,floatLinear:u,maxTextureAnisotropy:a?t.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,shaderTextureLod:n||!!t.getExtension("EXT_shader_texture_lod"),instanceDraw:n||!!t.getExtension("ANGLE_instanced_arrays"),ktx2Support:!!((e=this.compressTextureCapabilityList).get("WEBGL_compressed_texture_astc")||e.get("WEBKIT_WEBGL_compressed_texture_astc")),drawBuffers:n||!!this.drawBufferExtension,asyncShaderCompile:!!this.glAsyncCompileExt,intIndexElementBuffer:!!t.getExtension("OES_element_index_uint"),standardDerivatives:n||!!t.getExtension("OES_standard_derivatives"),readableDepthStencilTextures:n||!!o,writableFragDepth:n||!!t.getExtension("EXT_frag_depth")};this.detail=c,a&&(this.textureMaxAnisotropyExt=a.TEXTURE_MAX_ANISOTROPY_EXT)},e.framebufferTexture2D=function(t,e,i,r,n){var a=this.drawBufferExtension;if(1===this.level&&!a&&i>0)throw Error("Draw multiple color buffers not available.");var o=a?a["COLOR_ATTACHMENT"+i+"_WEBGL"]:t["COLOR_ATTACHMENT"+i];o?t.framebufferTexture2D(e,o,r,n,0):console.error("Invalid color attachment index: "+i+".")},e.drawBuffers=function(t,e){var i=this.drawBufferExtension;if(1===this.level&&!i){if(!(e.length>1))return;throw Error("Draw buffers not available.")}var r=e.map(function(e,r){return e?i?i["COLOR_ATTACHMENT"+r+"_WEBGL"]:t["COLOR_ATTACHMENT"+r]:t.NONE});i?i.drawBuffersWEBGL(r):t.drawBuffers(r)},e.setTextureAnisotropic=function(t,e,i){var r=this.detail.maxTextureAnisotropy;r&&t.texParameterf(e,this.textureMaxAnisotropyExt,Math.min(r,i||4))},rC(t,[{key:"isWebGL2",get:function(){return 2===this.level}}]),t}();function n$(t,e){var i=t.createTexture(),r=!1;return t.getError(),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.R16F,1,1,0,t.RED,e,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.getError()||(r=!0),t.deleteTexture(i),r}t.CompressTextureCapabilityType=void 0,(tm=t.CompressTextureCapabilityType||(t.CompressTextureCapabilityType={})).astc="WEBGL_compressed_texture_astc",tm.astc_webkit="WEBKIT_WEBGL_compressed_texture_astc",tm.etc="WEBGL_compressed_texture_etc",tm.etc_webkit="WEBKIT_WEBGL_compressed_texture_etc",tm.etc1="WEBGL_compressed_texture_etc1",tm.pvrtc="WEBGL_compressed_texture_pvrtc",tm.pvrtc_webkit="WEBKIT_WEBGL_compressed_texture_pvrtc",tm.sRGB="EXT_sRGB";var n0=function(){function t(t){this.engine=t,this.currentFramebuffer=null,this.renderTargetPool=new nQ(t)}var e=t.prototype;return e.setGlobalFloat=function(t,e){},e.setGlobalInt=function(t,e){},e.setGlobalVector4=function(t,e){},e.setGlobalVector3=function(t,e){},e.setGlobalMatrix=function(t,e){},e.getFramebuffer=function(){return this.currentFramebuffer},e.setFramebuffer=function(t){},e.setViewport=function(t,e,i,r){},e.resize=function(t,e){},e.clear=function(t){},e.getWidth=function(){return 0},e.getHeight=function(){return 0},e.lost=function(t){},e.restore=function(){},e.getShaderLibrary=function(){},e.renderRenderFrame=function(t){},e.renderMeshes=function(t){},e.drawGeometry=function(t,e,i,r){},e.getTemporaryRT=function(t,e,i,r,n,a){return this.renderTargetPool.get(t,e,i,r,n,a)},e.releaseTemporaryRT=function(t){this.renderTargetPool.release(t)},e.dispose=function(){},t}(),n1=function(){function t(t){void 0===t&&(t={}),this.semantics=i2({},t)}var e=t.prototype;return e.toObject=function(){return i2({},this.semantics)},e.setSemantic=function(t,e){void 0===e?delete this.semantics[t]:this.semantics[t]=e},e.getSemanticValue=function(t,e){var i=this.semantics[t];return iy(i)?i(e):i},e.hasSemanticValue=function(t){return t in this.semantics},e.dispose=function(){var t=this;Object.keys(this.semantics).forEach(function(e){delete t.semantics[e]})},t}(),n2=function(e){function i(t){(i=e.call(this,t)||this).visible=!0,i.meshCollider=new a5,i._color=new e1(1,1,1,1),i.getHitTestParams=function(t){var e=rO.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix()),r=i.interaction;if(t||r){i.meshCollider.setGeometry(i.geometry,e);var n,a=i.meshCollider.getBoundingBoxData();if(a)return{behavior:(null==(n=i.interaction)?void 0:n.behavior)||0,type:a.type,triangles:a.area,backfaceCulling:i.renderer.side===tF.FRONT}}},i.renderer={renderMode:tj.MESH,blending:tV.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tF.DOUBLE,mask:0},i.defaultGeometry=ng.create(i.engine,{attributes:{aPos:{type:rL.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},aUV:{size:2,offset:0,releasable:!0,type:rL.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rL.TRIANGLES,drawCount:6}),i.geometry=i.defaultGeometry;var i,r=nh.create(i.engine,{shader:{fragment:nI,vertex:nM,shared:!0}});return i.material=r,i.material.setColor("_Color",new e1(1,1,1,1)),i.maskManager=new nl(t),i.configureMaterial(i.renderer),i}iN(i,e);var r=i.prototype;return r.setVisible=function(t){this.visible=t},r.getVisible=function(){return this.visible},r.setColor=function(t){eF(t,e1)?this._color.copyFrom(t):this._color.setFromArray(t),this.material.setColor("_Color",this._color)},r.setTexture=function(t){var e=this;return eV(function(){var i;return ez(this,function(r){switch(r.label){case 0:if("string"!=typeof t)return[3,2];return[4,r7.fromImage(t,e.item.engine)];case 1:return i=r.sent(),[3,3];case 2:i=t,r.label=3;case 3:return e.renderer.texture=i,e.material.setTexture("_MainTex",i),[2]}})})()},r.render=function(t){this.getVisible()&&(this.maskManager.drawStencilMask(t),this.draw(t))},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){var e=this.material.colorMask;this.material.colorMask=!1,this.draw(t),this.material.colorMask=e}},r.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},r.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},r.configureMaterial=function(t){var e=t.side,i=t.occlusion,r=t.blending,n=t.mask,a=t.texture,o=this.maskManager.maskMode,s=this.material;s.blending=!0,s.depthTest=!0,s.depthMask=i,s.stencilRef=void 0!==n?[n,n]:void 0,rz(s,r),rU(s,o),rB(s,e),s.shader.shaderData.properties='_MainTex("_MainTex",2D) = "white" {}',s.setVector4("_TexOffset",new e0(0,0,1,1)),s.setTexture("_MainTex",a);var u=rk(r),h=new e0;return h.x=t.occlusion?+t.transparentOcclusion:1,h.y=u,h.z=t.renderMode,h.w=o,s.setVector4("_TexParams",h),0===h.x||this.maskManager.alphaMaskEnabled?s.enableMacro("ALPHA_CLIP"):s.disableMacro("ALPHA_CLIP"),s},r.draw=function(t){for(var e=0;e<this.materials.length;e++){var i=this.materials[e];i.setVector2("_Size",this.transform.size),(this.renderer.renderMode===tj.BILLBOARD||this.renderer.renderMode===tj.VERTICAL_BILLBOARD||this.renderer.renderMode===tj.HORIZONTAL_BILLBOARD)&&i.setVector3("_Scale",this.transform.scale),t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),i,e)}},r.fromData=function(i){e.prototype.fromData.call(this,i);var r,n,a,o,s=null!=(r=i.renderer)?r:{},u=i.mask;u&&this.maskManager.setMaskOptions(u),this.renderer={renderMode:null!=(n=s.renderMode)?n:tj.MESH,blending:null!=(a=s.blending)?a:tV.ALPHA,texture:s.texture?this.engine.findObject(s.texture):this.engine.whiteTexture,occlusion:!!s.occlusion,transparentOcclusion:!!s.transparentOcclusion||this.maskManager.maskMode===t.MaskMode.MASK,side:null!=(o=s.side)?o:tF.DOUBLE,mask:this.maskManager.getRefValue()},this.configureMaterial(this.renderer)},rC(i,[{key:"color",get:function(){return this._color},set:function(t){this.setColor(t)}}]),i}(rA),n3=(ty=new Int32Array((tv=new Float32Array(1)).buffer),function(t){tv[0]=t;var e=ty[0],i=e>>16&32768,r=e>>12&2047,n=e>>23&255;return n<103?i:n>142?(i|=31744,i|=(255==n?0:1)&&8388607&e):n<113?(r|=2048,i|=(r>>114-n)+(r>>113-n&1)):(i|=n-112<<10|r>>1,i+=1&r)}),n4=function(){function t(t){if(Number.isInteger(t))this.data=new Uint16Array(t);else if(t&&"object"==typeof t&&Number.isInteger(t.length))for(var e=this.data=new Uint16Array(t.length),i=0;i<e.length;i++)e[i]=n3(t[i])}return t.prototype.set=function(t,e){for(var i=0;i<t.length;i++)this.data[i+e]=n3(t[i])},t}(),n5=new nb,n6=new rO;function n8(t,e,i,r,n,a,o){var s=r/n,u=r,h=e.speedOverLifetime;h&&(u=h.getIntegrateValue(0,r,n));var l=e.gravityModifier?e.gravityModifier.getIntegrateByTime(0,r):0;t.copyFrom(a),t.addScaledVector(o,u),t.addScaledVector(i,l);var c=e.linearVelOverLifetime||{},f=e.orbitalVelOverLifetime||{};if(f.enabled){var d=new e$;f.center&&d.setFromArray(f.center);var p=t.clone().subtract(d),m=f.asRotation,v=["x","y","z"].map(function(t){var e=f[t];return e?m?e.getValue(s):e.getIntegrateValue(0,r,n):0});n5.setFromArray(v).negate(),n6.setFromEuler(n5);var y=n6.transformPoint(p);t.addVectors(d,y)}if(c.enabled){var g=c.asMovement,x=c.x,b=c.y,T=c.z;if(x){var _=g?x.getValue(s):x.getIntegrateValue(0,r,n);t.x=t.x+_}if(b){var E=g?b.getValue(s):b.getIntegrateValue(0,r,n);t.y=t.y+E}if(T){var C=g?T.getValue(s):T.getIntegrateValue(0,r,n);t.z=t.z+C}}return t}function n9(t){return Array.isArray(t)?[t[0],t[1],t[2]]:[0,0,0]}function n7(t,e){for(var i=0,r=t.length;i<r;i++)t[i]=e;return t}function at(t,e,i){if(e&&i)for(var r=0,n=e.length;r<n;r++)t[r]=e[r]*i[r];else if(e){if(t!==e)for(var a=0;a<e.length;a++)t[a]=e[a]}else if(i&&t!==i)for(var o=0;o<i.length;o++)t[o]=i[o];return t}var ae=((e_={})[tW.PARTICLE_ORIGIN_CENTER]=[0,0],e_[tW.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],e_[tW.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],e_[tW.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],e_[tW.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],e_[tW.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],e_[tW.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],e_[tW.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],e_[tW.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],e_);function ai(t,e,i){var r=i.position,n=new e$(t,e,0),a=new e$;return i.getInverseViewProjectionMatrix().projectPoint(n,a),a.subtract(r),new n_(r,a)}function ar(t,e,i){var r=t.x,n=t.y,a=t.z,o=new e$(r-e,n+i,a),s=new e$(r-e,n-i,a),u=new e$(r+e,n-i,a),h=new e$(r+e,n+i,a);return[{p0:o,p1:s,p2:u},{p0:o.clone(),p1:u.clone(),p2:h}]}function an(t,e,i){return void 0===i&&(i=1e-6),Math.abs(t-e)<i}function aa(t,e){void 0===e&&(e=2);var i=Math.pow(10,e);return Math.floor(t*i)/i}var ao={pointIndexCache:{xIndex:0,yIndex:0},getPointInCurve:function(t){t[0];var e=t[1],i=this.getPointIndexInCurve(t,this.pointIndexCache),r=i.xIndex,n=i.yIndex;return new eJ(e[r],e[n])},getPointIndexInCurve:function(t,e){var i=t[0],r=t[2],n=i===tq.LINE?0:i===tq.EASE_OUT?0:i===tq.EASE_IN?2:i===tq.EASE?2:i===tq.HOLD&&r===tq.EASE_IN?2:0;return e?(e.xIndex=n,e.yIndex=n+1,e):{xIndex:n,yIndex:n+1}},isLeftSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===tq.HOLD&&this.isKeyframeTypeLeftSideEase(i))||this.isKeyframeTypeLeftSideEase(e)},isRightSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===tq.HOLD&&this.isKeyframeTypeRightSideEase(i))||this.isKeyframeTypeRightSideEase(e)},isKeyframeTypeLeftSideEase:function(t){return[tq.EASE,tq.EASE_IN,tq.AUTO].includes(t)},isKeyframeTypeRightSideEase:function(t){return[tq.EASE,tq.EASE_OUT,tq.AUTO].includes(t)},isHoldInKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===tq.HOLD&&[tq.HOLD,tq.LINE_OUT,tq.EASE_OUT].includes(i)},isHoldOutKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===tq.HOLD&&[tq.HOLD,tq.LINE,tq.EASE_IN].includes(i)}},as=function(t,e){this.points=t,this.totalLength=e},au={},ah={};function al(t,e,i){return(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t}function ac(t,e,i){return 3*(1-3*i+3*e)*t*t+2*(3*i-6*e)*t+3*e}var af=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.catching={lastPoint:0,lastAddedLength:0};var n=function(t,e,i,r){var n=aa(e.x-t.x,3)+"_"+aa(e.y-t.y,3)+"_"+aa(e.z-t.z,3)+"&"+(aa(i.x-t.x,3)+"_"+aa(i.y-t.y,3))+"_"+aa(i.z-t.z,3)+"&"+(aa(r.x-t.x,3)+"_"+aa(r.y-t.y,3))+"_"+aa(r.z-t.z,3);if(ah[n])return{data:ah[n],interval:t};for(var a=[],o=null,s=0,u=0,h=0;h<300;h+=1){var l=new e$,c=h/299;u=0,l.x=3*Math.pow(1-c,2)*c*(i.x-t.x)+3*(1-c)*Math.pow(c,2)*(r.x-t.x)+Math.pow(c,3)*(e.x-t.x),l.y=3*Math.pow(1-c,2)*c*(i.y-t.y)+3*(1-c)*Math.pow(c,2)*(r.y-t.y)+Math.pow(c,3)*(e.y-t.y),l.z=3*Math.pow(1-c,2)*c*(i.z-t.z)+3*(1-c)*Math.pow(c,2)*(r.z-t.z)+Math.pow(c,3)*(e.z-t.z),null!==o&&(u+=Math.pow(l.x-o.x,2)+Math.pow(l.y-o.y,2)+Math.pow(l.z-o.z,2)),o=l,s+=u=Math.sqrt(u),a[h]={partialLength:u,point:l}}var f=new as(a,s);return ah[n]=f,{data:f,interval:new e$(t.x,t.y,t.z)}}(t,e,i,r),a=n.data,o=n.interval;this.lengthData=a,this.interval=o,this.totalLength=a.totalLength}return t.prototype.getPointInPercent=function(t){var e=this.lengthData;if(0===t)return e.points[0].point.clone().add(this.interval);if(an(1-t,0))return e.points[299].point.clone().add(this.interval);if(an(e.totalLength,0))return this.p1.clone();var i=new e$,r=aa(e.totalLength*t,4),n=this.catching.lastAddedLength,a=this.catching.lastPoint;if(an(n,r))return e.points[a].point.clone().add(this.interval);var o=!0,s=1;for(r<n&&(s=-1);o;){if(r>=n){if(299===a){i.x=e.points[a].point.x,i.y=e.points[a].point.y,i.z=e.points[a].point.z;break}if(r<n+e.points[a+1].partialLength){var u=(r-n)/e.points[a+1].partialLength;i.x=e.points[a].point.x+(e.points[a+1].point.x-e.points[a].point.x)*u,i.y=e.points[a].point.y+(e.points[a+1].point.y-e.points[a].point.y)*u,i.z=e.points[a].point.z+(e.points[a+1].point.z-e.points[a].point.z)*u;break}}s>0&&a<299?(a+=s,n+=aa(e.points[a].partialLength,5)):s<0&&a>0?(n-=aa(e.points[a].partialLength,5),a+=s):o=!1}return this.catching.lastPoint=a,this.catching.lastAddedLength=n,i.add(this.interval),i},t}(),ad=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.temp=new i5,this.totalLength=0}return t.prototype.getPointInPercent=function(t){return 0===t?this.temp.copyFrom(this.p1):an(1-t,0)?this.temp.copyFrom(this.p2):(ay.slerpFlat(this.temp,this.p1,this.p2,t),this.temp)},t}(),ap=function(){function t(t,e,i,r){this.precomputed=!1,this.control1=new eJ,this.control2=new eJ,this.weighted=!1,this.isConstant=!1,this.mSampleValues=Array(11),void 0!==t&&void 0!==e&&void 0!==i&&void 0!==r?(this.control1.x=t,this.control1.y=e,this.control2.x=i,this.control2.y=r,this.weighted=!0):void 0!==t&&void 0!==e?(this.control1.x=1/3,this.control1.y=t,this.control2.x=2/3,this.control2.y=e):this.isConstant=!0}var e=t.prototype;return e.getValue=function(t){return this.isConstant?0:this.control1.x===this.control1.y&&this.control2.x===this.control2.y||0===t||1===t?t:this.weighted?(this.precomputed||this.precompute(),al(this.getTForX(t),this.control1.y,this.control2.y)):this.bezierInterpolate(0,this.control1.y,this.control2.y,1,t)},e.bezierInterpolate=function(t,e,i,r,n){var a=1-n,o=a*a,s=n*n;return o*a*t+e*o*n*3+i*a*s*3+s*n*r},e.calcSampleValues=function(){for(var t=0;t<11;++t)this.mSampleValues[t]=al(.1*t,this.control1.x,this.control2.x)},e.getTForX=function(t){for(var e=this.mSampleValues,i=0,r=1;10!==r&&e[r]<=t;++r)i+=.1;var n=i+(t-e[--r])/(e[r+1]-e[r])*.1,a=ac(n,this.control1.x,this.control2.x);return a>=.001?function(t,e,i,r){for(var n=0;n<4;++n){var a=ac(e,i,r);if(0===a)break;var o=al(e,i,r)-t;e-=o/a}return e}(t,n,this.control1.x,this.control2.x):0===a?n:function(t,e,i,r,n){var a,o,s=0;do(a=al(o=e+(i-e)/2,r,n)-t)>0?i=o:e=o;while(Math.abs(a)>1e-7&&++s<10);return o}(t,i,i+.1,this.control1.x,this.control2.x)},e.precompute=function(){this.precomputed=!0,(this.control1.x!==this.control1.y||this.control2.x!==this.control2.y)&&this.calcSampleValues()},t}();function am(t,e){var i,r,n,a=av(t,e,!0),o=a.p0,s=a.p1,u=a.p2,h=a.p3;ih(u),ih(h);var l=h.x-o.x,c=h.y-o.y,f=aa((s.x-o.x)/l,5),d=aa((u.x-o.x)/l,5);an(c,0)?i=r=NaN:(i=aa((s.y-o.y)/c,5),r=aa((u.y-o.y)/c,5)),f<0&&(console.error("Invalid bezier points, x1 < 0",o,s,u,h),f=0),d<0&&(console.error("Invalid bezier points, x2 < 0",o,s,u,h),d=0),f>1&&(console.error("Invalid bezier points, x1 >= 1",o,s,u,h),f=1),d>1&&(console.error("Invalid bezier points, x2 >= 1",o,s,u,h),d=1);var p=("bez_"+f+"_"+i+"_"+d+"_"+r).replace(/\./g,"p");return au[p]?n=au[p]:(n=an(c,0)?new ap:new ap(f,i,d,r),au[p]=n),{points:[o,s,u,h],timeInterval:l,valueInterval:c,curve:n}}function av(t,e,i){var r=t[1],n=ao.isHoldOutKeyframe(t),a=ao.isHoldInKeyframe(e),o=!a&&ao.isRightSideEase(t),s=!n&&ao.isLeftSideEase(e);if(o&&!s&&!a){var u=new eJ(r[r.length-4],r[r.length-3]),h=new eJ(r[r.length-2],r[r.length-1]),l=ao.getPointInCurve(e),c=new eJ(l.x,l.y),f=new eJ(c.x-(c.x-u.x)/10,c.y);return{type:"ease",p0:u,p1:h,p2:f,p3:c}}if(!o&&s&&!n){var d=e[1],p=ao.getPointInCurve(t),m=new eJ(p.x,p.y),v=new eJ(d[0],d[1]),y=new eJ(d[2],d[3]),g=new eJ(m.x+(y.x-m.x)/10,m.y);return{type:"ease",p0:m,p1:g,p2:v,p3:y}}if(o&&s){var x=e[1];return{type:"ease",p0:new eJ(r[r.length-4],r[r.length-3]),p1:new eJ(r[r.length-2],r[r.length-1]),p2:new eJ(x[0],x[1]),p3:new eJ(x[2],x[3])}}var b=ao.getPointInCurve(t),T=ao.getPointInCurve(e);if(n?T.y=b.y:a&&(b.y=T.y),!i)return{type:"line",p0:b,p1:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a};var _=new eJ((T.x-b.x)/3+b.x,(T.y-b.y)/3+b.y),E=new eJ((T.x-b.x)/3*2+b.x,(T.y-b.y)/3*2+b.y);return{type:"line",p0:b,p1:_,p2:E,p3:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a}}var ay=function(){function t(){}return t.slerpFlat=function(t,e,i,r){var n=e.x,a=e.y,o=e.z,s=e.w,u=i.x,h=i.y,l=i.z,c=i.w;if(0===r){t.x=n,t.y=a,t.z=o,t.w=s;return}if(1===r){t.x=u,t.y=h,t.z=l,t.w=c;return}if(s!==c||n!==u||a!==h||o!==l){var f=1-r,d=n*u+a*h+o*l+s*c,p=d>=0?1:-1,m=1-d*d;if(m>Number.EPSILON){var v=Math.sqrt(m),y=Math.atan2(v,d*p);f=Math.sin(f*y)/v,r=Math.sin(r*y)/v}var g=r*p;if(n=n*f+u*g,a=a*f+h*g,o=o*f+l*g,s=s*f+c*g,f===1-r){var x=1/Math.sqrt(n*n+a*a+o*o+s*s);n*=x,a*=x,o*=x,s*=x}}t.x=n,t.y=a,t.z=o,t.w=s},t}(),ag="not_implement",ax=function(){function t(t){this.onCreate(t)}var e=t.prototype;return e.onCreate=function(t){throw Error(ag)},e.getIntegrateValue=function(t,e,i){throw Error(ag)},e.getIntegrateByTime=function(t,e){throw Error(ag)},e.getValue=function(t){throw Error(ag)},e.getMaxTime=function(){throw Error(ag)},e.toUniform=function(t){throw Error(ag)},e.map=function(t){throw Error(ag)},e.scaleXCoord=function(t){return this},e.toData=function(){throw Error(ag)},t.getAllData=function(t,e){for(var i=new(e?n4:Float32Array)(4*t.index),r=0,n=0,a=t.curves;r<a.length;r++){var o=a[r].toData();i.set(o,n),n+=o.length}return e?i.data:i},t}(),ab=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.value=t},i.getIntegrateValue=function(t,e,i){return this.value*(e-t)},i.getIntegrateByTime=function(t,e){return .5*this.value*(e*e-t*t)},i.getValue=function(t){return this.value},i.toUniform=function(){return new Float32Array([0,this.value,0,0])},i.map=function(t){var e=this.value;return this.value=t(e),this},i.getMaxTime=function(){return 0},e}(ax),aT=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.items=t},i.getValue=function(t){var e=this.items;return e[Math.floor(Math.random()*e.length)]},i.map=function(t){return this.items=this.items.map(t),this},e}(ax),a_=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t,e){return this.min+(null!=e?e:Math.random())*(this.max-this.min)},i.getIntegrateValue=function(t,e,i){return(this.min+(null!=i?i:1)*(this.max-this.min))*(e-t)},i.toUniform=function(){return new Float32Array([4,this.min,this.max,0])},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},e}(ax),aE=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t){for(var e=this.min,i=this.max,r=[],n=0;n<e.length;n++){var a=Math.random();r[n]=e[n]*(1-a)+i[n]*a}return r},i.map=function(t){return this.min=this.min.map(t),this.max=this.max.map(t),this},e}(ax),aC=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1],this.xCoord=1},i.getValue=function(t){return t/=this.xCoord,this.min*(1-t)+this.max*t},i.toUniform=function(){return new Float32Array([1,this.min,this.max,this.xCoord])},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=this.min,n=this.max,a=this.xCoord*i;return((r+e/a*(n-r)+r)*e-(r+t/a*(n-r)+r)*t)/2},i.getIntegrateByTime=function(t,e){return aR(e,0,this.xCoord,this.min,this.max)-aR(t,0,this.xCoord,this.min,this.max)},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},i.scaleXCoord=function(t){return this.xCoord=t,this},e}(ax),aw=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.stops=e4(t)},i.getStops=function(){return this.stops},i.getValue=function(t){for(var e=this.stops,i=e.length-1,r=0;r<i;r++){var n=e[r],a=e[r+1];if(n.time<=t&&a.time>t){var o=(t-n.time)/(a.time-n.time);return e5(n.color.toArray(),a.color.toArray(),o,!0)}}return e[i].color.toArray()},e}(ax),aS=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t.map(function(t){return t.slice?t.slice(0,2):[t.time,t.value]}).sort(function(t,e){return t[0]-e[0]});var e=this.keys[this.keys.length-1];e[0]<1&&this.keys.push([1,e[1]]);var i=this.keys[0];i[0]>0&&this.keys.unshift([0,i[1]]),this.isLineSeg=!0},i.getValue=function(t){var e=this.keys;if(t<e[0][0])return e[0][1];for(var i=e.length-1,r=0;r<i;r++){var n=e[r],a=e[r+1],o=n[0],s=a[0];if(t>=o&&t<=s){var u=(t-o)/(s-o),h=n[1];return h+u*(a[1]-h)}}return e[i][1]},i.getIntegrateValue=function(t,e,i){return void 0===i&&(i=1),(this.integrate(e,!1)-this.integrate(t,!1))*i},i.getIntegrateByTime=function(t,e){return this.integrate(e,!0)-this.integrate(t,!0)},i.integrate=function(t,e){var i=this.keys;if(t<=i[0][0])return 0;for(var r=0,n=i.length-1,a=e?aR:aP,o=0;o<n;o++){var s=i[o],u=i[o+1],h=s[0],l=u[0];if(t>h&&t<=l)return r+a(t,h,l,s[1],u[1]);r+=a(l,h,l,s[1],u[1])}return r},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*Math.ceil(t.length/2)),i=0,r=0;i<t.length;i++,r+=2)e.set(t[i],r);return e.set(t[t.length-1],e.length-2),e},i.toUniform=function(t){var e=t.index,i=Math.ceil(this.keys.length/2);return t.lineSegCount+=i,t.curves.push(this),t.index+=i,t.max=Math.max(t.max,i),new Float32Array([3,e,i,0])},i.map=function(t){return this.keys.forEach(function(e){return e[1]=t(e[1])}),this},i.scaleXCoord=function(t){return this.keys.forEach(function(e){return e[0]=t*e[0]}),this},e}(ax),aA=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t[0],this.values=t[1]},i.getValue=function(t){for(var e=this.keys,i=this.values,r=0;r<e.length-1;r++){var n=e[r],a=e[r+1];if(n[0]<=t&&a[0]>=t){var o=a[1]-n[1],s=void 0;return s=0===o?(t-n[0])/(a[0]-n[0]):(function(t,e,i){var r=i[0]-e[0],n=e[3]*r,a=i[2]*r,o=(t-e[0])/r,s=o*o,u=s*o;return(2*u-3*s+1)*e[1]+(u-2*s+o)*n+(u-s)*a+(-2*u+3*s)*i[1]}(t,n,a)-n[1])/o,this.calculateVec(r,s)}}return t<=e[0][0]?i[0].slice():i[i.length-1].slice()},i.calculateVec=function(t,e){for(var i=this.values[t],r=this.values[t+1],n=[0,0,0],a=0;a<i.length;a++)n[a]=i[a]*(1-e)+r[a]*e;return n},e}(ax),aM=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length){for(var n=0;n<e.length-1;n++){var a=e[n],o=e[n+1],s=new e$(i[n][0],i[n][1],i[n][2]),u=new e$(i[n+1][0],i[n+1][1],i[n+1][2]),h=new e$(r[2*n][0],r[2*n][1],r[2*n][2]),l=new e$(r[2*n+1][0],r[2*n+1][1],r[2*n+1][2]),c=am(a,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new af(s,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g,timeStart:Number(v.x),timeEnd:Number(y.x)}}this.keyTimeData=Object.keys(this.curveSegments)}},i.getValue=function(t){var e=aa(t,5),i=0,r=new e$,n=this.keyTimeData;if(!n.length)return r;var a=this.curveSegments[n[0]].timeStart,o=this.curveSegments[n[n.length-1]].timeEnd;if(e<=a)return this.curveSegments[n[0]].pathCurve.getPointInPercent(0);if(e>=o)return this.curveSegments[n[n.length-1]].pathCurve.getPointInPercent(1);for(var s=0;s<n.length;s++){var u=this.curveSegments[n[s]].timeStart,h=this.curveSegments[n[s]].timeEnd;if(e>=Number(u)&&e<Number(h)){var l=this.curveSegments[n[s]].pathCurve;i=this.getPercValue(n[s],e),r=l.getPointInPercent(i)}}return r},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=aa((e-r.x)/n,4);return eK(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=this.keyTimeData;return this.curveSegments[t[t.length-1]].timeEnd},e}(ax),aI=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length)for(var n=0;n<e.length-1;n++){var a=e[n],o=e[n+1],s=i5.fromArray(i[n]),u=i5.fromArray(i[n+1]),h=i5.fromArray(r[2*n]),l=i5.fromArray(r[2*n+1]),c=am(a,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new ad(s,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g}}},i.getValue=function(t){var e=0,i=aa(t,5),r=Object.keys(this.curveSegments),n=Number(r[0].split("&")[0]),a=Number(r[r.length-1].split("&")[1]);if(i<=n)return this.curveSegments[r[0]].pathCurve.getPointInPercent(0);if(i>=a)return this.curveSegments[r[r.length-1]].pathCurve.getPointInPercent(1);for(var o=0;o<r.length;o++){var s=r[o].split("&"),u=s[0],h=s[1];if(i>=Number(u)&&i<Number(h)){var l=this.curveSegments[r[o]].pathCurve;return e=this.getPercValue(r[o],i),l.getPointInPercent(e)}}return this.curveSegments[r[0]].pathCurve.getPointInPercent(0)},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=aa((e-r.x)/n,4);return eK(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=Object.keys(this.curveSegments);return Number(t[t.length-1].split("&")[1])},e}(ax);function aP(t,e,i,r,n){var a=t-e;return(r+r+(n-r)*a/(i-e))*a/2}function aR(t,e,i,r,n){var a=t*t,o=e*e;return(a*t*2*(r-n)+3*a*(e*n-i*r)-o*e*(2*r+n)+3*o*i*r)/(6*(e-i))}function aO(t,e){if(e){var i=e[0],r=e[1];if(i===tZ.CURVE){t.curves.push(r);var n=r.length;r[0][0]>0&&n++,r[r.length-1][0]<1&&n++,t.index+=n,t.max=Math.max(t.max,n),t.curveCount+=n}else if(i===tZ.LINE){var a=r.length;if(2===a&&0===r[0][0]&&1===r[1][0])return;r[0][0]>0&&a++,r[r.length-1][0]<1&&a++;var o=Math.ceil(a/2);t.lineSegCount+=o,t.curves.push(r),t.index+=o,t.max=Math.max(t.max,o)}else if(i===tZ.BEZIER_CURVE){var s=r.length-1;t.index+=2*s,t.curves.push(r),t.max=Math.max(t.max,2*s),t.curveCount+=2*s}}}function aN(){return{curves:[],index:0,max:0,lineSegCount:0,curveCount:0}}function aL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(aL=function(){return!!t})()}function aV(t,e,i){return(aV=aL()?Reflect.construct:function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&iO(n,i.prototype),n}).apply(null,arguments)}var aF=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e0,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aW(t[0]),this.yCurve=aW(t[1]),this.zCurve=aW(t[2]),this.wCurve=aW(t[3])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t),n=this.wCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime(),this.wCurve.getMaxTime())},e}(ax),aD=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e$,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aW(t[0]),this.yCurve=aW(t[1]),this.zCurve=aW(t[2])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t);return this.value.set(e,i,r),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime())},e}(ax),ak=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new eJ,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aW(t[0]),this.yCurve=aW(t[1])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t);return this.value.set(e,i),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime())},e}(ax),az="editor",aB={"Item duration can't be less than 0":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS","ValueType: 21/22 is not supported":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b","Container size overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#MvjnY","Container is not an HTMLElement":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#WZaWg","Invalid container size":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#lLlSW","DPI overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#ulfNT"};t.TangentMode=void 0,(tg=t.TangentMode||(t.TangentMode={}))[tg.Cubic=0]="Cubic",tg[tg.Linear=1]="Linear",tg[tg.Constant=2]="Constant",t.WeightedMode=void 0,(tx=t.WeightedMode||(t.WeightedMode={}))[tx.None=0]="None",tx[tx.In=1]="In",tx[tx.Out=2]="Out",tx[tx.Both=3]="Both";var aU=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.keyFrames=aG(t);var e=this.keyFrames;this.curveMap={},this.keys=[],this.curveInfos=[];for(var i=0;i<e.length-1;i++){var r=function(t,e){var i,r,n,a=new eJ(t.time,t.value),o=new eJ,s=new eJ,u=new eJ,h=2===t.weightedMode||3===t.weightedMode||1===e.weightedMode||3===e.weightedMode,l=2===t.tangentMode,c=(h?t.outWeight:1)*(e.time-t.time)/3;o.x=t.time+c,o.y=t.value+c*(l?0:t.outSlope);var f=(h?e.inWeight:1)*(e.time-t.time)/3;s.x=e.time-f,s.y=e.value-f*(l?0:e.inSlope),u.x=e.time,u.y=l?t.value:e.value,ih(s),ih(u);var d=u.x-a.x,p=u.y-a.y,m=aa((o.x-a.x)/d,5),v=aa((s.x-a.x)/d,5);an(p,0)?i=r=NaN:(i=aa((o.y-a.y)/p,5),r=aa((s.y-a.y)/p,5)),m<0&&(console.error("Invalid bezier points, x1 < 0",a,o,s,u),m=0),v<0&&(console.error("Invalid bezier points, x2 < 0",a,o,s,u),v=0),m>1&&(console.error("Invalid bezier points, x1 >= 1",a,o,s,u),m=1),v>1&&(console.error("Invalid bezier points, x2 >= 1",a,o,s,u),v=1);var y=("bez_"+m+"_"+i+"_"+v+"_"+r).replace(/\./g,"p");return au[y]?n=au[y]:(n=an(p,0)?new ap:h?new ap(m,i,v,r):new ap(i,r),au[y]=n),{points:[a,o,s,u],timeInterval:d,valueInterval:p,curve:n}}(e[i],e[i+1]),n=r.points,a=r.curve,o=r.timeInterval,s=r.valueInterval,u=n[0],h=n[n.length-1];this.keys.push([].concat(u.toArray(),n[1].toArray())),this.keys.push([].concat(h.toArray(),n[2].toArray()));var l={points:n,timeInterval:o,valueInterval:s,curve:a,timeStart:Number(u.x),timeEnd:Number(h.x)};this.curveMap[u.x+"&"+h.x]=l,this.curveInfos.push(l)}},i.getValue=function(t){var e=0,i=this.keyFrames.length;if(t<=this.keyFrames[0].time)e=this.keyFrames[0].value;else if(t<this.keyFrames[i-1].time)for(var r=0;r<this.keyFrames.length-1;r++){var n=this.keyFrames[r].time,a=this.keyFrames[r+1].time;if(t>=n&&t<a){var o=this.curveInfos[r],s=o.points[0],u=o.timeInterval,h=o.valueInterval,l=(t-s.x)/u,c=0;c=1===this.keyFrames[r].tangentMode?l:o.curve.getValue(l),e=s.y+h*c;break}}else t>=this.keyFrames[i-1].time&&(e=this.keyFrames[i-1].value);return e},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=(e-t)/i,n=0,a=Object.keys(this.curveMap);if(r<=this.curveMap[a[0]].timeStart)return 0;for(var o=0;o<a.length;o++){var s=this.curveMap[a[o]].timeStart,u=this.curveMap[a[o]].timeEnd;if(r>=Number(u)&&(n+=i*this.getCurveIntegrateValue(a[o],Number(u))),r>=Number(s)&&r<Number(u)){n+=i*this.getCurveIntegrateValue(a[o],r);break}}return n},i.getIntegrateByTime=function(t,e){return this.getIntegrateValue(0,e)-this.getIntegrateValue(0,t)},i.getCurveIntegrateValue=function(t,e){for(var i=this.curveMap[t],r=i.points[0],n=i.timeInterval,a=i.valueInterval,o=0,s=(e-r.x)/20,u=0;u<=20;u++){var h=u*s/n,l=r.y+a*i.curve.getValue(h);0===u||20===u?o+=l:u%2==1?o+=4*l:o+=2*l}return s/3*o},i.toUniform=function(t){var e=t.index,i=this.keys.length;return t.curves.push(this),t.index=e+i,t.max=Math.max(t.max,i),t.curveCount+=i,new Float32Array([5,e+1/i,e,i])},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*t.length),i=0,r=0;i<t.length;i++,r+=4)e.set(t[i],r);return e},i.getMaxTime=function(){return this.keyFrames[this.keyFrames.length-1].time},e}(ax);function aG(t){for(var e=[],i=[],r={x:0,y:0},n=0;n<t.length;n++){var a=t[n],o=av(a,n+1<t.length?t[n+1]:t[n],!0),s=o.p0,u=o.p1,h=o.p2,l=o.p3,c=o.type;ih(h),ih(l);var f={leftControl:r,value:s,rightControl:u,tangentMode:"line"===c?1:0};a[0]===tq.HOLD&&(f.tangentMode=2),i.push(f),r=h}for(var d=function(t,e){return(e.y-t.y)/(e.x-t.x+1e-6)},p=0;p<i.length;p++){var m=i[p].leftControl,v=i[p].value,y=i[p].rightControl,g=0,x=0;p>0&&(g=d(m,v)),p<i.length-1&&(x=d(v,y));var b={time:v.x,value:v.y,inSlope:g,outSlope:x,inWeight:0,outWeight:0,tangentMode:i[p].tangentMode,weightedMode:3};e.push(b),p>0&&(b.inWeight=(v.x-m.x)/((v.x-i[p-1].value.x)/3)),p+1<i.length&&(b.outWeight=(y.x-v.x)/((i[p+1].value.x-v.x)/3))}return e}var aj=((eE={})[tZ.RANDOM]=function(t){return eF(t[0],Array)?new aE(t):new a_(t)},eE[tZ.CONSTANT]=function(t){return new ab(t)},eE[tZ.CONSTANT_VEC2]=function(t){return new ab(t)},eE[tZ.CONSTANT_VEC3]=function(t){return new ab(t)},eE[tZ.CONSTANT_VEC4]=function(t){return new ab(t)},eE[tZ.RGBA_COLOR]=function(t){return new ab(t)},eE[tZ.COLORS]=function(t){return new aT(t.map(function(t){return e2(t,!1)}))},eE[tZ.LINE]=function(t){return 2===t.length&&0===t[0][0]&&1===t[1][0]?new aC([t[0][1],t[1][1]]):new aS(t)},eE[tZ.GRADIENT_COLOR]=function(t){return new aw(t)},eE[tZ.LINEAR_PATH]=function(t){return new aA(t)},eE[tZ.BEZIER_CURVE]=function(t){return 1===t.length?new ab(t[0][1][1]):new aU(t)},eE[tZ.BEZIER_CURVE_PATH]=function(t){return 1===t[0].length?new ab(aV(e$,[].concat(t[1][0]))):new aM(t)},eE[tZ.BEZIER_CURVE_QUAT]=function(t){return 1===t[0].length?new ab(aV(i5,[].concat(t[1][0]))):new aI(t)},eE[tZ.COLOR_CURVE]=function(t){return new aX(t)},eE[tZ.VECTOR4_CURVE]=function(t){return new aF(t)},eE[tZ.VECTOR2_CURVE]=function(t){return new ak(t)},eE[27]=function(t){return new aD(t)},eE);function aW(t){if(!t||!isNaN(+t))return new ab(t||0);if(eF(t,ax))return t;if(iy(aj[t[0]]))return aj[t[0]](t[1]);throw Error("ValueType: "+t[0]+" is not supported, see "+aB["ValueType: 21/22 is not supported"]+".")}var aX=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e1,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.rCurve=aW(t[0]),this.gCurve=aW(t[1]),this.bCurve=aW(t[2]),this.aCurve=aW(t[3])},i.getValue=function(t){var e=this.rCurve.getValue(t),i=this.gCurve.getValue(t),r=this.bCurve.getValue(t),n=this.aCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.rCurve.getMaxTime(),this.gCurve.getMaxTime(),this.bCurve.getMaxTime(),this.aCurve.getMaxTime())},e}(ax);t.TexturePaintScaleMode=void 0,(tb=t.TexturePaintScaleMode||(t.TexturePaintScaleMode={}))[tb.Fill=0]="Fill",tb[tb.Fit=1]="Fit",tb[tb.Crop=2]="Crop",tb[tb.Tile=3]="Tile",t.ShapeComponent=function(e){function i(t){(i=e.call(this,t)||this).shapeDirty=!0,i.materialDirty=!0,i.graphicsPath=new ui,i.fills=[],i.strokeAttributes={width:1,alignment:.5,cap:ea.Butt,join:eo.Miter,miterLimit:10},i.strokeWidth=1,i.strokeCap=ea.Butt,i.strokeJoin=eo.Miter,i.strokes=[],i.meshCollider=new a5,i.fillMaterials=[],i.strokeMaterials=[],i.getHitTestParams=function(t){var e=rO.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix());if(t){i.meshCollider.setGeometry(i.geometry,e);var r=i.meshCollider.getBoundingBoxData();if(r)return{behavior:0,type:r.type,triangles:r.area,backfaceCulling:i.rendererOptions.side===tF.FRONT}}},i.rendererOptions={renderMode:tj.MESH,blending:tV.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tF.DOUBLE,mask:0},i.maskManager=new nl(i.engine);var i,r={type:ei.Solid,color:new e1(1,1,1,1)};i.strokes.push(r);var n={type:ei.Solid,color:new e1(1,1,1,1)};return i.fills.push(n),i.shapeAttributes={type:en.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},i.geometry=ng.create(i.engine,{attributes:{aPos:{type:rL.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},aUV:{size:2,offset:0,releasable:!0,type:rL.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rL.TRIANGLES,drawCount:6}),i.geometry.subMeshes.push({offset:0,indexCount:0,vertexCount:0},{offset:0,indexCount:0,vertexCount:0}),i}iN(i,e);var r=i.prototype;return r.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},r.onUpdate=function(t){this.shapeDirty&&(this.buildPath(this.shapeAttributes),this.buildGeometryFromPath(this.graphicsPath.shapePath),this.shapeDirty=!1),this.materialDirty&&(this.updateMaterials(),this.materialDirty=!1)},r.render=function(t){this.maskManager.drawStencilMask(t),this.draw(t)},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){for(var e=!1,i=0;i<this.fillMaterials.length;i++)e=this.fillMaterials[i].colorMask,this.fillMaterials[i].colorMask=!1,t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[i],0),this.fillMaterials[i].colorMask=e;for(var r=0;r<this.strokeMaterials.length;r++)e=this.strokeMaterials[r].colorMask,this.strokeMaterials[r].colorMask=!1,t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[r],1),this.strokeMaterials[r].colorMask=e}},r.draw=function(t){for(var e=0;e<this.fillMaterials.length;e++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[e],0);for(var i=0;i<this.strokeMaterials.length;i++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[i],1)},r.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},r.buildGeometryFromPath=function(t){var e=t.shapePrimitives,i=[],r=[];if(this.fills.length>0)for(var n,a=iD(e);!(n=a()).done;){var o=n.value.shape,s=[],u=r.length,h=i.length/2;o.build(s),o.triangulate(s,i,h,r,u)}var l=r.length;if(this.strokes.length>0)for(var c,f=iD(e);!(c=f()).done;){var d=c.value.shape,p=[];r.length;var m=i.length/2,v=this.strokeAttributes;v.cap=this.strokeCap,v.join=this.strokeJoin,v.width=this.strokeWidth;var y=!0;this.shapeAttributes.type===en.Custom&&(y=d.closePath),d.build(p),s0(p,v,!1,y,i,2,m,r)}var g=r.length-l,x=i.length/2,b=this.geometry.getAttributeData("aPos"),T=this.geometry.getAttributeData("aUV"),_=this.geometry.getIndexData();(!b||b.length<3*x)&&(b=new Float32Array(3*x)),(!T||T.length<2*x)&&(T=new Float32Array(2*x)),(!_||_.length<r.length)&&(_=new Uint16Array(r.length));for(var E=Number.MAX_VALUE,C=Number.MAX_VALUE,w=Number.MIN_VALUE,S=Number.MIN_VALUE,A=0;A<x;A++){var M=3*A,I=2*A,P=i[I],R=i[I+1];b[M]=P,b[M+1]=R,b[M+2]=0,E=Math.min(E,P),C=Math.min(C,R),w=Math.max(w,P),S=Math.max(S,R)}for(var O=w-E,N=S-C,L=0;L<x;L++){var V=3*L,F=2*L;T[F]=(b[V]-E)/O,T[F+1]=(b[V+1]-C)/N}_.set(r),this.geometry.setAttributeData("aPos",b),this.geometry.setAttributeData("aUV",T),this.geometry.setIndexData(_),this.geometry.setDrawCount(r.length);var D=this.geometry.subMeshes[0],k=this.geometry.subMeshes[1];D.indexCount=l,k.offset=2*l,k.indexCount=g},r.buildPath=function(e){switch(this.graphicsPath.clear(),e.type){case en.Custom:for(var i,r=this.shapeAttributes,n=r.points,a=r.easingIns,o=r.easingOuts,s=iD(r.shapes);!(i=s()).done;){var u=i.value,h=u.indexes,l=n[h[0].point];this.graphicsPath.moveTo(l.x,l.y);for(var c=1;c<h.length;c++){var f=h[c],d=h[c-1],p=n[f.point],m=n[d.point],v=o[d.easingOut],y=a[f.easingIn];this.graphicsPath.bezierCurveTo(v.x+m.x,v.y+m.y,y.x+p.x,y.y+p.y,p.x,p.y,1)}if(u.close){var g=h[0],x=h[h.length-1],b=n[g.point],T=n[x.point],_=o[x.easingOut],E=a[g.easingIn];this.graphicsPath.bezierCurveTo(_.x+T.x,_.y+T.y,E.x+b.x,E.y+b.y,b.x,b.y,1),this.graphicsPath.closePath()}}break;case en.Ellipse:this.graphicsPath.ellipse(0,0,e.xRadius,e.yRadius);break;case en.Rectangle:this.graphicsPath.rect(-e.width/2,-e.height/2,e.width,e.height,e.roundness);break;case en.Star:this.graphicsPath.polyStar(e.pointCount,e.outerRadius,e.innerRadius,e.outerRoundness,e.innerRoundness,t.StarType.Star);break;case en.Polygon:this.graphicsPath.polyStar(e.pointCount,e.radius,e.radius,e.roundness,e.roundness,t.StarType.Polygon)}},r.updateMaterials=function(){for(var t=0;t<this.fills.length;t++)this.updatePaintMaterial(this.fillMaterials[t],this.fills[t]);for(var e=0;e<this.strokes.length;e++)this.updatePaintMaterial(this.strokeMaterials[e],this.strokes[e])},r.updatePaintMaterial=function(t,e){if(t.setFloat("_FillType",e.type),e.type===ei.Solid)t.color=e.color;else if(e.type===ei.GradientLinear||e.type===ei.GradientAngular||e.type===ei.GradientRadial)this.updateGradientMaterial(t,e.gradientStops,e.startPoint,e.endPoint);else if(e.type===ei.Texture){t.setInt("_ImageScaleMode",e.scaleMode),t.setVector2("_ImageSize",new eJ(e.texture.getWidth(),e.texture.getHeight()));var i=this.getBoundingBox(),r=i.area[0].p1,n=i.area[1].p2;t.setVector2("_DestSize",new eJ(r.x-n.x,r.y-n.y)),t.setFloat("_ImageOpacity",e.opacity),t.setFloat("_ImageScalingFactor",e.scalingFactor),t.setTexture("_ImageTex",e.texture);var a=e.textureTransform;t.setMatrix3("_TextureTransform",new nT().scale(a.scale.x,a.scale.y).rotate(a.rotation).translate(a.offset.x,a.offset.y).invert())}},r.updateGradientMaterial=function(t,e,i,r){for(var n,a=[],o=[],s=iD(e.stops);!(n=s()).done;){var u=n.value,h=u.color;a.push(new e0(h.r,h.g,h.b,h.a)),o.push(u.time)}t.setVector4Array("_Colors",a),t.setFloats("_Stops",o),t.setInt("_StopsCount",o.length),t.setVector2("_StartPoint",i),t.setVector2("_EndPoint",r)},r.createMaterialFromRendererOptions=function(e){var i={shader:{vertex:"precision highp float;attribute vec3 aPos;attribute vec2 aUV;varying vec2 uv0;uniform mat4 effects_MatrixVP;uniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;void main(){vec4 pos=vec4(aPos.xyz,1.0);uv0=aUV;gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}",fragment:"precision highp float;\n#define _MAX_STOPS 8\n#define PI 3.14159265359\nuniform vec4 _Color;uniform vec4 _Colors[_MAX_STOPS];uniform float _Stops[_MAX_STOPS];uniform int _StopsCount;uniform float _FillType;uniform vec2 _StartPoint;uniform vec2 _EndPoint;uniform sampler2D _ImageTex;uniform vec2 _ImageSize;uniform vec2 _DestSize;uniform int _ImageScaleMode;uniform mat3 _TextureTransform;uniform float _ImageScalingFactor;uniform float _ImageOpacity;varying vec2 uv0;vec4 smoothMix(vec4 a,vec4 b,float t){return mix(a,b,smoothstep(0.0,1.0,t));}float calculateAngleRatio(vec2 v1,vec2 v2){float angle=atan(v2.y,v2.x)-atan(v1.y,v1.x);if(angle<0.0)angle+=2.0*PI;return angle/(2.0*PI);}vec2 applyTransform(mat3 m,vec2 uv){uv=uv-vec2(0.5,0.5);vec3 p=m*vec3(uv,1.0);p.xy=p.xy+vec2(0.5,0.5);return p.xy;}void main(){vec4 finalColor=vec4(1.0);if(_FillType==0.0){finalColor=_Color;}else if(_FillType==1.0||_FillType==2.0||_FillType==3.0){float t=0.0;if(_FillType==1.0){vec2 gradientVector=_EndPoint-_StartPoint;vec2 pixelVector=uv0-_StartPoint;float denom=max(dot(gradientVector,gradientVector),1e-6);t=clamp(dot(pixelVector,gradientVector)/denom,0.0,1.0);}else if(_FillType==2.0){float maxRadius=max(distance(_EndPoint,_StartPoint),0.001);t=clamp(distance(uv0,_StartPoint)/maxRadius,0.0,1.0);}else{vec2 center=_StartPoint;vec2 referenceVector=_EndPoint-center;vec2 targetVector=uv0-center;if(length(targetVector)>0.001){t=calculateAngleRatio(referenceVector,targetVector);}}finalColor=_Colors[0];for(int i=1;i<_MAX_STOPS;i++){if(i>=_StopsCount)break;float prevStop=_Stops[i-1];float currStop=_Stops[i];if(t>=prevStop&&t<=currStop){float localT=(t-prevStop)/max(currStop-prevStop,1e-6);finalColor=smoothMix(_Colors[i-1],_Colors[i],localT);break;}}}else if(_FillType==4.0){vec2 uv=uv0;float rSrc=_ImageSize.x/max(_ImageSize.y,1.0);float rDst=_DestSize.x/max(_DestSize.y,1.0);bool maskOutside=false;if(_ImageScaleMode==0){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(1.0,rSrc/rDst);}else{scale=vec2(rDst/rSrc,1.0);}uv=(uv-0.5)*scale+0.5;uv=clamp(uv,0.0,1.0);}else if(_ImageScaleMode==1){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(rSrc/rDst,1.0);}else{scale=vec2(1.0,rSrc/rDst);}uv=(uv-0.5)*scale+0.5;maskOutside=true;}else if(_ImageScaleMode==2){uv=applyTransform(_TextureTransform,uv0);maskOutside=true;}else if(_ImageScaleMode==3){float aspectFix=rDst/max(rSrc,1e-6);vec2 uvTile=(uv0-0.5)*vec2(aspectFix,1.0)+0.5;float s=max(abs(_ImageScalingFactor),1e-6);uv=fract(uvTile*s);}vec4 img=texture2D(_ImageTex,uv);if(maskOutside){if(uv.x<0.0||uv.x>1.0||uv.y<0.0||uv.y>1.0){img.a=0.0;}}img.a*=_ImageOpacity;finalColor=img;}finalColor.rgb*=finalColor.a;gl_FragColor=finalColor;}",glslVersion:t.GLSLVersion.GLSL1}},r=nh.create(this.engine,i),n=e.side,a=e.occlusion,o=e.blending,s=e.mask,u=e.texture,h=this.maskManager.maskMode;r.blending=!0,r.depthTest=!0,r.depthMask=a,r.stencilRef=void 0!==s?[s,s]:void 0,rz(r,o),rU(r,h),rB(r,n),r.shader.shaderData.properties='_ImageTex("_ImageTex",2D) = "white" {}',r.setVector4("_TexOffset",new e0(0,0,1,1)),r.setTexture("_ImageTex",u);var l=rk(o),c=new e0;return c.x=e.occlusion?+e.transparentOcclusion:1,c.y=l,c.z=e.renderMode,c.w=h,r.setVector4("_TexParams",c),0===c.x||this.maskManager.alphaMaskEnabled?r.enableMacro("ALPHA_CLIP"):r.disableMacro("ALPHA_CLIP"),r},r.fromData=function(i){e.prototype.fromData.call(this,i),this.shapeDirty=!0,i.mask&&this.maskManager.setMaskOptions(i.mask);var r=null!=(n=i.renderer)?n:{};this.rendererOptions={renderMode:tj.MESH,blending:null!=(a=r.blending)?a:tV.ALPHA,texture:r.texture?this.engine.findObject(r.texture):this.engine.whiteTexture,occlusion:!!r.occlusion,transparentOcclusion:!!r.transparentOcclusion||this.maskManager.maskMode===t.MaskMode.MASK,side:null!=(o=r.side)?o:tF.DOUBLE,mask:this.maskManager.getRefValue()},this.strokeCap=null!=(s=i.strokeCap)?s:ea.Butt,this.strokeWidth=null!=(u=i.strokeWidth)?u:1,this.strokeJoin=null!=(h=i.strokeJoin)?h:eo.Miter,this.fills.length=0,this.fillMaterials.length=0;for(var n,a,o,s,u,h,l,c=iD(i.fills);!(l=c()).done;){var f=l.value;this.fills.push(this.createPaint(f)),this.fillMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}this.strokes.length=0,this.strokeMaterials.length=0;for(var d,p=iD(i.strokes);!(d=p()).done;){var m=d.value;this.strokes.push(this.createPaint(m)),this.strokeMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}switch(this.materials=[].concat(this.fillMaterials,this.strokeMaterials),i.type){case en.Custom:for(var v,y={type:en.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},g=iD(i.points);!(v=g()).done;){var x=v.value;y.points.push(new eJ(x.x,x.y))}for(var b,T=iD(i.easingIns);!(b=T()).done;){var _=b.value;y.easingIns.push(new eJ(_.x,_.y))}for(var E,C=iD(i.easingOuts);!(E=C()).done;){var w=E.value;y.easingOuts.push(new eJ(w.x,w.y))}y.shapes=i.shapes,this.shapeAttributes=y;break;case en.Ellipse:var S={type:en.Ellipse,xRadius:i.xRadius,yRadius:i.yRadius};this.shapeAttributes=S;break;case en.Rectangle:var A={type:en.Rectangle,width:i.width,height:i.height,roundness:i.roundness};this.shapeAttributes=A;break;case en.Star:var M={type:en.Star,pointCount:i.pointCount,innerRadius:i.innerRadius,outerRadius:i.outerRadius,innerRoundness:i.innerRoundness,outerRoundness:i.outerRoundness};this.shapeAttributes=M;break;case en.Polygon:var I={type:en.Polygon,pointCount:i.pointCount,radius:i.radius,roundness:i.roundness};this.shapeAttributes=I}},r.createPaint=function(t){var e;switch(t.type){case ei.Solid:e={type:t.type,color:new e1().copyFrom(t.color)};break;case ei.GradientLinear:case ei.GradientAngular:case ei.GradientRadial:e={type:t.type,gradientStops:aW(t.gradientStops),startPoint:new eJ().copyFrom(t.startPoint),endPoint:new eJ().copyFrom(t.endPoint)};break;case ei.Texture:var i,r,n,a=i2({offset:{x:0,y:0},rotation:0,scale:{x:1,y:1}},null!=(i=t.textureTransform)?i:{});e={type:t.type,texture:this.engine.findObject(t.texture),scaleMode:t.scaleMode,scalingFactor:null!=(r=t.scalingFactor)?r:1,opacity:null!=(n=t.opacity)?n:1,textureTransform:{offset:new eJ().copyFrom(a.offset),rotation:a.rotation,scale:new eJ().copyFrom(a.scale)}}}return e},r.onApplyAnimationProperties=function(){this.shapeDirty=!0,this.materialDirty=!0},rC(i,[{key:"shape",get:function(){return this.shapeAttributes}}]),i}(rA),t.ShapeComponent=ek([iU("ShapeComponent")],t.ShapeComponent),t.Fake3DComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.loop=!1,t.amountOfMotion=1,t.animationLength=2,t.mode=1,t.startPositionX=0,t.startPositionY=0,t.startPositionZ=0,t.endPositionX=0,t.endPositionY=0,t.endPositionZ=0,t.amplitudeX=0,t.amplitudeY=0,t.amplitudeZ=0,t.phaseX=0,t.phaseY=0,t.phaseZ=0,t}iN(i,e);var r=i.prototype;return r.onStart=function(){this.effectComponent=this.item.getComponent(t.EffectComponent)},r.onUpdate=function(t){this.updateFake3D()},r.updateFake3D=function(){if(this.effectComponent){var t=this.item.time%this.animationLength/this.animationLength,e=0,i=0,r=0;switch(this.mode){case 0:var n=Math.PI;e=Math.sin(2*n*(t+this.phaseX))*this.amplitudeX,i=Math.sin(2*n*(t+this.phaseY))*this.amplitudeY,r=Math.sin(2*n*(t+this.phaseZ))*this.amplitudeZ;break;case 1:var a=t;this.loop&&(a>.5&&(a=1-a),a*=2),e=this.startPositionX*(1-a)+a*this.endPositionX,i=this.startPositionY*(1-a)+a*this.endPositionY,r=this.startPositionZ*(1-a)+a*this.endPositionZ}var o=this.effectComponent.material;o.setFloat("_PosX",e*this.amountOfMotion),o.setFloat("_PosY",i*this.amountOfMotion),o.setFloat("_PosZ",r*this.amountOfMotion)}},i}(rw),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"loop",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amountOfMotion",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"animationLength",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"mode",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionZ",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionZ",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeZ",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"phaseX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"phaseY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"phaseZ",void 0),t.Fake3DComponent=ek([iU("Fake3DComponent")],t.Fake3DComponent),t.Fake3DAnimationMode=void 0,(tT=t.Fake3DAnimationMode||(t.Fake3DAnimationMode={}))[tT.Circular=0]="Circular",tT[tT.Linear=1]="Linear",t.CameraController=function(t){function e(e,i){var r;return r=t.call(this,e)||this,i&&r.fromData(i),r}iN(e,t);var i=e.prototype;return i.onUpdate=function(){if(this.item.composition&&this.item.transform.getValid()){var t=this.item.composition.camera;t.near=this.options.near,t.far=this.options.far,t.fov=this.options.fov,t.clipMode=this.options.clipMode,t.transform.parentTransform=this.transform.parentTransform,t.position=this.transform.position,t.setQuat(this.transform.getQuaternion().clone().conjugate())}},i.fromData=function(e){t.prototype.fromData.call(this,e),this.options=e.options},e}(rw),t.CameraController=ek([iU(el.CameraController)],t.CameraController);var aH=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iR);t.HitTestType=void 0,(t_=t.HitTestType||(t.HitTestType={}))[t_.triangle=1]="triangle",t_[t_.box=2]="box",t_[t_.sphere=3]="sphere",t_[t_.custom=4]="custom";var aY=function(){this.position=new eJ,this.delta=new eJ,this.pointerCurrentRaycast=new aZ},aZ=function(){this.point=null,this.item=null},aq="click",aQ="touchstart",aK="touchmove",aJ="touchend";t.PointerEventType=void 0,(tE=t.PointerEventType||(t.PointerEventType={}))[tE.PointerDown=0]="PointerDown",tE[tE.PointerUp=1]="PointerUp",tE[tE.PointerMove=2]="PointerMove";var a$=function(){function t(t,e){void 0===e&&(e=!1),this.engine=t,this.allowPropagation=e,this.enabled=!0,this.skipPointerMovePicking=!0,this.handlers={},this.nativeHandlers={},this.target=null}var e=t.prototype;return e.bindListeners=function(t){var e,i,r,n,a,o,s=this;this.target=t,a=function(t){return t};var u="mousedown",h="mousemove",l="mouseup",c="mouseleave",f=function(t,e,i,r,a){void 0===r&&(r=0),void 0===a&&(a=0);var o=0,u=0,h=performance.now();if(!s.target)return id.warn("Trigger TouchEvent after EventSystem is disposed."),{x:e,y:i,vx:0,vy:u,dx:r,dy:a,ts:h,width:0,height:0,origin:t};var l=s.target,c=l.width,f=l.height;if(n){var d=h-n.ts;o=(r-n.dx)/d||0,u=(a-n.dy)/d||0,n={dx:r,dy:a,ts:h}}return{x:e,y:i,vx:o,vy:u,dx:r,dy:a,ts:h,width:c,height:f,origin:t}};ii()&&(a=function(t){var e=t.touches,i=t.changedTouches;return e[0]||i[0]},u="touchstart",h="touchmove",l="touchend",c="touchcancel"),this.nativeHandlers=((o={})[u]=function(t){if(s.enabled){var o=a(t),u=a0(o);e=u.x,i=u.y,n=r={clientX:o.clientX,clientY:o.clientY,ts:performance.now(),x:e,y:i},s.dispatchEvent(aQ,f(t,e,i))}},o[h]=function(t){if(r&&s.enabled){var n=a0(a(t));e=n.x,i=n.y,s.dispatchEvent(aK,f(t,e,i,e-r.x,i-r.y))}},o[l]=function(t){if(r&&s.enabled){!s.allowPropagation&&t.cancelable&&(t.preventDefault(),t.stopPropagation());var n=a(t),o=a0(n),u=Math.abs(r.clientX-n.clientX)+Math.abs(r.clientY-n.clientY);e=o.x,i=o.y,u<4&&s.dispatchEvent(aq,f(t,e,i)),s.dispatchEvent(aJ,f(t,e,i,e-r.x,i-r.y))}r=0},o),this.nativeHandlers[c]=this.nativeHandlers[l],Object.keys(this.nativeHandlers).forEach(function(t){var e;null==(e=s.target)||e.addEventListener(String(t),s.nativeHandlers[t])}),this.addEventListener(aq,this.onClick.bind(this)),this.addEventListener(aQ,this.onPointerDown.bind(this)),this.addEventListener(aJ,this.onPointerUp.bind(this)),this.addEventListener(aK,this.onPointerMove.bind(this))},e.dispatchEvent=function(t,e){var i=this.handlers[t];null==i||i.forEach(function(t){return t(e)})},e.addEventListener=function(t,e){var i=this.handlers[t];return i||(i=this.handlers[t]=[]),eW(i,e),function(){eX(i,e)}},e.removeEventListener=function(t,e){var i=this.handlers[t];i&&eX(i,e)},e.onClick=function(t){for(var e,i=t.x,r=t.y,n=[],a=iD(this.engine.compositions);!(e=a()).done;){var o=e.value;n.push.apply(n,[].concat(o.hitTest(i,r)))}for(var s,u=iD(n);!(s=u()).done;){var h=s.value,l=h.item.composition;if(l){var c=i2({},h,{compositionId:l.id,compositionName:l.name});h.item.emit("click",h),l.emit("click",c),this.engine.emit("click",c)}}},e.onPointerDown=function(t){this.handlePointerEvent(t,0)},e.onPointerUp=function(t){this.handlePointerEvent(t,1)},e.onPointerMove=function(t){this.handlePointerEvent(t,2)},e.handlePointerEvent=function(t,e){var i=null,r=t.x,n=t.y,a=t.width,o=t.height;if(!(2===e&&this.skipPointerMovePicking))for(var s,u=iD(this.engine.compositions);!(s=u()).done;){var h=s.value.hitTest(r,n);h.length>0&&(i=h[h.length-1])}var l=new aY;l.position.x=(r+1)/2*a,l.position.y=(n+1)/2*o,l.delta.x=t.vx*a,l.delta.y=t.vy*o;var c=l.pointerCurrentRaycast;i&&(c.point=i.position,c.item=i.item);var f="pointerdown";switch(e){case 0:f="pointerdown";break;case 1:f="pointerup";break;case 2:f="pointermove"}if(i){var d=i.item,p=d.composition;d.emit(f,l),p.emit(f,l),this.engine.emit(f,l)}},e.dispose=function(){var t=this;this.target&&(this.handlers={},Object.keys(this.nativeHandlers).forEach(function(e){var i;null==(i=t.target)||i.removeEventListener(String(e),t.nativeHandlers[e])}),this.nativeHandlers={})},t}();function a0(t){var e=t.target,i=t.clientX,r=t.clientY,n=e.getBoundingClientRect(),a=n.left,o=n.top;return{x:(i-a)/n.width*2-1,y:1-(r-o)/n.height*2}}var a1=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iR),a2=1,a3=function(){function e(t,e,i){this.transform=e,this.engine=i,this.color=t.options.previewColor;var r=this.createMaterial(),n=this.createGeometry();this.mesh=this.createMesh(n,r),this.updateMesh()}var i=e.prototype;return i.updateMesh=function(){var t=this.mesh.material,e=t.getVector2("uSize").clone(),i=t.getVector4("uPos").clone(),r=new e$,n=new i5,a=this.transform.scale.clone();this.transform.assignWorldTRS(r,n,a),e.x=a.x,e.y=a.y,i.x=r.x,i.y=r.y,i.z=r.z,t.setVector2("uSize",e),t.setVector4("uPos",i),t.setQuaternion("uQuat",n)},i.createMaterial=function(){var e=[["ENV_EDITOR",this.engine.env===az]],i=aW(this.color).getValue(0),r={shader:{vertex:"\nprecision highp float;\n\nattribute vec2 aPoint;\nuniform vec4 uPos;\nuniform vec2 uSize;\nuniform vec4 uQuat;\nuniform vec4 uColor;\nuniform mat4 effects_ObjectToWorld;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_MatrixVP;\nvarying vec4 vColor;\n\nvec3 rotateByQuat(vec3 a, vec4 quat){\n vec3 qvec = quat.xyz;\n vec3 uv = cross(qvec, a);\n vec3 uuv = cross(qvec, uv) * 2.;\n return a +(uv * 2. * quat.w + uuv);\n}\n\nvoid main() {\n vec4 _pos = uPos;\n vec3 point = rotateByQuat(vec3(aPoint.xy * uSize, 0.),uQuat);\n vec4 pos = vec4(_pos.xyz, 1.0);\n pos = effects_ObjectToWorld * pos;\n pos.xyz += effects_MatrixInvV[0].xyz * point.x+ effects_MatrixInvV[1].xyz * point.y;\n gl_Position = effects_MatrixVP * pos;\n vColor = uColor;\n}\n",fragment:"\nprecision highp float;\n\n#define fragColor gl_FragColor\n\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vColor*vColor.a;\n}\n",glslVersion:t.GLSLVersion.GLSL1,macros:e}},n=nh.create(this.engine,r);return n.blending=!0,n.depthTest=!1,n.setVector4("uPos",new e0(0,0,0,0)),n.setVector2("uSize",new eJ(1,1)),n.setVector4("uColor",new e0(i[0]/255,i[1]/255,i[2]/255,i[3])),n.setQuaternion("uQuat",new i5(0,0,0,0)),n},i.createGeometry=function(){var t=new Uint8Array([0,1,1,2,2,3,3,0]);return ng.create(this.engine,{attributes:{aPoint:{size:2,offset:0,stride:2*Float32Array.BYTES_PER_ELEMENT,data:new Float32Array([-.5,.5,.5,.5,.5,-.5,-.5,-.5])}},drawCount:t.length,indices:{data:t},mode:rL.LINES,maxVertex:4})},i.createMesh=function(t,e){return nA.create(this.engine,{name:"Interact_preview"+a2++,priority:0,worldMatrix:rO.fromIdentity(),geometry:t,material:e})},e}();function a4(t,e){var i=1e-5*(e||1);return t&&Math.abs(t.vx||0)<i&&Math.abs(t.vy||0)<i}t.InteractComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.downgrade=.95,t.speed=25,t.dragRatio=[1,1],t.dragRange={dxRange:[0,0],dyRange:[0,0]},t.invalidBorderRange=0,t.invalidByBorderRange=!1,t.duringPlay=!1,t._interactive=!0,t.lastTime=-1,t.getHitTestParams=function(e){if(t.clickable){var i=t.item.props.content.options.behavior,r=t.getBoundingBox();if(r)return{type:r.type,triangles:r.area,behavior:i}}},t}iN(i,e);var r=i.prototype;return r.getDragRangeX=function(){return this.dragRange.dxRange},r.setDragRangeX=function(t,e){this.dragRange.dxRange=[t,e]},r.getDragRangeY=function(){return this.dragRange.dyRange},r.setDragRangeY=function(t,e){this.dragRange.dyRange=[t,e]},r.onStart=function(){var t=this.item.engine.env,e=this.interactData.options,i=e.type,r=e.showPreview;i===tB.CLICK&&(this.clickable=!0,r&&t===az&&(this.previewContent=new a3(this.item.props.content,this.transform,this.engine))),this.previewContent&&(this.previewContent.mesh.item=this.item,this.materials=this.previewContent.mesh.materials),this.item.getHitTestParams=this.getHitTestParams},r.onDisable=function(){e.prototype.onDisable.call(this),this.item&&this.item.composition&&(this.duringPlay&&!this.item.transform.getValid()&&this.item.composition.getSpeed()>0&&(this.item.composition.removeInteractiveItem(this.item,this.item.props.content.options.type),this.duringPlay=!1),this.clickable=!1,this.endDragTarget())},r.onEnable=function(){e.prototype.onEnable.call(this);var t=this.interactData.options.type,i=this.item.engine.env;if(t===tB.CLICK)this.clickable=!0;else if(t===tB.DRAG){var r=this.interactData.options,n=r.enableInEditor;if(i!==az||n){var a,o=(null!=(a=this.item.composition)?a:{}).event;o&&this.beginDragTarget(r,o)}}},r.onUpdate=function(t){var e;if(this.duringPlay=!0,this.lastTime<=this.item.time){if(this.item.time>=0&&this.lastTime<0){var i,r=this.item.props.content.options;null==(i=this.item.composition)||i.addInteractiveItem(this.item,r.type)}}else if(this.item.time>=0&&t>0){var n,a=this.item.props.content.options;null==(n=this.item.composition)||n.addInteractiveItem(this.item,a.type)}this.lastTime=this.item.time,null==(e=this.previewContent)||e.updateMesh(),this.dragEvent&&this.bouncingArg&&(this.bouncingArg.vx*=this.downgrade,this.bouncingArg.vy*=this.downgrade,this.bouncingArg.dy+=this.bouncingArg.vy,this.bouncingArg.dx+=this.bouncingArg.vx,a4(this.bouncingArg)?(this.dragEvent=null,this.bouncingArg=null):this.handleDragMove(this.dragEvent,this.bouncingArg))},r.render=function(t){this.previewContent&&this.previewContent.mesh.render(t)},r.onDestroy=function(){var t;null==(t=this.previewContent)||t.mesh.dispose()},r.endDragTarget=function(){},r.handleDragMove=function(t,e){if((null==t?void 0:t.cameraParam)&&this.canInteract()&&this.item.composition){var i,r,n=t.cameraParam,a=n.position,o=n.fov,s=e.dy,u=e.dx*e.width/e.height,h=a[2],l=Math.tan(o*Math.PI/180/2)*Math.abs(h),c=this.dragRange,f=c.dxRange,d=c.dyRange,p=a[0]-this.dragRatio[0]*(u*l),m=a[1]-this.dragRatio[1]*(s*l),v=f[0],y=f[1],g=d[0],x=d[1];p=eK(p,v,y),m=eK(m,g,x),p!==v&&p!==y&&v!==y&&(null==(i=e.origin)||i.preventDefault()),m!==g&&m!==x&&g!==x&&(null==(r=e.origin)||r.preventDefault()),this.item.composition.camera.position=new e$(p,m,h)}},r.beginDragTarget=function(t,e){var r,n=this;if("camera"===t.target){var a={touchstart:function(t){if(n.canInteract()&&(n.invalidByBorderRange=n.checkInvalidBorderRange({x:t.x,y:t.y}),!n.invalidByBorderRange)){n.dragEvent=null,n.bouncingArg=null;var e,i=null==(e=n.item.composition)?void 0:e.camera;r={x:t.x,y:t.y,cameraParam:{position:(null==i?void 0:i.position.toArray())||[0,0,8],fov:(null==i?void 0:i.fov)||60}}}},touchmove:function(t){n.invalidByBorderRange||(n.handleDragMove(r,t),n.bouncingArg=t)},touchend:function(t){if(n.canInteract()){var e=n.bouncingArg;!a4(e,3)&&e&&(e.vx*=n.speed,e.vy*=n.speed,n.dragEvent=i2({},r)),r=null}}};Object.keys(a).forEach(function(t){e.addEventListener(t,a[t])}),a.touchmove({dx:0,dy:0,width:1,height:1}),this.item.getComponent(i).endDragTarget=function(){Object.keys(a).forEach(function(t){e.removeEventListener(t,a[t])})}}},r.getBoundingBox=function(){var e=this.transform.getWorldMatrix(),i=ar(e$.ZERO,.5*this.transform.size.x,.5*this.transform.size.y);return i.forEach(function(t){e.transformPoint(t.p0),e.transformPoint(t.p1),e.transformPoint(t.p2)}),{type:t.HitTestType.triangle,area:i}},r.fromData=function(t){if(e.prototype.fromData.call(this,t),this.interactData=t,t.options.type===tB.DRAG){var i=t.options;i.dxRange&&(this.dragRange.dxRange=i.dxRange),i.dyRange&&(this.dragRange.dyRange=i.dyRange)}},r.canInteract=function(){var t;return!!(null==(t=this.item.composition)?void 0:t.interactive)&&this._interactive},r.checkInvalidBorderRange=function(t){var e=this.invalidBorderRange;if(e){var i,r,n,a,o=0,s=0,u=0,h=0;if("number"==typeof e?(o=e,s=e,u=e,h=e):iv(e)&&(o=void 0===(i=e[0])?0:i,s=void 0===(r=e[1])?0:r,u=void 0===(n=e[2])?0:n,h=void 0===(a=e[3])?0:a),t.x<h-1||t.x>1-s||t.y<o-1||t.y>1-u)return!0}return!1},rC(i,[{key:"interactive",get:function(){return this._interactive},set:function(t){this._interactive=t,t||(this.bouncingArg=null)}}]),i}(rA),t.InteractComponent=ek([iU(el.InteractComponent)],t.InteractComponent);var a5=function(){function e(){this.triangles=[],this.worldMatrix=new rO,this.assemblyTriangles=function(t,e,i,r,n){for(var a=i;a<r;a+=3){var o=3*e[a],s=3*e[a+1],u=3*e[a+2],h={x:t[o],y:t[o+1],z:t[o+2]},l={x:t[s],y:t[s+1],z:t[s+2]},c={x:t[u],y:t[u+1],z:t[u+2]};n.push({p0:h,p1:l,p2:c})}}}var i=e.prototype;return i.getBoundingBoxData=function(){return this.applyWorldMatrix(this.boundingBoxData.area),this.boundingBoxData},i.getBoundingBox=function(){for(var e,i=-Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=iD(this.boundingBoxData.area);!(e=o()).done;){var s=e.value;i=Math.max(s.p0.x,s.p1.x,s.p2.x,i),r=Math.max(s.p0.y,s.p1.y,s.p2.y,r),n=Math.min(s.p0.x,s.p1.x,s.p2.x,n),a=Math.min(s.p0.y,s.p1.y,s.p2.y,a)}var u=[],h=new e$(n,r,0),l=new e$(i,r,0),c=new e$(i,a,0),f=new e$(n,a,0);return u.push({p0:h,p1:l,p2:c}),u.push({p0:h,p1:c,p2:f}),this.applyWorldMatrix(u),{type:t.HitTestType.triangle,area:u}},i.setGeometry=function(e,i){this.triangles=this.geometryToTriangles(e);for(var r,n=[],a=iD(this.triangles);!(r=a()).done;){var o=r.value;n.push({p0:o.p0,p1:o.p1,p2:o.p2})}i&&this.worldMatrix.copyFrom(i),this.boundingBoxData={type:t.HitTestType.triangle,area:n}},i.geometryToTriangles=function(t){var e=t.getIndexData(),i=t.getAttributeData("aPos"),r=[];if(!e||!i)return r;if(0===t.subMeshes.length)this.assemblyTriangles(i,e,0,e.length,r);else for(var n,a=iD(t.subMeshes);!(n=a()).done;){var o=n.value;if(void 0!==o.indexCount){var s=e.BYTES_PER_ELEMENT,u=o.offset/s,h=u+o.indexCount;this.assemblyTriangles(i,e,u,h,r)}}return r},i.applyWorldMatrix=function(t){var e=this;return t.forEach(function(t){t.p0=e.worldMatrix.transformPoint(t.p0,new e$),t.p1=e.worldMatrix.transformPoint(t.p1,new e$),t.p2=e.worldMatrix.transformPoint(t.p2,new e$)}),t},e}(),a6=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="sprite",e}return iN(e,t),e}(iR),a8=function(){function t(){this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1,this.duration=0,this.destroyed=!1,this.playState=0,this.time=0}var e=t.prototype;return e.play=function(){switch(this.playState){case 0:break;case 1:this.playState=0,this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1}},e.pause=function(){0===this.playState&&(this.playState=1,this.onPlayablePauseFlag=!0,this.onPlayablePlayFlag=!1)},e.setTime=function(t){this.time=t},e.getTime=function(){return this.time},e.setDuration=function(t){this.duration=t},e.getDuration=function(){return this.duration},e.getPlayState=function(){return this.playState},e.prepareFrame=function(t){},e.processFrame=function(t){},e.onPlayableDestroy=function(){},e.dispose=function(){this.destroyed||(this.onPlayableDestroy(),this.destroyed=!0)},t}(),a9=function(){function t(){this.context={deltaTime:0,output:this}}var e=t.prototype;return e.setUserData=function(t){this.userData=t},e.getUserData=function(){return this.userData},e.prepareFrame=function(){},e.processFrame=function(){},t}(),a7=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iW);function ot(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}t.PlayState=void 0,(tC=t.PlayState||(t.PlayState={}))[tC.Playing=0]="Playing",tC[tC.Paused=1]="Paused";var oe=new i5,oi=new e$,or=new e$,on=1,oa=function(){function t(t,e){void 0===t&&(t={}),this.taggedProperties={},this.position=new e$(0,0,0),this.quat=new i5(0,0,0,1),this.rotation=new nb(0,0,0),this.scale=new e$(1,1,1),this.anchor=new e$(0,0,0),this.size=new eJ(1,1),this.children=[],this.worldMatrix=rO.fromIdentity(),this.localMatrix=rO.fromIdentity(),this.valid=!0,this.dirtyFlags={localData:!1,localMatrix:!1,worldMatrix:!1,parentMatrix:!1},this.worldTRSCache={position:new e$(0,0,0),quat:new i5(0,0,0,1),scale:new e$(1,1,1)},this.name="transform_"+on++,t&&this.setTransform(t),e&&(this.parentTransform=e),void 0!==t.valid&&this.setValid(t.valid)}var e=t.prototype;return e.setPosition=function(t,e,i){(this.position.x!==t||this.position.y!==e||this.position.z!==i)&&(this.position.x=t,this.position.y=e,this.position.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.translate=function(t,e,i){(0!==t||0!==e||0!==i)&&(this.position.x+=t,this.position.y+=e,this.position.z+=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setRotation=function(t,e,i){(this.rotation.x!==t||this.rotation.y!==e||this.rotation.z!==i)&&(this.rotation.x=t,this.rotation.y=e,this.rotation.z=i,this.quat.setFromEuler(this.rotation),this.quat.conjugate(),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setQuaternion=function(t,e,i,r){(this.quat.x!==t||this.quat.y!==e||this.quat.z!==i||this.quat.w!==r)&&(this.quat.x=t,this.quat.y=e,this.quat.z=i,this.quat.w=r,this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setScale=function(t,e,i){(this.scale.x!==t||this.scale.y!==e||this.scale.z!==i)&&(this.scale.x=t,this.scale.y=e,this.scale.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setSize=function(t,e){(this.size.x!==t||this.size.y!==e)&&(this.size.x=t,this.size.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.rotateByQuat=function(t){this.quat.multiply(t),this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.scaleBy=function(t,e,i){this.scale.x*=t,this.scale.y*=e,this.scale.z*=i,this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setAnchor=function(t,e){(this.anchor.x!==t||this.anchor.y!==e)&&(this.anchor.x=t,this.anchor.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setTransform=function(t,e){var i=t.position,r=t.rotation,n=t.scale,a=t.size,o=t.quat,s=t.name,u=t.anchor;if(s&&(this.name=s),i&&(eF(i,e$)?this.setPosition(i.x,i.y,i.z):this.setPosition(i[0],i[1],i[2])),o)eF(o,i5)?this.setQuaternion(o.x,o.y,o.z,o.w):this.setQuaternion(o[0],o[1],o[2],o[3]);else if(r){var h=e?-1:1;eF(r,nb)?this.setRotation(r.x*h,r.y*h,r.z*h):this.setRotation(r[0]*h,r[1]*h,r[2]*h)}n&&(eF(n,e$)?this.setScale(n.x,n.y,n.z):this.setScale(n[0],n[1],n[2])),a&&this.setSize(a.x,a.y),u&&(eF(u,eJ)?this.setAnchor(u.x,u.y):this.setAnchor(u[0],u[1]))},e.addChild=function(t){eW(this.children,t)},e.removeChild=function(t){eX(this.children,t)},e.getRotation=function(){return t.getRotation(this.quat,new nb)},e.getQuaternion=function(){return this.quat},e.updateLocalMatrix=function(){this.valid?(this.dirtyFlags.localData&&(this.localMatrix.compose(this.position,this.quat,this.scale,this.anchor),this.dirtyFlags.localMatrix=!0),this.dirtyFlags.localData=!1):this.localMatrix.isIdentity()||(this.localMatrix.identity(),this.dirtyFlags.localMatrix=!0)},e.getMatrix=function(){return this.updateLocalMatrix(),this.localMatrix},e.getParentMatrix=function(){return this.parent&&(this.parentMatrix=this.parent.getWorldMatrix(),this.dirtyFlags.parentMatrix=this.dirtyFlags.parentMatrix||this.parent.dirtyFlags.localMatrix||this.parent.dirtyFlags.worldMatrix),this.parentMatrix},e.getWorldMatrix=function(){var t=this.getMatrix(),e=this.getParentMatrix();return(this.dirtyFlags.localMatrix||this.dirtyFlags.parentMatrix)&&(e?this.worldMatrix.multiplyMatrices(e,t):this.worldMatrix.copyFrom(t),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix=!1,this.dirtyFlags.parentMatrix=!1),this.worldMatrix},e.getWorldScale=function(){var t=this.worldTRSCache;return this.dirtyFlags.worldMatrix&&(this.getWorldMatrix().decompose(t.position,t.quat,t.scale),this.dirtyFlags.worldMatrix=!1),this.worldTRSCache.scale.clone()},e.getWorldPosition=function(){return this.updateTRSCache(),this.worldTRSCache.position.clone()},e.setWorldPosition=function(t,e,i){var r=this.getParentMatrix();r?(oi.set(0,0,0),oe.set(0,0,0,1),or.set(1,1,1),r.decompose(oi,oe,or),oi.set(t-oi.x,e-oi.y,i-oi.z),oe.invert(),oi.applyQuaternion(oe),oi.x=0!==or.x?oi.x/or.x:0,oi.y=0!==or.y?oi.y/or.y:0,oi.z=0!==or.z?oi.z/or.z:0,this.setPosition(oi.x,oi.y,oi.z)):this.setPosition(t,e,i)},e.getWorldRotation=function(){return this.updateTRSCache(),t.getRotation(this.worldTRSCache.quat,new nb)},e.assignWorldTRS=function(t,e,i){this.updateTRSCache(),t&&t.copyFrom(this.worldTRSCache.position),e&&e.copyFrom(this.worldTRSCache.quat),i&&i.copyFrom(this.worldTRSCache.scale)},e.cloneFromMatrix=function(t,e){t.decompose(this.position,this.quat,this.scale),this.rotation.setFromQuaternion(this.quat.clone().conjugate()),e&&e.copyFrom(this.scale),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setValid=function(t){this.valid!==t&&(this.valid=t,t?this.dirtyFlags.localData=!0:(this.localMatrix.identity(),this.dirtyFlags.localMatrix=!0),this.dispatchValueChange())},e.getValid=function(){return this.valid},e.toData=function(){var t=this.taggedProperties;return t.position=this.position.clone(),t.eulerHint={x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},t.scale=this.scale.clone(),t},e.fromData=function(t){var e={};e.position=new e$().copyFrom(t.position),t.quat?e.quat=new i5(t.quat.x,t.quat.y,t.quat.z,t.quat.w):e.rotation=new nb(t.eulerHint.x,t.eulerHint.y,t.eulerHint.z),e.scale=new e$().copyFrom(t.scale),t.size&&(e.size=new eJ().copyFrom(t.size)),t.anchor&&(e.anchor=new eJ().copyFrom(t.anchor)),this.setTransform(e)},e.dispose=function(){},e.updateTRSCache=function(){var t=this.getWorldMatrix();if(this.dirtyFlags.worldMatrix){var e=this.worldTRSCache;t.decompose(e.position,e.quat,e.scale),this.dirtyFlags.worldMatrix=!1}},e.dispatchValueChange=function(){this.children.forEach(function(t){t.parentMatrixDirty=!0})},t.getRotation=function(t,e){var i=oe.copyFrom(t);return i.conjugate(),e.setFromQuaternion(i)},rC(t,[{key:"parentTransform",get:function(){return this.parent},set:function(t){t&&this.parent!==t&&this!==t&&(this.parent&&this.parent.removeChild(this),t.addChild(this),this.parent=t,this.parentMatrixDirty=!0)}},{key:"parentMatrixDirty",get:function(){return this.dirtyFlags.parentMatrix},set:function(t){this.dirtyFlags.parentMatrix!==t&&(this.dirtyFlags.parentMatrix=t,this.dispatchValueChange())}}]),t}(),oo=new e$(1,1,1),os=function(){function t(t,e){void 0===e&&(e={}),this.name=t,this.transform=new oa,this.pixelWidth=0,this.pixelHeight=0,this.viewportMatrix=rO.fromIdentity(),this.viewMatrix=rO.fromIdentity(),this.projectionMatrix=rO.fromIdentity(),this.viewProjectionMatrix=rO.fromIdentity(),this.inverseViewMatrix=rO.fromIdentity(),this.dirty=!0;var i=e.near,r=e.far,n=e.fov,a=e.aspect,o=e.clipMode,s=void 0===o?tY.portrait:o,u=e.position,h=void 0===u?[0,0,8]:u,l=e.rotation,c=void 0===l?[0,0,0]:l,f=e.pixelWidth,d=e.pixelHeight,p=new nb(c[0],c[1],c[2]),m=new i5().setFromEuler(p);this.options={near:void 0===i?.1:i,far:void 0===r?20:r,fov:void 0===n?60:n,aspect:void 0===a?1:a,clipMode:s},this.pixelWidth=void 0===f?0:f,this.pixelHeight=void 0===d?0:d,this.transform.setPosition(h[0],h[1],h[2]),this.transform.setQuaternion(m.x,m.y,m.z,m.w),this.dirty=!0,this.updateMatrix()}var e=t.prototype;return e.setTransform=function(t){this.transform.parentTransform=t.parentTransform,this.transform.cloneFromMatrix(t.getMatrix()),this.dirty=!0},e.setViewportMatrix=function(t){this.viewportMatrix=t.clone(),this.dirty=!0},e.getViewportMatrix=function(){return this.viewportMatrix},e.getViewMatrix=function(){return this.updateMatrix(),this.viewMatrix.clone()},e.getInverseViewMatrix=function(){return this.updateMatrix(),this.inverseViewMatrix.clone()},e.getProjectionMatrix=function(){return this.updateMatrix(),this.projectionMatrix.clone()},e.getInverseProjectionMatrix=function(){var t;return this.updateMatrix(),null==(t=this.inverseProjectionMatrix)?void 0:t.clone()},e.getViewProjectionMatrix=function(){return this.updateMatrix(),this.viewProjectionMatrix.clone()},e.getInverseViewProjectionMatrix=function(){return this.updateMatrix(),this.inverseViewProjectionMatrix||(this.inverseViewProjectionMatrix=this.viewProjectionMatrix.clone(),this.inverseViewProjectionMatrix.invert()),this.inverseViewProjectionMatrix.clone()},e.getModelViewProjection=function(t,e){return t.multiplyMatrices(this.viewProjectionMatrix,e)},e.getInverseVPRatio=function(t){var e=new e$(this.position.x,this.position.y,t),i=this.getViewProjectionMatrix(),r=this.getInverseViewProjectionMatrix();if(!this.viewportMatrix.isIdentity()){var n=this.viewportMatrix.clone();r.premultiply(n),i.multiply(n.invert())}var a=i.projectPoint(e).z,o=r.projectPoint(new e$(1,1,a)),s=o.x,u=o.y,h=r.projectPoint(new e$(-1,-1,a));return new e$((s-h.x)/2,(u-h.y)/2,0)},e.setQuat=function(t){this.transform.getQuaternion().equals(t)||(this.transform.setQuaternion(t.x,t.y,t.z,t.w),this.dirty=!0)},e.getQuat=function(){return this.transform.quat.clone()},e.getOptions=function(){return i2({},this.options,{position:this.position.clone(),rotation:this.rotation.clone()})},e.copy=function(t){var e=t.near,i=t.far,r=t.fov,n=t.clipMode,a=t.aspect,o=t.position,s=t.rotation;this.near=e,this.far=i,this.fov=r,this.clipMode=n,this.aspect=a,this.position=o,this.rotation=s,this.updateMatrix()},e.updateMatrix=function(){if(this.dirty){var t,e=this.options,i=e.fov,r=e.aspect,n=e.near,a=e.far,o=e.clipMode;this.projectionMatrix.perspective(i*eY,r,n,a,o===tY.portrait),this.projectionMatrix.premultiply(this.viewportMatrix),this.inverseViewMatrix.compose(this.position,this.getQuat(),oo),this.inverseViewMatrix.premultiply(null!=(t=this.transform.getParentMatrix())?t:rO.IDENTITY),this.viewMatrix.copyFrom(this.inverseViewMatrix).invert(),this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix,this.viewMatrix),this.inverseViewProjectionMatrix=null,this.dirty=!1}},e.worldToScreenPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e$,r=this.getViewProjectionMatrix();return i.set(t.x,t.y,t.z),r.projectPoint(i,i),i.x=(i.x+1)*.5*this.pixelWidth,i.y=(i.y+1)*.5*this.pixelHeight,i.z=(i.z+1)*.5,i},e.screenToWorldPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e$,r=this.getInverseViewProjectionMatrix(),n=t.x/this.pixelWidth*2-1,a=t.y/this.pixelHeight*2-1,o=2*t.z-1;return i.set(n,a,o),r.projectPoint(i,i),i},rC(t,[{key:"near",get:function(){return this.options.near},set:function(t){this.options.near!==t&&(this.options.near=t,this.dirty=!0)}},{key:"far",get:function(){return this.options.far},set:function(t){this.options.far!==t&&(this.options.far=t,this.dirty=!0)}},{key:"fov",get:function(){return this.options.fov},set:function(t){this.options.fov!==t&&(this.options.fov=t,this.dirty=!0)}},{key:"aspect",get:function(){return this.options.aspect},set:function(t){this.options.aspect!==t&&(this.options.aspect=t,this.dirty=!0)}},{key:"clipMode",get:function(){return this.options.clipMode},set:function(t){void 0!==t&&this.options.clipMode!==t&&(this.options.clipMode=t,this.dirty=!0)}},{key:"position",get:function(){return this.transform.position.clone()},set:function(t){this.transform.position.equals(t)||(this.transform.setPosition(t.x,t.y,t.z),this.dirty=!0)}},{key:"worldPosition",get:function(){return this.transform.getWorldPosition()}},{key:"rotation",get:function(){return this.transform.rotation.clone()},set:function(t){this.transform.rotation.equals(t)||(this.transform.setRotation(t.x,t.y,t.z),this.dirty=!0)}}]),t}(),ou=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=oh(this.arc,this.arcMode,t)*eY,i=new e$(Math.cos(e)*this.radius,Math.sin(e)*this.radius,0),r=Math.tan(this.angle*eY),n=i.clone().multiply(r);return n.z+=1,{position:i.multiply(iT(0,1)),direction:n.normalize()}},t}();function oh(t,e,i){if(e===tJ.RANDOM)t=iT(0,t);else if(e===tJ.UNIDIRECTIONAL_CYCLE){var r=i.index%(i.total+1);t=t/i.total*r}else if(e===tJ.BIDIRECTIONAL_CYCLE){var n=i.index/(i.total+1),a=n-Math.floor(n);t*=Math.floor(n)%2?1-a:a}else e===tJ.UNIFORM_BURST&&(t=t*i.burstIndex/i.burstCount);return t}var ol=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=oh(this.arc,this.arcMode,t)*eY,i=new e$(Math.cos(e),Math.sin(e),0),r=this.radius;return{direction:i,position:i.clone().multiply(r)}},t}(),oc=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2}return t.prototype.generate=function(t){var e=iT(-this._d,this._d),i=iT(-this._h,this._h);return{direction:new e$(0,0,1),position:new e$(e,i,0)}},t}(),of=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2,this.arcMode=t.arcMode,this.arc=t.arc}return t.prototype.generate=function(t){var e=oh(this.arc,this.arcMode,t)*eY,i=new e$(Math.cos(e),Math.sin(e),0),r=this._d,n=this._h,a=Math.atan2(n,r),o=Math.tan(e),s=new e$;return e<a?s.set(r,r*o,0):e>=a&&e<Math.PI-a?s.set(n/o,n,0):e<Math.PI+a?s.set(-r,-r*o,0):e<2*Math.PI-a?s.set(-n/o,-n,0):s.set(r,r*o,0),{direction:i,position:s}},t}(),od=function(){function t(t){this._d=t.width||1,this.arcMode=t.arcMode}return t.prototype.generate=function(t){var e=this.arcMode===tJ.UNIFORM_BURST?t.burstIndex%t.burstCount/(t.burstCount-1):iT(0,1);return{direction:new e$(0,1,0),position:new e$(this._d*(e-.5),0,0)}},t}(),op=new rO,om=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=this.donutRadius,i=this.radius-e,r=iT(0,2*Math.PI),n=oh(this.arc,this.arcMode,t)*eY,a=op.setFromRotationZ(n),o=new e$(Math.cos(r),Math.sin(r),0),s=new e$(i+Math.cos(r)*e,0,Math.sin(r)*e);return{direction:a.transformNormal(o),position:a.transformPoint(s)}},t}(),ov=new rO,oy=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}var e=t.prototype;return e.getHorizontalAngle=function(){return iT(-90,90)},e.generate=function(t){var e=oh(this.arc,this.arcMode,t)*eY,i=this.getHorizontalAngle()*eY,r=this.radius,n=new e$(Math.cos(i),0,Math.sin(i)),a=ov.setFromRotationZ(e).transformNormal(n);return{position:a.clone().multiply(r),direction:a}},t}(),og=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.getHorizontalAngle=function(){return iT(0,90)},e}(oy),ox=function(){function t(t){var e=t.detail||{anchors:[.5,.5],block:[0,0]};this.anchors=new Float32Array(e.anchors),this.width=t.width||1,this.height=t.height||1,this.block=e.block,this.arcMode=t.arcMode,this.random=eK(t.random||0,0,1)}return t.prototype.generate=function(t){var e=this.anchors,i=Math.floor(oh(e.length/2-1,this.arcMode,t)),r=(e[2*i]+this.block[0]*this.random*Math.random())%1-.5,n=(e[2*i+1]+this.block[1]*this.random*Math.random())%1-.5,a=new e$(r,n,0);return{position:new e$(r*this.width,n*this.height,0),direction:a.normalize()}},t}(),ob=function(){function t(){}return t.prototype.generate=function(){return{position:new e$,direction:new e$}},t}(),oT=((eC={})[tk.NONE]=ob,eC[tk.CONE]=ou,eC[tk.SPHERE]=oy,eC[tk.HEMISPHERE]=og,eC[tk.CIRCLE]=ol,eC[tk.DONUT]=om,eC[tk.RECTANGLE]=oc,eC[tk.EDGE]=od,eC[tk.RECTANGLE_EDGE]=of,eC[tk.TEXTURE]=ox,eC);function o_(t){if(!t)return new ob;var e=i2({radius:1,arc:360,angle:0,arcMode:tJ.RANDOM},t),i=t.type,r=oT[i];if(!r)throw Error("Invalid shape: "+i+".");var n=new r(e);if(i!==tk.NONE){var a=t.alignSpeedDirection,o=t.upDirection;n.alignSpeedDirection=a,n.upDirection=e$.fromArray(void 0===o?[0,0,1]:o).normalize()}return n}function oE(t,e,i,r,n){var a,o;if(n===function(t,e,i,r){for(var n=0,a=e,o=i-r;a<i;a+=r)n+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return n}(t,e,i,r)>0)for(a=e;a<i;a+=r)o=oV(a,t[a],t[a+1],o);else for(a=i-r;a>=e;a-=r)o=oV(a,t[a],t[a+1],o);return o&&oI(o,o.next)&&(oF(o),o=o.next),o}function oC(t,e){if(!t)return t;e||(e=t);var i,r=t;do if(i=!1,!r.steiner&&(oI(r,r.next)||0===oM(r.prev,r,r.next))){if(oF(r),(r=e=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function ow(t,e){return t.x-e.x}function oS(t,e,i,r,n){return(t=((t=((t=((t=((t=32767*(t-i)*n)|t<<8)&16711935)|t<<4)&252645135)|t<<2)&858993459)|t<<1)&1431655765)|(e=((e=((e=((e=((e=32767*(e-r)*n)|e<<8)&16711935)|e<<4)&252645135)|e<<2)&858993459)|e<<1)&1431655765)<<1}function oA(t,e,i,r,n,a,o,s){return(n-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(r-s)-(i-o)*(e-s)>=0&&(i-o)*(a-s)-(n-o)*(r-s)>=0}function oM(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function oI(t,e){return t.x===e.x&&t.y===e.y}function oP(t,e,i,r){var n=oO(oM(t,e,i)),a=oO(oM(t,e,r)),o=oO(oM(i,r,t)),s=oO(oM(i,r,e));return!!(n!==a&&o!==s||0===n&&oR(t,i,e)||0===a&&oR(t,r,e)||0===o&&oR(i,t,r)||0===s&&oR(i,e,r))}function oR(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function oO(t){return t>0?1:t<0?-1:0}function oN(t,e){return 0>oM(t.prev,t,t.next)?oM(t,e,t.next)>=0&&oM(t,t.prev,e)>=0:0>oM(t,e,t.prev)||0>oM(t,t.next,e)}function oL(t,e){var i=new oD(t.i,t.x,t.y),r=new oD(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function oV(t,e,i,r){var n=new oD(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function oF(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function oD(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ok=0;function oz(t,e,i,r){i=i||2,ok=r||0;var n,a,o,s,u,h,l,c=e&&e.length,f=c?e[0]*i:t.length,d=oE(t,0,f,i,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(t,e,i,r){var n,a,o,s,u,h=[];for(n=0,a=e.length;n<a;n++)o=e[n]*r,s=n<a-1?e[n+1]*r:t.length,(u=oE(t,o,s,r,!1))===u.next&&(u.steiner=!0),h.push(function(t){var e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}(u));for(h.sort(ow),n=0;n<h.length;n++)(function(t,e){if(e=function(t,e){var i,r,n,a=e,o=t.x,s=t.y,u=-1/0;do{if(s<=a.y&&s>=a.next.y&&a.next.y!==a.y){var h=a.x+(s-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(h<=o&&h>u){if(u=h,h===o){if(s===a.y)return a;if(s===a.next.y)return a.next}n=a.x<a.next.x?a:a.next}}a=a.next}while(a!==e);if(!n)return null;if(o===u)return n;var l,c=n,f=n.x,d=n.y,p=1/0;a=n;do o>=a.x&&a.x>=f&&o!==a.x&&oA(s<d?o:u,s,f,d,s<d?u:o,s,a.x,a.y)&&(l=Math.abs(s-a.y)/(o-a.x),oN(a,t)&&(l<p||l===p&&(a.x>n.x||a.x===n.x&&(i=n,r=a,0>oM(i.prev,i,r.prev)&&0>oM(r.next,i,i.next))))&&(n=a,p=l)),a=a.next;while(a!==c);return n}(t,e)){var i=oL(e,t);oC(e,e.next),oC(i,i.next)}})(h[n],i),i=oC(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],a=s=t[1];for(var m=i;m<f;m+=i)u=t[m],h=t[m+1],u<n&&(n=u),h<a&&(a=h),u>o&&(o=u),h>s&&(s=h);l=0!==(l=Math.max(o-n,s-a))?1/l:0}return function t(e,i,r,n,a,o,s){if(e){!s&&o&&function(t,e,i,r){var n=t;do null===n.z&&(n.z=oS(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,a,o,s,u,h=1;do{for(i=t,t=null,a=null,o=0;i;){for(o++,r=i,s=0,e=0;e<h&&(s++,r=r.nextZ);e++);for(u=h;s>0||u>0&&r;)0!==s&&(0===u||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,u--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=r}a.nextZ=null,h*=2}while(o>1)}(n)}(e,n,a,o);for(var u,h,l=e;e.prev!==e.next;){if(u=e.prev,h=e.next,o?function(t,e,i,r){var n=t.prev,a=t.next;if(oM(n,t,a)>=0)return!1;for(var o=n.x<t.x?n.x<a.x?n.x:a.x:t.x<a.x?t.x:a.x,s=n.y<t.y?n.y<a.y?n.y:a.y:t.y<a.y?t.y:a.y,u=n.x>t.x?n.x>a.x?n.x:a.x:t.x>a.x?t.x:a.x,h=n.y>t.y?n.y>a.y?n.y:a.y:t.y>a.y?t.y:a.y,l=oS(o,s,e,i,r),c=oS(u,h,e,i,r),f=t.prevZ,d=t.nextZ;f&&f.z>=l&&d&&d.z<=c;){if(f!==t.prev&&f!==t.next&&oA(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&oM(f.prev,f,f.next)>=0||(f=f.prevZ,d!==t.prev&&d!==t.next&&oA(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&oM(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&oA(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&oM(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=c;){if(d!==t.prev&&d!==t.next&&oA(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&oM(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}(e,n,a,o):function(t){var e=t.prev,i=t.next;if(oM(e,t,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(oA(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&oM(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}(e)){i.push(u.i/r+ok),i.push(e.i/r+ok),i.push(h.i/r+ok),oF(e),e=h.next,l=h.next;continue}if((e=h)===l){s?1===s?t(e=function(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!oI(n,a)&&oP(n,r,r.next,a)&&oN(n,a)&&oN(a,n)&&(e.push(n.i/i+ok),e.push(r.i/i+ok),e.push(a.i/i+ok),oF(r),oF(r.next),r=t=a),r=r.next}while(r!==t);return oC(r)}(oC(e),i,r),i,r,n,a,o,2):2===s&&function(e,i,r,n,a,o){var s=e;do{for(var u,h,l=s.next.next;l!==s.prev;){if(s.i!==l.i&&(u=s,h=l,u.next.i!==h.i&&u.prev.i!==h.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&oP(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(u,h)&&(oN(u,h)&&oN(h,u)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}(u,h)&&(oM(u.prev,u,h.prev)||oM(u,h.prev,h))||oI(u,h)&&oM(u.prev,u,u.next)>0&&oM(h.prev,h,h.next)>0))){var c=oL(s,l);s=oC(s,s.next),c=oC(c,c.next),t(s,i,r,n,a,o),t(c,i,r,n,a,o);return}l=l.next}s=s.next}while(s!==e)}(e,i,r,n,a,o):t(oC(e),i,r,n,a,o,1);break}}}}(d,p,i,n,a,l),p}function oB(t,e){for(var i,r,n=t.s,a=t.p,o=n[1],s=a[1],u=0,h=0;h<o.length;h++)u+=o[h].length-1;var l,c=new Float32Array(6*u),f=e.indexBase,d=e.uvTransform,p=0,m=0,v=0,y=1,g=1;d&&(m=d[0],v=d[1],y=(l=d[4])?d[3]:d[2],g=l?d[2]:d[3]);for(var x=[0,0],b=0===l?0:-Math.PI/2,T=0;T<o.length;T++)for(var _=o[T],E=s[T],C=s[T+1]||s[0],w=[0,0],S=0;S<_.length-1;S++)(function(t,e,i,r,n,a,o,s){var u=1-e,h=u*u*u,l=3*e*u*u,c=3*e*e*u,f=e*e*e;t[0]=h*i[0]+l*n+c*o+f*r[0],t[1]=h*i[1]+l*a+c*s+f*r[1]})(w,_[S],E,C,E[4],E[5],C[2],C[3]),i=w[0],r=w[1],c[p++]=i/2,c[p++]=r/2,d?(x[0]=i,x[1]=r,oG(x,x,b),c[p++]=m+(x[0]+1)/2*y,c[p++]=v+(x[1]+1)/2*g):(c[p++]=(i+1)/2,c[p++]=(r+1)/2),p+=2;var A=oz(Array.from(c),null,6,void 0===f?0:f);return{aPoint:c,index:new Uint16Array(A)}}function oU(t,e){for(var i,r=[],n=(i=[],("gs"in t)?t.gs.forEach(function(t){i.push({p:[tZ.SHAPE_POINTS,t.p],s:[tZ.SHAPE_SPLITS,t.s]})}):("g"in t)?i.push({p:[tZ.SHAPE_POINTS,t.g.p],s:[tZ.SHAPE_SPLITS,t.g.s]}):i.push(t),i),a=0,o=0,s=0,u=0;u<n.length;u++){var h=oB(n[u],{indexBase:a,uvTransform:e});a+=h.aPoint.length/5,r.push(h),o+=h.aPoint.length,s+=h.index.length}if(1===r.length)return r[0];for(var l=new Float32Array(o),c=new Uint16Array(s),f=0,d=0,p=0;f<r[f];f++){var m=r[f];l.set(m.aPoint,d),d+=m.aPoint.length,c.set(m.index,p),p+=m.index.length}return{aPoint:l,index:c}}function oG(t,e,i){var r=Math.cos(i),n=Math.sin(i),a=e[0],o=e[1];return t[0]=r*a+n*o,t[1]=-n*a+r*o,t}var oj=function(){function t(t){var e=t.time,i=t.interval,r=t.count,n=t.cycles,a=t.probability;this.time=+e||0,this.interval=+i||1,this.count=eF(r,ax)?r:aW(r),this.cycles=+n||1/0,this.probability=isNaN(a)?1:+a,this.reset()}var e=t.prototype;return e.getGeneratorOptions=function(t,e){if(t-this.time-this.now>this.interval*this.index&&this.internalCycles>0)return this.internalCycles--,this.index++,Math.random()<=this.probability?{index:this.index,total:1/this.interval,count:this.count.getValue(e),cycleIndex:this.cycles-this.internalCycles-1}:null},e.reset=function(){this.internalCycles=this.cycles,this.index=0,this.now=0},e.clone=function(){return new t({time:this.time,interval:this.interval,count:this.count,cycles:this.cycles,probability:this.probability})},t}(),oW=function(t){this.content=t},oX=function(){function t(t){this.sort=t,this.length=0}var e=t.prototype;return e.findNodeByContent=function(t){var e=this.first;if(e)do if(t(e.content))return e;while(e=e.next)},e.insertNode=function(t,e){var i=t.next;t.next=e,e.pre=t,e.next=i,i&&(i.pre=e)},e.shiftNode=function(t){var e=new oW(t);if(this.length++,1===this.length)return this.first=this.last=e;for(var i=this.first;i;){if(!(0>=this.sort(i.content,e.content)))return i.pre?this.insertNode(i.pre,e):(this.first=e,e.next=i,i.pre=e),e;if(!i.next)return this.insertNode(i,e),this.last=e;i=i.next}},e.pushNode=function(t){var e=new oW(t);if(this.length++,1===this.length)return this.last=this.first=e;for(var i=this.last;i;){if(!(0>=this.sort(e.content,i.content)))return this.insertNode(i,e),i===this.last&&(this.last=e),e;if(this.first===i)return i.pre=e,e.next=i,this.first=e;i=i.pre}},e.removeNode=function(t){var e=this.first;if(this.length--,e===t){var i=this.first=e.next;i&&(i.pre=null)}else if((e=this.last)===t){var r=this.last=e.pre;r&&(r.next=null)}else if(t){var n=t.pre,a=t.next;n.next=a,a&&(a.pre=n)}t.pre=null,t.next=null},e.forEach=function(t,e){var i=this.first,r=0;if(i)do t.call(e||this,i.content,r++);while(i=i.next)},e.forEachReverse=function(t,e){var i=this.last,r=this.length-1;if(i)do t.call(e||this,i.content,r--);while(i=i.pre)},e.getNodeByIndex=function(t){var e=0,i=this.first;if(!i||t>=this.length||t<0)return null;for(;e<t;)i=i.next,e++;return i},t}(),oH="lookup_texture",oY="offscreen_canvas",oZ={},oq=new e$,oQ=new e$,oK=function(){function e(e,i){this.pointStart=[];var r=i.colorOverLifetime,n=i.colorOverTrail,a=i.maxTrailCount,o=i.opacityOverLifetime,s=void 0===o?aW(1):o,u=i.widthOverTrail,h=i.name,l=i.occlusion,c=i.blending,f=i.maskMode,d=i.mask,p=i.textureMap,m=i.texture,v=i.transparentOcclusion,y=i.minimumVertexDistance,g=i.lifetime,x=i.matrix,b=e.gpuCapability,T=b.detail,_=b.level,E=Math.max(i.pointCountPerTrail,2),C=aN(),w=T.maxVertexTextures>0,S=(null!=e?e:{}).env,A={},M=[["ENABLE_VERTEX_TEXTURE",w],["LOOKUP_TEXTURE_CURVE",0],["ENV_EDITOR",S===az]],I=a>64,P=0;r&&(M.push(["COLOR_OVER_LIFETIME",!0]),P|=1,A.uColorOverLifetime=r7.createWithData(e,io(r))),n&&(M.push(["COLOR_OVER_TRAIL",!0]),P|=4,A.uColorOverTrail=r7.createWithData(e,io(n))),I?(M.push(["ATTR_TRAIL_START",1]),P|=8):A.uTrailStart=new Float32Array(a),A.uOpacityOverLifetimeValue=s.toUniform(C);var R=u.toUniform(C);M.push(["VERT_CURVE_VALUE_COUNT",C.index],["VERT_MAX_KEY_FRAME_COUNT",C.max]),A.uVCurveValues=ax.getAllData(C);var O={shader:{vertex:nO,fragment:nP,macros:M,glslVersion:1===_?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,name:"trail#"+h,cacheId:"-t:+"+P+"+"+C.index+"+"+C.max}},N=E*a*2,L=(E-1)*a,V=Float32Array.BYTES_PER_ELEMENT,F=12*V,D={attributes:{aColor:{size:4,stride:F,data:new Float32Array(12*N)},aSeed:{size:1,stride:F,offset:4*V,dataSource:"aColor"},aInfo:{size:3,stride:F,offset:5*V,dataSource:"aColor"},aPos:{size:4,stride:F,offset:8*V,dataSource:"aColor"},aTime:{size:1,data:new Float32Array(N)},aDir:{size:3,data:new Float32Array(3*N)}},indices:{data:new Uint16Array(6*N)},drawCount:6*L,name:"trail#"+h,bufferUsage:rL.DYNAMIC_DRAW};if(I)D.attributes.aTrailStart={size:1,data:new Float32Array(N)};else{var k=new Float32Array(N);D.attributes.aTrailStartIndex={size:1,data:k};for(var z=0;z<a;z++)for(var B=2*E,U=z*B,G=0;G<B;G++)k[U+G]=z}var j=rk(c),W=nh.create(e,O);W.blending=!0,W.depthMask=l,W.depthTest=!0,W.stencilRef=d?[d,d]:void 0,rU(W,f),rz(W,c);var X=this.mesh=nA.create(e,{name:"MTrail_"+h,material:W,geometry:ng.create(e,D)}),H=null!=m?m:r7.createWithData(e);Object.keys(A).map(function(t){var e=A[t];if(eF(e,r7))W.setTexture(t,e);else if("uTrailStart"===t)W.setFloats("uTrailStart",e);else if("uVCurveValues"===t){for(var i=[],r=0;r<e.length;r+=4){var n=new e0(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}W.setVector4Array(t,i)}else W.setVector4(t,e0.fromArray(e))}),W.setFloat("uTime",0),W.setVector4("uWidthOverTrail",e0.fromArray(R)),W.setVector2("uTexOffset",new eJ(0,0)),W.setVector4("uTextureMap",e0.fromArray(void 0===p?[0,0,1,1]:p)),W.setVector4("uParams",new e0(0,E-1,0,0)),W.setTexture("uMaskTex",H),W.setVector4("uColorParams",new e0(m?1:0,+j,0,+(l&&!v))),this.maxTrailCount=a,this.pointCountPerTrail=E,this.checkVertexDistance=y>0,this.minimumVertexDistance=Math.pow(y||.001,2),this.useAttributeTrailStart=I,this.lifetime=g,x&&(this.mesh.worldMatrix=x),this.geometry=X.firstGeometry(),this.trailCursors=new Uint16Array(a)}var i=e.prototype;return i.addPoint=function(t,e,i){i=i||{};var r=this.trailCursors[t],n=this.pointCountPerTrail,a=this.geometry,o=n-1,s=r%n,u=(r-1)%n,h=(r-2)%n,l=this.getTrailPosition(t,u,oq);if(!(l&&this.checkVertexDistance&&(null==l?void 0:l.distanceSquared(e))<this.minimumVertexDistance)){var c=t*n+s,f=o1(l,e),d=i.time||this.time,p=[Math.random(),i.lifetime||this.lifetime,r],m=i.size||1,v=new Float32Array(6);v.set(f,0),v.set(f,3),a.setAttributeSubData("aDir",6*c,v),a.setAttributeSubData("aTime",2*c,new Float32Array([d,d]));var y=i.color||[1,1,1,1],g=new Float32Array(24),x=e.toArray();if(g.set(y,0),g.set(p,4),g[7]=0,g.set(x,8),g[11]=.5*m,g.set(y,12),g.set(p,16),g[19]=1,g.set(x,20),g[23]=-.5*m,a.setAttributeSubData("aColor",24*c,g),u>=0){var b=new Float32Array(o1(this.getTrailPosition(t,h,oQ),l,e)),T=(t*n+u)*6;a.setAttributeSubData("aDir",T,b),a.setAttributeSubData("aDir",T+3,b);var _=t*n*2,E=new Uint16Array([2*u+_,2*u+1+_,2*s+_,2*s+_,2*u+1+_,2*s+1+_]),C=(t*o+(r-1)%o)*6;a.setIndexSubData(C,E)}r=++this.trailCursors[t];var w=this.mesh.material,S=w.getVector4("uParams"),A=p[2];if(this.useAttributeTrailStart){for(var M=2*n,I=new Float32Array(M),P=0;P<M;P++)I[P]=A;a.setAttributeSubData("aTrailStart",t*I.length,I)}else{var R=w.getFloats("uTrailStart");void 0!=R&&(R[t]=A,w.setFloats("uTrailStart",R))}S&&(S.y=Math.max(S.y,r-1)-Math.max(0,r-n),w.setVector4("uParams",S))}},i.getTrailPosition=function(t,e,i){var r=this.pointCountPerTrail;if(e>=0&&e<r){var n=(t*r+e)*24+8,a=this.geometry.getAttributeData("aColor");return ih(a),i.x=a[n],i.y=a[1+n],i.z=a[2+n],i}},i.clearAllTrails=function(){var t=this.geometry.getIndexData();ih(t),this.trailCursors=new Uint16Array(this.trailCursors.length),this.geometry.setIndexData(new Uint16Array(t.length))},i.minusTime=function(t){var e=this.geometry.getAttributeData("aTime");ih(e);for(var i=0;i<e.length;i++)e[i]-=t;this.geometry.setAttributeData("aTime",e),this.time-=t},i.clearTrail=function(t){if(0!==this.trailCursors[t]){var e=(this.pointCountPerTrail-1)*6,i=this.geometry.getIndexData();ih(i),i.set(new Uint16Array(e),t*e),this.geometry.setIndexData(i),this.trailCursors[t]=0}},i.getPointStartPos=function(t){return this.pointStart[t]},i.setPointStartPos=function(t,e){this.pointStart[t]=e},i.onUpdate=function(t){},rC(e,[{key:"time",get:function(){return this.mesh.material.getFloat("uTime")||0},set:function(t){this.mesh.material.setFloat("uTime",null!=t?t:0)}}]),e}(),oJ=new e$,o$=new e$,o0=new e$;function o1(t,e,i){return t||i?(t?i?(o$.subtractVectors(e,t).normalize(),o$.subtractVectors(i,e),o0.copyFrom(o$).normalize(),oJ.addVectors(o$,o0)):oJ.subtractVectors(e,t):oJ.subtractVectors(i,e),oJ.normalize().toArray()):[0,0,0]}var o2=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.lastTime=0,t}iN(i,e);var r=i.prototype;return r.start=function(e){var i=e.output.getUserData();!this.particleSystem&&eF(i,t.VFXItem)&&(this.particleSystem=i.getComponent(t.ParticleSystem),this.particleSystem&&(this.particleSystem.name=i.name))},r.processFrame=function(t){this.time>=0&&this.start(t);var e=this.particleSystem;e&&(this.time>=0&&this.time<e.item.duration&&e.isEnded()&&e.reset(),e.update(this.time-e.time)),this.lastTime=this.time},i}(a8),o3=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new o2},e}(a7),o4={uSprite:"vec4",uParams:"vec4",uAcceleration:"vec4",uGravityModifierValue:"vec4",uOpacityOverLifetimeValue:"vec4",uRXByLifeTimeValue:"vec4",uRYByLifeTimeValue:"vec4",uRZByLifeTimeValue:"vec4",uLinearXByLifetimeValue:"vec4",uLinearYByLifetimeValue:"vec4",uLinearZByLifetimeValue:"vec4",uSpeedLifetimeValue:"vec4",uOrbXByLifetimeValue:"vec4",uOrbYByLifetimeValue:"vec4",uOrbZByLifetimeValue:"vec4",uSizeByLifetimeValue:"vec4",uSizeYByLifetimeValue:"vec4",uColorParams:"vec4",uFSprite:"vec4",uPreviewColor:"vec4",uVCurveValues:"vec4Array",uFCurveValues:"vec4",uFinalTarget:"vec3",uForceCurve:"vec4",uOrbCenter:"vec3",uTexOffset:"vec2",uPeriodValue:"vec4",uMovementValue:"vec4",uStrengthValue:"vec4",uWaveParams:"vec4"},o5=function(){function e(e,i){this.particleCount=0,this.cachedRotationVector3=new e$,this.cachedRotationMatrix=new nT,this.cachedLinearMove=new e$,this.tempMatrix3=new nT,this.VERT_MAX_KEY_FRAME_COUNT=0;var r,n,a,o,s,u,h,l,c=(null!=e?e:{}).env,f=i.speedOverLifetime,d=i.colorOverLifetime,p=i.linearVelOverLifetime,m=i.orbitalVelOverLifetime,v=i.sizeOverLifetime,y=i.rotationOverLifetime,g=i.sprite,x=i.gravityModifier,b=i.maxCount,T=i.textureFlip,_=i.useSprite,E=i.name,C=i.gravity,w=i.forceTarget,S=i.side,A=i.occlusion,M=i.anchor,I=i.blending,P=i.maskMode,R=i.mask,O=i.transparentOcclusion,N=i.meshSlots,L=i.renderMode,V=void 0===L?0:L,F=i.diffuse,D=void 0===F?r7.createWithData(e):F,k=e.gpuCapability.detail,z=k.halfFloatTexture,B=k.maxVertexUniforms,U=[["RENDER_MODE",+V],["ENV_EDITOR",c===az]],G=e.gpuCapability.level,j=aN(),W=aN(),X=B>0,H={},Y=0,Z=0;this.useSprite=_,X&&U.push(["ENABLE_VERTEX_TEXTURE",!0]),f&&(U.push(["SPEED_OVER_LIFETIME",!0]),Z|=2,H.uSpeedLifetimeValue=f.toUniform(j)),(null==g?void 0:g.animate)&&(U.push(["USE_SPRITE",!0]),Z|=4,H.uFSprite=H.uSprite=new Float32Array([g.col,g.row,g.total,g.blend?1:0]),this.useSprite=!0),(null==d?void 0:d.color)&&(U.push(["COLOR_OVER_LIFETIME",!0]),Z|=16,H.uColorOverLifetime=eF(d.color,r7)?d.color:r7.createWithData(e,io(d.color))),(null==d?void 0:d.opacity)?H.uOpacityOverLifetimeValue=d.opacity.toUniform(j):H.uOpacityOverLifetimeValue=aW(1).toUniform(j),["x","y","z"].forEach(function(t,e){var i=0,r=0;(null==p?void 0:p[t])&&(H["uLinear"+t.toUpperCase()+"ByLifetimeValue"]=p[t].toUniform(j),i=1,Z|=1<<7+e,p.enabled=!0),U.push(["LINEAR_VEL_"+t.toUpperCase(),i]),(null==m?void 0:m[t])&&(H["uOrb"+t.toUpperCase()+"ByLifetimeValue"]=m[t].toUniform(j),r=1,Z|=1<<10+e,h=!0,m.enabled=!0),U.push(["ORB_VEL_"+t.toUpperCase(),r])}),(null==p?void 0:p.asMovement)&&(U.push(["AS_LINEAR_MOVEMENT",!0]),Z|=32),h&&((null==m?void 0:m.asRotation)&&(U.push(["AS_ORBITAL_MOVEMENT",!0]),Z|=64),H.uOrbCenter=new Float32Array((null==m?void 0:m.center)||[0,0,0])),H.uSizeByLifetimeValue=null==v?void 0:v.x.toUniform(j),(null==v?void 0:v.separateAxes)&&(U.push(["SIZE_Y_BY_LIFE",1]),Z|=16384,H.uSizeYByLifetimeValue=null==v?void 0:null==(l=v.y)?void 0:l.toUniform(j)),(null==y?void 0:y.z)&&(H.uRZByLifeTimeValue=y.z.toUniform(j),Z|=32768,U.push(["ROT_Z_LIFETIME",1])),(null==y?void 0:y.x)&&(H.uRXByLifeTimeValue=y.x.toUniform(j),Z|=65536,U.push(["ROT_X_LIFETIME",1])),(null==y?void 0:y.y)&&(H.uRYByLifeTimeValue=y.y.toUniform(j),Z|=131072,U.push(["ROT_Y_LIFETIME",1])),(null==y?void 0:y.asRotation)&&(U.push(["ROT_LIFETIME_AS_MOVEMENT",1]),Z|=262144),H.uGravityModifierValue=x.toUniform(j),w&&(U.push(["FINAL_TARGET",!0]),Z|=524288,H.uFinalTarget=new Float32Array(w.target||[0,0,0]),H.uForceCurve=w.curve.toUniform(j)),z&&W.max?(Z|=1048576,H.uFCurveValueTexture=nt(e,ax.getAllData(W,!0),W.index,1)):H.uFCurveValues=ax.getAllData(W);var q=j.max+j.curves.length-32>B;if(2===G&&(j.max=-1,j.index=N?N[0]:o8(j.index),W.index>0&&(W.max=-1,W.index=N?N[1]:o8(W.index))),q&&z&&X){var Q=nt(e,ax.getAllData(j,!0),j.index,1);H.uVCurveValueTexture=Q,Y=1}else H.uVCurveValues=ax.getAllData(j);var K=["-p:",V,Z,j.index,j.max,W.index,W.max].join("+");U.push(["VERT_CURVE_VALUE_COUNT",j.index],["FRAG_CURVE_VALUE_COUNT",W.index],["VERT_MAX_KEY_FRAME_COUNT",j.max],["FRAG_MAX_KEY_FRAME_COUNT",W.max]),this.VERT_MAX_KEY_FRAME_COUNT=j.max;var J={fragment:nP,vertex:"#define LOOKUP_TEXTURE_CURVE "+Y+"\n"+nR,glslVersion:1===G?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,cacheId:K,macros:U,name:"particle#"+E},$=rk(I);H.uTexOffset=new Float32Array(D?[1/D.getWidth(),1/D.getHeight()]:[0,0]),H.uMaskTex=D,H.uColorParams=new Float32Array([D?1:0,+$,0,+(!!A&&!O)]),H.uParams=[0,0,0,0],H.uAcceleration=[(null==C?void 0:C[0])||0,(null==C?void 0:C[1])||0,(null==C?void 0:C[2])||0,0];var tt=nh.create(e,{shader:J});tt.blending=!0,tt.depthTest=!0,tt.depthMask=!!A,tt.stencilRef=R?[R,R]:void 0,rU(tt,P),rz(tt,I),rB(tt,S),Object.keys(H).map(function(t){var e=H[t];if(eF(e,r7)){tt.setTexture(t,e);return}var i=[];switch(o4[t]){case"vec4":tt.setVector4(t,e0.fromArray(e));break;case"vec3":tt.setVector3(t,e$.fromArray(e));break;case"vec2":tt.setVector2(t,eJ.fromArray(e));break;case"vec4Array":for(var r=0;r<e.length;r+=4){var n=new e0(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}tt.setVector4Array(t,i),i.length=0;break;default:console.warn("Uniform "+t+"'s type not in typeMap.")}}),tt.setVector3("emissionColor",new e$(0,0,0)),tt.setFloat("emissionIntensity",0);var te=ng.create(e,(r=4*b,n=this.useSprite,a="particle#"+E,u={aPos:{size:3,offset:0,stride:s=12*(o=Float32Array.BYTES_PER_ELEMENT),data:new Float32Array(0)},aVel:{size:3,offset:3*o,stride:s,dataSource:"aPos"},aDirX:{size:3,offset:6*o,stride:s,dataSource:"aPos"},aDirY:{size:3,offset:9*o,stride:s,dataSource:"aPos"},aRot:{size:3,offset:0,stride:8*o,data:new Float32Array(0)},aSeed:{size:1,offset:3*o,stride:8*o,dataSource:"aRot"},aColor:{size:4,offset:4*o,stride:8*o,dataSource:"aRot"},aOffset:{size:4,stride:4*o,data:new Float32Array(0)},aTranslation:{size:3,data:new Float32Array(0)},aLinearMove:{size:3,data:new Float32Array(0)},aRotation0:{size:3,offset:0,stride:9*o,data:new Float32Array(0)},aRotation1:{size:3,offset:3*o,stride:9*o,dataSource:"aRotation0"},aRotation2:{size:3,offset:6*o,stride:9*o,dataSource:"aRotation0"}},n&&(u.aSprite={size:3,stride:3*o,data:new Float32Array(0)}),{attributes:u,indices:{data:new Uint16Array(0)},name:a,maxVertex:r})),ti=nA.create(e,{name:"MParticle_"+E,material:tt,geometry:te});this.anchor=M,this.mesh=ti,this.geometry=ti.firstGeometry(),this.forceTarget=w,this.sizeOverLifetime=v,this.speedOverLifetime=f,this.linearVelOverLifetime=p,this.orbitalVelOverLifetime=m,this.orbitalVelOverLifetime=m,this.gravityModifier=x,this.rotationOverLifetime=y,this.maxCount=b,this.textureOffsets=T?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],this.time=0}var i=e.prototype;return i.getPointColor=function(t){var e=this.geometry.getAttributeData("aRot"),i=32*t+4;return ih(e),[e[i],e[i+1],e[i+2],e[i+3]]},i.clearPoints=function(){this.resetGeometryData(this.geometry),this.particleCount=0,this.geometry.setDrawCount(0),this.maxParticleBufferCount=0},i.resetGeometryData=function(t){for(var e=t.getAttributeNames(),i=t.getIndexData(),r=0;r<e.length;r++){var n=e[r],a=t.getAttributeData(n);a&&t.setAttributeData(n,new a.constructor(0))}t.setIndexData(new i.constructor(0))},i.onUpdate=function(t){var e=Math.ceil(this.geometry.getAttributeData("aPos").length/12);this.applyTranslation(e,t),this.applyRotation(e,t),this.applyLinearMove(e,t)},i.minusTime=function(t){for(var e=this.geometry.getAttributeData("aOffset"),i=0;i<e.length;i+=4)e[i+2]-=t;this.geometry.setAttributeData("aOffset",e),this.time-=t},i.removePoint=function(t){t<this.particleCount&&this.geometry.setAttributeSubData("aOffset",16*t,new Float32Array(16))},i.setPoint=function(t,e){var i=this.maxCount;if(t<i){var r,n=t+1,a=4*n,o=this.geometry,s=n>this.maxParticleBufferCount,u=1;this.particleCount>300?u=(this.particleCount+100)/this.particleCount:this.particleCount>100?u=1.4:this.particleCount>0&&(u=2);var h={aPos:new Float32Array(48),aRot:new Float32Array(32),aOffset:new Float32Array(16),aTranslation:new Float32Array(12),aLinearMove:new Float32Array(12),aRotation0:new Float32Array(36)},l=this.useSprite;l&&(h.aSprite=new Float32Array(12));var c=new e$,f=new i5,d=new e$(1,1,1);e.transform.assignWorldTRS(c,f,d);var p=oa.getRotation(f,new nb),m=c.toArray(),v=p.toArray(),y=this.textureOffsets,g=[0,0,e.delay,e.lifetime],x=[0,0,1,1],b=e.vel,T=e.color,_=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],E=Math.random();l&&(r=e.sprite);for(var C=0;C<4;C++){var w=2*C,S=3*C,A=4*C,M=12*C,I=8*C;h.aPos.set(m,M),b.fill(h.aPos,M+3),h.aRot.set(v,I),h.aRot[I+3]=E,h.aRot.set(T,I+4),l&&h.aSprite.set(r,S);var P=e.uv||x;if(P){var R=l?1-y[w+1]:y[w+1];g[0]=P[0]+y[w]*P[2],g[1]=P[1]+R*P[3]}h.aOffset.set(g,A);for(var O=C+C,N=(_[O]-this.anchor.x)*d.x,L=(_[O+1]-this.anchor.y)*d.y,V=0;V<3;V++)h.aPos[M+6+V]=e.dirX.getElement(V)*N,h.aPos[M+9+V]=e.dirY.getElement(V)*L}var F=new Uint16Array([0,1,2,2,1,3].map(function(e){return e+4*t}));if(s){var D=eH(o.getIndexData(),6*n,6*i,u);D.set(F,6*t),o.setIndexData(D),this.maxParticleBufferCount=D.length/6}else o.setIndexSubData(6*t,F);Object.keys(h).forEach(function(e){var r=h[e],n=o.getAttributeStride(e)/Float32Array.BYTES_PER_ELEMENT;if(s){var l=o.getAttributeData(e);ih(l);var c=eH(l,a*n,4*i*n,u);c.set(r,r.length*t),o.setAttributeData(e,c)}else o.setAttributeSubData(e,r.length*t,r)}),this.particleCount=Math.max(n,this.particleCount),o.setDrawCount(6*this.particleCount)}},i.applyTranslation=function(t,e){var i=this.time,r=this.geometry.getAttributeData("aTranslation"),n=this.geometry.getAttributeData("aVel"),a=this.geometry.getAttributeData("aOffset");r.length<3*t&&(r=this.expandArray(r,3*t));for(var o=0,s=0,u=0,h=this.mesh.material.getVector4("uAcceleration"),l=this.mesh.material.getVector4("uGravityModifierValue"),c=0;c<t;c+=4){var f=12*c+3;o=n[f],s=n[f+1],u=n[f+2];var d=i-a[4*c+2],p=a[4*c+3];if(h&&l){var m=this.gravityModifier.getIntegrateValue(0,d,p),v=h.x*m,y=h.y*m,g=h.z*m;if(this.speedOverLifetime){var x=this.speedOverLifetime.getValue(d/p);o=o*x+v,s=s*x+y,u=u*x+g}else o+=v,s+=y,u+=g}var b=3*c;if(a[4*c+2]<i){var T=e/1e3*o,_=e/1e3*s,E=e/1e3*u;r[b]+=T,r[b+1]+=_,r[b+2]+=E,r[b+3]+=T,r[b+4]+=_,r[b+5]+=E,r[b+6]+=T,r[b+7]+=_,r[b+8]+=E,r[b+9]+=T,r[b+10]+=_,r[b+11]+=E}}this.geometry.setAttributeData("aTranslation",r)},i.applyRotation=function(t,e){var i=this.geometry.getAttributeData("aRotation0"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aRot"),a=this.geometry.getAttributeData("aSeed"),o=this.time,s=this.cachedRotationMatrix;i.length<9*t&&(i=this.expandArray(i,9*t));for(var u=0;u<t;u+=4){var h=eK((o-r[4*u+2])/r[4*u+3],0,1),l=8*u,c=this.cachedRotationVector3.set(n[l],n[l+1],n[l+2]),f=a[8*u+3];this.rotationOverLifetime?(this.rotationOverLifetime.x&&(eF(this.rotationOverLifetime.x,a_)?c.x+=this.rotationOverLifetime.x.getValue(h,f):c.x+=this.rotationOverLifetime.x.getValue(h)),this.rotationOverLifetime.y&&(eF(this.rotationOverLifetime.y,a_)?c.y+=this.rotationOverLifetime.y.getValue(h,f):c.y+=this.rotationOverLifetime.y.getValue(h)),this.rotationOverLifetime.z&&(eF(this.rotationOverLifetime.z,a_)?c.z+=this.rotationOverLifetime.z.getValue(h,f):c.z+=this.rotationOverLifetime.z.getValue(h))):s.setZero(),0===c.dot(c)&&s.identity();var d=Math.PI/180,p=c.x*d,m=c.y*d,v=c.z*d,y=Math.sin(p),g=Math.sin(m),x=Math.sin(v),b=Math.cos(p),T=Math.cos(m),_=Math.cos(v);s.set(_,-x,0,x,_,0,0,0,1),s.multiply(this.tempMatrix3.set(T,0,g,0,1,0,-g,0,T)),s.multiply(this.tempMatrix3.set(1,0,0,0,b,-y,0,y,b));var E=9*u,C=s.elements;i.set(C,E),u+4<=t&&(i.set(C,E+9),i.set(C,E+18),i.set(C,E+27))}this.geometry.setAttributeData("aRotation0",i)},i.applyLinearMove=function(t,e){var i=this.geometry.getAttributeData("aLinearMove"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aSeed"),a=this.time;i.length<3*t&&(i=this.expandArray(i,3*t));var o=this.cachedLinearMove;if(this.linearVelOverLifetime&&this.linearVelOverLifetime.enabled)for(var s=0;s<t;s+=4){var u=a-r[4*s+2],h=r[4*s+3],l=u/h,c=n[8*s+3];o.setZero(),this.linearVelOverLifetime.asMovement?(this.linearVelOverLifetime.x&&(eF(this.linearVelOverLifetime.x,a_)?o.x=this.linearVelOverLifetime.x.getValue(l,c):o.x=this.linearVelOverLifetime.x.getValue(l)),this.linearVelOverLifetime.y&&(eF(this.linearVelOverLifetime.y,a_)?o.y=this.linearVelOverLifetime.y.getValue(l,c):o.y=this.linearVelOverLifetime.y.getValue(l)),this.linearVelOverLifetime.z&&(eF(this.linearVelOverLifetime.z,a_)?o.z=this.linearVelOverLifetime.z.getValue(l,c):o.z=this.linearVelOverLifetime.z.getValue(l))):(this.linearVelOverLifetime.x&&(eF(this.linearVelOverLifetime.x,a_)?o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,c):o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.y&&(eF(this.linearVelOverLifetime.y,a_)?o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,c):o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.z&&(eF(this.linearVelOverLifetime.z,a_)?o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,c):o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,h)));var f=3*s;i[f]=o.x,i[f+1]=o.y,i[f+2]=o.z,i[f+3]=o.x,i[f+4]=o.y,i[f+5]=o.z,i[f+6]=o.x,i[f+7]=o.y,i[f+8]=o.z,i[f+9]=o.x,i[f+10]=o.y,i[f+11]=o.z}this.geometry.setAttributeData("aLinearMove",i)},i.expandArray=function(t,e){var i=new Float32Array(e);return i.set(t),i},e}(),o6=[10,32,64,160];function o8(t){for(var e=0;e<o6.length;e++){var i=o6[e];if(i>t)return i}return t||o6[0]}var o9=function(t){function e(e,i,r){(n=t.call(this,e)||this).name="ParticleSystemRenderer",i&&(n.particleMesh=new o5(e,i)),r&&(n.trailMesh=new oK(e,r));var n,a=[n.particleMesh.mesh];return n.materials.push(n.particleMesh.mesh.material),n.trailMesh&&(a.push(n.trailMesh.mesh),n.materials.push(n.trailMesh.mesh.material)),n.meshes=a,n}iN(e,t);var i=e.prototype;return i.onStart=function(){this._priority=this.item.renderOrder;for(var t,e=iD(this.meshes);!(t=e()).done;)t.value.onStart()},i.onUpdate=function(t){var e,i=this.particleMesh.time,r=null!=(e=this.particleMesh.mesh.material.getVector4("uParams"))?e:new e0;this.particleMesh.mesh.material.setVector4("uParams",r.set(i,this.item.duration,0,0))},i.render=function(t){this.maskManager.drawStencilMask(t);for(var e,i=iD(this.meshes);!(e=i()).done;)e.value.render(t)},i.reset=function(){var t;this.particleMesh.clearPoints(),null==(t=this.trailMesh)||t.clearAllTrails()},i.updateTime=function(t,e){this.particleMesh.time=t,this.particleMesh.onUpdate(e),this.trailMesh&&(this.trailMesh.time=t,this.trailMesh.onUpdate(e))},i.minusTimeForLoop=function(t){var e;this.particleMesh.minusTime(t),null==(e=this.trailMesh)||e.minusTime(t)},i.updateWorldMatrix=function(t){this.particleMesh.mesh.worldMatrix=t,this.trailMesh&&(this.trailMesh.mesh.worldMatrix=t)},i.setVisible=function(t){var e;this.particleMesh.mesh.setVisible(t),null==(e=this.trailMesh)||e.mesh.setVisible(t)},i.getTextures=function(){var t=[],e=this.particleMesh.mesh.material.textures;if(Object.keys(e).forEach(function(i){t.push(e[i])}),this.trailMesh){var i=this.trailMesh.mesh.material.textures;Object.keys(i).forEach(function(e){t.push(i[e])})}return t},i.setParticlePoint=function(t,e){this.particleMesh.setPoint(t,e)},i.removeParticlePoint=function(t){this.particleMesh.removePoint(t)},i.getParticlePointColor=function(t){return this.particleMesh.getPointColor(t)},i.hasTrail=function(){return void 0!==this.trailMesh},i.clearTrail=function(t){var e;null==(e=this.trailMesh)||e.clearTrail(t)},i.addTrailPoint=function(t,e,i){var r;null==(r=this.trailMesh)||r.addPoint(t,e,i)},i.setTrailStartPosition=function(t,e){var i;null==(i=this.trailMesh)||i.setPointStartPos(t,e)},i.getTrailStartPosition=function(t){return this.trailMesh.getPointStartPos(t)},e}(rA);t.ParticleSystem=function(e){function i(i,r){var n;return(n=e.call(this,i)||this).destroyed=!1,n.getHitTestParams=function(e){var i=n.interaction;if(e||i)return{type:t.HitTestType.custom,collect:function(t){return n.raycast({radius:(null==i?void 0:i.radius)||.4,multiple:!!(null==i?void 0:i.multiple),removeParticle:(null==i?void 0:i.behavior)===tK.removeParticle,ray:t})}}},n.maskManager=new nl(i),r&&n.fromData(r),n}iN(i,e);var r=i.prototype;return r.isFrozen=function(){return this.frozen},r.isEnded=function(){return this.ended},r.initEmitterTransform=function(){var t,e=this.item.transform.position.clone(),i=this.item.transform.rotation.clone(),r=this.props.emitterTransform&&this.props.emitterTransform.path;r&&(r[0]===tZ.CONSTANT_VEC3?e.add(r[1]):t=aW(r)),this.basicTransform={position:e,rotation:i,path:t};var n=e.clone();if(t&&n.add(t.getValue(0)),this.transform.setPosition(n.x,n.y,n.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.updateEmitterTransform=function(t){var e=this.basicTransform,i=e.path,r=e.position.clone();if(i){var n=this.item.duration;r.add(i.getValue(t/n))}if(this.transform.setPosition(r.x,r.y,r.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.addParticle=function(t,e){var i,r=this.particleLink,n=[t.delay+t.lifetime,0,t.delay,t];if(r.length<e)i=n[1]=r.length;else{var a=r.first;r.removeNode(a),i=n[1]=a.content[1]}r.pushNode(n),this.renderer.setParticlePoint(i,t),this.clearPointTrail(i),this.transform.parentTransform&&this.renderer.setTrailStartPosition(i,this.transform.parentTransform.position.clone())},r.setVisible=function(t){this.renderer.setVisible(t)},r.getTextures=function(){return this.renderer.getTextures()},r.startEmit=function(){(!this.started||this.ended)&&(this.reset(),this.started=!0,this.ended=!1)},r.stop=function(){this.ended=!0,this.started=!1},r.reset=function(){this.renderer.reset(),this.time=0,this.loopStartTime=0,this.lastEmitTime=-1/this.emission.rateOverTime.getValue(0),this.generatedCount=0,this.particleLink=new oX(function(t,e){return t[0]-e[0]}),this.emission.bursts.forEach(function(t){return t.reset()}),this.frozen=!1,this.ended=!1,this.destroyed=!1},r.onStart=function(){this.startEmit(),this.initEmitterTransform()},r.onUpdate=function(t){this.update(t)},r.update=function(t){var e=this;if(this.started&&!this.frozen){var i=this.time+t/1e3,r=this.options,n=this.loopStartTime,a=this.emission;this.time=i,this.upDirectionWorld=null,this.renderer.updateTime(i,t);var o=this.particleLink,s=(i-n)/this.item.duration,u=this.timePassed,h=!1,l=function(){e.trails&&!h&&(h=!0,o.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3];i<u?e.clearPointTrail(r):u>n&&e.updatePointTrail(r,s,a,n)}))};if(this.ended){if(this.item.endBehavior!==tQ.restart&&tQ.destroy===this.item.endBehavior){var c=o.last;c&&c.content[0]<this.time&&(this.destroyed=!0)}}else{var f=this.item.duration,d=this.lifetime;if(u<f){var p=1/a.rateOverTime.getValue(d),m=Math.floor((u-this.lastEmitTime)/p),v=p/m,y=r.maxCount;this.updateEmitterTransform(u);for(var g=function(){var t=o.first;return e.emissionStopped||o.length===y&&t&&t.content[0]-n>u},x=0;x<m&&x<y&&!g();x++){var b=this.createPoint(d);b.delay+=i+x*v,this.addParticle(b,y),this.lastEmitTime=u}for(var T=a.bursts,_=(null==T?void 0:T.length)-1,E=0;_>=0&&E<y&&!g();_--){var C=T[_],w=!C.disabled&&C.getGeneratorOptions(u,d);if(w){var S=[0,0,0],A=a.burstOffsets[_],M=A&&A[w.cycleIndex]||S;C.once&&this.removeBurst(_);for(var I=0;I<w.count&&E<y&&!g();I++){var P,R=this.initPoint(this.shape.generate({total:w.total,index:w.index,burstIndex:I,burstCount:w.count}));R.delay+=i,E++,(P=R.transform).translate.apply(P,[].concat(M)),this.addParticle(R,y)}}}}else this.item.endBehavior===tQ.restart?(l(),this.loopStartTime=i-f,this.lastEmitTime-=f,this.time-=f,a.bursts.forEach(function(t){return t.reset()}),this.particleLink.forEach(function(t){t[0]-=f,t[2]-=f,t[3].delay-=f}),this.renderer.minusTimeForLoop(f)):(this.ended=!0,this.item.endBehavior===tQ.freeze&&(this.frozen=!0))}l()}},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){for(var e=[],i=0;i<this.renderer.meshes.length;i++){var r=this.renderer.meshes[i].material;e.push(r.colorMask),r.colorMask=!1}for(var n,a=iD(this.renderer.meshes);!(n=a()).done;)n.value.render(t);for(var o=0;o<this.renderer.meshes.length;o++)this.renderer.meshes[o].material.colorMask=e[o]}},r.onDestroy=function(){this.item&&this.item.composition&&this.meshes.forEach(function(t){return t.dispose()})},r.getParticleBoxes=function(){var t=this.particleLink,e=this.renderer,i=[],r=this.particleCount,n=0;if(!(t&&e))return i;for(var a=t.last,o=!1;!o;){var s=a.content[0],u=a.content[3];if(s>this.timePassed){var h=this.getPointPosition(u);i.push({center:h,size:u.transform.scale}),a.pre?a=a.pre:o=!0}++n>r&&(o=!0)}return i},r.raycast=function(t){var e=this.particleLink,i=this.renderer;if(e&&i){var r=e.last,n=[],a=new e$,o=!1;if(r&&r.content)do{var s=r.content,u=s[0],h=s[1];s[2];var l=s[3];if(u>this.timePassed){var c=this.getPointPosition(l),f=t.ray,d=!1;f&&(d=!!f.intersectSphere({center:c,radius:t.radius},a)),d&&(t.removeParticle&&(i.removeParticlePoint(h),this.clearPointTrail(h),r.content=[0]),n.push(c),t.multiple||(o=!0))}}while((r=r.pre)&&!o);return n}},r.clearPointTrail=function(t){this.trails&&this.trails.dieWithParticles&&this.renderer.clearTrail(t)},r.updatePointTrail=function(t,e,i,r){var n=this.renderer;if(n.hasTrail()){var a=this.trails,o=this.getPointPosition(i),s=a.inheritParticleColor?n.getParticlePointColor(t):[1,1,1,1],u=i.transform.getWorldScale().toArray(),h=1,l=a.lifetime.getValue(e);if(a.sizeAffectsWidth&&(h*=u[0]),a.sizeAffectsLifetime&&(l*=u[0]),a.parentAffectsPosition&&this.transform.parentTransform){o.add(this.transform.parentTransform.position);var c=n.getTrailStartPosition(t);c&&o.subtract(c)}n.addTrailPoint(t,o,{color:s,lifetime:l,size:h,time:r})}},r.getPointPositionByIndex=function(t){var e=this.particleLink.getNodeByIndex(t);return e?this.getPointPosition(e.content[3]):(console.error("Get point error."),null)},r.getPointPosition=function(t){var e=t.transform,i=t.vel,r=t.lifetime,n=t.delay,a=t.gravity,o=this.options.forceTarget,s=this.time-n,u=new e$,h=e$.fromArray(void 0===a?[]:a);e.assignWorldTRS(u);var l=n8(new e$,this.options,h,s,r,u,i);if(o){var c=o.target||[0,0,0],f=o.curve.getValue(s/r),d=1-f;l.x=l.x*d+c[0]*f,l.y=l.y*d+c[1]*f,l.z=l.z*d+c[2]*f}return l},r.initPoint=function(t){var e,i,r,n,a=this.options,o=this.lifetime,s=this.shape,u=a.startSpeed.getValue(o),h=a.particleFollowParent?rO.IDENTITY:this.transform.getWorldMatrix(),l=t.position,c=new oa({position:h.transformPoint(l,new e$),valid:!0}),f=t.direction;if(f=h.transformNormal(f,o7).normalize(),a.startTurbulence&&a.turbulence){for(var d=0;d<3;d++)sn.setElement(d,a.turbulence[d].getValue(o));sa.setFromVector3(sn.negate()),ss.setFromEuler(sa).transformNormal(f).normalize()}s.alignSpeedDirection?(sr.copyFrom(f),this.upDirectionWorld||(s.upDirection?this.upDirectionWorld=s.upDirection.clone():this.upDirectionWorld=e$.Z.clone(),h.transformNormal(this.upDirectionWorld)),si.crossVectors(sr,this.upDirectionWorld).normalize(),si.isZero()&&si.set(1,0,0)):(si.set(1,0,0),sr.set(0,1,0));var p=this.textureSheetAnimation;p&&p.animate&&((n=so)[0]=p.animationDelay.getValue(o),n[1]=p.animationDuration.getValue(o),n[2]=p.cycles.getValue(o)),a.start3DRotation?se.set(a.startRotationX.getValue(o),a.startRotationY.getValue(o),a.startRotationZ.getValue(o)):a.startRotation?se.set(0,0,a.startRotation.getValue(o)):se.set(0,0,0),c.setRotation(se.x,se.y,se.z);var m=a.startColor.getValue(o);if(3===m.length&&(m[3]=1),a.start3DSize)st.x=a.startSizeX.getValue(o),st.y=a.startSizeY.getValue(o);else{var v=a.startSize.getValue(o),y=a.sizeAspect.getValue(o);st.x=v,st.y=0===y?0:v/y}var g=f.clone();if(g.multiply(u),!a.particleFollowParent){var x=new e$;this.transform.assignWorldTRS(void 0,void 0,x),st.x*=x.x,st.y*=x.y}return c.setScale(st.x,st.y,1),{size:st,vel:g,color:m,delay:a.startDelay.getValue(o),lifetime:a.startLifetime.getValue(o),uv:(i=Math.floor(Math.random()*(e=this.uvs).length),r=e[i],r),gravity:a.gravity,sprite:n,dirY:sr,dirX:si,transform:c}},r.addBurst=function(t,e){var i=!1;if(this.emission.bursts.includes(t)||(this.emission.bursts.push(t),i=!0),i&&eF(e,Array)){var r=this.emission.bursts.indexOf(t);return this.emission.burstOffsets[r]=e,r}return -1},r.removeBurst=function(t){t<this.emission.bursts.length&&(this.emission.burstOffsets[t]=null,this.emission.bursts.splice(t,1))},r.createPoint=function(t){var e={total:this.emission.rateOverTime.getValue(t),index:this.generatedCount,burstIndex:0,burstCount:0};return this.generatedCount++,this.initPoint(this.shape.generate(e))},r.stopParticleEmission=function(){this.emissionStopped=!0},r.resumeParticleEmission=function(){this.emissionStopped=!1},r.getBoundingBox=function(){var e=this.getParticleBoxes();return{type:t.HitTestType.sphere,area:e}},r.fromData=function(t){e.prototype.fromData.call(this,t),this.props=t,this.destroyed=!1;var i,r,n,a,o,s,u,h,l,c,f,d,p,m=t.options,v=t.positionOverLifetime,y=void 0===v?{}:v,g=t.shape,x=null==y?void 0:y.gravityOverLifetime,b=n9(null==y?void 0:y.gravity),T=t.textureSheetAnimation,_=T?{animationDelay:aW(T.animationDelay||0),animationDuration:aW(T.animationDuration||1),cycles:aW(T.cycles||1),animate:T.animate,col:T.col,row:T.row,total:T.total||T.col*T.row}:void 0,E=!!(g&&g.turbulenceX||(null==g?void 0:g.turbulenceY)||(null==g?void 0:g.turbulenceZ));E&&(n=[aW(null!=(a=g.turbulenceX)?a:0),aW(null!=(o=g.turbulenceY)?o:0),aW(null!=(s=g.turbulenceZ)?s:0)]),this.name="ParticleSystem",this.shape=o_(g),this.emission={rateOverTime:aW(t.emission.rateOverTime),burstOffsets:(i=null!=(u=t.emission.burstOffsets)?u:[],r={},Array.isArray(i)&&i.forEach(function(t){var e=eF(t,Array),i=e?t[0]:t.index,n=r[i];n||(n=r[i]=[]),e?n.push(t.slice(1,4)):n.push([+t.x,+t.y,+t.z])}),r),bursts:(t.emission.bursts||[]).map(function(t){return new oj(t)})},this.textureSheetAnimation=_;var C=t.renderer||{},w=t.rotationOverLifetime;w&&((h={}).asRotation=!!w.asRotation,h.z=w.z?aW(w.z):aW(0),w.separateAxes&&(h.x=w.x&&aW(w.x),h.y=w.y&&aW(w.y))),(null==y?void 0:y.forceTarget)&&(l={target:y.target||[0,0,0],curve:aW(y.forceCurve||[tZ.LINE,[[0,0],[1,1]]])});var S={x:y.linearX&&aW(y.linearX||0),y:y.linearY&&aW(y.linearY||0),z:y.linearZ&&aW(y.linearZ||0),asMovement:y.asMovement},A={x:y.orbitalX&&aW(y.orbitalX),y:y.orbitalY&&aW(y.orbitalY),z:y.orbitalZ&&aW(y.orbitalZ),center:y.orbCenter,asRotation:y.asRotation},M=t.sizeOverLifetime||{},I=t.colorOverLifetime,P=(null==M?void 0:M.separateAxes)?{separateAxes:!0,x:aW(M.x),y:aW(M.y)}:{separateAxes:!1,x:aW(("size"in M?M.size:M.x)||1)};C.anchor=C.anchor||[0,0];var R=eJ.fromArray(C.anchor);this.options={particleFollowParent:!!m.particleFollowParent,startLifetime:aW(m.startLifetime),startDelay:aW(m.startDelay||0),startSpeed:aW(y.startSpeed||0),startColor:aW(m.startColor),looping:!1,maxCount:null!=(c=m.maxCount)?c:0,gravityModifier:aW(x||0),gravity:b,start3DSize:!!m.start3DSize,startTurbulence:E,turbulence:n,speedOverLifetime:y.speedOverLifetime&&aW(y.speedOverLifetime),linearVelOverLifetime:S,orbitalVelOverLifetime:A,forceTarget:l},m.startRotationZ&&(this.options.startRotation=aW(m.startRotationZ||0)),(m.startRotationX||m.startRotationY)&&(this.options.start3DRotation=!0,this.options.startRotationX=aW(m.startRotationX||0),this.options.startRotationY=aW(m.startRotationY||0),this.options.startRotationZ=aW(m.startRotationZ||0)),m.start3DSize?(this.options.startSizeX=aW(m.startSizeX),this.options.startSizeY=aW(m.startSizeY)):(this.options.startSize=aW(m.startSize),this.options.sizeAspect=aW(m.sizeAspect||1)),t.mask&&this.maskManager.setMaskOptions(t.mask);var O={meshSlots:m.meshSlots,name:this.name,matrix:rO.IDENTITY,shaderCachePrefix:"",renderMode:C.renderMode||tj.BILLBOARD,side:C.side||tF.DOUBLE,gravity:b,blending:C.blending||tV.ALPHA,rotationOverLifetime:h,gravityModifier:this.options.gravityModifier,linearVelOverLifetime:this.options.linearVelOverLifetime,orbitalVelOverLifetime:this.options.orbitalVelOverLifetime,speedOverLifetime:this.options.speedOverLifetime,sprite:_,occlusion:!!C.occlusion,transparentOcclusion:!!C.transparentOcclusion,maxCount:m.maxCount,mask:this.maskManager.getRefValue(),maskMode:this.maskManager.maskMode,forceTarget:l,diffuse:C.texture?this.engine.findObject(C.texture):void 0,sizeOverLifetime:P,anchor:R};if(I){var N=I.color,L=I.opacity;O.colorOverLifetime={},L&&(O.colorOverLifetime.opacity=aW(I.opacity)),N&&(N[0]===tZ.GRADIENT_COLOR?O.colorOverLifetime.color=I.color[1]:N[0]===tZ.RGBA_COLOR?O.colorOverLifetime.color=r7.createWithData(this.engine,{data:new Uint8Array(N[1]),width:1,height:1}):eF(N,r7)&&(O.colorOverLifetime.color=N))}var V=[],F=[0,0,1,1];if(t.splits){var D=t.splits[0];F=(f=D[4])?[D[0],D[1],D[3],D[2]]:[D[0],D[1],D[2],D[3]]}if(_&&!_.animate)for(var k=f?_.row:_.col,z=f?_.col:_.row,B=_.total||k*z,U=0,G=0;G<k;G++)for(var j=0;j<z&&U<B;j++,U++)V.push([G*F[2]/k+F[0],j*F[3]/z+F[1],F[2]/k,F[3]/z]);else V.push(F);this.uvs=V,O.textureFlip=f;var W=t.trails;W&&(this.trails={lifetime:aW(W.lifetime),dieWithParticles:!1!==W.dieWithParticles,sizeAffectsWidth:!!W.sizeAffectsWidth,sizeAffectsLifetime:!!W.sizeAffectsLifetime,inheritParticleColor:!!W.inheritParticleColor,parentAffectsPosition:!!W.parentAffectsPosition},W.mask&&this.maskManager.setMaskOptions(W.mask),d={name:"Trail",matrix:rO.IDENTITY,minimumVertexDistance:W.minimumVertexDistance||.02,maxTrailCount:m.maxCount,pointCountPerTrail:Math.round(W.maxPointPerTrail)||32,blending:W.blending,texture:W.texture?this.engine.findObject(W.texture):void 0,opacityOverLifetime:aW(W.opacityOverLifetime||1),widthOverTrail:aW(W.widthOverTrail||1),shaderCachePrefix:"",lifetime:this.trails.lifetime,occlusion:!!W.occlusion,transparentOcclusion:!!W.transparentOcclusion,textureMap:W.textureMap,mask:this.maskManager.getRefValue(),maskMode:this.maskManager.maskMode},W.colorOverLifetime&&W.colorOverLifetime[0]===tZ.GRADIENT_COLOR&&(d.colorOverLifetime=W.colorOverLifetime[1]),W.colorOverTrail&&W.colorOverTrail[0]===tZ.GRADIENT_COLOR&&(d.colorOverTrail=W.colorOverTrail[1])),this.renderer=new o9(this.engine,O,d),this.renderer.item=this.item,this.renderer.maskManager=this.maskManager,this.meshes=this.renderer.meshes;var X=t.interaction;X&&(this.interaction={multiple:X.multiple,radius:null!=(p=X.radius)?p:.4,behavior:X.behavior}),this.item.getHitTestParams=this.getHitTestParams},rC(i,[{key:"timePassed",get:function(){return this.time-this.loopStartTime}},{key:"lifetime",get:function(){return this.timePassed/this.item.duration}},{key:"particleCount",get:function(){return this.particleLink.length}},{key:"maxParticles",get:function(){return this.options.maxCount},set:function(t){var e;this.options.maxCount=t,(null==(e=this.renderer)?void 0:e.particleMesh)&&(this.renderer.particleMesh.maxCount=t)}}]),i}(rw),t.ParticleSystem=ek([iU(el.ParticleSystem)],t.ParticleSystem);var o7=new e$,st=new eJ,se=new nb,si=new e$,sr=new e$,sn=new e$,sa=new nb,so=[0,0,0],ss=new rO,su=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.clipPlayables=[],e.clipWeights=[],e}iN(e,t);var i=e.prototype;return i.processFrame=function(t){for(var e,i=iD(this.clipPlayables);!(e=i()).done;)e.value.processFrame(t);this.evaluate(t)},i.setClipWeight=function(t,e){if(eF(t,a8)){for(var i=0;i<this.clipPlayables.length;i++)if(this.clipPlayables[i]===t){this.clipWeights[i]=e;return}}else this.clipWeights.length<t+1&&(this.clipWeights.length=t+1),this.clipWeights[t]=e},i.getClipWeight=function(t){return this.clipWeights[t]},i.getClipPlayable=function(t){return this.clipPlayables[t]},i.evaluate=function(t){},e}(a8),sh=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(eF(i,t.VFXItem)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?(i.transform.setValid(!0),i.setActive(!0)):(i.transform.setValid(!1),i.setActive(!1))}},i}(su),sl=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();eF(i,t.VFXItem)&&(i.time=this.time)},i}(a8),sc=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.processFrame=function(t){this.value=this.curve.getValue(this.time/this.getDuration())},e}(a8),sf=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyPath="",e.propertyName="",e}iN(e,t);var i=e.prototype;return i.evaluate=function(t){var e=t.output.getUserData();if(e){this.directTarget||this.preparePath(e);var i=!1;if(this.propertyValue=this.directTarget[this.propertyName],void 0!==this.propertyValue&&null!==this.propertyValue){this.resetPropertyValue();for(var r=0;r<this.clipPlayables.length;r++){var n=this.getClipWeight(r);if(n>0){var a=this.getClipPlayable(r);if(!eF(a,sc)){console.error("PropertyTrack added non-PropertyPlayableAsset");continue}var o=a.value;this.addWeightedValue(o,n),i=!0}}i&&(this.directTarget[this.propertyName]=this.propertyValue,eF(e,rw)&&e.onApplyAnimationProperties())}}},i.preparePath=function(t){for(var e=this.propertyPath.split("."),i=t,r=0;r<e.length-1;r++){var n=i[e[r]];void 0===n&&console.error("The "+e[r]+" property of "+t+" was not found"),i=n}e.length>0&&(this.propertyName=e[e.length-1]),this.directTarget=i},e}(su),sd=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.setZero()},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.r+=t.r*e,i.g+=t.g*e,i.b+=t.b*e,i.a+=t.a*e},e}(sf),sp=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue=0},i.addWeightedValue=function(t,e){this.propertyValue+=t*e},e}(sf),sm=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.evaluate=function(t){},e}(su),sv=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.evaluate=function(t){},e}(su),sy=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();eF(i,t.CompositionComponent)&&(i.time=this.getTime())},i}(a8),sg=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(eF(i,t.CompositionComponent)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?i.item.setActive(!0):i.item.setActive(!1)}},i}(su),sx=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.evaluate=function(t){},e}(su),sb=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0,this.propertyValue.w=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e,i.w+=t.w*e},e}(sf),sT=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e},e}(sf),s_=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e},e}(sf),sE=new nb,sC=new e$(1,1,1),sw=new e$,sS=function(e){function i(){return e.apply(this,arguments)}iN(i,e);var r=i.prototype;return r.start=function(){var t,e=this.boundObject,i=e.transform.scale;this.originalTransform={position:e.transform.position.clone(),rotation:e.transform.getRotation().clone(),scale:new e$(i.x,i.y,i.x)};var r=this.data.positionOverLifetime,n=this.data.rotationOverLifetime,a=this.data.sizeOverLifetime;if(r&&0!==Object.keys(r).length){this.positionOverLifetime=r,r.path&&(this.originalTransform.path=aW(r.path));var o=r.linearX||r.linearY||r.linearZ;o&&(this.linearVelOverLifetime={x:r.linearX&&aW(r.linearX),y:r.linearY&&aW(r.linearY),z:r.linearZ&&aW(r.linearZ),asMovement:r.asMovement,enabled:!!o});var s=r.orbitalX||r.orbitalY||r.orbitalZ;s&&(this.orbitalVelOverLifetime={x:r.orbitalX&&aW(r.orbitalX),y:r.orbitalY&&aW(r.orbitalY),z:r.orbitalZ&&aW(r.orbitalZ),center:n9(r.orbCenter),asRotation:r.asRotation,enabled:!!s}),this.speedOverLifetime=r.speedOverLifetime&&aW(r.speedOverLifetime)}if(a&&(a.separateAxes?(this.sizeSeparateAxes=!0,this.sizeXOverLifetime=aW(a.x||1),this.sizeYOverLifetime=aW(a.y||1),this.sizeZOverLifetime=aW(a.z||1)):this.sizeXOverLifetime=aW(a.size||1)),n&&(this.rotationOverLifetime={asRotation:n.asRotation,separateAxes:n.separateAxes,z:aW(n.z||0)},n.separateAxes)){var u=this.rotationOverLifetime;u.x=aW(n.x||0),u.y=aW(n.y||0)}this.gravity=e$.fromArray((null==r?void 0:r.gravity)||[]),this.gravityModifier=aW(null!=(t=null==r?void 0:r.gravityOverLifetime)?t:0),this.direction=(null==r?void 0:r.direction)?e$.fromArray(r.direction).normalize():new e$,this.startSpeed=(null==r?void 0:r.startSpeed)||0,this.velocity=this.direction.clone(),this.velocity.multiply(this.startSpeed)},r.processFrame=function(e){if(!this.boundObject){var i=e.output.getUserData();eF(i,t.VFXItem)&&(this.boundObject=i,this.start())}this.boundObject&&this.boundObject.composition&&this.sampleAnimation()},r.sampleAnimation=function(){var t=this,e=this.boundObject,i=this.getDuration(),r=this.time/i;if(r=r<0?0:r>1?1:r,this.sizeXOverLifetime){sC.x=this.sizeXOverLifetime.getValue(r),this.sizeSeparateAxes?(sC.y=this.sizeYOverLifetime.getValue(r),sC.z=this.sizeZOverLifetime.getValue(r)):sC.z=sC.y=sC.x;var n=this.originalTransform.scale;e.transform.setScale(sC.x*n.x,sC.y*n.y,sC.z*n.z)}if(this.rotationOverLifetime){var a=function(e){return t.rotationOverLifetime.asRotation?e.getValue(r):e.getIntegrateValue(0,r,i)},o=a(this.rotationOverLifetime.z),s=this.rotationOverLifetime.separateAxes;sE.x=s?a(this.rotationOverLifetime.x):0,sE.y=s?a(this.rotationOverLifetime.y):0,sE.z=o;var u=sE.addEulers(this.originalTransform.rotation,sE);e.transform.setRotation(u.x,u.y,u.z)}this.positionOverLifetime&&(n8(sw,this,this.gravity,this.time,i,this.originalTransform.position,this.velocity),this.originalTransform.path&&sw.add(this.originalTransform.path.getValue(r)),e.transform.setPosition(sw.x,sw.y,sw.z))},i}(a8);t.TransformPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new sS;return t.data=this.transformAnimationData,t},i.fromData=function(t){this.transformAnimationData=t},e}(a7),t.TransformPlayableAsset=ek([iU(el.TransformPlayableAsset)],t.TransformPlayableAsset);var sA=function(){function t(){this.start=0,this.duration=0}return t.prototype.toLocalTime=function(t){var e=t-this.start,i=this.duration;return e-i>0&&(this.endBehavior===tQ.restart?e%=i:this.endBehavior===tQ.freeze&&(e=Math.min(i,e))),e},t}();t.TrackAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.trackType=0,e.clipSeed=0,e.clips=[],e.children=[],e}iN(e,t);var i=e.prototype;return i.updateAnimatedObject=function(t){return t},i.createTrackMixer=function(){return new su},i.createOutput=function(){return new a9},i.createPlayableGraph=function(t){return this.createMixerPlayableGraph(t)},i.createMixerPlayableGraph=function(t){for(var e,i=[],r=iD(this.clips);!(e=r()).done;){var n=e.value;i.push(n)}return this.compileClips(i,t)},i.compileClips=function(t,e){for(var i,r=this.createTrackMixer(),n=iD(t);!(i=n()).done;){var a=i.value,o=this.createClipPlayable(a);o.setDuration(a.duration);var s=new sM(a,o,r);e.push(s),r.clipPlayables.push(o),r.setClipWeight(o,0)}return r},i.createPlayable=function(){return new a8},i.getChildTracks=function(){return this.children},i.addChild=function(t){this.children.push(t),t.parent=this},i.createClip=function(t,e){var i=new sA;return i.asset=new t(this.engine),i.name=e||"TimelineClip"+i.id,this.addClip(i),i},i.getClips=function(){return this.clips},i.findClip=function(t){for(var e,i=iD(this.clips);!(e=i()).done;){var r=e.value;if(r.name===t)return r}},i.addClip=function(t){t.id=(this.clipSeed++).toString(),this.clips.push(t)},i.createClipPlayable=function(t){return t.asset.createPlayable()},i.fromData=function(e){t.prototype.fromData.call(this,e);for(var i,r=iD(this.children);!(i=r()).done;)i.value.parent=this},e}(a7),ek([ij(sA,void 0)],t.TrackAsset.prototype,"clips",void 0),ek([ij(void 0,void 0)],t.TrackAsset.prototype,"children",void 0),t.TrackAsset=ek([iU(el.TrackAsset)],t.TrackAsset),t.TrackType=void 0,(tw=t.TrackType||(t.TrackType={}))[tw.MasterTrack=0]="MasterTrack",tw[tw.ObjectTrack=1]="ObjectTrack";var sM=function(){function e(t,e,i){this.clip=t,this.playable=e,this.parentMixer=i}var i=e.prototype;return i.getParticleSystem=function(){return!this.particleSystem&&eF(this.parentMixer.trackInstance.boundObject,t.VFXItem)&&(this.particleSystem=this.parentMixer.trackInstance.boundObject.getComponent(t.ParticleSystem)),this.particleSystem},i.evaluateAt=function(e){var i=this.clip,r=1,n=!1,a=!1,o=this.parentMixer.trackInstance.boundObject;e>=i.start+i.duration&&i.endBehavior===tQ.destroy?eF(o,t.VFXItem)&&t.VFXItem.isParticle(o)&&this.getParticleSystem()&&!this.getParticleSystem().destroyed?r=1:(r=0,n=!0):e-this.clip.start>=0?(r=1,a=!0):e<i.start&&(r=0),a&&this.playable.getPlayState()!==t.PlayState.Playing&&this.playable.play(),this.parentMixer.setClipWeight(this.playable,r);var s=i.toLocalTime(e);this.playable.setTime(s),n&&this.playable.getPlayState()===t.PlayState.Playing&&this.playable.pause()},rC(e,[{key:"enable",set:function(t){t?this.playable.play():(this.parentMixer.setClipWeight(this.playable,0),this.playable.pause())}}]),e}();t.ActivationTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new sh},e}(t.TrackAsset),t.ActivationTrack=ek([iU(el.ActivationTrack)],t.ActivationTrack);var sI=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyNames=[],e.path="",e}return iN(e,t),e.prototype.fromData=function(e){t.prototype.fromData.call(this,e);var i=this.path.split(".");this.propertyNames=i},e}(t.TrackAsset);ek([ij(void 0,void 0)],sI.prototype,"path",void 0),t.FloatPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sp;return t.propertyPath=this.path,t},e}(sI),t.FloatPropertyTrack=ek([iU(el.FloatPropertyTrack)],t.FloatPropertyTrack),t.SpriteColorTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new sv},e}(t.TrackAsset),t.SpriteColorTrack=ek([iU(el.SpriteColorTrack)],t.SpriteColorTrack),t.SubCompositionTrack=function(e){function i(){return e.apply(this,arguments)}iN(i,e);var r=i.prototype;return r.updateAnimatedObject=function(e){if(!eF(e,t.VFXItem))throw Error("SubCompositionTrack needs to be set under the VFXItem track.");return e.getComponent(t.CompositionComponent)},r.createTrackMixer=function(){return new sg},i}(t.TrackAsset),t.SubCompositionTrack=ek([iU(el.SubCompositionTrack)],t.SubCompositionTrack),t.TransformTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new sx},e}(t.TrackAsset),t.TransformTrack=ek([iU(el.TransformTrack)],t.TransformTrack),t.MaterialTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.updateAnimatedObject=function(t){if(!eF(t,rA))throw Error("MaterialTrack: expected a RendererComponent bound object.");var e=t.materials;if(this.index>=e.length)throw Error("MaterialTrack: material index "+this.index+" out of bounds (length="+e.length+").");return e[this.index]},e}(t.TrackAsset),ek([ij(void 0,void 0)],t.MaterialTrack.prototype,"index",void 0),t.MaterialTrack=ek([iU("MaterialTrack")],t.MaterialTrack);var sP=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new sm},e}(t.TrackAsset);t.Vector4PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sb;return t.propertyPath=this.path,t},e}(sI),t.Vector4PropertyTrack=ek([iU(el.Vector4PropertyTrack)],t.Vector4PropertyTrack),t.Vector3PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sT;return t.propertyPath=this.path,t},e}(sI),t.Vector3PropertyTrack=ek([iU(el.Vector3PropertyTrack)],t.Vector3PropertyTrack),t.Vector2PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new s_;return t.propertyPath=this.path,t},e}(sI),t.Vector2PropertyTrack=ek([iU(el.Vector2PropertyTrack)],t.Vector2PropertyTrack),t.ColorPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sd;return t.propertyPath=this.path,t},e}(sI),t.ColorPropertyTrack=ek([iU(el.ColorPropertyTrack)],t.ColorPropertyTrack),t.ObjectBindingTrack=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.create=function(e,i){var r=i[this.getInstanceId()];if(eF(r,t.VFXItem))for(var n,a=iD(this.getChildTracks());!(n=a()).done;){var o=n.value;if(eF(o,t.ActivationTrack)){if(r.getComponent(t.ParticleSystem))for(var s,u=e.createTrack(sP,this,"ParticleTrack"),h=iD(o.getClips());!(s=h()).done;){var l=s.value,c=u.createClip(o3);c.start=l.start,c.duration=l.duration,c.endBehavior=l.endBehavior}if(r.getComponent(t.SpriteComponent))for(var f,d=e.createTrack(sW,this,"SpriteComponentTimeTrack"),p=iD(o.getClips());!(f=p()).done;){var m=f.value,v=d.createClip(sH);v.start=m.start,v.duration=m.duration,v.endBehavior=m.endBehavior}if(r.getComponent(t.EffectComponent))for(var y,g=e.createTrack(sX,this,"EffectComponentTimeTrack"),x=iD(o.getClips());!(y=x()).done;){var b=y.value,T=g.createClip(sH);T.start=b.start,T.duration=b.duration,T.endBehavior=b.endBehavior}break}}},i}(t.TrackAsset),t.ObjectBindingTrack=ek([iU(el.ObjectBindingTrack)],t.ObjectBindingTrack),t.ActivationPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new sl},e}(a7),t.ActivationPlayableAsset=ek([iU(el.ActivationPlayableAsset)],t.ActivationPlayableAsset),t.ColorPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sc;return t.curve=aW(this.curveData),t.value=t.curve.getValue(0),t},e}(a7),ek([ij(void 0,void 0)],t.ColorPropertyPlayableAsset.prototype,"curveData",void 0),t.ColorPropertyPlayableAsset=ek([iU(el.ColorPropertyPlayableAsset)],t.ColorPropertyPlayableAsset),t.FloatPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sc;return t.curve=aW(this.curveData),t.value=t.curve.getValue(0),t},e}(a7),ek([ij(void 0,void 0)],t.FloatPropertyPlayableAsset.prototype,"curveData",void 0),t.FloatPropertyPlayableAsset=ek([iU(el.FloatPropertyPlayableAsset)],t.FloatPropertyPlayableAsset),t.SubCompositionPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new sy},e}(a7),t.SubCompositionPlayableAsset=ek([iU(el.SubCompositionPlayableAsset)],t.SubCompositionPlayableAsset),t.Vector4PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sc;return t.curve=aW(this.curveData),t.value=t.curve.getValue(0),t},e}(a7),ek([ij(void 0,void 0)],t.Vector4PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector4PropertyPlayableAsset=ek([iU(el.Vector4PropertyPlayableAsset)],t.Vector4PropertyPlayableAsset),t.Vector3ropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sc;return t.curve=aW(this.curveData),t.value=t.curve.getValue(0),t},e}(a7),ek([ij(void 0,void 0)],t.Vector3ropertyPlayableAsset.prototype,"curveData",void 0),t.Vector3ropertyPlayableAsset=ek([iU(el.Vector3PropertyPlayableAsset)],t.Vector3ropertyPlayableAsset),t.Vector2PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sc;return t.curve=aW(this.curveData),t.value=t.curve.getValue(0),t},e}(a7),ek([ij(void 0,void 0)],t.Vector2PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector2PropertyPlayableAsset=ek([iU(el.Vector2PropertyPlayableAsset)],t.Vector2PropertyPlayableAsset);var sR=function(){function t(t,e,i){this.children=[],this.trackAsset=t,this.mixer=e,this.output=i,this.mixer.trackInstance=this}return t.prototype.addChild=function(t){this.children.push(t)},t}();t.TimelineAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.tracks=[],e.cacheFlattenedTracks=null,e}iN(e,t);var i=e.prototype;return i.createTrack=function(t,e,i){var r=new t(this.engine);return r.name=i||t.name,e.addChild(r),this.invalidate(),r},i.invalidate=function(){this.cacheFlattenedTracks=null},i.addSubTracksRecursive=function(t,e){for(var i,r=iD(t.getChildTracks());!(i=r()).done;){var n=i.value;e.push(n)}for(var a,o=iD(t.getChildTracks());!(a=o()).done;){var s=a.value;this.addSubTracksRecursive(s,e)}},rC(e,[{key:"flattenedTracks",get:function(){if(!this.cacheFlattenedTracks){this.cacheFlattenedTracks=[];for(var t,e=iD(this.tracks);!(t=e()).done;){var i=t.value;this.cacheFlattenedTracks.push(i),this.addSubTracksRecursive(i,this.cacheFlattenedTracks)}}return this.cacheFlattenedTracks}}]),e}(iW),ek([ij(void 0,void 0)],t.TimelineAsset.prototype,"tracks",void 0),t.TimelineAsset=ek([iU(el.TimelineAsset)],t.TimelineAsset);var sO=function(){function e(e,i){this.time=0,this.clips=[],this.masterTrackInstances=[];for(var r,n={},a=iD(i);!(r=a()).done;){var o=r.value;n[o.key.getInstanceId()]=o.value}for(var s,u=iD(e.tracks);!(s=u()).done;){var h=s.value;eF(h,t.ObjectBindingTrack)&&h.create(e,n)}this.compileTracks(e.flattenedTracks,i)}var i=e.prototype;return i.setTime=function(t){this.time=t},i.getTime=function(){return this.time},i.evaluate=function(t){for(var e,i=this.getTime(),r=iD(this.clips);!(e=r()).done;)e.value.evaluateAt(i);for(var n,a=iD(this.masterTrackInstances);!(n=a()).done;){var o=n.value;this.tickTrack(o,t)}},i.compileTracks=function(t,e){for(var i,r={},n=iD(t);!(i=n()).done;){var a=i.value,o=a.createPlayableGraph(this.clips),s=a.createOutput(),u=new sR(a,o,s);r[a.getInstanceId()]=u,a.parent||this.masterTrackInstances.push(u)}for(var h,l=iD(t);!(h=l()).done;)for(var c,f=h.value,d=r[f.getInstanceId()],p=iD(f.getChildTracks());!(c=p()).done;){var m=r[c.value.getInstanceId()];d.addChild(m)}for(var v,y=iD(e);!(v=y()).done;){var g=v.value;r[g.key.getInstanceId()].boundObject=g.value}for(var x,b=iD(this.masterTrackInstances);!(x=b()).done;){var T=x.value;this.updateTrackAnimatedObject(T)}},i.tickTrack=function(e,i){var r=e.output.context;r.deltaTime=i,e.output.setUserData(e.boundObject);for(var n,a=iD(e.mixer.clipPlayables);!(n=a()).done;){var o=n.value;o.getPlayState()===t.PlayState.Playing&&o.processFrame(r)}e.mixer.evaluate(r);for(var s,u=iD(e.children);!(s=u()).done;){var h=s.value;this.tickTrack(h,i)}},i.updateTrackAnimatedObject=function(t){for(var e,i=iD(t.children);!(e=i()).done;){var r=e.value;if(!r.boundObject){var n=r.trackAsset.updateAnimatedObject(t.boundObject);r.boundObject=n}this.updateTrackAnimatedObject(r)}},e}();t.CompositionComponent=function(e){function i(){var i;return i=e.apply(this,arguments)||this,i.time=0,i.items=[],i.state=t.PlayState.Playing,i.reusable=!1,i.sceneBindings=[],i}iN(i,e);var r=i.prototype;return r.onStart=function(){var e;this.timelineAsset||(this.timelineAsset=new t.TimelineAsset(this.engine)),this.timelineInstance=new sO(this.timelineAsset,this.sceneBindings),null==(e=this.item.composition)||e.refContent.push(this.item)},r.getReusable=function(){return this.reusable},r.pause=function(){this.state=t.PlayState.Paused},r.resume=function(){this.state=t.PlayState.Playing},r.onUpdate=function(e){if(this.state!==t.PlayState.Paused){var i=this.time;this.timelineInstance.setTime(i),this.timelineInstance.evaluate(e/1e3)}},r.onEnable=function(){for(var t,e=iD(this.items);!(t=e()).done;)t.value.setActive(!0)},r.onDisable=function(){for(var t,e=iD(this.items);!(t=e()).done;)t.value.setActive(!1)},r.onDestroy=function(){this.item.composition&&this.items&&(this.items.forEach(function(t){return t.dispose()}),this.items.length=0)},r.hitTest=function(e,i,r,n,a,o){for(var s,u=[],h=(null==o?void 0:o.stop)||ip,l=(null==o?void 0:o.skip)||ip,c=(null==o?void 0:o.maxCount)||this.items.length,f=0;f<this.items.length&&n.length<c;f++){var d=(s=this,function(o){var c=s.items[o];if(c.isActive&&c.transform.getValid()&&!t.VFXItem.isComposition(c)&&!l(c)){var f=c.getHitTestParams(a);if(f){var d=!1,p=new e$;if(f.type===t.HitTestType.triangle)for(var m=f.triangles,v=f.backfaceCulling,y=0;y<m.length;y++){var g=m[y];if(e.intersectTriangle(g,p,v)){d=!0,u.push(p);break}}else if(f.type===t.HitTestType.box){var x=f.center,b=f.size,T=x.clone().addScaledVector(b,.5),_=x.clone().addScaledVector(b,-.5);e.intersectBox({min:T,max:_},p)&&(d=!0,u.push(p))}else if(f.type===t.HitTestType.sphere){var E=f.center,C=f.radius;e.intersectSphere({center:E,radius:C},p)&&(d=!0,u.push(p))}else if(f.type===t.HitTestType.custom){var w=f.collect(e,new eJ(i,r));w&&w.length>0&&(w.forEach(function(t){u.push(t)}),d=!0)}if(d){var S={compContent:s.item,id:c.getInstanceId(),name:c.name,position:u[u.length-1],parentId:c.parentId,hitPositions:u,behavior:f.behavior,item:c,composition:s.item.composition};if(n.push(S),h(S))return{v:n}}}}}(f));if("object"===eD(d))return d.v}return n},r.setChildrenRenderOrder=function(t){for(var e,r=iD(this.items);!(e=r()).done;){var n=e.value;n.renderOrder=t++;var a=n.getComponent(i);a&&(t=a.setChildrenRenderOrder(t))}return t},r.fromData=function(t){e.prototype.fromData.call(this,t)},i}(rw),ek([ij(void 0,void 0)],t.CompositionComponent.prototype,"items",void 0),ek([ij(void 0,void 0)],t.CompositionComponent.prototype,"sceneBindings",void 0),ek([ij(void 0,void 0)],t.CompositionComponent.prototype,"timelineAsset",void 0),t.CompositionComponent=ek([iU("CompositionComponent")],t.CompositionComponent);var sN=function(){var t=this,e=this;this.listeners={},this.off=function(e,i){t.listeners[e]&&(t.listeners[e]=t.listeners[e].filter(function(t){return t.listener!==i}))},this.on=function(e,i,r){return t.listeners[e]=t.listeners[e]||[],t.listeners[e].push({listener:i,options:r}),function(){return t.off(e,i)}},this.once=function(e,i){t.on(e,i,{once:!0})},this.emit=function(t){for(var i,r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];null==(i=e.listeners[t])||i.forEach(function(i){var r=i.listener,a=i.options;r.apply(void 0,[].concat(n)),(null==a?void 0:a.once)&&e.off(t,r)})},this.getListeners=function(e){var i;return(null==(i=t.listeners[e])?void 0:i.map(function(t){return t.listener}))||[]}},sL=function(){function t(){this.update=new sF,this.lateUpdate=new sD}var e=t.prototype;return e.addComponent=function(t){t.onUpdate!==rw.prototype.onUpdate&&this.update.addComponent(t),t.onLateUpdate!==rw.prototype.onLateUpdate&&this.lateUpdate.addComponent(t)},e.removeComponent=function(t){t.onUpdate!==rw.prototype.onUpdate&&this.update.removeComponent(t),t.onLateUpdate!==rw.prototype.onLateUpdate&&this.lateUpdate.removeComponent(t)},e.clear=function(){this.update.clear(),this.lateUpdate.clear()},t}(),sV=function(){function t(){this.components=[],this.ticks=[]}var e=t.prototype;return e.tick=function(t){this.tickComponents(this.components,t);for(var e=0;e<this.ticks.length;e++)this.ticks[e](t)},e.tickComponents=function(t,e){},e.addComponent=function(t){this.components.includes(t)||this.components.push(t)},e.removeComponent=function(t){var e=this.components.indexOf(t);e>-1&&this.components.splice(e,1)},e.addTick=function(t,e){var i=t.bind(e);this.ticks.includes(i)||this.ticks.push(i)},e.clear=function(){this.components=[]},t}(),sF=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=iD(t);!(i=r()).done;)i.value.onUpdate(e)},e}(sV),sD=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=iD(t);!(i=r()).done;)i.value.onLateUpdate(e)},e}(sV),sk=function(e){function i(r,n){(y=e.call(this)||this).sceneTicking=new sL,y.speed=1,y.isEnded=!1,y.loaderData={},y.refContent=[],y.startTime=0,y.postProcessingEnabled=!1,y.destroyed=!1,y.paused=!1,y.isEndCalled=!1,y._textures=[],y.videos=[];var a,o,s,u=r.reusable,h=void 0!==u&&u,l=r.speed,c=r.baseRenderOrder,f=r.renderer,d=r.event,p=r.width,m=r.height,v=r.onItemMessage;y.renderer=f,y.renderer.engine.addComposition(ot(y)),y._textures=n.textures;for(var y,g,x,b=iD(Object.keys(n.assets));!(x=b()).done;){var T=x.value,_=n.assets[T];eF(_,HTMLVideoElement)&&y.videos.push(_)}y.postProcessingEnabled=null!=(E=null==(g=n.jsonScene.renderSettings)?void 0:g.postProcessingEnabled)&&E,y.getEngine().renderLevel=n.renderLevel,h&&(n.consumed=!0);for(var E,C,w=n.jsonScene.compositions[0],S=iD(n.jsonScene.compositions);!(C=S()).done;){var A=C.value;A.id===n.jsonScene.compositionId&&(w=A)}ih(w),y.rootItem=new t.VFXItem(y.getEngine()),y.rootItem.setInstanceId(w.id),y.rootItem.name="rootItem",y.rootItem.duration=w.duration,y.rootItem.endBehavior=w.endBehavior,y.rootItem.composition=ot(y);for(var M,I=w.components,P=iD(I);!(M=P()).done;){var R=M.value,O=y.getEngine().findObject(R);y.rootItem.components.push(O),O.item=y.rootItem}return y.rootComposition=y.rootItem.getComponent(t.CompositionComponent),y.width=p,y.height=m,y.renderOrder=void 0===c?0:c,y.id=w.id,y.startTime=null!=(a=w.startTime)?a:0,y.renderer=f,y.event=d,y.statistic={loadStart:null!=(o=n.startTime)?o:0,loadTime:null!=(s=n.totalTime)?s:0,compileTime:0,firstFrameTime:0},y.reusable=h,y.speed=void 0===l?1:l,y.name=w.name,iM.initializeComposition(ot(y),n),y.camera=new os(y.name,i2({},null==w?void 0:w.camera,{aspect:p/m,pixelWidth:p,pixelHeight:m})),y.url=n.url,y.interactive=!0,v&&(y.onItemMessage=v),y.createRenderFrame(),i.buildItemTree(y.rootItem),y.rootComposition.setChildrenRenderOrder(0),y}iN(i,e);var r=i.prototype;return r.getDuration=function(){return this.rootItem.duration},r.restart=function(){this.reset(),this.forwardTime(this.startTime)},r.setIndex=function(t){this.renderOrder=t},r.getIndex=function(){return this.renderOrder},r.setSpeed=function(t){this.speed=t},r.setVisible=function(t){this.rootItem.setVisible(t)},r.getSpeed=function(){return this.speed},r.play=function(){this.isEnded&&this.reusable&&this.restart(),this.rootComposition.isStartCalled?this.setTime(this.time-this.startTime):this.setTime(0),this.resume()},r.pause=function(){this.paused=!0,this.emit("pause")},r.getPaused=function(){return this.paused},r.resume=function(){this.paused=!1,this.isEnded&&this.reusable&&this.restart();var t=this.time;this.emit("play",{time:t})},r.gotoAndPlay=function(t){this.setTime(t),this.emit("goto",{time:t}),this.resume()},r.gotoAndStop=function(t){this.setTime(t),this.emit("goto",{time:t}),this.pause()},r.createRenderFrame=function(){this.renderFrame=new nH({camera:this.camera,renderer:this.renderer,globalVolume:this.globalVolume,postProcessingEnabled:this.postProcessingEnabled})},r.setTime=function(t){var e=this.speed,i=this.getPaused();i&&this.resume(),this.setSpeed(1),this.forwardTime(t+this.startTime),this.setSpeed(e),i&&(this.paused=!0)},r.addItem=function(t){this.items.push(t),t.setParent(this.rootItem)},r.getComponent=function(t){return this.rootItem.getComponent(t)},r.forwardTime=function(t){for(var e=1e3*t-1e3*this.time,i=e<0,r=Math.abs(e),n=i?-15:15;r>15;r-=15)this.update(n);this.update(i?-r:r)},r.reset=function(){this.isEnded=!1,this.isEndCalled=!1,this.rootComposition.time=0},r.prepareRender=function(){},r.update=function(t){if(!this.getPaused()){this.rootItem.isDuringPlay||(this.rootItem.awake(),this.rootItem.beginPlay());var e=this.time;this.updateCompositionTime(t*this.speed/1e3);var i=(this.time-e)*1e3;this.sceneTicking.update.tick(i),this.sceneTicking.lateUpdate.tick(i),this.updateCamera(),this.prepareRender(),this.isEnded&&!this.isEndCalled&&(this.isEndCalled=!0,this.emit("end",{composition:this})),this.shouldDispose()&&this.dispose()}},r.shouldDispose=function(){return this.isEnded&&this.rootItem.endBehavior===tQ.destroy&&!this.reusable},r.updateCamera=function(){this.camera.updateMatrix()},r.updateCompositionTime=function(e){if(this.rootComposition.state!==t.PlayState.Paused&&this.rootComposition.isActiveAndEnabled){var i=this.time+e-this.startTime;e<0&&i<0&&(i=0);var r=this.rootItem.duration,n=this.rootItem.endBehavior,a=!1;if(i>=r)switch(a=!0,n){case tQ.restart:i%=r,this.restart();break;case tQ.freeze:i=Math.min(r,i);case tQ.forward:case tQ.destroy:}this.rootComposition.time=i+this.startTime,this.isEnded!==a&&(a?this.isEnded=!0:(this.isEnded=!1,this.isEndCalled=!1))}},r.getItemByName=function(t){return this.rootItem.find(t)},r.getHitTestRay=function(t,e){var i=this.renderFrame.editorTransform,r=i.x,n=i.y;return ai((t-i.z)/r,(e-i.w)/n,this.camera)},r.getEngine=function(){var t;return null==(t=this.renderer)?void 0:t.engine},r.hitTest=function(e,i,r,n){if(this.isDestroyed||!this.interactive)return[];var a=[],o=this.getHitTestRay(e,i);return this.refContent.forEach(function(s){var u;null==(u=s.getComponent(t.CompositionComponent))||u.hitTest(o,e,i,a,r,n)}),a},r.addInteractiveItem=function(t,e){if(e===tB.MESSAGE)return null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:2,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:2,id:t.id}),t.id},r.removeInteractiveItem=function(t,e){e===tB.MESSAGE&&(null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:1,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:1,id:t.id}))},r.destroyItem=function(t){t.type!==tG.composition&&eX(this.items,t)},r.lost=function(t){this.videoState=this.textures.map(function(t){if("video"in t.source)return t.source.video.pause(),t.source.video.currentTime}),this.textures.map(function(t){return t.dispose()}),this.dispose()},r.dispose=function(){var e=this;if(!this.destroyed){this.destroyed=!0;for(var i,r=iD(this.textures);!(i=r()).done;)i.value.dispose();this._textures=[];for(var n,a=iD(this.videos);!(n=a()).done;){var o=n.value;o.pause(),o.removeAttribute("src"),o.load()}this.videos=[],this.rootItem.dispose(),this.renderFrame.dispose(),iM.destroyComposition(this),this.update=function(){id.error("Update disposed composition: "+e.name+".")},this.dispose=ip,this.renderer.engine.removeComposition(this),this.getEngine().env!==az&&this.renderer.clear({stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]})}},r.setEditorTransform=function(t,e,i){this.renderFrame.editorTransform.set(t,t,e,i)},r.translateByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.rootItem.translateByPixel(t,e)},r.setPositionByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.rootItem.setPositionByPixel(t,e)},r.translate=function(t,e,i){this.rootItem.translate(t,e,i)},r.setPosition=function(t,e,i){this.rootItem.setPosition(t,e,i)},r.rotate=function(t,e,i){this.rootItem.rotate(t,e,i)},r.setRotation=function(t,e,i){this.rootItem.setRotation(t,e,i)},r.scale=function(t,e,i){this.rootItem.scale(t,e,i)},r.setScale=function(t,e,i){this.rootItem.setScale(t,e,i)},r.offloadTexture=function(){this.textureOffloaded||(this.textures.forEach(function(t){return t&&t.offloadData()}),this.textureOffloaded=!0)},r.reloadTexture=function(){var t=this;return eV(function(){return ez(this,function(e){switch(e.label){case 0:if(!t.textureOffloaded)return[3,2];return[4,Promise.all(t.textures.map(function(t){return null==t?void 0:t.reloadData()}))];case 1:e.sent(),t.textureOffloaded=!1,e.label=2;case 2:return[2]}})})()},i.buildItemTree=function(e){for(var i,r=new Map,n=e.getComponent(t.CompositionComponent).items,a=iD(n);!(i=a()).done;){var o=i.value;r.set(o.id,o)}for(var s,u=iD(n);!(s=u()).done;){var h=s.value;if(void 0===h.parentId)h.setParent(e);else{var l=r.get(h.parentId);if(l)h.setParent(l);else throw Error("The element references a non-existent element, please check the data.")}}},rC(i,[{key:"transform",get:function(){return this.rootItem.transform}},{key:"textures",get:function(){return this._textures}},{key:"items",get:function(){return this.rootComposition.items}},{key:"time",get:function(){return this.rootComposition.time}},{key:"isDestroyed",get:function(){return this.destroyed}},{key:"viewportMatrix",get:function(){return this.camera.getViewportMatrix()},set:function(t){this.camera.setViewportMatrix(t)}}]),i}(sN);t.VFXItem=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).children=[],r.transform=new oa,r.time=-1,r.duration=0,r.endBehavior=tQ.forward,r.type=tG.base,r.components=[],r.isDuringPlay=!1,r.active=!0,r.visible=!0,r.listIndex=0,r.isEnabled=!1,r.eventProcessor=new sN,r.name="VFXItem",r.transform.name=r.name,r.transform.engine=t,i&&r.fromData(i),r}iN(i,e);var r=i.prototype;return r.on=function(t,e,i){this.eventProcessor.on(t,e,i)},r.off=function(t,e){this.eventProcessor.off(t,e)},r.once=function(t,e){this.eventProcessor.once(t,e)},r.emit=function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=this.eventProcessor).emit.apply(e,[].concat([t],r))},r.getListeners=function(t){return this.eventProcessor.getListeners(t)},r.addComponent=function(t){var e=new t(this.engine);return this.components.push(e),e.setVFXItem(this),e},r.getComponent=function(t){for(var e,i,r=iD(this.components);!(i=r()).done;){var n=i.value;if(eF(n,t)){e=n;break}}return e},r.getComponents=function(t){for(var e,i=[],r=iD(this.components);!(e=r()).done;){var n=e.value;eF(n,t)&&i.push(n)}return i},r.setParent=function(t){(t!==this||t)&&(this.parent&&eX(this.parent.children,this),this.parent=t,this.transform.parentTransform=t.transform,t.children.push(this),!this.composition&&t.composition&&(this.composition=t.composition),!this.isDuringPlay&&t.isDuringPlay&&(this.awake(),this.beginPlay()))},r.setColor=function(t,e,i,r){},r.setOpacity=function(t){},r.setActive=function(t){!!t!==this.active&&(this.active=!!t,this.onActiveChanged())},r.setVisible=function(t){for(var e,i=iD(this.components);!(e=i()).done;)e.value.enabled=t;this.visible=t},r.getVisible=function(){return this.visible},r.getWorldTransform=function(t){var e=null!=t?t:new oa({valid:!0});return e.cloneFromMatrix(this.transform.getWorldMatrix()),e},r.translate=function(t,e,i){this.transform.translate(t,e,i)},r.rotate=function(t,e,i){var r=new nb(t,e,i),n=i5.fromEuler(r);n.conjugate(),this.transform.rotateByQuat(n)},r.scale=function(t,e,i){this.transform.scaleBy(t,e,i)},r.setPositionByPixel=function(t,e){if(this.composition){var i=this.transform.getWorldPosition().z,r=this.composition.camera.getInverseVPRatio(i),n=r.x,a=r.y,o=this.composition.renderer.getWidth()/2,s=this.composition.renderer.getHeight()/2;this.transform.setPosition((2*t/o-1)*n,(1-2*e/s)*a,i)}},r.setPosition=function(t,e,i){this.transform.setPosition(t,e,i)},r.setRotation=function(t,e,i){this.transform.setRotation(t,e,i)},r.setScale=function(t,e,i){this.transform.setScale(t,e,i)},r.setWorldPosition=function(t,e,i){this.transform.setWorldPosition(t,e,i)},r.getBoundingBox=function(){},r.getHitTestParams=function(t){},r.getCurrentPosition=function(){var t=new e$;return this.transform.assignWorldTRS(t),t},r.find=function(t){if(this.name===t)return this;var e=[];e.push.apply(e,[].concat(this.children));for(var i=0;i<e.length;){var r=e[i];if(i++,r.name===t)return r;e.push.apply(e,[].concat(r.children))}},r.duplicate=function(){var t=new Map;this.gatherPreviousObjectID(t),this.resetGUID();var e=this.engine.findObject({id:this.defination.id});return e.resetGUID(),this.resetGUID(t),this.composition&&e.setParent(this.composition.rootItem),e},r.beginPlay=function(){this.isDuringPlay=!0,this.composition&&this.active&&!this.isEnabled&&this.onEnable();for(var t,e=iD(this.children);!(t=e()).done;){var i=t.value;i.isDuringPlay||i.beginPlay()}},r.awake=function(){for(var t,e=iD(this.components);!(t=e()).done;){var i=t.value;i.isAwakeCalled||(i.onAwake(),i.isAwakeCalled=!0)}for(var r,n=iD(this.children);!(r=n()).done;)r.value.awake()},r.onActiveChanged=function(){this.isEnabled?this.onDisable():this.onEnable()},r.onEnable=function(){this.isEnabled=!0;for(var t,e=iD(this.components);!(t=e()).done;){var i=t.value;i.enabled&&!i.isStartCalled&&(i.onStart(),i.isStartCalled=!0)}for(var r,n=iD(this.components);!(r=n()).done;){var a=r.value;a.enabled&&!a.isEnableCalled&&a.enable()}},r.onDisable=function(){this.isEnabled=!1;for(var t,e=iD(this.components);!(t=e()).done;){var i=t.value;i.enabled&&i.isEnableCalled&&i.disable()}},r.fromData=function(r){e.prototype.fromData.call(this,r);var n=r.id,a=r.name,o=r.parentId,s=r.endBehavior,u=r.transform,h=r.duration,l=void 0===h?0:h,c=r.visible;if(this.props=r,this.type=r.type,this.id=n.toString(),this.name=a,u&&this.transform.fromData(u),this.transform.name=this.name,this.transform.engine=this.engine,this.parentId=o,this.duration=l,this.endBehavior=s,r.content||(r.content={options:{}}),l<0)throw Error("Item duration can't be less than 0, see "+aB["Item duration can't be less than 0"]+".");if(r.components){this.components.length=0;for(var f,d=iD(r.components);!(f=d()).done;){var p=f.value,m=this.engine.findObject(p);this.components.push(m),eF(m,t.ParticleSystem)&&!this.components.includes(m.renderer)&&this.components.push(m.renderer)}}i.isComposition(this)&&this.instantiatePreComposition(),this.setVisible(void 0===c||c)},r.toData=function(){if(this.defination.id=this.guid,this.defination.transform=this.transform.toData(),this.defination.dataType=el.VFXItemData,(null==(e=this.parent)?void 0:e.name)!=="rootItem"&&(this.defination.parentId=null==(i=this.parent)?void 0:i.guid),!this.defination.components){this.defination.components=[];for(var e,i,r,n=iD(this.components);!(r=n()).done;){var a=r.value;eF(a,t.EffectComponent)&&this.defination.components.push(a)}}this.defination.content={}},r.translateByPixel=function(t,e){if(this.composition){var i=this.composition.getEngine().canvas.getBoundingClientRect(),r=i.width,n=i.height,a=this.transform.getWorldPosition().z,o=this.composition.camera.getInverseVPRatio(a),s=o.x,u=o.y;this.transform.translate(2*t*s/r,-2*e*u/n,0)}},r.dispose=function(){if(this.resetChildrenParent(),this.composition){this.composition.destroyItem(this);for(var t,i=iD(this.components.slice());!(t=i()).done;)t.value.dispose();this.components=[],this._composition=null,this.transform.setValid(!1)}e.prototype.dispose.call(this)},r.resetChildrenParent=function(){for(var t,e,i=iD(this.children);!(e=i()).done;){var r=e.value;this.parent&&r.setParent(this.parent)}this.parent&&eX(null==(t=this.parent)?void 0:t.children,this)},r.instantiatePreComposition=function(){var e=this.props.content.options.refId,i=this.engine.findEffectsObjectData(e);if(!i)throw Error("Referenced precomposition with Id: "+e+" does not exist.");var r=i.components,n=this.getInstanceId();this.setInstanceId(i.id);for(var a,o=iD(r);!(a=o()).done;){var s=a.value,u=this.engine.findObject(s);if(u.item=this,this.components.push(u),u.setInstanceId(i_()),eF(u,t.CompositionComponent))for(var h,l=iD(u.items);!(h=l()).done;){var c=h.value;c.setInstanceId(i_());for(var f,d=iD(c.components);!(f=d()).done;)f.value.setInstanceId(i_())}}this.setInstanceId(n),sk.buildItemTree(this)},r.resetGUID=function(t){var e=null!=(i=null==t?void 0:t.get(this))?i:i_();this.setInstanceId(e);for(var i,r,n=iD(this.components);!(r=n()).done;){var a,o=r.value,s=null!=(a=null==t?void 0:t.get(o))?a:i_();o.setInstanceId(s)}for(var u,h=iD(this.children);!(u=h()).done;)u.value.resetGUID(t)},r.gatherPreviousObjectID=function(t){t.set(this,this.getInstanceId());for(var e,i=iD(this.components);!(e=i()).done;){var r=e.value;t.set(r,r.getInstanceId())}for(var n,a=iD(this.children);!(n=a()).done;)n.value.gatherPreviousObjectID(t)},i.isComposition=function(t){return t.type===tG.composition},i.isSprite=function(t){return t.type===tG.sprite},i.isParticle=function(t){return t.type===tG.particle},i.isNull=function(t){return t.type===tG.null},i.isTree=function(t){return t.type===tG.tree},i.isCamera=function(t){return t.type===tG.camera},i.isAncestor=function(t,e){for(var i=e.parent;i;){if(i===t)return!0;i=i.parent}return!1},rC(i,[{key:"composition",get:function(){return this._composition},set:function(t){this._composition=t;for(var e,i=iD(this.children);!(e=i()).done;){var r=e.value;r.composition||(r.composition=t)}}},{key:"compositionReusable",get:function(){var t,e;return null!=(e=null==(t=this.composition)?void 0:t.reusable)&&e}},{key:"renderOrder",get:function(){return this.listIndex},set:function(t){if(this.listIndex!==t){this.listIndex=t;for(var e,i=iD(this.components);!(e=i()).done;){var r=e.value;eF(r,rA)&&(r.priority=t)}}}},{key:"isActive",get:function(){return this.active},set:function(t){this.setActive(t)}},{key:"isVisible",get:function(){return this.visible}}]),i}(iW),t.VFXItem=ek([iU(el.VFXItemData)],t.VFXItem),t.Item=void 0,(tS=t.Item||(t.Item={})).is=function(t,e){return t.type===e},tS.isComposition=function(t){return t.type===tG.composition},tS.isParticle=function(t){return t.type===tG.particle},tS.isNull=function(t){return t.type===tG.null};var sz=[1,1,1,1],sB=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.renderColor=[1,1,1,1],t}iN(i,e);var r=i.prototype;return r.processFrame=function(e){var i,r,n,a=e.output.getUserData();if(eF(a,t.VFXItem)){if(this.activeComponent||(this.activeComponent=this.getActiveComponent(a)),!this.activeMaterial){this.activeMaterial=null==(o=this.activeComponent)?void 0:o.material;var o,s,u=null==(s=this.activeMaterial)?void 0:s.getColor("_Color");u&&(this.startColor=u.toArray())}var h=n7(sz,1),l=this.time/this.getDuration(),c=this.opacityOverLifetime,f=this.colorOverLifetime;f&&(h=e3(f,l,!0),i=!0),c&&(h[3]*=c.getValue(l),i=!0),i&&(at(this.renderColor,h,this.startColor),null==(n=this.activeMaterial)||null==(r=n.getColor("_Color"))||r.setFromArray(this.renderColor))}},r.create=function(t){this.clipData=t;var e,i=t.colorOverLifetime;return i&&(this.opacityOverLifetime=aW(null!=(e=i.opacity)?e:1),i.color&&i.color[0]===tZ.GRADIENT_COLOR&&(this.colorOverLifetime=e4(i.color[1]))),this},r.getActiveComponent=function(t){return t.getComponent(n2)},i}(a8);t.AnimationClip=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.positionCurves=[],e.rotationCurves=[],e.eulerCurves=[],e.scaleCurves=[],e.floatCurves=[],e.colorCurves=[],e}iN(e,t);var i=e.prototype;return i.sampleAnimation=function(t,e){for(var i,r=eK(e,0,this.duration),n=iD(this.positionCurves);!(i=n()).done;){var a=i.value,o=a.keyFrames.getValue(r),s=this.findTarget(t,a.path);null==s||s.transform.setPosition(o.x,o.y,o.z)}for(var u,h=iD(this.rotationCurves);!(u=h()).done;){var l=u.value,c=l.keyFrames.getValue(r),f=this.findTarget(t,l.path);null==f||f.transform.setQuaternion(c.x,c.y,c.z,c.w)}for(var d,p=iD(this.eulerCurves);!(d=p()).done;){var m=d.value,v=m.keyFrames.getValue(r),y=this.findTarget(t,m.path);null==y||y.transform.setRotation(v.x,v.y,v.z)}for(var g,x=iD(this.scaleCurves);!(g=x()).done;){var b=g.value,T=b.keyFrames.getValue(r),_=this.findTarget(t,b.path);null==_||_.transform.setScale(T.x,T.y,T.z)}},i.fromData=function(t){this.positionCurves.length=0,this.scaleCurves.length=0,this.rotationCurves.length=0,this.eulerCurves.length=0,this.floatCurves.length=0,this.colorCurves.length=0;var e=0;if(t.positionCurves)for(var i,r=iD(t.positionCurves);!(i=r()).done;){var n=i.value,a={path:n.path,keyFrames:aW(n.keyFrames)};e=Math.max(e,a.keyFrames.getMaxTime()),this.positionCurves.push(a)}if(t.rotationCurves)for(var o,s=iD(t.rotationCurves);!(o=s()).done;){var u=o.value,h={path:u.path,keyFrames:aW(u.keyFrames)};e=Math.max(e,h.keyFrames.getMaxTime()),this.rotationCurves.push(h)}if(t.eulerCurves)for(var l,c=iD(t.eulerCurves);!(l=c()).done;){var f=l.value,d={path:f.path,keyFrames:aW(f.keyFrames)};e=Math.max(e,d.keyFrames.getMaxTime()),this.eulerCurves.push(d)}if(t.scaleCurves)for(var p,m=iD(t.scaleCurves);!(p=m()).done;){var v=p.value,y={path:v.path,keyFrames:aW(v.keyFrames)};e=Math.max(e,y.keyFrames.getMaxTime()),this.scaleCurves.push(y)}if(t.floatCurves)for(var g,x=iD(t.floatCurves);!(g=x()).done;){var b=g.value,T={path:b.path,keyFrames:aW(b.keyFrames),property:b.property,className:b.className};e=Math.max(e,T.keyFrames.getMaxTime()),this.floatCurves.push(T)}if(t.colorCurves)for(var _,E=iD(t.colorCurves);!(_=E()).done;){var C=_.value,w={path:C.path,keyFrames:aW(C.keyFrames),property:C.property,className:C.className};e=Math.max(e,w.keyFrames.getMaxTime()),this.colorCurves.push(w)}void 0!==t.duration?this.duration=t.duration:this.duration=e},i.findTarget=function(t,e){for(var i,r=t,n=e.split("."),a=iD(n);!(i=a()).done;){for(var o,s=i.value,u=!1,h=iD(r.children);!(o=h()).done;){var l=o.value;if(l.name===s){r=l,u=!0;break}}if(!u)return}return r},e}(iW),t.AnimationClip=ek([iU(el.AnimationClip)],t.AnimationClip);var sU=[[0,0,1,1,0]],sG=0;t.SpriteColorPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new sB;return t.create(this.data),t},i.fromData=function(t){this.data=t},e}(a7),t.SpriteColorPlayableAsset=ek([iU(el.SpriteColorPlayableAsset)],t.SpriteColorPlayableAsset);var sj=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new su},e}(t.TrackAsset),sW=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.SpriteComponent)},i}(sj),sX=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.EffectComponent)},i}(sj),sH=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new sY},e}(a7),sY=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.processFrame=function(t){var e=t.output.getUserData();"time"in e&&(e.time=this.time)},e}(a8);t.SpriteComponent=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).time=0,r.duration=1,r.loop=!0,r.splits=sU,r.name="MSprite"+sG++,i&&r.fromData(i),r}iN(i,e);var r=i.prototype;return r.onUpdate=function(t){var e=this,i=this.time,r=this.duration;i>r&&this.loop&&(i%=r);var n=Math.min(Math.max(i/r,0),1),a=this.textureSheetAnimation,o=this.renderer.texture.source.video;if(o&&(0===i?o.pause():o.play().catch(function(t){e.engine.renderErrors.add(t)}),this.renderer.texture.uploadCurrentVideoFrame()),a){var s,u,h,l,c,f=a.total||a.row*a.col,d=0,p=0,m=1,v=1;if(this.splits){var y=this.splits[0];u=y[4],d=y[0],p=y[1],u?(m=y[3],v=y[2]):(m=y[2],v=y[3])}if(u?(h=1/a.row*m,l=1/a.col*v):(h=1/a.col*m,l=1/a.row*v),a.animate){var g=Math.round(n*(f-1)),x=Math.floor(g/a.col),b=g-x*a.col;c=u?[h*x,l*(a.col-b)]:[h*b,l*(1+x)]}else c=[0,l];null==(s=this.material.getVector4("_TexOffset"))||s.setFromArray([d+c[0],v+p-c[1],h,l])}this.time=i+t/1e3},r.onDisable=function(){e.prototype.onDisable.call(this),this.time=0},r.onDestroy=function(){var e=this.renderer.texture.source;e.sourceType===t.TextureSourceType.video&&(null==e?void 0:e.video)&&(e.video.pause(),e.video.src="",e.video.load())},r.updateGeometry=function(t){var e=this.textureSheetAnimation?[0,0,1,1,this.splits[0][4]]:this.splits[0],i=e[0],r=e[1],n=!!e[4],a=n?e[3]:e[2],o=n?e[2]:e[3],s=n?-Math.PI/2:0,u=t.getAttributeData("aUV"),h=t.getAttributeData("aPos"),l=t.getIndexData(),c=[0,0];if(u&&h&&l){for(var f=u.length/2,d=0;d<f;d++){var p=3*d,m=2*d,v=h[p],y=h[p+1];c[0]=v,c[1]=y,oG(c,c,s),u[m]=(c[0]+.5)*a+i,u[m+1]=(c[1]+.5)*o+r}this.geometry.setAttributeData("aPos",h.slice()),this.geometry.setAttributeData("aUV",u.slice()),this.geometry.setIndexData(l.slice()),this.geometry.setDrawCount(l.length)}this.geometry.subMeshes.length=0;for(var g,x=iD(t.subMeshes);!(g=x()).done;){var b=g.value;this.geometry.subMeshes.push({offset:b.offset,indexCount:b.indexCount,vertexCount:b.vertexCount})}},r.updateGeometryFromMultiSplit=function(){for(var t=this.splits,e=this.textureSheetAnimation,i=this.defaultGeometry,r=[],n=[],a=[],o=0;o<2;o++)for(var s=0;s<2;s++){var u=(2*s+o)*4,h=e?[0,0,1,1,t[0][4]]:t[2*s+o],l=h[4]?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],c=((o+o+1)/2-1)/2,f=((s+s+1)/2-1)/2,d=h[0],p=h[1],m=h[4]?h[3]:h[2],v=h[4]?h[2]:h[3],y=[-.25+c,.25+f,-.25+c,-.25+f,.25+c,.25+f,.25+c,-.25+f];r.push(l[0]*m+d,l[1]*v+p,l[2]*m+d,l[3]*v+p,l[4]*m+d,l[5]*v+p,l[6]*m+d,l[7]*v+p),a.push(1*y[0],1*y[1],0,1*y[2],1*y[3],0,1*y[4],1*y[5],0,1*y[6],1*y[7],0),n.push(u,1+u,2+u,2+u,1+u,3+u)}i.setAttributeData("aPos",new Float32Array(a)),i.setIndexData(new Uint16Array(n)),i.setAttributeData("aUV",new Float32Array(r)),i.setDrawCount(n.length)},r.fromData=function(t){e.prototype.fromData.call(this,t);var i,r,n,a=null!=(i=t.splits)?i:sU,o=t.textureSheetAnimation;this.splits=a,this.textureSheetAnimation=o;var s=t.geometry?this.engine.findObject(t.geometry):this.defaultGeometry;1===a.length?this.updateGeometry(s):this.updateGeometryFromMultiSplit(),this.interaction=t.interaction;var u=t.options.startColor||[1,1,1,1];this.material.setColor("_Color",new e1().setFromArray(u)),this.duration=null!=(r=t.duration)?r:this.item.duration,this.loop=null==(n=t.loop)||n},i}(n2),t.SpriteComponent=ek([iU(el.SpriteComponent)],t.SpriteComponent);var sZ=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iR),sq=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iR),sQ=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){return this.set(t.x,t.y),this},e.copyTo=function(t){return t.set(this.x,this.y),t},e.equals=function(t){return t.x===this.x&&t.y===this.y},e.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},rC(t,null,[{key:"shared",get:function(){return sK.x=0,sK.y=0,sK}}]),t}(),sK=new sQ;function sJ(t,e,i,r,n,a,o,s){o?(u=r,h=-i):(u=-r,h=i);var u,h,l=t-i*n+u,c=e-r*n+h,f=t+i*a+u,d=e+r*a+h;return s.push(l,c),s.push(f,d),2}function s$(t,e,i,r,n,a,o,s){var u=i-t,h=r-e,l=Math.atan2(u,h),c=Math.atan2(n-t,a-e);s&&l<c?l+=2*Math.PI:!s&&l>c&&(c+=2*Math.PI);var f=l,d=c-l,p=Math.sqrt(u*u+h*h),m=(15*Math.abs(d)*Math.sqrt(p)/Math.PI>>0)+1,v=d/m;if(f+=v,s){o.push(t,e),o.push(i,r);for(var y=1,g=f;y<m;y++,g+=v)o.push(t,e),o.push(t+Math.sin(g)*p,e+Math.cos(g)*p);o.push(t,e),o.push(n,a)}else{o.push(i,r),o.push(t,e);for(var x=1,b=f;x<m;x++,b+=v)o.push(t+Math.sin(b)*p,e+Math.cos(b)*p),o.push(t,e);o.push(n,a),o.push(t,e)}return 2*m}function s0(t,e,i,r,n,a,o,s,u){if(0!==t.length){var h=e.alignment;if(.5!==e.alignment){var l=function(t){var e=t.length;if(e<6)return 1;for(var i=0,r=0,n=t[e-2],a=t[e-1];r<e;r+=2){var o=t[r],s=t[r+1];i+=(o-n)*(s+a),n=o,a=s}return i<0?-1:1}(t);i&&(l*=-1),h=(h-.5)*l+.5}var c=new sQ(t[0],t[1]),f=new sQ(t[t.length-2],t[t.length-1]),d=1e-4>Math.abs(c.x-f.x)&&1e-4>Math.abs(c.y-f.y);if(r){t=t.slice(),d&&(t.pop(),t.pop(),f.set(t[t.length-2],t[t.length-1]));var p=(c.x+f.x)*.5,m=(f.y+c.y)*.5;t.unshift(p,m),t.push(p,m)}var v=t.length/2,y=t.length,g=n.length/2,x=e.width/2,b=x*x,T=e.miterLimit*e.miterLimit,_=t[0],E=t[1],C=t[2],w=t[3],S=0,A=0,M=-(E-w),I=_-C,P=0,R=0,O=Math.sqrt(M*M+I*I)+1e-6;M/=O,I/=O,M*=x,I*=x;var N=h,L=(1-N)*2,V=2*N;r||(e.cap===ea.Round?y+=s$(_-M*(L-V)*.5,E-I*(L-V)*.5,_-M*L,E-I*L,_+M*V,E+I*V,n,!0)+2:e.cap===ea.Square&&(y+=sJ(_,E,M,I,L,V,!0,n))),n.push(_-M*L,E-I*L),n.push(_+M*V,E+I*V);for(var F=1;F<v-1;++F){_=t[(F-1)*2],E=t[(F-1)*2+1],C=t[2*F],w=t[2*F+1],S=t[(F+1)*2],A=t[(F+1)*2+1],O=Math.sqrt((M=-(E-w))*M+(I=_-C)*I)+1e-6,M/=O,I/=O,M*=x,I*=x,O=Math.sqrt((P=-(w-A))*P+(R=C-S)*R)+1e-6,P/=O,R/=O,P*=x,R*=x;var D=C-_,k=E-w,z=C-S,B=A-w,U=D*z+k*B,G=k*z-B*D,j=G<0;if(Math.abs(G)<.001*Math.abs(U)){n.push(C-M*L,w-I*L),n.push(C+M*V,w+I*V),U>=0&&(e.join===eo.Round?y+=s$(C,w,C-M*L,w-I*L,C-P*L,w-R*L,n,!1)+4:y+=2,n.push(C-P*V,w-R*V),n.push(C+P*L,w+R*L));continue}var W=(-M+_)*(-I+w)-(-M+C)*(-I+E),X=(-P+S)*(-R+w)-(-P+C)*(-R+A),H=(D*X-z*W)/G,Y=(B*W-k*X)/G,Z=(H-C)*(H-C)+(Y-w)*(Y-w),q=C+(H-C)*L,Q=w+(Y-w)*L,K=C-(H-C)*V,J=w-(Y-w)*V,$=j?L:V;Z<=Math.min(D*D+k*k,z*z+B*B)+$*$*b?e.join===eo.Bevel||Z/b>T?(j?(n.push(q,Q),n.push(C+M*V,w+I*V),n.push(q,Q),n.push(C+P*V,w+R*V)):(n.push(C-M*L,w-I*L),n.push(K,J),n.push(C-P*L,w-R*L),n.push(K,J)),y+=2):e.join===eo.Round?j?(n.push(q,Q),n.push(C+M*V,w+I*V),y+=s$(C,w,C+M*V,w+I*V,C+P*V,w+R*V,n,!0)+4,n.push(q,Q),n.push(C+P*V,w+R*V)):(n.push(C-M*L,w-I*L),n.push(K,J),y+=s$(C,w,C-M*L,w-I*L,C-P*L,w-R*L,n,!1)+4,n.push(C-P*L,w-R*L),n.push(K,J)):(n.push(q,Q),n.push(K,J)):(n.push(C-M*L,w-I*L),n.push(C+M*V,w+I*V),e.join===eo.Round?j?y+=s$(C,w,C+M*V,w+I*V,C+P*V,w+R*V,n,!0)+2:y+=s$(C,w,C-M*L,w-I*L,C-P*L,w-R*L,n,!1)+2:e.join===eo.Miter&&Z/b<=T&&(j?(n.push(K,J),n.push(K,J)):(n.push(q,Q),n.push(q,Q)),y+=2),n.push(C-P*L,w-R*L),n.push(C+P*V,w+R*V),y+=2)}_=t[(v-2)*2],E=t[(v-2)*2+1],C=t[(v-1)*2],O=Math.sqrt((M=-(E-(w=t[(v-1)*2+1])))*M+(I=_-C)*I)+1e-6,M/=O,I/=O,M*=x,I*=x,n.push(C-M*L,w-I*L),n.push(C+M*V,w+I*V),r||(e.cap===ea.Round?y+=s$(C-M*(L-V)*.5,w-I*(L-V)*.5,C-M*L,w-I*L,C+M*V,w+I*V,n,!1)+2:e.cap===ea.Square&&(y+=sJ(C,w,M,I,L,V,!1,n)));for(var tt=g;tt<y+g-2;++tt)_=n[2*tt],E=n[2*tt+1],C=n[(tt+1)*2],w=n[(tt+1)*2+1],S=n[(tt+2)*2],1e-8>Math.abs(_*(w-(A=n[(tt+2)*2+1]))+C*(A-E)+S*(E-w))||s.push(tt,tt+1,tt+2)}}var s1=function(){},s2="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s3={exports:{}};!function(t){function e(t,e){return t.b===e.b&&t.a===e.a}function i(t,e){return t.b<e.b||t.b===e.b&&t.a<=e.a}function r(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?r<n?e.a-t.a+r/(r+n)*(t.a-i.a):e.a-i.a+n/(r+n)*(i.a-t.a):0}function n(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?(e.a-i.a)*r+(e.a-t.a)*n:0}function a(t,e){return t.a<e.a||t.a===e.a&&t.b<=e.b}function o(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?r<n?e.b-t.b+r/(r+n)*(t.b-i.b):e.b-i.b+n/(r+n)*(i.b-t.b):0}function s(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?(e.b-i.b)*r+(e.b-t.b)*n:0}function u(t,e,i,r){return(t=0>t?0:t)<=(i=0>i?0:i)?0===i?(e+r)/2:e+t/(t+i)*(r-e):r+i/(t+i)*(e-r)}function h(t){var e=p(t.b);return v(e,t.c),v(e.b,t.c),y(e,t.a),e}function l(t,e){var i=!1,r=!1;t!==e&&(e.a!==t.a&&(r=!0,x(e.a,t.a)),e.d!==t.d&&(i=!0,b(e.d,t.d)),m(e,t),r||(v(e,t.a),t.a.c=t),i||(y(e,t.d),t.d.a=t))}function c(t){var e=t.b,i=!1;t.d!==t.b.d&&(i=!0,b(t.d,t.b.d)),t.c===t?x(t.a,null):(t.b.d.a=Q(t),t.a.c=t.c,m(t,Q(t)),i||y(t,t.d)),e.c===e?(x(e.a,null),b(e.d,null)):(t.d.a=Q(e),e.a.c=e.c,m(e,Q(e))),g(t)}function f(t){var e=p(t),i=e.b;return m(e,t.e),e.a=t.b.a,v(i,e.a),e.d=i.d=t.d,e=e.b,m(t.b,Q(t.b)),m(t.b,e),t.b.a=e.a,e.b.a.c=e.b,e.b.d=t.b.d,e.f=t.f,e.b.f=t.b.f,e}function d(t,e){var i=!1,r=p(t),n=r.b;return e.d!==t.d&&(i=!0,b(e.d,t.d)),m(r,t.e),m(n,e),r.a=t.b.a,n.a=e.a,r.d=n.d=t.d,t.d.a=n,i||y(r,t.d),r}function p(t){var e=new q,i=new q,r=t.b.h;return i.h=r,r.b.h=e,e.h=t,t.b.h=i,e.b=i,e.c=e,e.e=i,i.b=e,i.c=i,i.e=e}function m(t,e){var i=t.c,r=e.c;i.b.e=e,r.b.e=t,t.c=r,e.c=i}function v(t,e){var i=e.f,r=new J(e,i);i.e=r,e.f=r,i=r.c=t;do i.a=r,i=i.c;while(i!==t)}function y(t,e){var i=e.d,r=new Z(e,i);i.b=r,e.d=r,r.a=t,r.c=e.c,i=t;do i.d=r,i=i.e;while(i!==t)}function g(t){var e=t.h;t=t.b.h,e.b.h=t,t.b.h=e}function x(t,e){var i=t.c,r=i;do r.a=e,r=r.c;while(r!==i);i=t.f,(r=t.e).f=i,i.e=r}function b(t,e){var i=t.a,r=i;do r.d=e,r=r.e;while(r!==i);i=t.d,(r=t.b).d=i,i.b=r}function T(t){var e=0;return Math.abs(t[1])>Math.abs(t[0])&&(e=1),Math.abs(t[2])>Math.abs(t[e])&&(e=2),e}var _,E=4*1e150;function C(t,e){t.f+=e.f,t.b.f+=e.b.f}function w(t,e,a){return(t=t.a,e=e.a,a=a.a,e.b.a===t)?a.b.a===t?i(e.a,a.a)?0>=n(a.b.a,e.a,a.a):0<=n(e.b.a,a.a,e.a):0>=n(a.b.a,t,a.a):a.b.a===t?0<=n(e.b.a,t,e.a):(e=r(e.b.a,t,e.a))>=(t=r(a.b.a,t,a.a))}function S(t){t.a.i=null;var e=t.e;e.a.c=e.c,e.c.a=e.a,t.e=null}function A(t,e){c(t.a),t.c=!1,t.a=e,e.i=t}function M(t){var e=t.a.a;do t=tl(t);while(t.a.a===e);return t.c&&(e=d(th(t).a.b,t.a.e),A(t,e),t=tl(t)),t}function I(t,e,i){var r=new tu;return r.a=i,r.e=G(t.f,e.e,r),i.i=r}function P(t,e){switch(t.s){case 100130:return 0!=(1&e);case 100131:return 0!==e;case 100132:return 0<e;case 100133:return 0>e;case 100134:return 2<=e||-2>=e}return!1}function R(t){var e=t.a,i=e.d;i.c=t.d,i.a=e,S(t)}function O(t,e,i){for(t=e,e=e.a;t!==i;){t.c=!1;var r=th(t),n=r.a;if(n.a!==e.a){if(!r.c){R(t);break}A(r,n=d(e.c.b,n.b))}e.c!==n&&(l(Q(n),n),l(e,n)),R(t),e=r.a,t=r}return e}function N(t,e,i,r,n,a){var o=!0;do I(t,e,i.b),i=i.c;while(i!==r);for(null===n&&(n=th(e).a.b.c);(i=(r=th(e)).a.b).a===n.a;)i.c!==n&&(l(Q(i),i),l(Q(n),i)),r.f=e.f-i.f,r.d=P(t,r.f),e.b=!0,!o&&D(t,e)&&(C(i,n),S(e),c(n)),o=!1,e=r,n=i;e.b=!0,a&&z(t,e)}function L(t,e,i,r,n){var a=[e.g[0],e.g[1],e.g[2]];e.d=null,e.d=t.o&&t.o(a,i,r,t.c)||null,null===e.d&&(n?t.n||(Y(t,100156),t.n=!0):e.d=i[0])}function V(t,e,i){var r=[null,null,null,null];r[0]=e.a.d,r[1]=i.a.d,L(t,e.a,r,[.5,.5,0,0],!1),l(e,i)}function F(t,e,i,r,n){var a=Math.abs(e.b-t.b)+Math.abs(e.a-t.a),o=Math.abs(i.b-t.b)+Math.abs(i.a-t.a),s=n+1;r[n]=.5*o/(a+o),r[s]=.5*a/(a+o),t.g[0]+=r[n]*e.g[0]+r[s]*i.g[0],t.g[1]+=r[n]*e.g[1]+r[s]*i.g[1],t.g[2]+=r[n]*e.g[2]+r[s]*i.g[2]}function D(t,r){var a=th(r),o=r.a,s=a.a;if(i(o.a,s.a)){if(0<n(s.b.a,o.a,s.a))return!1;if(e(o.a,s.a)){if(o.a!==s.a){var a=t.e,u=o.a.h;if(0<=u){var a=a.b,h=a.d,c=a.e,d=a.c,p=d[u];h[p]=h[a.a],d[h[p]]=p,p<=--a.a&&(1>=p?to(a,p):i(c[h[p>>1]],c[h[p]])?to(a,p):ts(a,p)),c[u]=null,d[u]=a.b,a.b=u}else for(a.c[-(u+1)]=null;0<a.a&&null===a.c[a.d[a.a-1]];)--a.a;V(t,Q(s),o)}}else f(s.b),l(o,Q(s)),r.b=a.b=!0}else{if(0>n(o.b.a,s.a,o.a))return!1;tl(r).b=r.b=!0,f(o.b),l(Q(s),o)}return!0}function k(t,h){var c=th(h),d=h.a,p=c.a,m=d.a,v=p.a,y=d.b.a,g=p.b.a,x=new J;if(n(y,t.a,m),n(g,t.a,v),m===v||Math.min(m.a,y.a)>Math.max(v.a,g.a))return!1;if(i(m,v)){if(0<n(g,m,v))return!1}else if(0>n(y,v,m))return!1;var b,T,_=y,E=m,C=g,w=v;if(i(_,E)||(b=_,_=E,E=b),i(C,w)||(b=C,C=w,w=b),i(_,C)||(b=_,_=C,C=b,b=E,E=w,w=b),i(C,E)?i(E,w)?(0>(b=r(_,C,E))+(T=r(C,E,w))&&(b=-b,T=-T),x.b=u(b,C.b,T,E.b)):(0>(b=n(_,C,E))+(T=-n(_,w,E))&&(b=-b,T=-T),x.b=u(b,C.b,T,w.b)):x.b=(C.b+E.b)/2,a(_,E)||(b=_,_=E,E=b),a(C,w)||(b=C,C=w,w=b),a(_,C)||(b=_,_=C,C=b,b=E,E=w,w=b),a(C,E)?a(E,w)?(0>(b=o(_,C,E))+(T=o(C,E,w))&&(b=-b,T=-T),x.a=u(b,C.a,T,E.a)):(0>(b=s(_,C,E))+(T=-s(_,w,E))&&(b=-b,T=-T),x.a=u(b,C.a,T,w.a)):x.a=(C.a+E.a)/2,i(x,t.a)&&(x.b=t.a.b,x.a=t.a.a),_=i(m,v)?m:v,i(_,x)&&(x.b=_.b,x.a=_.a),e(x,m)||e(x,v))return D(t,h),!1;if(!e(y,t.a)&&0<=n(y,t.a,x)||!e(g,t.a)&&0>=n(g,t.a,x)){if(g===t.a)return f(d.b),l(p.b,d),d=th(h=M(h)).a,O(t,th(h),c),N(t,h,Q(d),d,d,!0),!0;if(y===t.a){f(p.b),l(d.e,Q(p)),v=(m=c=h).a.b.a;do m=tl(m);while(m.a.b.a===v);return m=th(h=m).a.b.c,c.a=Q(p),p=O(t,c,null),N(t,h,p.c,d.b.c,m,!0),!0}return 0<=n(y,t.a,x)&&(tl(h).b=h.b=!0,f(d.b),d.a.b=t.a.b,d.a.a=t.a.a),0>=n(g,t.a,x)&&(h.b=c.b=!0,f(p.b),p.a.b=t.a.b,p.a.a=t.a.a),!1}return f(d.b),f(p.b),l(Q(p),d),d.a.b=x.b,d.a.a=x.a,d.a.h=tt(t.e,d.a),d=d.a,p=[0,0,0,0],x=[m.d,y.d,v.d,g.d],d.g[0]=d.g[1]=d.g[2]=0,F(d,m,y,p,0),F(d,v,g,p,2),L(t,d,x,p,!0),tl(h).b=h.b=c.b=!0,!1}function z(t,e){for(var r=th(e);;){for(;r.b;)e=r,r=th(r);if(!e.b&&(r=e,null===(e=tl(e))||!e.b))break;e.b=!1;var a,o=e.a,s=r.a;if(a=o.b.a!==s.b.a)t:{var u=th(a=e),h=a.a,d=u.a,p=void 0;if(i(h.b.a,d.b.a)){if(0>n(h.b.a,d.b.a,h.a)){a=!1;break t}tl(a).b=a.b=!0,p=f(h),l(d.b,p),p.d.c=a.d}else{if(0<n(d.b.a,h.b.a,d.a)){a=!1;break t}a.b=u.b=!0,p=f(d),l(h.e,d.b),p.b.d.c=a.d}a=!0}if(a&&(r.c?(S(r),c(s),s=(r=th(e)).a):e.c&&(S(e),c(o),o=(e=tl(r)).a)),o.a!==s.a){if(o.b.a===s.b.a||e.c||r.c||o.b.a!==t.a&&s.b.a!==t.a)D(t,e);else if(k(t,e))break}o.a===s.a&&o.b.a===s.b.a&&(C(s,o),S(e),c(o),e=tl(r))}}function B(t,e){var i=new tu,r=h(t.b);r.a.b=E,r.a.a=e,r.b.a.b=-E,r.b.a.a=e,t.a=r.b.a,i.a=r,i.f=0,i.d=!1,i.c=!1,i.h=!0,i.b=!1,r=G(r=t.f,r.a,i),i.e=r}function U(t){this.a=new j,this.b=t,this.c=w}function G(t,e,i){do e=e.c;while(null!==e.b&&!t.c(t.b,e.b,i));return t=new j(i,e.a,e),e.a.c=t,e.a=t}function j(t,e,i){this.b=t||null,this.a=e||this,this.c=i||this}function W(){this.d=X,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}var X=0;function H(t,e){if(t.d!==e)for(;t.d!==e;)if(t.d<e)switch(t.d){case X:Y(t,100151),t.u(null);break;case 1:Y(t,100152),t.t()}else switch(t.d){case 2:Y(t,100154),t.v();break;case 1:Y(t,100153),t.w()}}function Y(t,e){t.p&&t.p(e,t.c)}function Z(t,e){this.b=t||this,this.d=e||this,this.a=null,this.c=!1}function q(){this.h=this,this.i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function Q(t){return t.b.e}function K(){this.c=new J,this.a=new Z,this.b=new q,this.d=new q,this.b.b=this.d,this.d.b=this.b}function J(t,e){this.e=t||this,this.f=e||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function $(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new ti}function tt(t,e){if(t.e){var i,r=t.b,n=++r.a;return 2*n>r.f&&(r.f*=2,r.c=tr(r.c,r.f+1)),0===r.b?i=n:(i=r.b,r.b=r.c[r.b]),r.e[i]=e,r.c[i]=n,r.d[n]=i,r.h&&ts(r,n),i}return r=t.a++,t.c[r]=e,-(r+1)}function te(t){if(0===t.a)return ta(t.b);var e=t.c[t.d[t.a-1]];if(0!==t.b.a&&i(tn(t.b),e))return ta(t.b);do--t.a;while(0<t.a&&null===t.c[t.d[t.a-1]]);return e}function ti(){this.d=tr([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function tr(t,e){for(var i=Array(e),r=0;r<t.length;r++)i[r]=t[r];for(;r<e;r++)i[r]=0;return i}function tn(t){return t.e[t.d[1]]}function ta(t){var e=t.d,i=t.e,r=t.c,n=e[1],a=i[n];return 0<t.a&&(e[1]=e[t.a],r[e[1]]=1,i[n]=null,r[n]=t.b,t.b=n,0<--t.a&&to(t,1)),a}function to(t,e){for(var r=t.d,n=t.e,a=t.c,o=e,s=r[o];;){var u=o<<1;u<t.a&&i(n[r[u+1]],n[r[u]])&&(u+=1);var h=r[u];if(u>t.a||i(n[s],n[h])){r[o]=s,a[s]=o;break}r[o]=h,a[h]=o,o=u}}function ts(t,e){for(var r=t.d,n=t.e,a=t.c,o=e,s=r[o];;){var u=o>>1,h=r[u];if(0===u||i(n[h],n[s])){r[o]=s,a[s]=o;break}r[o]=h,a[h]=o,o=u}}function tu(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function th(t){return t.e.c.b}function tl(t){return t.e.a.b}(_=W.prototype).x=function(){H(this,X)},_.B=function(t,e){switch(t){case 100142:return;case 100140:switch(e){case 100130:case 100131:case 100132:case 100133:case 100134:this.s=e;return}break;case 100141:this.m=!!e;return;default:Y(this,100900);return}Y(this,100901)},_.y=function(t){switch(t){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Y(this,100900)}return!1},_.A=function(t,e,i){this.j[0]=t,this.j[1]=e,this.j[2]=i},_.z=function(t,e){var i=e||null;switch(t){case 100100:case 100106:this.h=i;break;case 100104:case 100110:this.l=i;break;case 100101:case 100107:this.k=i;break;case 100102:case 100108:this.i=i;break;case 100103:case 100109:this.p=i;break;case 100105:case 100111:this.o=i;break;case 100112:this.r=i;break;default:Y(this,100900)}},_.C=function(t,e){var i=!1,r=[0,0,0];H(this,2);for(var n=0;3>n;++n){var a=t[n];-1e150>a&&(a=-1e150,i=!0),1e150<a&&(a=1e150,i=!0),r[n]=a}i&&Y(this,100155),null===(i=this.q)?l(i=h(this.b),i.b):(f(i),i=i.e),i.a.d=e,i.a.g[0]=r[0],i.a.g[1]=r[1],i.a.g[2]=r[2],i.f=1,i.b.f=-1,this.q=i},_.u=function(t){H(this,X),this.d=1,this.b=new K,this.c=t},_.t=function(){H(this,1),this.d=2,this.q=null},_.v=function(){H(this,2),this.d=1},_.w=function(){H(this,1),this.d=X;var t,r,a=this.j[0],o=this.j[1],s=this.j[2],u=!1,h=[a,o,s];if(0===a&&0===o&&0===s){for(var o=[-2*1e150,-2*1e150,-2*1e150],p=[2*1e150,2*1e150,2*1e150],s=[],v=[],u=this.b.c,a=u.e;a!==u;a=a.e)for(var y=0;3>y;++y){var b=a.g[y];b<p[y]&&(p[y]=b,v[y]=a),b>o[y]&&(o[y]=b,s[y]=a)}if(a=0,o[1]-p[1]>o[0]-p[0]&&(a=1),o[2]-p[2]>o[a]-p[a]&&(a=2),p[a]>=o[a])h[0]=0,h[1]=0,h[2]=1;else{for(o=0,p=v[a],s=s[a],v=[0,0,0],p=[p.g[0]-s.g[0],p.g[1]-s.g[1],p.g[2]-s.g[2]],y=[0,0,0],a=u.e;a!==u;a=a.e)y[0]=a.g[0]-s.g[0],y[1]=a.g[1]-s.g[1],y[2]=a.g[2]-s.g[2],v[0]=p[1]*y[2]-p[2]*y[1],v[1]=p[2]*y[0]-p[0]*y[2],v[2]=p[0]*y[1]-p[1]*y[0],(b=v[0]*v[0]+v[1]*v[1]+v[2]*v[2])>o&&(o=b,h[0]=v[0],h[1]=v[1],h[2]=v[2]);0>=o&&(h[0]=h[1]=h[2]=0,h[T(p)]=1)}u=!0}for(v=T(h),a=this.b.c,o=(v+1)%3,s=(v+2)%3,v=0<h[v]?1:-1,h=a.e;h!==a;h=h.e)h.b=h.g[o],h.a=v*h.g[s];if(u){for(h=0,a=(u=this.b.a).b;a!==u;a=a.b)if(!(0>=(o=a.a).f))do h+=(o.a.b-o.b.a.b)*(o.a.a+o.b.a.a),o=o.e;while(o!==a.a);if(0>h)for(u=(h=this.b.c).e;u!==h;u=u.e)u.a=-u.a}for(this.n=!1,a=(h=this.b.b).h;a!==h;a=u)u=a.h,o=a.e,e(a.a,a.b.a)&&a.e.e!==a&&(V(this,o,a),c(a),o=(a=o).e),o.e===a&&(o!==a&&((o===u||o===u.b)&&(u=u.h),c(o)),(a===u||a===u.b)&&(u=u.h),c(a));for(this.e=h=new $,a=(u=this.b.c).e;a!==u;a=a.e)a.h=tt(h,a);for(function(t){t.d=[];for(var e,r=0;r<t.a;r++)t.d[r]=r;t.d.sort((e=t.c,function(t,r){return i(e[t],e[r])?1:-1})),t.e=!0,function(t){for(var e=t.a;1<=e;--e)to(t,e);t.h=!0}(t.b)}(h),this.f=new U(this),B(this,-E),B(this,E);null!==(h=te(this.e));){for(;;){t:if(0===(a=this.e).a)u=tn(a.b);else if(u=a.c[a.d[a.a-1]],0!==a.b.a&&i(a=tn(a.b),u)){u=a;break t}if(null===u||!e(u,h))break;u=te(this.e),V(this,h.c,u.c)}!function t(r,a){r.a=a;for(var o=a.c;null===o.i;)if((o=o.c)===a.c){var o=r,s=a,u=new tu;u.a=s.c.b;var h=o.f,p=h.a;do p=p.a;while(null!==p.b&&!h.c(h.b,u,p.b));var h=p.b,m=th(h),u=h.a,p=m.a;if(0===n(u.b.a,s,u.a))e((u=h.a).a,s)||e(u.b.a,s)||(f(u.b),h.c&&(c(u.c),h.c=!1),l(s.c,u),t(o,s));else{var v=i(p.b.a,u.b.a)?h:m,m=void 0;h.d||v.c?(m=v===h?d(s.c.b,u.e):d(p.b.c.b,s.c).b,v.c?A(v,m):(u=o,(h=I(o,h,m)).f=tl(h).f+h.a.f,h.d=P(u,h.f)),t(o,s)):N(o,h,s.c,s.c,null,!0)}return}if(h=(u=th(o=M(o.i))).a,(u=O(r,u,null)).c===h){var h=u,u=h.c,p=th(o),m=o.a,v=p.a,y=!1;m.b.a!==v.b.a&&k(r,o),e(m.a,r.a)&&(l(Q(u),m),u=th(o=M(o)).a,O(r,th(o),p),y=!0),e(v.a,r.a)&&(l(h,Q(v)),h=O(r,p,null),y=!0),y?N(r,o,h.c,u,u,!0):(s=i(v.a,m.a)?Q(v):m,N(r,o,s=d(h.c.b,s),s.c,s.c,!1),s.b.i.c=!0,z(r,o))}else N(r,o,u.c,h,h,!0)}(this,h)}for(h=0,this.a=this.f.a.a.b.a.a;null!==(u=this.f.a.a.b);)u.h||++h,S(u);for(this.f=null,(h=this.e).b=null,h.d=null,this.e=h.c=null,a=(h=this.b).a.b;a!==h.a;a=u)u=a.b,(a=a.a).e.e===a&&(C(a.c,a),c(a));if(!this.n){if(h=this.b,this.m)for(a=h.b.h;a!==h.b;a=u)u=a.h,a.b.d.c!==a.d.c?a.f=a.d.c?1:-1:c(a);else for(a=h.a.b;a!==h.a;a=u)if(u=a.b,a.c){for(a=a.a;i(a.b.a,a.a);a=a.c.b);for(;i(a.a,a.b.a);a=a.e);for(o=a.c.b,s=void 0;a.e!==o;)if(i(a.b.a,o.a)){for(;o.e!==a&&(i((t=o.e).b.a,t.a)||0>=n(o.a,o.b.a,o.e.b.a));)o=(s=d(o.e,o)).b;o=o.c.b}else{for(;o.e!==a&&(i((r=a.c.b).a,r.b.a)||0<=n(a.b.a,a.a,a.c.b.a));)a=(s=d(a,a.c.b)).b;a=a.e}for(;o.e.e!==a;)o=(s=d(o.e,o)).b}if(this.h||this.i||this.k||this.l){if(this.m){for(u=(h=this.b).a.b;u!==h.a;u=u.b)if(u.c){this.h&&this.h(2,this.c),a=u.a;do this.k&&this.k(a.a.d,this.c),a=a.e;while(a!==u.a);this.i&&this.i(this.c)}}else{for(h=this.b,u=!!this.l,a=!1,o=-1,s=h.a.d;s!==h.a;s=s.d)if(s.c){a||(this.h&&this.h(4,this.c),a=!0),v=s.a;do u&&o!==(p=v.b.d.c?0:1)&&(o=p,this.l&&this.l(!!o,this.c)),this.k&&this.k(v.a.d,this.c),v=v.e;while(v!==s.a)}a&&this.i&&this.i(this.c)}}if(this.r){for(a=(h=this.b).a.b;a!==h.a;a=u)if(u=a.b,!a.c){s=(o=a.a).e,v=void 0;do s=(v=s).e,v.d=null,null===v.b.d&&(v.c===v?x(v.a,null):(v.a.c=v.c,m(v,Q(v))),(p=v.b).c===p?x(p.a,null):(p.a.c=p.c,m(p,Q(p))),g(v));while(v!==o);o=a.d,(a=a.b).d=o,o.b=a}this.r(this.b),this.c=this.b=null;return}}this.b=this.c=null},s2.libtess={GluTesselator:W,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},W.prototype.gluDeleteTess=W.prototype.x,W.prototype.gluTessProperty=W.prototype.B,W.prototype.gluGetTessProperty=W.prototype.y,W.prototype.gluTessNormal=W.prototype.A,W.prototype.gluTessCallback=W.prototype.z,W.prototype.gluTessVertex=W.prototype.C,W.prototype.gluTessBeginPolygon=W.prototype.u,W.prototype.gluTessBeginContour=W.prototype.t,W.prototype.gluTessEndContour=W.prototype.v,W.prototype.gluTessEndPolygon=W.prototype.w,t.exports=s2.libtess}(s3);var s4=((tA=new s3.exports.GluTesselator).gluTessCallback(s3.exports.gluEnum.GLU_TESS_VERTEX_DATA,function(t,e){e[e.length]=t[0],e[e.length]=t[1]}),tA.gluTessCallback(s3.exports.gluEnum.GLU_TESS_BEGIN,function(t){t!==s3.exports.primitiveType.GL_TRIANGLES&&console.info("expected TRIANGLES but got type: "+t)}),tA.gluTessCallback(s3.exports.gluEnum.GLU_TESS_ERROR,function(t){console.error("error callback, error number: "+t)}),tA.gluTessCallback(s3.exports.gluEnum.GLU_TESS_COMBINE,function(t,e,i){return[t[0],t[1],t[2]]}),tA.gluTessCallback(s3.exports.gluEnum.GLU_TESS_EDGE_FLAG,function(t){}),tA);function s5(t){s4.gluTessNormal(0,0,1);var e=[];s4.gluTessBeginPolygon(e);for(var i=0;i<t.length;i++){s4.gluTessBeginContour();for(var r=t[i],n=0;n<r.length;n+=2){var a=[r[n],r[n+1],0];s4.gluTessVertex(a,a)}s4.gluTessEndContour()}return s4.gluTessEndPolygon(),e}var s6=function(t){function e(){for(var e,i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(e=t.call(this)||this).points=[],e.closePath=!1;var a=Array.isArray(r[0])?r[0]:r;if("number"!=typeof a[0]){for(var o=[],s=0,u=a.length;s<u;s++)o.push(a[s].x,a[s].y);a=o}return e.points=a,e.closePath=!0,e}iN(e,t);var i=e.prototype;return i.clone=function(){var t=new e(this.points.slice());return t.closePath=this.closePath,t},i.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,a=r-1;n<r;a=n++){var o=this.points[2*n],s=this.points[2*n+1],u=this.points[2*a],h=this.points[2*a+1];s>e!=h>e&&t<(e-s)/(h-s)*(u-o)+o&&(i=!i)}return i},i.copyFrom=function(t){return this.points=t.points.slice(),this.closePath=t.closePath,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.points[this.points.length-2]},i.getY=function(){return this.points[this.points.length-1]},i.build=function(t){for(var e=0;e<this.points.length;e++)t[e]=this.points[e]},i.triangulate=function(t,e,i,r,n){var a=s5([t]),o=e.length/2;0===a.length&&this.getLineEndPointsTriangle(t,a);for(var s=0;s<a.length;s++)e[2*i+s]=a[s];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=o+h},i.getLineEndPointsTriangle=function(t,e){if(!t||t.length<2||t.length%2!=0)throw Error("Invalid points array");if(2===t.length){e.push(t[0],t[1],t[0],t[1],t[0],t[1]);return}var i=t[2]-t[0],r=t[3]-t[1],n=t[0],a=t[1],o=t[0],s=t[1];if(Math.abs(i)>=Math.abs(r))for(var u=0;u<t.length;u+=2){var h=t[u],l=t[u+1];h<n&&(n=h,a=l),h>o&&(o=h,s=l)}else for(var c=0;c<t.length;c+=2){var f=t[c],d=t[c+1];d<a&&(n=f,a=d),d>s&&(o=f,s=d)}e.push(n,a,o,s,o,s)},rC(e,[{key:"lastX",get:function(){return this.points[this.points.length-2]}},{key:"lastY",get:function(){return this.points[this.points.length-1]}}]),e}(s1);function s8(t,e,i,r,n,a,o,s,u,h){var l=(1-Math.min(.99,Math.max(0,null!=h?h:.5)))/5;return function t(e,i,r,n,a,o,s,u,h,l,c){if(!(c>8)){var f=(e+r)/2,d=(i+n)/2,p=(r+a)/2,m=(n+o)/2,v=(a+s)/2,y=(o+u)/2,g=(f+p)/2,x=(d+m)/2,b=(p+v)/2,T=(m+y)/2,_=(g+b)/2,E=(x+T)/2;if(c>0){var C=s-e,w=u-i,S=Math.abs((r-s)*w-(n-u)*C),A=Math.abs((a-s)*w-(o-u)*C);if(S>11920929e-14&&A>11920929e-14){if((S+A)*(S+A)<=l*(C*C+w*w)){h.push(_,E);return}}else if(S>11920929e-14){if(S*S<=l*(C*C+w*w)){h.push(_,E);return}}else if(A>11920929e-14){if(A*A<=l*(C*C+w*w)){h.push(_,E);return}}else if((C=_-(e+s)/2)*C+(w=E-(i+u)/2)*w<=l){h.push(_,E);return}}t(e,i,f,d,g,x,_,E,h,l,c+1),t(_,E,b,T,v,y,s,u,h,l,c+1)}}(e,i,r,n,a,o,s,u,t,l*=l,0),t.push(s,u),t}var s9=function(t){function e(e,i,r,n){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),(a=t.call(this)||this).type="ellipse",a.x=e,a.y=i,a.halfWidth=r,a.halfHeight=n,a}iN(e,t);var i=e.prototype;return i.clone=function(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)},i.contains=function(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;var i=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1},i.strokeContains=function(t,e,i){var r=this.halfWidth,n=this.halfHeight;if(r<=0||n<=0)return!1;var a=i/2,o=r-a,s=n-a,u=r+a,h=n+a,l=t-this.x,c=e-this.y;return l*l/(o*o)+c*c/(s*s)>1&&l*l/(u*u)+c*c/(h*h)<=1},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.x},i.getY=function(){return this.y},i.build=function(t){var e=this.x,i=this.y,r=this.halfWidth,n=this.halfHeight;if(!(r>=0&&n>=0))return t;var a=Math.ceil(5*Math.sqrt(r+n)),o=8*a+0+0;if(0===o)return t;if(0===a)return t[0]=t[6]=e+0,t[1]=t[3]=i+0,t[2]=t[4]=e-0,t[5]=t[7]=i-0,t;var s=0,u=4*a+0+2,h=u,l=o,c=0+r,f=0,d=e+c,p=e-c,m=i+0;t[s++]=d,t[s++]=m,t[--u]=m,t[--u]=p;for(var v=1;v<a;v++){var y=Math.PI/2*(v/a),g=0+Math.cos(y)*r,x=0+Math.sin(y)*n,b=e+g,T=e-g,_=i+x,E=i-x;t[s++]=b,t[s++]=_,t[--u]=_,t[--u]=T,t[h++]=T,t[h++]=E,t[--l]=E,t[--l]=b}c=0,f=0+n,d=e+c,p=e-c,m=i+f;var C=i-f;return t[s++]=d,t[s++]=m,t[--l]=C,t[--l]=d,t},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,o=0,s=0;s<t.length;s+=2)a+=t[s],o+=t[s+1];a/=t.length/2,o/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=o;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(s1);t.StarType=void 0,(tM=t.StarType||(t.StarType={}))[tM.Star=0]="Star",tM[tM.Polygon=1]="Polygon";var s7=function(t){function e(e,i,r,n,a,o){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=0),(s=t.call(this)||this).pointCount=e,s.outerRadius=i,s.innerRadius=r,s.outerRoundness=n,s.innerRoundness=a,s.starType=o,s.v=[],s.in=[],s.out=[],s}iN(e,t);var i=e.prototype;return i.clone=function(){return new e(this.pointCount,this.outerRadius,this.innerRadius,this.outerRoundness,this.innerRoundness,this.starType)},i.copyFrom=function(t){this.pointCount=t.pointCount,this.outerRadius=t.outerRadius,this.innerRadius=t.innerRadius,this.outerRoundness=t.outerRoundness,this.innerRoundness=t.innerRoundness,this.starType=t.starType},i.copyTo=function(t){t.copyFrom(this)},i.build=function(t){switch(this.starType){case 0:this.buildStarPath();break;case 1:this.buildPolygonPath()}for(var e=0;e<this.v.length-2;e+=2)s8(t,this.v[e],this.v[e+1],this.out[e],this.out[e+1],this.in[e+2],this.in[e+3],this.v[e+2],this.v[e+3],1);var i=this.v.length-1;s8(t,this.v[i-1],this.v[i],this.out[i-1],this.out[i],this.in[0],this.in[1],this.v[0],this.v[1],1)},i.triangulate=function(t,e,i,r,n){for(var a=s5([t]),o=e.length/2,s=0;s<a.length;s++)e[2*i+s]=a[s];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=o+h},i.buildStarPath=function(){this.v=[],this.in=[],this.out=[];var t,e,i,r,n=2*Math.floor(this.pointCount),a=2*Math.PI/n,o=!0,s=this.outerRadius,u=this.innerRadius,h=this.outerRoundness/100,l=this.innerRoundness/100,c=2*Math.PI*s/(2*n),f=2*Math.PI*u/(2*n),d=-Math.PI/2;for(t=0;t<n;t++){e=o?s:u,i=o?h:l,r=o?c:f;var p=e*Math.cos(d),m=e*Math.sin(d),v=0===p&&0===m?0:m/Math.sqrt(p*p+m*m),y=0===p&&0===m?0:-p/Math.sqrt(p*p+m*m),g=2*t;this.v[g]=p,this.v[g+1]=m,this.in[g]=p+v*r*i*1,this.in[g+1]=m+y*r*i*1,this.out[g]=p-v*r*i*1,this.out[g+1]=m-y*r*i*1,o=!o,d+=1*a}},i.buildPolygonPath=function(){this.v=[],this.in=[],this.out=[];var t,e=Math.floor(this.pointCount),i=2*Math.PI/e,r=this.outerRadius,n=this.outerRoundness/100,a=2*Math.PI*r/(4*e),o=-(.5*Math.PI);for(t=0;t<e;t++){var s=r*Math.cos(o),u=r*Math.sin(o),h=0===s&&0===u?0:u/Math.sqrt(s*s+u*u),l=0===s&&0===u?0:-s/Math.sqrt(s*s+u*u),c=2*t;this.v[c]=s,this.v[c+1]=u,this.in[c]=s+h*a*n*1,this.in[c+1]=u+l*a*n*1,this.out[c]=s-h*a*n*1,this.out[c+1]=u-l*a*n*1,o+=1*i}},e}(s1),ut=function(t){function e(e,i,r,n,a){var o;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=20),(o=t.call(this)||this).x=e,o.y=i,o.width=r,o.height=n,o.roundness=a,o}iN(e,t);var i=e.prototype;return i.getBounds=function(t){return(t=t||new e).x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.clone=function(){return new e(this.x,this.y,this.width,this.height,this.roundness)},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.roundness=t.roundness,this},i.copyTo=function(t){return t.copyFrom(this),t},i.build=function(t){var e,i=this.width/2,r=this.height/2,n=this.x+i,a=this.y+r,o=e=Math.max(0,Math.min(this.roundness/100,1)*Math.min(i,r)),s=i-o,u=r-e;if(o>=0&&e>=0&&s>=0&&u>=0){var h=5*Math.ceil(2.3*Math.sqrt(o+e)),l=8*h+(s?4:0)+(u?4:0);if(0!==l){if(0===h){t[0]=t[6]=n+s,t[1]=t[3]=a+u,t[2]=t[4]=n-s,t[5]=t[7]=a-u;return}var c=0,f=4*h+(s?2:0)+2,d=f,p=l,m=s+o,v=u,y=n+m,g=n-m,x=a+v;if(t[c++]=y,t[c++]=x,t[--f]=x,t[--f]=g,u){var b=a-v;t[d++]=g,t[d++]=b,t[--p]=b,t[--p]=y}for(var T=1;T<h;T++){var _=Math.PI/2*(T/h),E=s+Math.cos(_)*o,C=u+Math.sin(_)*e,w=n+E,S=n-E,A=a+C,M=a-C;t[c++]=w,t[c++]=A,t[--f]=A,t[--f]=S,t[d++]=S,t[d++]=M,t[--p]=M,t[--p]=w}m=s,v=u+e,y=n+m,g=n-m,x=a+v;var I=a-v;t[c++]=y,t[c++]=x,t[--p]=I,t[--p]=y,s&&(t[c++]=g,t[c++]=x,t[--p]=I,t[--p]=g)}}},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,o=0,s=0;s<t.length;s+=2)a+=t[s],o+=t[s+1];a/=t.length/2,o/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=o;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(s1),ue=function(){function t(t){this.graphicsPath=t,this.currentPoly=null,this.shapePrimitives=[]}var e=t.prototype;return e.buildPath=function(){this.currentPoly=null,this.shapePrimitives.length=0;for(var t,e=this.graphicsPath,i=iD(e.instructions);!(t=i()).done;){var r=t.value,n=r.action,a=r.data;switch(n){case"bezierCurveTo":this.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"moveTo":this.moveTo(a[0],a[1]);break;case"ellipse":this.ellipse(a[0],a[1],a[2],a[3],a[4]);break;case"polyStar":this.polyStar(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"rect":this.rect(a[0],a[1],a[2],a[3],a[4]);break;case"closePath":this.closePath()}}this.endPoly()},e.bezierCurveTo=function(t,e,i,r,n,a,o){this.ensurePoly();var s=this.currentPoly;return s8(s.points,s.lastX,s.lastY,t,e,i,r,n,a,o),this},e.moveTo=function(t,e){return this.startPoly(t,e),this},e.closePath=function(){return this.endPoly(!0),this},e.ellipse=function(t,e,i,r,n){return this.drawShape(new s9(t,e,i,r),n),this},e.polyStar=function(t,e,i,r,n,a,o){return this.drawShape(new s7(t,e,i,r,n,a),o),this},e.rect=function(t,e,i,r,n,a){return this.drawShape(new ut(t,e,i,r,n),a),this},e.drawShape=function(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this},e.startPoly=function(t,e){var i=this.currentPoly;return i&&this.endPoly(),(i=new s6).points.push(t,e),this.currentPoly=i,this},e.endPoly=function(t){void 0===t&&(t=!1);var e=this.currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this.currentPoly=null,this},e.ensurePoly=function(t){this.currentPoly||(this.currentPoly=new s6,this.currentPoly.points.push(0,0))},t}(),ui=function(){function t(){this.instructions=[],this.dirty=!1}var e=t.prototype;return e.bezierCurveTo=function(t,e,i,r,n,a,o){return this.instructions.push({action:"bezierCurveTo",data:[t,e,i,r,n,a,o]}),this.dirty=!0,this},e.moveTo=function(t,e){return this.instructions.push({action:"moveTo",data:[t,e]}),this.dirty=!0,this},e.closePath=function(){return this.instructions.push({action:"closePath",data:[]}),this.dirty=!0,this},e.ellipse=function(t,e,i,r,n){return this.instructions.push({action:"ellipse",data:[t,e,i,r,n]}),this.dirty=!0,this},e.rect=function(t,e,i,r,n,a){return this.instructions.push({action:"rect",data:[t,e,i,r,n,a]}),this.dirty=!0,this},e.polyStar=function(t,e,i,r,n,a,o){return this.instructions.push({action:"polyStar",data:[t,e,i,r,n,a,o]}),this.dirty=!0,this},e.clear=function(){return this.instructions.length=0,this.dirty=!0,this},rC(t,[{key:"shapePath",get:function(){return this._shapePath||(this._shapePath=new ue(this)),this.dirty&&(this.dirty=!1,this._shapePath.buildPath()),this._shapePath}}]),t}(),ur=new(function(){function t(){this.elements=[]}var e=t.prototype;return e.dispose=function(){this.elements.forEach(function(t){return t.remove()}),this.elements.length=0},e.getCanvas=function(){if(0!==this.elements.length){var t=this.elements.shift();return ih(t),t}if(oZ[oY])return window._createOffscreenCanvas(10,10);var e=document.createElement("canvas");return e.getContext("2d",{willReadFrequently:!0}),e},e.saveCanvas=function(t){t.width=1,t.height=1,this.elements.length<3?eW(this.elements,t):t.remove()},t}()),un=function(){function t(t){this.width=0,this.height=0,this.update(t)}var e=t.prototype;return e.update=function(t){var e=t.textHeight,i=t.textWidth,r=t.textOverflow,n=void 0===r?t5.clip:r,a=t.textVerticalAlign,o=void 0===a?t7.top:a,s=t.textAlign,u=void 0===s?t9.left:s,h=t.letterSpace,l=t.autoWidth,c=t.fontSize,f=t.lineHeight;this.letterSpace=void 0===h?0:h,this.overflow=n,this.textVerticalAlign=o,this.textAlign=u,this.width=void 0===i?100:i,this.height=void 0===e?100:e,this.lineHeight=void 0===f?c:f,this.autoWidth=void 0!==l&&l},e.getOffsetY=function(t,e,i,r,n){var a=t.outlineWidth,o=t.fontScale,s=(i-r)/3,u=r+a*o,h=void 0!==n?n:i*(e-1),l=0;switch(this.textVerticalAlign){case t7.top:l=u+s;break;case t7.middle:l=(this.height*o-h+u)/2;break;case t7.bottom:l=this.height*o-h-s}return l},e.getOffsetX=function(t,e){var i=0;switch(this.textAlign){case t9.left:i=t.outlineWidth*t.fontScale;break;case t9.middle:i=(this.width*t.fontScale-e)/2;break;case t9.right:i=this.width*t.fontScale-e}return i},e.setSize=function(t,e){this.width=t,this.height=e},t}(),ua=function(){function t(t){this.isUnderline=!1,this.underlineHeight=1,this.isOutlined=!1,this.outlineWidth=0,this.hasShadow=!1,this.fontDesc="",this.fontScale=2,this.fontOffset=0,this.update(t)}return t.prototype.update=function(t){var e,i,r,n,a,o,s=t.textColor,u=t.fontSize,h=t.outline,l=t.shadow,c=t.fontWeight,f=t.fontStyle,d=t.fontFamily;this.textColor=[].concat(void 0===s?[1,1,1,1]:s),this.textWeight=void 0===c?"normal":c,this.fontStyle=void 0===f?"normal":f,this.fontFamily=void 0===d?"sans-serif":d,this.fontSize=void 0===u?40:u,this.isOutlined=!1,this.outlineColor=[1,1,1,1],this.outlineWidth=0,h&&(this.isOutlined=!0,this.outlineColor=[].concat(null!=(e=h.outlineColor)?e:[1,1,1,1]),this.outlineWidth=null!=(i=h.outlineWidth)?i:1),this.hasShadow=!1,this.shadowBlur=2,this.shadowColor=[0,0,0,1],this.shadowOffsetX=0,this.shadowOffsetY=0,l&&(this.hasShadow=!0,this.shadowBlur=null!=(r=l.shadowBlur)?r:2,this.shadowColor=[].concat(null!=(n=l.shadowColor)?n:[0,0,0,1]),this.shadowOffsetX=null!=(a=l.shadowOffsetX)?a:0,this.shadowOffsetY=null!=(o=l.shadowOffsetY)?o:0),this.fontOffset=0,this.fontStyle!==ee.normal&&(this.fontOffset+=this.fontSize*Math.tan(.20943951))},t}(),uo=function(){function t(){this.isDirty=!0,this.lineCount=0,this.maxLineWidth=0,this.SCALE_FACTOR=.1,this.ALPHA_FIX_VALUE=1/255}var e=t.prototype;return e.setText=function(t){this.text!==t&&(this.text=t.toString(),this.isDirty=!0)},e.setTextAlign=function(t){this.textLayout.textAlign!==t&&(this.textLayout.textAlign=t,this.isDirty=!0)},e.setTextVerticalAlign=function(t){this.textLayout.textVerticalAlign!==t&&(this.textLayout.textVerticalAlign=t,this.isDirty=!0)},e.setTextBaseline=function(t){console.warn("setTextBaseline 已废弃,请改用 setTextVerticalAlign。本次调用将转调用 setTextVerticalAlign。"),this.setTextVerticalAlign(t)},e.setTextColor=function(t){this.textStyle.textColor!==t&&(this.textStyle.textColor=t,this.isDirty=!0)},e.setFontFamily=function(t){if(!il(t)){console.warn("Risky font family, ignored:",t);return}this.textStyle.fontFamily!==t&&(this.textStyle.fontFamily=t,this.isDirty=!0)},e.setFontWeight=function(t){this.textStyle.textWeight!==t&&(this.textStyle.textWeight=t,this.isDirty=!0)},e.setFontStyle=function(t){this.textStyle.fontStyle!==t&&(this.textStyle.fontStyle=t,this.isDirty=!0)},e.setOutlineColor=function(t){this.textStyle.outlineColor!==t&&(this.textStyle.outlineColor=t,this.isDirty=!0)},e.setFontScale=function(t){this.textStyle.fontScale!==t&&(this.textStyle.fontScale=t,this.isDirty=!0)},e.setOverflow=function(t){this.textLayout.overflow=t,this.isDirty=!0},e.getFontDesc=function(t){var e=this.textStyle,i=e.fontSize,r=e.fontScale,n=e.fontFamily,a=e.textWeight,o=e.fontStyle,s=""+(t||i*r).toString()+"px ";return["serif","sans-serif","monospace","courier"].includes(n)?s+=n:s+='"'+n+'"',a!==et.normal&&(s=a+" "+s),o!==ee.normal&&(s=o+" "+s),s},e.setupOutline=function(){var t=this.context,e=this.textStyle,i=e.outlineColor,r=e.outlineWidth,n=i[0],a=i[1],o=i[2],s=i[3];t&&(t.strokeStyle="rgba("+255*n+", "+255*a+", "+255*o+", "+s+")",t.lineWidth=2*r)},e.setupShadow=function(){var t=this.context,e=this.textStyle,i=e.outlineColor,r=e.shadowBlur,n=e.shadowOffsetX,a=e.shadowOffsetY,o=i[0],s=i[1],u=i[2],h=i[3];t&&(t.shadowColor="rgba("+255*o+", "+255*s+", "+255*u+", "+h+")",t.shadowBlur=r,t.shadowOffsetX=n,t.shadowOffsetY=-a)},e.disposeTextTexture=function(){var t=this.renderer.texture;t&&t!==this.engine.whiteTexture&&t.dispose()},e.renderToTexture=function(t,e,i,r,n){if(void 0===n&&(n={}),this.context&&this.canvas){var a=this.context;a.save(),this.canvas.width=t,this.canvas.height=e,a.setTransform(1,0,0,1,0,0),i||(a.translate(0,e),a.scale(1,-1)),a.clearRect(0,0,t,e),a.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",r(a),a.restore();var o=a.getImageData(0,0,t,e),s=r7.createWithData(this.engine,{data:new Uint8Array(o.data),width:o.width,height:o.height},{flipY:i,magFilter:rL.LINEAR,minFilter:rL.LINEAR,wrapS:rL.CLAMP_TO_EDGE,wrapT:rL.CLAMP_TO_EDGE});!1!==n.disposeOld&&this.disposeTextTexture(),this.renderer.texture=s,this.material.setTexture("_MainTex",s)}},e.initTextBase=function(t){this.engine=t,this.canvas=ur.getCanvas(),ur.saveCanvas(this.canvas),this.context=this.canvas.getContext("2d",{willReadFrequently:!0})},t}(),us=0;t.TextComponent=function(t){function e(e){(i=t.call(this,e)||this).isDirty=!0,i.lineCount=0,i.maxLineWidth=0,i.name="MText"+us++,i.canvas=ur.getCanvas(),ur.saveCanvas(i.canvas),i.context=i.canvas.getContext("2d",{willReadFrequently:!0});var i,r=i.getDefaultProps().options;return i.updateWithOptions(r),i}iN(e,t);var i=e.prototype;return i.getDefaultProps=function(){return{id:"default-id-"+Math.random().toString(36).substr(2,9),item:{id:"default-item-"+Math.random().toString(36).substr(2,9)},dataType:el.TextComponent,options:{text:"默认文本",fontFamily:"AlibabaSans-BoldItalic",fontSize:40,textColor:[255,255,255,1],fontWeight:et.normal,letterSpace:0,textAlign:1,fontStyle:ee.normal,autoWidth:!1,textWidth:200,textHeight:42,lineHeight:40.148},renderer:{renderMode:1,anchor:[.5,.5]}}},i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture()},i.onDestroy=function(){t.prototype.onDestroy.call(this),this.disposeTextTexture()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.interaction,r=e.options;this.interaction=i,this.resetState(),this.updateWithOptions(r),this.renderText(r),this.material.setColor("_Color",new e1(1,1,1,1))},i.resetState=function(){this.disposeTextTexture(),this.isDirty=!0,this.lineCount=0,this.maxLineWidth=0},i.setText=function(t){this.text!==t&&(this.text=t.toString(),this.lineCount=this.getLineCount(this.text),this.isDirty=!0)},i.updateWithOptions=function(t){this.textStyle?this.textStyle.update(t):this.textStyle=new ua(t),this.textLayout?this.textLayout.update(t):this.textLayout=new un(t),this.text=t.text.toString(),this.lineCount=this.getLineCount(t.text)},i.getLineCount=function(t){var e=this.context,i=this.textLayout,r=i.letterSpace,n=i.overflow;this.maxLineWidth=0;var a=this.textLayout.width+this.textStyle.fontOffset,o=1,s=0;e&&(e.font=this.getFontDesc(this.textStyle.fontSize));for(var u=0;u<t.length;u++){var h,l,c=t[u],f=null!=(l=null==e?void 0:null==(h=e.measureText(c))?void 0:h.width)?l:0;s+=r,n===t5.display?"\n"===c?(o++,s=0):(s+=f,this.maxLineWidth=Math.max(this.maxLineWidth,s)):((s+f>a&&u>0||"\n"===c)&&(o++,this.maxLineWidth=Math.max(this.maxLineWidth,s),s=0),"\n"!==c&&(s+=f))}return o},i.setLineHeight=function(t){var e=Math.max(this.textStyle.fontSize,t);this.textLayout.lineHeight!==e&&(this.textLayout.lineHeight=e,this.isDirty=!0)},i.setFontWeight=function(t){this.textStyle.textWeight!==t&&(this.textStyle.textWeight=t,this.isDirty=!0)},i.setFontStyle=function(t){this.textStyle.fontStyle!==t&&(this.textStyle.fontStyle=t,this.isDirty=!0)},i.setTextAlign=function(t){this.textLayout.textAlign!==t&&(this.textLayout.textAlign=t,this.isDirty=!0)},i.setTextColor=function(t){this.textStyle.textColor!==t&&(this.textStyle.textColor=t,this.isDirty=!0)},i.setOutlineColor=function(t){this.textStyle.outlineColor!==t&&(this.textStyle.outlineColor=t,this.isDirty=!0)},i.setFontScale=function(t){this.textStyle.fontScale!==t&&(this.textStyle.fontScale=t,this.isDirty=!0)},i.updateTexture=function(t){var e=this;if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){var i=this.textStyle,r=this.textLayout,n=i.fontScale,a=(r.width+i.fontOffset)*n,o=r.lineHeight*this.lineCount,s=i.fontSize*n,u=r.lineHeight*n;i.fontDesc=this.getFontDesc(s);var h=(this.text||"").split("");r.autoWidth?(this.canvas.height=o*n,this.item.transform.size.set(1,o/r.height)):this.canvas.height=r.height*n;var l=this.canvas.height;this.renderToTexture(a,l,t,function(t){e.maxLineWidth>a&&r.overflow===t5.display?t.font=e.getFontDesc(s*a/e.maxLineWidth):t.font=i.fontDesc,i.hasShadow&&e.setupShadow(),i.isOutlined&&e.setupOutline();var o=i.textColor,l=o[0],c=o[1],f=o[2],d=o[3];t.fillStyle="rgba("+l+", "+c+", "+f+", "+d+")";for(var p=[],m=0,v=r.getOffsetY(i,e.lineCount,u,s),y=[],g=[],x=0;x<h.length;x++){var b=h[x],T=t.measureText(b);((m+=r.letterSpace*n)+T.width>a&&x>0||"\n"===b)&&(p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[]),"\n"!==b&&(y.push(b),g.push(m),m+=T.width)}p.push({y:v,width:m,chars:y,charOffsetX:g}),p.forEach(function(e){var n=r.getOffsetX(i,e.width);e.chars.forEach(function(r,a){i.isOutlined&&t.strokeText(r,n+e.charOffsetX[a],e.y),t.fillText(r,n+e.charOffsetX[a],e.y)})}),i.hasShadow&&(t.shadowColor="transparent")}),this.isDirty=!1}},i.renderText=function(t){this.updateTexture()},i.setAutoWidth=function(t){var e=this.textLayout,i=!!t;e.autoWidth!==i&&(e.autoWidth=i,this.isDirty=!0)},i.setFontSize=function(t){if(this.textStyle.fontSize!==t){var e=this.textStyle.fontSize-t,i=this.textLayout;i.lineHeight+=e,this.textStyle.fontSize=t,this.isDirty=!0}},i.setOutlineWidth=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.outlineWidth!==e&&(this.textStyle.outlineWidth=e,this.isDirty=!0)},i.setShadowBlur=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.shadowBlur!==e&&(this.textStyle.shadowBlur=e,this.isDirty=!0)},i.setShadowColor=function(t){var e=null!=t?t:[0,0,0,1];this.textStyle.shadowColor!==e&&(this.textStyle.shadowColor=e,this.isDirty=!0)},i.setShadowOffsetX=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetX!==e&&(this.textStyle.shadowOffsetX=e,this.isDirty=!0)},i.setShadowOffsetY=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetY!==e&&(this.textStyle.shadowOffsetY=e,this.isDirty=!0)},e}(n2),t.TextComponent=ek([iU(el.TextComponent)],t.TextComponent),iC(t.TextComponent,[uo]);var uu=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iR),uh=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iW);t.BinaryAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iW),ek([ij(void 0,void 0)],t.BinaryAsset.prototype,"buffer",void 0),t.BinaryAsset=ek([iU(el.BinaryAsset)],t.BinaryAsset);var ul=function(){function t(){}return t.serialize=function(e,i){e.toData(),i||(i={});var r=iG(e);if(r)for(var n,a=iD(Object.keys(r));!(n=a()).done;){var o=n.value,s=e[o];"number"==typeof s||"string"==typeof s||"boolean"==typeof s||t.checkTypedArray(s)?i[o]=s:iv(s)?(i[o]||(i[o]=[]),t.serializeArrayProperty(s,i[o],0)):iW.is(s)?i[o]={id:s.getInstanceId()}:ig(s)&&(i[o]||(i[o]={}),t.serializeObjectProperty(s,i[o],0))}for(var u,h=iD(Object.keys(e.defination));!(u=h()).done;){var l=u.value,c=e.defination[l];"number"==typeof c||"string"==typeof c||"boolean"==typeof c||t.checkTypedArray(c)?i[l]=c:iv(c)?(i[l]||(i[l]=[]),t.serializeArrayProperty(c,i[l],0)):iW.is(c)?i[l]={id:c.getInstanceId()}:ig(c)&&(i[l]||(i[l]={}),t.serializeObjectProperty(c,i[l],0))}return i},t.deserialize=function(e,i){i.defination=e;var r=iG(i),n=i.engine;if(r)for(var a,o=iD(Object.keys(r));!(a=o()).done;){var s=a.value,u=e[s];if(void 0!==u){var h=r[s].type;i[s]=t.deserializeProperty(u,n,0,h)}}i.fromData(i.defination)},t.checkTypedArray=function(t){return eF(t,Int8Array)||eF(t,Uint8Array)||eF(t,Uint8ClampedArray)||eF(t,Int16Array)||eF(t,Uint16Array)||eF(t,Int32Array)||eF(t,Uint32Array)||eF(t,Float32Array)||eF(t,Float64Array)||eF(t,ArrayBuffer)},t.checkDataPath=function(t){return!!(ig(t)&&1===Object.keys(t).length&&"id"in t&&im(t.id))},t.checkGLTFNode=function(t){return ig(t)&&void 0!==t.nodeIndex&&void 0!==t.isJoint},t.checkImageSource=function(t){return ib(t)||eF(t,HTMLImageElement)},t.deserializeProperty=function(e,i,r,n,a){if(void 0===a&&(a=!0),r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}if(iv(e)){for(var o,s=[],u=iD(e);!(o=u()).done;){var h=o.value;s.push(t.deserializeProperty(h,i,r+1,n,a))}return s}if(t.checkDataPath(e)){var l=i.findObject(e);return a?l:e}if(!ix(e))return e;c=n?new n:{};for(var c,f,d=iD(Object.keys(e));!(f=d()).done;){var p=f.value;c[p]=t.deserializeProperty(e[p],i,r+1,void 0,a)}return c},t.serializeObjectProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i={});for(var n,a=iD(Object.keys(e));!(n=a()).done;){var o=n.value,s=e[o];"number"==typeof s||"string"==typeof s||"boolean"==typeof s||t.checkTypedArray(e)?i[o]=s:iv(s)?(i[o]||(i[o]=[]),t.serializeArrayProperty(s,i[o],r+1)):iW.is(s)?i[o]={id:s.getInstanceId()}:ig(s)&&(i[o]||(i[o]={}),t.serializeObjectProperty(s,i[o],r+1))}},t.serializeArrayProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i=[]);for(var n=0;n<e.length;n++){var a=e[n];"number"==typeof a||"string"==typeof a||"boolean"==typeof a||t.checkTypedArray(e)?i[n]=a:iv(a)?(i[n]||(i[n]=[]),t.serializeArrayProperty(a,i[n],r+1)):iW.is(a)?i[n]={id:a.getInstanceId()}:ig(a)&&(i[n]||(i[n]={}),t.serializeObjectProperty(a,i[n],r+1))}},t}(),uc=function(){function t(t){this.engine=t}var e=t.prototype;return e.loadGUID=function(t){if(!t)return null;var e,i=t.id,r=this.findData(i);if(!r){console.error("Object data with uuid: "+i+" not found.");return}switch(r.dataType){case el.Material:e=nh.create(this.engine);break;case el.Geometry:e=ng.create(this.engine);break;case el.Texture:e=r7.create(this.engine);break;default:var n=iB[r.dataType];n&&(e=new n(this.engine))}if(!e){console.error("Constructor for DataType: "+r.dataType+" not found.");return}return e.setInstanceId(r.id),this.engine.addInstance(e),ul.deserialize(r,e),e},e.findData=function(t){return this.engine.jsonSceneData[t]},t}(),uf=function(){function t(){}return t.prototype.loadGUID=function(t){return eV(function(){return ez(this,function(t){return[2,void 0]})})()},t}();function ud(t,e){if(!t.includes(e))return t.push(e),!0}function up(t){if(Number.isFinite(t))return[tZ.CONSTANT,t];if(t){var e=t[0],i=t[1];if(Array.isArray(e))return;if("static"===e||e===tZ.CONSTANT)return[tZ.CONSTANT,t[1]];if("lines"===e)return[tZ.LINE,t[1]];if(e===tZ.LINE){var r=i.map(function(t){return[tq.LINE,t]});return[tZ.BEZIER_CURVE,r]}return"curve"===e||e===tZ.CURVE?[tZ.BEZIER_CURVE,uR(i)]:t}}function um(t,e){return Array.isArray(t)&&"random"===t[0]?[tZ.CONSTANT,t[1][e]]:up(t)}function uv(t){return t&&"color"===t[0]?ux(t[1],!0):[1,1,1,1]}function uy(t){return t&&"random"===t[0]?[tZ.RANDOM,t[1]]:up(t)}function ug(t,e){if(t){var i=[];return Object.getOwnPropertyNames(t).forEach(function(r){var n,a=(n=/^(-)?([\d+.]+)%$/.exec(r))?+n[2]/100*(n[1]?-1:1):+r,o=ux(t[r],e);i.push([a,o[0],o[1],o[2],o[3]])}),i=i.sort(function(t,e){return t[0]-e[0]}),[tZ.GRADIENT_COLOR,i]}}function ux(t,e){var i;if("string"==typeof t){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:Math.round(255*n)]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else eF(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:Math.round(255*t[3])]);return e&&(i=ub(i)),i}function ub(t){if(Array.isArray(t))return t.map(function(t){return Number.isFinite(t/255)?Number((t/255).toFixed(6)):0})}function uT(t,e){return Array.isArray(t)?t[0]===tZ.GRADIENT_COLOR?t:("gradient"===t[0]||"color"===t[0])&&ug(t[1],e):ug(t,e)}function u_(t){if(t){if(3===t.length)return[tZ.CONSTANT_VEC3,t];var e=t[0];if("path"===e||"bezier"===e||e===tZ.BEZIER_PATH||e===tZ.LINEAR_PATH){var i=t[1],r=i[0],n=i[1],a=i[2],o=uR(r);if(!a){a=[];for(var s=0;s<n.length;s++){var u=n[s].slice();0===s||s<n.length-1&&a.push(u),a.push(u)}}return[tZ.BEZIER_CURVE_PATH,[o,n,a]]}return t}}function uE(t){for(var e,i=iD(Object.keys(t));!(e=i()).done;){var r=e.value;t[r]=Number(t[r])}return t}function uC(t){for(var e,i=iD(Object.keys(t));!(e=i()).done;){var r=e.value;void 0===t[r]&&delete t[r]}return t}var uw=Math.cos,uS=Math.sin,uA=Math.PI/180,uM=180/Math.PI;function uI(t,e){return t?[t[0]-.5,.5-t[1]]:e?uP[e]:[0,0]}var uP=((ew={})[tW.PARTICLE_ORIGIN_CENTER]=[0,0],ew[tW.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],ew[tW.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],ew[tW.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],ew[tW.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],ew[tW.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],ew[tW.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],ew[tW.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],ew[tW.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],ew);function uR(t){for(var e=-1e6,i=1e6,r=0;r<t.length;r++)e=Math.max(e,t[r][1]),i=Math.min(i,t[r][1]);for(var n=[[t[0][0],t[0][1]]],a=0;a<t.length-1;a++){var o=t[a][3]*(e-i),s=t[a+1][2]*(e-i),u=[t[a][0],t[a][1]],h=[t[a+1][0],t[a+1][1]];if(u[0]!=h[0]){var l=function(t,e,i,r){var n=i[0],a=i[1],o=r[0],s=r[1],u=o-n;return[[n+(o-n)/3,a+(t*=u)/3],[o-(o-n)/3,s-(e*=u)/3]]}(o,s,u,h),c=l[0],f=l[1];n[n.length-1].push(c[0]),n[n.length-1].push(c[1]),n.push([f[0],f[1],h[0],h[1]])}else n[n.length-1].push(h[0]),n[n.length-1].push(h[1])}return n.map(function(t,e){return 0===e?[tq.EASE_OUT,t]:e===n.length-1?[tq.EASE_IN,t]:[tq.EASE,t]})}function uO(t){return t.compositions.forEach(function(t){t.items.forEach(function(t){t.type===tG.null&&t.endBehavior===tQ.destroy&&(t.endBehavior=tQ.freeze)})}),t.version=tN["2_1"],t}var uN=new Map,uL=new Map;function uV(t){for(var e,i=iD(t.components);!(e=i()).done;){var r=e.value;if(r.dataType===el.ShapeComponent&&r.type===en.Custom){(null==(n=r.shapes)?void 0:n.length)>0&&r.shapes[0].fill&&(r.fill=r.shapes[0].fill);for(var n,a,o=Array(r.easingIns.length),s=Array(r.easingOuts.length).fill(!1),u=iD(r.shapes);!(a=u()).done;)for(var h,l=a.value,c=iD(l.indexes);!(h=c()).done;){var f=h.value,d=r.points[f.point],p=r.easingIns[f.easingIn],m=r.easingOuts[f.easingOut];o[f.easingIn]||(p.x-=d.x,p.y-=d.y,o[f.easingIn]=!0),s[f.easingOut]||(m.x-=d.x,m.y-=d.y,s[f.easingOut]=!0)}}}return t.version=tN["3_2"],t}function uF(e){uN.clear(),uL.clear();for(var i,r=e.compositions,n=e.items,a=e.components,o=iD(a);!(i=o()).done;){var s=i.value;uN.set(s.id,s)}for(var u,h=iD(n);!(u=h()).done;){var l=u.value;uL.set(l.id,l)}for(var c,f=iD(r);!(c=f()).done;)!function(e){for(var i,r=iD(e.items);!(i=r()).done;){var n=i.value,a=uL.get(n.id);if(!a)return;if(a.type===tG.sprite||a.type===tG.particle||a.type===tG.spine||a.type===tG.text||a.type===tG.richtext||a.type===tG.video||a.type===tG.shape){var o=uN.get(a.components[0].id);o&&function(e){var i=e.renderer,r=null==i?void 0:i.maskMode;r&&r!==t.MaskMode.NONE&&(r===t.MaskMode.MASK?(e.mask={isMask:!0},eS=e.id):(r===tD.OBSCURED||r===tD.REVERSE_OBSCURED)&&(e.mask={inverted:r===tD.REVERSE_OBSCURED,reference:{id:eS}}))}(o)}}}(c.value);return e.version=tN["3_3"],e}function uD(t){null==(e=t.plugins)||e.forEach(function(e,i){"richtext"===e&&(t.plugins[i]="rich-text")});for(var e,i,r=iD(t.items);!(i=r()).done;){var n=i.value;if(n.type===tG.sprite){var a=uN.get(n.components[0].id);if(a){var o,s=a.renderer.shape,u=void 0;u=Number.isInteger(s)?null==(o=t.shapes)?void 0:o[s]:s,a.renderer.shape=u}}}for(var h,l=t.compositionId,c={},f=iD(t.compositions);!(h=f()).done;){var d=h.value,p=i_();c[d.id]=p,d.id===l&&(t.compositionId=p),d.id=p;var m={id:i_(),dataType:"CompositionComponent",items:d.items,timelineAsset:d.timelineAsset,sceneBindings:d.sceneBindings,item:{id:d.id}};d.timelineAsset=void 0,d.sceneBindings=void 0,d.components=[{id:m.id}],t.components.push(m)}for(var v,y=iD(t.items);!(v=y()).done;){var g=v.value;if(g.content){var x=g.content.options;x&&void 0!==x.refId&&(x.refId=c[x.refId])}}return t.version=tN["3_4"],t}function uk(t){for(var e,i={},r=iD(t.components);!(e=r()).done;){var n=e.value;i[n.id]=n}for(var a,o=iD(t.compositions);!(a=o()).done;)for(var s,u=a.value,h=iD(u.components);!(s=h()).done;)i[s.value.id].item.id=u.id;for(var l,c=iD(t.components);!(l=c()).done;){var f=l.value;if(f.dataType===el.SpriteComponent){var d=f.renderer.shape;if(null!=d&&!("aPoint"in d&&"index"in d)){var p=function(t,e){void 0===e&&(e="形状");for(var i=oU(t),r=i.index,n=void 0===r?[]:r,a=i.aPoint,o=void 0===a?[]:a,s=new Float32Array(o),u=[],h=[],l=0;l<s.length;l+=6)h.push(o[l+2],o[l+3]),u.push(s[l],s[l+1],0);var c=u.length/3,f=n.length,d=4*u.length,p=d+4*h.length,m=2*n.length,v={mode:ec.TRIANGLES,vertexData:{vertexCount:c,channels:[]},name:e,indexFormat:ed.UInt16,indexOffset:p,buffer:"",id:i_(),dataType:el.Geometry,subMeshes:[]};v.vertexData.channels.push({semantic:ep.Position,offset:0,format:ef.Float32,dimension:3}),v.vertexData.channels.push({semantic:ep.Uv,offset:d,format:ef.Float32,dimension:2}),v.subMeshes.push({offset:0,indexCount:f,vertexCount:c});var y=new ArrayBuffer(p+m+(m%4==0?0:2)),g=new Float32Array(y);g.set(u,0),g.set(h,u.length),new Uint16Array(y,p).set(n,0);var x=new Uint8Array(y).slice(0,p+m);return v.binaryData=x,v}(d);f.geometry={id:p.id},t.geometries.push(p)}}if(f.dataType===el.ShapeComponent){if(f.fills=[],f.fill){var m={type:ei.Solid,color:f.fill.color};f.fills.push(m)}if(delete f.fill,f.strokes=[],f.stroke){var v={type:ei.Solid,color:f.stroke.color};f.strokes.push(v),f.strokeWidth=f.stroke.width,f.strokeCap=f.stroke.cap,f.strokeJoin=f.stroke.join,delete f.stroke}}}return t.version="3.5",t}function uz(t){if(t.components)for(var e,i=iD(t.components);!(e=i()).done;){var r,n=e.value;n.dataType===el.RichTextComponent&&n.options&&void 0===n.options.useLegacyRichText&&(void 0===n.options.lineGap?n.options.useLegacyRichText=!0:n.options.useLegacyRichText=!1),n.dataType!==el.TextComponent&&(n.dataType!==el.RichTextComponent||!n.options)||(r=n.options)&&void 0===r.TextVerticalAlign&&void 0===r.TextVerticalAlign&&(r.TextVerticalAlign=r.textBaseline)}return t.version="3.6",t}function uB(t){for(var e,i=i2({},t,{items:[],compositions:[],components:[],materials:[],shaders:[],geometries:[],animations:[],miscs:[]}),r=iD(i.images);!(e=r()).done;)e.value.id=i_();if(null!=i.textures||(i.textures=[]),i.textures.forEach(function(t){var e;t.id=i_(),t.dataType=el.Texture,t.source={id:null==(e=i.images[t.source])?void 0:e.id}}),i.textures.length<i.images.length)for(var n=i.textures.length;n<i.images.length;n++)i.textures.push({id:i_(),dataType:el.Texture,source:{id:i.images[n].id},flipY:!0});t.bins&&(a=t.bins,i.bins=a.map(function(t){return{url:t.url,dataType:"BinaryAsset",id:i_()}}));for(var a,o,s={},u={},h=iD(t.compositions);!(o=h()).done;)!function(){var t=o.value;(3===t.endBehavior||1===t.endBehavior)&&(t.endBehavior=tQ.freeze),t.items=t.items.filter(function(t){return"8"!==t.type}),t.items.forEach(function(t){t.type===tG.particle&&t.content.filter&&delete t.content.filter});for(var e,r=iD(t.items);!(e=r()).done;){var n=e.value;s[n.id]=i_(),n.oldId=n.id,n.id=s[n.id],u[n.id]=n}t.items.forEach(function(e,r){if(e.parentId){if(e.parentId.includes("^")){var n=e.parentId.split("^")[0],a=e.parentId.split("^")[1];e.parentId=s[n]+"^"+a}else e.parentId=s[e.parentId]}i.items.push(e),t.items[r]={id:e.id}});var a=i2({},t,{timelineAsset:{id:""},sceneBindings:[]});i.compositions.push(a),function(t,e,i){for(var r,n=[],a=[],o=[],s={tracks:[],id:i_(),dataType:"TimelineAsset"},u=iD(t.items);!(r=u()).done;){var h=e[r.value.id],l=[],c={id:i_(),dataType:"ActivationPlayableAsset"};o.push(c);var f={id:i_(),dataType:"ActivationTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:c.id}}]};if(l.push({id:f.id}),a.push(f),h.type!==tG.particle){var d={id:i_(),dataType:"TransformPlayableAsset",sizeOverLifetime:h.content.sizeOverLifetime,rotationOverLifetime:h.content.rotationOverLifetime,positionOverLifetime:h.content.positionOverLifetime};o.push(d);var p={id:i_(),dataType:"TransformTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:d.id}}]};l.push({id:p.id}),a.push(p)}if(h.type===tG.sprite||h.type===tG.text){var m={id:i_(),dataType:"SpriteColorPlayableAsset",colorOverLifetime:h.content.colorOverLifetime};o.push(m);var v={id:i_(),dataType:"SpriteColorTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:m.id}}]};l.push({id:v.id}),a.push(v)}if(h.type===tG.composition){var y={id:i_(),dataType:"SubCompositionPlayableAsset"};o.push(y);var g={id:i_(),dataType:"SubCompositionTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:y.id}}]};l.push({id:g.id}),a.push(g)}var x={id:i_(),dataType:"ObjectBindingTrack",children:l,clips:[]};a.push(x),s.tracks.push({id:x.id}),n.push({key:{id:x.id},value:{id:h.id}})}for(var b,T=[],_=iD(a);!(b=_()).done;){var E=b.value;T.push({id:E.id})}t.timelineAsset={id:s.id},t.sceneBindings=n,i.miscs.push(s);for(var C,w=iD(a);!(C=w()).done;){var S=C.value;i.miscs.push(S)}for(var A,M=iD(o);!(A=M()).done;){var I=A.value;i.miscs.push(I)}}(a,u,i)}();for(var l,c=iD(i.items);!(l=c()).done;){var f=l.value;if(f.content){if(f.content.renderer&&void 0!==f.content.renderer.texture){var d=f.content.renderer.texture;f.content.renderer.texture={id:i.textures[d].id}}if(f.content.trails&&void 0!==f.content.trails.texture){var p=f.content.trails.texture;f.content.trails.texture={id:i.textures[p].id}}}if(f.transform){var m=[].concat(null!=(g=f.transform.position)?g:[0,0,0]),v=[].concat(null!=(x=f.transform.rotation)?x:[0,0,0]),y=[].concat(null!=(b=f.transform.scale)?b:[1,1,1]);if(Object.assign(f,{transform:{position:{x:m[0],y:m[1],z:m[2]},eulerHint:{x:v[0],y:v[1],z:v[2]},scale:{x:y[0],y:y[1],z:y[0]}}}),f.type===tG.sprite&&(f.transform.size={x:y[0],y:y[1]},f.transform.scale={x:1,y:1,z:1}),f.type===tG.sprite){var g,x,b,T,_,E,C,w=f.content;w.renderer||(w.renderer={});var S=w.renderer,A=uI(S.anchor,S.particleOrigin),M=f.transform.size;S.anchor||void 0===S.particleOrigin||(f.transform.position.x+=-A[0]*(null!=(T=null==M?void 0:M.x)?T:1),f.transform.position.y+=-A[1]*(null!=(_=null==M?void 0:M.y)?_:1)),f.transform.anchor={x:A[0]*(null!=(E=null==M?void 0:M.x)?E:1),y:A[1]*(null!=(C=null==M?void 0:M.y)?C:1)}}}if(f.type===tG.particle){var I=f.content;I.renderer||(I.renderer={});var P=I.renderer;I.renderer.anchor=uI(P.anchor,P.particleOrigin)}if(f.type===tG.camera&&f.content.positionOverLifetime&&0!==Object.keys(f.content.positionOverLifetime).length&&(f.content.positionOverLifetime.asMovement=!0),void 0!==f.pn){var R=f.pn,O=t.plugins,N=void 0===O?[]:O;void 0!==R&&Number.isInteger(R)&&(f.pluginName=N[R])}switch("editor-gizmo"===f.pluginName&&(f.type="editor-gizmo"),"orientation-transformer"===f.pluginName&&(f.type="orientation-transformer"),f.content.options.target&&"editor-gizmo"===f.pluginName&&(f.content.options.target=s[f.content.options.target]),f.type===tG.spine&&t.spines&&0!==t.spines.length&&function(t,e,i){e.resource={atlas:{bins:{id:i.bins[t.atlas[1][0]].id},source:t.atlas[1].slice(1)},skeleton:{bins:{id:i.bins[t.skeleton[1][0]].id},source:t.skeleton[1].slice(1)},skeletonType:t.skeletonType,images:t.images.map(function(t){return{id:i.textures[t].id}})}}(t.spines[f.content.options.spine],f.content,i),(f.type===tG.sprite||f.type===tG.particle||f.type===tG.mesh||f.type===tG.skybox||f.type===tG.light||"camera"===f.type||f.type===tG.tree||f.type===tG.interact||f.type===tG.camera||f.type===tG.text||f.type===tG.spine||"editor-gizmo"===f.type||"orientation-transformer"===f.type)&&(f.components=[],i.components.push(f.content),f.content.id=i_(),f.content.item={id:f.id},f.dataType=el.VFXItemData,f.components.push({id:f.content.id})),(f.type===tG.null||f.type===tG.composition)&&(f.components=[],f.dataType=el.VFXItemData),f.type){case tG.sprite:f.content.dataType=el.SpriteComponent;break;case tG.particle:f.content.dataType=el.ParticleSystem;break;case tG.mesh:f.content.dataType=el.MeshComponent;break;case tG.skybox:f.content.dataType=el.SkyboxComponent;break;case tG.light:f.content.dataType=el.LightComponent;break;case"camera":f.content.dataType=el.CameraComponent;break;case"editor-gizmo":f.content.dataType="GizmoComponent";break;case"orientation-transformer":f.content.dataType="OrientationComponent";break;case tG.tree:f.content.dataType=el.TreeComponent;break;case tG.interact:f.content.dataType=el.InteractComponent;break;case tG.camera:f.content.dataType=el.CameraController;break;case tG.text:f.content.dataType=el.TextComponent;break;case tG.spine:f.content.dataType=el.SpineComponent}}return i.version=tN["3_0"],i}function uU(t,e){var i,r=t.options,n=t.velocityOverLifetime||{},a={path:u_(null==(i=t.transform)?void 0:i.path),gravity:r.gravity,gravityOverLifetime:up(r.gravityModifier),direction:r.direction,startSpeed:r.startSpeed,asMovement:n.asMovement,linearX:up(n.linearX),linearY:up(n.linearY),linearZ:up(n.linearZ),asRotation:n.asRotation,orbCenter:n.orbCenter,orbitalX:up(n.orbitalX),orbitalY:up(n.orbitalY),orbitalZ:up(n.orbitalZ),speedOverLifetime:up(n.speedOverLifetime)};uC(a);var o={options:{startColor:uv(r.startColor)},positionOverLifetime:a};r.startSize&&(e.scale=[r.startSize,r.startSize/(r.sizeAspect||1),1]),r.startRotation&&(e.rotation?e.rotation[2]+=r.startRotation:e.rotation=[0,0,r.startRotation]);var s=t.rotationOverLifetime;if(s){var u=o.rotationOverLifetime={separateAxes:s.separateAxes,asRotation:s.asRotation};u.separateAxes?(u.x=up(s.x),u.y=up(s.y),u.z=up(s.z)):u.z=up(s.angularVelocity)}var h=t.colorOverLifetime;if(h){var l=o.colorOverLifetime={opacity:up(h.opacity)};h.color&&(l.color=uT(h.color))}var c=t.sizeOverLifetime;return c&&(o.sizeOverLifetime={separateAxes:c.separateAxes,size:up(c.size),x:up(c.x),y:up(c.y),z:up(c.z)}),o}var uG="2.8.0-alpha.2",uj=/^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/,uW=/^(\d+)\.(\d+)$/,uX=!1;function uH(t){if(!t||"object"!=typeof t)throw Error("Invalid input: Expected a JSON object.");if(function(t){var e=(t.playerVersion||{}).web,i=void 0===e?"":e;if(i){var r,n,a=null!=(r=uj.exec(i))?r:[],o=null!=(n=uj.exec(uG))?n:[],s=a[1],u=a[2],h=o[1],l=o[2];return Number(h)<Number(s)||Number(h)===Number(s)&&Number(l)<Number(u)}return!1}(t)&&console.warn("The JSON need higher than "+(null==(d=t.playerVersion)?void 0:d.web)+" runtime version(current: "+uG+"). Some features may not work as expected."),!(f=null==(c=(l=t).version)?void 0:c.split("."))||Number(f[0])>2||2===Number(f[0])&&Number(f[1])>=2||l.compositions.forEach(function(t){t.items.forEach(function(t){(t.type===tG.mesh||t.type===tG.light)&&(t.endBehavior=1===t.endBehavior?tQ.destroy:t.endBehavior)})}),uj.test(t.version)){var e,i,r,n,a,o,s,u;return uX=(null==(p=/^(\d+)/.exec(t.version))?void 0:p[0])==="0",uz(uk(uD(uF(uV(uB(uO((e=t,uY=tN["1_0"],n=e.plugins||[],(null==(i=e.bins)?void 0:i.length)&&(uY=tN["1_3"]),a=(e.requires||[]).slice(),o=e.images.map(function(t,i){return uZ(t,i,e.imageTags||[])}),s=e.textures||o.map(function(t,e){return{source:e,flipY:!0}}),u={plugins:n,shapes:e.shapes||[],type:"ge",version:uY,playerVersion:null!=(r=e.playerVersion)?r:{web:"",native:""},compositionId:e.compositionId+"",compositions:e.compositions.map(function(t){return uq(t,{plugins:n,requires:a})}),images:o,imgUsage:e._imgs,binUsage:e.binUsage,spines:e.spines,requires:e.requires,textures:s,bins:(e.bins||[]).slice()},e._textures&&(u._textures=e._textures),u))))))))}uX=!1;var h,l,c,f,d,p,m=uW.exec(t.version)||[],v=Number(m[1]),y=Number(m[2]);if(v)return(v<2||2===v&&y<4)&&((h=t).compositions.map(function(t){for(var e,i=iD(t.items);!(e=i()).done;)(function t(e){if(e)for(var i,r=iD(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],o=Array.isArray(a);o&&2===a.length&&Array.isArray(a[1])?"path"===n?e[n]=u_(a):e[n]=up(a):o||"object"!=typeof a||t(a)}})(e.value.content)}),t=h),v<3&&(t=uB(uO(t))),v=Number((m=uW.exec(t.version)||[])[1]),y=Number(m[2]),v<4&&(y<2&&(t=uV(t)),y<3&&(t=uF(t)),y<4&&(t=uD(t)),y<5&&(t=uk(t)),y<6&&(t=uz(t))),t;throw Error("Invalid JSON version: "+t.version+".")}var uY=tN["1_0"];function uZ(t,e,i){var r=i[e];if("string"==typeof t)return{id:i_(),renderLevel:r,url:t};if(t.template)return{id:i_(),url:t.url,template:t.template,webp:t.webp,renderLevel:r};if(t.compressed)return{id:i_(),url:t.url,compressed:{astc:t.compressed.android,pvrtc:t.compressed.iOS},webp:t.webp,renderLevel:r};if(t.url)return{id:i_(),url:t.url,webp:t.webp,renderLevel:r};if(t&&t.sourceType)return t;throw Error("Invalid image type.")}function uq(t,e){void 0===e&&(e={});var i,r={id:t.id+"",camera:i2({clipMode:0},t.camera),duration:t.duration,endBehavior:t.endBehavior,items:t.items.map(function(t){return uK(t,e)}),name:t.name},n=t.startTime||t.st;n&&(r.startTime=n);var a=null==(i=t.meta)?void 0:i.previewSize;return a&&a[0]===a[1]&&0===a[0]&&(a=void 0),a&&(r.previewSize=a),r}var uQ=[0,0,0,1];function uK(t,e){void 0===e&&(e={});var i=tG.base,r=t.endBehavior,n=NaN;if(t.content?(i=t.type||tG.plugin,m=t.pn,p=t.pluginName,f=t.content,c=t.content,isNaN(m)&&!p&&(p=f.options.type),t.duration&&(n=t.duration),l=t.transform||b(c.transform)):t.particle?(i=tG.particle,l=b((c=t.particle).transform,uX,!0),f=function(t){var e=t.options,i=t.transform,r={type:tk.NONE};if(t.shape){var n,a=null==(n=t.shape.shape)?void 0:n.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,"");if(r=i2({},t.shape,{type:tk[a]}),t.shape.upDirection){var o=t.shape.upDirection,s=o[0],u=o[1],h=o[2];0===s&&0===u&&0===h&&delete r.upDirection}}e.startTurbulence&&(r.turbulenceX=uy(e.turbulenceX),r.turbulenceY=uy(e.turbulenceY),r.turbulenceZ=uy(e.turbulenceZ));var l=t.emission;l.bursts&&l.bursts.length>0&&(l.bursts=l.bursts.map(function(t){return uE(t)})),l.burstOffsets&&l.burstOffsets.length>0&&(l.burstOffsets=l.burstOffsets.map(function(t){return uE(t)})),l.rateOverTime&&(l.rateOverTime=uy(l.rateOverTime));var c={renderer:t.renderer,shape:r,splits:t.splits,emission:l,options:{startLifetime:uy(e.startLifetime),start3DSize:!!e.start3DSize,startSize:uy(e.startSize),startSizeX:uy(e.startSizeX),startSizeY:uy(e.startSizeY),sizeAspect:uy(e.sizeAspect),maxCount:e.maxCount,startDelay:uy(e.startDelay),startColor:function(t,e){if(t)return"colors"===t[0]?[tZ.COLORS,t[1].map(function(t){return ux(t,e)})]:"gradient"===t[0]?ug(t[1],e):"color"===t[0]?[tZ.RGBA_COLOR,ux(t[1],e)]:t}(e.startColor,!0),startRotationZ:uy(e.startRotation||e.startRotationZ),particleFollowParent:e.particleFollowParent}};e.start3DRotation&&(c.options.startRotationX=uy(e.startRotationX),c.options.startRotationY=uy(e.startRotationY)),i&&i.path&&(c.emitterTransform={path:u_(i.path)});var f=t.sizeOverLifetime;f&&(f.separateAxes?c.sizeOverLifetime={separateAxes:!0,x:uy(f.x),y:uy(f.y)}:c.sizeOverLifetime={size:uy(f.size)});var d=t.velocityOverLifetime||{},p=d.speedOverLifetime;p=p?up(p):void 0,c.positionOverLifetime={gravity:e.gravity,gravityOverLifetime:up(e.gravityModifier),startSpeed:uy(e.startSpeed),speedOverLifetime:p,asMovement:d.asMovement,linearX:uy(d.linearX),linearY:uy(d.linearY),linearZ:uy(d.linearZ),asRotation:d.asRotation,orbCenter:d.orbCenter,orbitalX:uy(d.orbitalX),orbitalY:uy(d.orbitalY),orbitalZ:uy(d.orbitalZ),forceTarget:d.forceTarget,target:d.target,forceCurve:up(d.forceCurve)},uC(c.positionOverLifetime);var m=t.rotationOverLifetime;m&&(c.rotationOverLifetime={separateAxes:m.separateAxes,asRotation:m.asRotation,z:uy(m.separateAxes?m.z:m.angularVelocity)},m.separateAxes&&(c.rotationOverLifetime.y=up(m.y),c.rotationOverLifetime.x=up(m.x)));var v=t.colorOverLifetime;if(v){var y=c.colorOverLifetime={opacity:up(v.opacity)};v.color&&(y.color=uT(v.color))}var g=t.textureSheetAnimation;g&&(c.textureSheetAnimation={row:g.row,col:g.col,total:g.total,animate:g.animate,cycles:up(g.cycles),animationDelay:um(g.animationDelay,0),animationDuration:um(g.animationDuration,0)});var x=t.trails;x&&(c.trails={lifetime:uy(x.lifetime),dieWithParticles:x.dieWithParticles,maxPointPerTrail:x.maxPointPerTrail,minimumVertexDistance:x.minimumVertexDistance,widthOverTrail:up(x.widthOverTrail),colorOverTrail:x.colorOverTrail&&uT(x.colorOverTrail,!1),blending:x.blending,colorOverLifetime:x.colorOverLifetime&&uT(x.colorOverLifetime,!1),inheritParticleColor:x.inheritParticleColor,occlusion:x.occlusion,transparentOcclusion:x.transparentOcclusion,orderOffset:x.orderOffset,sizeAffectsLifetime:x.sizeAffectsLifetime,sizeAffectsWidth:x.sizeAffectsWidth,texture:x.texture,parentAffectsPosition:x.parentAffectsPosition,opacityOverLifetime:uy(x.opacityOverLifetime)}),c.trails&&uC(c.trails);var b=t.interaction;return b&&(c.interaction={behavior:b.behavior,radius:b.radius,multiple:b.multiple}),c}(c)):t.sprite?(i=tG.sprite,l=b((c=t.sprite).transform,!1,!0),s=uU(o=c,l),(u=o.textureSheetAnimation)&&(s.textureSheetAnimation={row:u.row,col:u.col,total:u.total||void 0,animate:u.animate}),s.renderer=o.renderer,o.splits&&(s.splits=o.splits),o.interaction&&(s.interaction=o.interaction),f=s):t.cal?(i=tG.null,l=b((c=t.cal).transform,!1,!0),f=uU(c,l)):t.ui?(i=tG.interact,l=b((c=t.ui).transform),f=function(t){var e,i=t.options;switch(i.type){case"click":e={type:tB.CLICK,showPreview:i.showPreview,previewColor:i.previewColor&&uv(i.previewColor),behavior:i.behavior||tU.NOTIFY};break;case"drag":e={type:tB.DRAG,enableInEditor:!!i.enableInEditor,dxRange:i.dxRange,dyRange:i.dyRange,target:i.target};break;case"message":e={type:tB.MESSAGE}}return{options:e}}(c),l.scale=[c.options.width||1,c.options.height||1,1]):t.model&&(c=t.model,1===t.model.options.type&&(i=tG.camera,l=b(c.transform),f=function(t){var e=t.options,i={options:{fov:e.fov,far:e.far,near:e.near,clipMode:e.clipMode}},r=t.velocityOverLifetime;if(r||(null==(n=t.transform)?void 0:n.path)){var n,a,o={path:u_(null==(a=t.transform)?void 0:a.path),linearX:up(null==r?void 0:r.translateX),linearY:up(null==r?void 0:r.translateY),linearZ:up(null==r?void 0:r.translateZ)};uC(o),i.positionOverLifetime=o}var s=t.rotationOverLifetime;if(s){var u={separateAxes:s.separateAxes,x:up(null==s?void 0:s.rotateX),y:up(null==s?void 0:s.rotateY),z:s.separateAxes?up(null==s?void 0:s.rotateZ):up(s.rotation)};uC(u),i.rotationOverLifetime=u}return i}(c))),null==(h=f.renderer)?void 0:h.anchor){var a=new Float32Array(f.renderer.anchor);.5==a[0]&&.5==a[1]?delete f.renderer.anchor:e.requires&&ud(e.requires,"anchor")}if(c){var o,s,u,h,l,c,f,d,p,m,v,y,g=null==(v=c.options)?void 0:v.looping;r=g?Array.isArray(g)?g[1]?tQ.restart:tQ.destroy:tQ.restart:r||(null==c?void 0:null==(y=c.options)?void 0:y.endBehavior)||tQ.destroy,c.options.renderLevel&&(d=c.options.renderLevel),isNaN(n)&&(n=c.options.duration)}var x={type:i,name:t.name,delay:t.delay,duration:n,id:t.id+"",transform:l,endBehavior:r,renderLevel:d,content:f};return p?e.plugins?(ud(e.plugins,p),x.pn=e.plugins.indexOf(p)):x.pluginName=p:Number.isInteger(m)&&(x.pn=m),t.parentId&&(x.parentId=t.parentId+""),x;function b(t,e,i){if(t){var r={},n=t.rotation;if(n&&(e?r.rotation=[-n[0],-n[1],-n[2]]:r.rotation=[n[0],n[1],n[2]],i)){var a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,w,S,A,M,I=(a=r.rotation[0],o=r.rotation[1],s=r.rotation[2],u=uw(a*uA/2),h=uw(o*uA/2),l=uw(s*uA/2),c=uS(a*uA/2),f=uS(o*uA/2),d=uS(s*uA/2),uQ[0]=c*h*l+u*f*d,uQ[1]=u*f*l-c*h*d,uQ[2]=u*h*d+c*f*l,uQ[3]=u*h*l-c*f*d,uQ);r.rotation=(p=[],m=I[0],v=I[1],y=I[2],g=I[3],x=m+m,b=v+v,T=y+y,_=m*x,E=v*x,C=v*b,w=y*T,S=g*T,A=y*x-g*b,p[1]=Math.asin((M=-A)>1?1:M<-1?-1:M)*uM,.9999999>Math.abs(A)?(p[0]=Math.atan2(y*b+g*x,1-_-C)*uM,p[2]=Math.atan2(E+S,1-C-w)*uM):(p[0]=0,p[2]=Math.atan2(-(E-S),1-_-w)*uM),p)}return t.position&&(r.position=t.position),Array.isArray(t.scale)&&(r.scale=[t.scale[0]||1,t.scale[1]||1,t.scale[2]||1]),r}return{}}}var uJ=((eA={})[tL.S]=[tL.S,tL.BPlus,tL.APlus],eA[tL.A]=[tL.A,tL.BPlus,tL.APlus],eA[tL.B]=[tL.B,tL.BPlus],eA);function u$(t,e){if(!t||!e)return!0;var i=uJ[e];return!!i&&i.includes(t)}function u0(t,e){var i,r,n=null!=(r=null==t?void 0:t.background)?r:{},a=n.name,o=n.url;return a&&(e&&e[a]?i=e[a]:o&&(i=o)),i}function u1(t,e,i){return u2.apply(this,arguments)}function u2(){return(u2=eV(function(t,e,i){var r,n;return ez(this,function(a){switch(a.label){case 0:if("string"!=typeof t)return[3,2];return[4,rq(t)];case 1:return r=a.sent(),[3,3];case 2:r=t,a.label=3;case 3:if(!r)throw Error("Image not provided.");if(!e)return[2,r];if(n=u0(e,i)){if(im(n)&&n!==r.src)return[2,rq(n)];if(eF(n,HTMLImageElement))return[2,n]}return[2,r]}})})).apply(this,arguments)}t.Scene=void 0,(tI=t.Scene||(t.Scene={})).isJSONObject=function(t){return ig(t)&&"jsonScene"in t},tI.isURL=function(t){return ig(t)&&"url"in t},tI.isWithOptions=function(t){return ig(t)&&"options"in t};var u3=1,u4=function(){function e(t,e){void 0===t&&(t={}),void 0===e&&(e=new rG),this.options=t,this.downloader=e,this.assets={},this.sourceFrom={},this.id=u3++,this.timers=[],this.updateOptions(t)}var i=e.prototype;return i.updateOptions=function(t){void 0===t&&(t={}),this.options=t,t.pluginData||(t.pluginData={});var e=t.timeout;this.timeout=void 0===e?10:e},i.loadScene=function(e,i){var r=this;return eV(function(){var n,a,o,s,u,h,l,c,f,d,p,m;return ez(this,function(v){return a=im(e)?e:r.id,o=performance.now(),s=[],l=null!=(h=null==(u=null==i?void 0:i.engine.gpuCapability)?void 0:u.detail.ktx2Support)&&h,c={},d=!1,p=new Promise(function(t,e){f=window.setTimeout(function(){d=!0,r.removeTimer(f),e(Error("Load time out: totalTime: "+(performance.now()-o).toFixed(4)+"ms "+s.join(" ")+", url: "+a+"."))},1e3*r.timeout),r.timers.push(f)}),m=eV(function(t,e){var i,r,n;return ez(this,function(a){switch(a.label){case 0:if(d)return[3,4];i=performance.now(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e()];case 2:return r=a.sent(),n=performance.now()-i,s.push("["+t+": "+n.toFixed(2)+"]"),c[t]=n,[2,r];case 3:throw Error("Load error in "+t+", "+a.sent()+".");case 4:throw Error("Load canceled.")}})}),[2,Promise.race([p,eV(function(){var i,u,h,d,p,v,y,g,x,b,T,_,E,C,w;return ez(this,function(S){switch(S.label){case 0:if(!im(e))return[3,2];return u=new URL(e,location.href).href,r.baseUrl=u,[4,m("loadJSON",function(){return r.loadJSON(u)})];case 1:return im(n=S.sent())&&(n=JSON.parse(n)),[3,3];case 2:n=e,r.baseUrl=location.href,S.label=3;case 3:if(!t.Scene.isJSONObject(n))return[3,4];return i=i2({},n),[3,9];case 4:return[4,m("processJSON",function(){return r.processJSON(n)})];case 5:return i={timeInfos:c,url:e,storage:{},jsonScene:v=S.sent().jsonScene,bins:[],textureOptions:[],textures:[],images:[],assets:r.assets},[4,m("plugin:processAssets",function(){return r.processPluginAssets(i)})];case 6:return S.sent(),g=void 0===(y=v.bins)?[]:y,x=v.images,b=v.fonts,[4,Promise.all([m("processBins",function(){return r.processBins(g)}),m("processImages",function(){return r.processImages(x,l)}),m("processFontURL",function(){return r.processFontURL(b)})])];case 7:return _=(T=S.sent())[0],E=T[1],[4,m("processTextures",function(){return r.processTextures(E,_,v)})];case 8:C=S.sent(),(h=i.bins).push.apply(h,[].concat(_)),(d=i.textureOptions).push.apply(d,[].concat(C)),(p=i.images).push.apply(p,[].concat(E)),i.renderLevel=r.options.renderLevel,S.label=9;case 9:return w=performance.now()-o,id.info("Load asset: totalTime: "+w.toFixed(4)+"ms "+s.join(" ")+", url: "+a+"."),window.clearTimeout(f),r.removeTimer(f),i.totalTime=w,i.startTime=o,i.timeInfos=c,[2,i]}})})()])]})})()},i.getAssets=function(){return this.assets},i.processJSON=function(t){return eV(function(){var e,i,r,n,a;return ez(this,function(o){for(r=iD(void 0===(i=(e=uH(t)).plugins)?[]:i);!(n=r()).done;)if(!iw[a=n.value])throw Error("The plugin '"+a+"' not found."+iP(a));return[2,{jsonScene:e}]})})()},i.processBins=function(t){var e=this;return eV(function(){var i,r;return ez(this,function(n){return i=e.options.renderLevel,r=e.baseUrl,[2,Promise.all(t.map(function(n){if(eF(n,ArrayBuffer))return n;if(u$(n.renderLevel,i))return e.loadBins(new URL(n.url,r).href);throw Error("Invalid bins source: "+JSON.stringify(t)+".")}))]})})()},i.processFontURL=function(t){var i=this;return eV(function(){return ez(this,function(r){return[2,e.loadFontFamily(t,i.baseUrl)]})})()},i.processImages=function(e,i){void 0===i&&(i=!1);var r=this;return eV(function(){var n,a,o,s,u,h,l;return ez(this,function(c){switch(c.label){case 0:return a=(n=r.options).useCompressedTexture,o=n.variables,s=n.disableWebP,u=n.disableAVIF,h=r.baseUrl,[4,Promise.all(e.map(eV(function(e,n){var l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,w,S,A,M,I;return ez(this,function(n){switch(n.label){case 0:if(l=e.url,c=e.webp,f=e.avif,d=e.ktx2,p=new URL(l,h).href,m=!s&&c?new URL(c,h).href:void 0,v=!u&&f?new URL(f,h).href:void 0,y=d&&a&&i?new URL(d,h).href:void 0,g=e.id,!("template"in e))return[3,8];if(!(b=(x=e.template).background))return[3,7];T=u0(x,o),_=b.type===eu.video,E=b&&_?r0:rq,n.label=1;case 1:return n.trys.push([1,6,,7]),[4,r2(T,E)];case 2:if(!eF(C=n.sent(),HTMLVideoElement))return[3,3];return r.sourceFrom[g]={url:C.src,type:t.TextureSourceType.video},[2,C];case 3:return b&&Array.isArray(T)&&o&&(o[b.name]=C.src),r.sourceFrom[g]={url:C.src,type:t.TextureSourceType.image},[4,u1(C,x,o)];case 4:return[2,n.sent()];case 5:return[3,7];case 6:throw w=n.sent(),Error("Failed to load. Check the template or if the URL is "+(_?"video":"image")+" type, URL: "+T+", Error: "+(w.message||w)+".");case 7:return[3,9];case 8:if("ktx2"in e&&y)return r.sourceFrom[g]={url:y,type:t.TextureSourceType.compressed},[2,r.loadBins(y)];if(eF(e,HTMLImageElement)||eF(e,HTMLCanvasElement)||eF(e,HTMLVideoElement)||eF(e,r7))return[2,e];n.label=9;case 9:if(!v)return[3,11];return[4,rY(p,v)];case 10:return I=n.sent(),[3,13];case 11:return[4,rX(p,m)];case 12:I=n.sent(),n.label=13;case 13:return A=(S=I).url,M=S.image,r.sourceFrom[g]={url:A,type:t.TextureSourceType.image},[2,M]}})})))];case 1:return l=c.sent(),r.assignImagesToAssets(e,l),[2,l]}})})()},i.processPluginAssets=function(t){var e=this;return eV(function(){return ez(this,function(i){switch(i.label){case 0:return[4,iM.processAssets(t,e.options)];case 1:return i.sent(),[2]}})})()},i.processTextures=function(e,i,r){var n=this;return eV(function(){var a;return ez(this,function(o){return[2,Promise.all((null!=(a=r.textures)?a:e.map(function(t,e){return{source:e}})).map(eV(function(e,a){var o,s,u,h,l;return ez(this,function(c){switch(c.label){case 0:if(eF(e,r7))return[2,e];if(!("mipmaps"in e))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r4(e,i,n.assets,r.bins)];case 2:return[2,c.sent()];case 3:throw Error("Load texture "+a+" fails, error message: "+c.sent()+".");case 4:if(o=e.source,s=e.id,h="",!ig(o))return[3,5];return u=n.assets[o.id],h=o.id,[3,7];case 5:if("string"!=typeof o)return[3,7];return[4,rq(iE(o))];case 6:u=c.sent(),c.label=7;case 7:if(!u)return[3,9];return[4,function(t,e,i){return u5.apply(this,arguments)}(u,n.sourceFrom[h],s)];case 8:return[2,(l=c.sent()).sourceType===t.TextureSourceType.compressed?l:i2({},l,e)];case 9:throw Error("Invalid texture source: "+o+".")}})})))]})})()},i.loadJSON=function(t){var e=this;return eV(function(){return ez(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadJSON(t,i,function(e,i){r("Couldn't load JSON "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.loadBins=function(t){var e=this;return eV(function(){return ez(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadBinary(t,i,function(e,i){r("Couldn't load bins "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.assignImagesToAssets=function(t,e){for(var i=0;i<t.length;i++)this.assets[t[i].id]=e[i]},i.removeTimer=function(t){var e=this.timers.indexOf(t);-1!==e&&this.timers.splice(e,1)},i.dispose=function(){this.timers.length&&this.timers.map(function(t){return window.clearTimeout(t)}),this.assets={},this.sourceFrom={},this.timers=[]},e.loadFontFamily=function(t,i){return void 0===i&&(i=location.href),eV(function(){return ez(this,function(r){return t?[2,Promise.all(t.map(eV(function(t){var r,n,a;return ez(this,function(o){switch(o.label){case 0:if(!(t.fontURL&&!e.fontCache.has(t.fontFamily)))return[3,4];il(t.fontFamily)||console.warn("Risky font family: "+t.fontFamily+"."),o.label=1;case 1:return o.trys.push([1,3,,4]),r=new URL(t.fontURL,i).href,[4,(a=new FontFace(null!=(n=t.fontFamily)?n:"","url("+r+")")).load()];case 2:return o.sent(),document.fonts.add(a),e.fontCache.add(t.fontFamily),[3,4];case 3:return o.sent(),id.warn("Invalid font family or font source: "+JSON.stringify(t.fontURL)+"."),[3,4];case 4:return[2]}})})))]:[2]})})()},e}();function u5(){return(u5=eV(function(e,i,r){var n,a,o,s,u;return ez(this,function(h){switch(h.label){case 0:if(n={id:r,dataType:el.Texture},!eF(e,r7))return[3,1];return[2,i2({},e.source,n)];case 1:if(!(eF(e,HTMLImageElement)||ib(e)))return[3,2];return[2,i2({image:e,sourceType:t.TextureSourceType.image,sourceFrom:i,keepImageSource:!0,minFilter:rL.LINEAR,magFilter:rL.LINEAR},n)];case 2:if(!eF(e,HTMLVideoElement))return[3,3];return[2,i2({sourceType:t.TextureSourceType.video,video:e,minFilter:rL.LINEAR,magFilter:rL.LINEAR},n)];case 3:if(!eF(e,ArrayBuffer))return[3,10];if(!(a=nn.getLoader("ktx2")))return[3,8];h.label=4;case 4:return h.trys.push([4,6,,7]),[4,a.loadFromBuffer(e)];case 5:return o=h.sent(),[2,i2({sourceType:o.sourceType,type:o.type,target:o.target,internalFormat:o.internalFormat,format:o.format,mipmaps:o.mipmaps,minFilter:rL.LINEAR,magFilter:rL.LINEAR,sourceFrom:i},n)];case 6:throw s=h.sent(),Error("Failed to parse KTX2 from "+(null!=(u=null==i?void 0:i.url)?u:"buffer")+": "+(s.message||s));case 7:return[3,9];case 8:throw Error("KTX2 loader not found. Please register it first.");case 9:return[3,11];case 10:if("width"in e&&"height"in e&&"data"in e)return[2,i2({sourceType:t.TextureSourceType.data,data:e,wrapS:rL.CLAMP_TO_EDGE,wrapT:rL.CLAMP_TO_EDGE,minFilter:rL.NEAREST,magFilter:rL.NEAREST},n)];h.label=11;case 11:throw Error("Invalid texture options.")}})})).apply(this,arguments)}u4.fontCache=new Set;var u6=function(){function e(t){this.engine=t,this.builtinObjects=[],this.builtinObjects.push(t.whiteTexture),this.builtinObjects.push(t.transparentTexture)}var i=e.prototype;return i.assembleSceneLoadOptions=function(e,i){void 0===i&&(i={});var r=e;return t.Scene.isURL(e)&&(t.Scene.isJSONObject(e)||(r=e.url),t.Scene.isWithOptions(e)&&(i=i2({},i,e.options))),{source:r,options:i}},i.updateTextVariables=function(t,e){var i=this;void 0===e&&(e={}),t.jsonScene.items.forEach(function(t){if(t.type===tG.text||t.type===tG.richtext){var r=e[t.name];r&&t.components.forEach(function(t){var e=t.id,n=i.engine.findEffectsObjectData(e);((null==n?void 0:n.dataType)===el.TextComponent||(null==n?void 0:n.dataType)===el.RichTextComponent)&&(n.options.text=r)})}})},i.initializeTexture=function(t){for(var e=0;e<t.textureOptions.length;e++)t.textures[e]=this.engine.findObject({id:t.textureOptions[e].id}),t.textures[e].initialize()},i.prepareAssets=function(t,e){for(var i,r=iD(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],o=new uh(this.engine);o.data=a,o.setInstanceId(n)}this.engine.addPackageDatas(t);for(var s,u=iD(this.builtinObjects);!(s=u()).done;){var h=s.value;this.engine.addInstance(h)}},i.createShaderVariant=function(){for(var t,e=iD(Object.keys(this.engine.objectInstance));!(t=e()).done;){var i=t.value,r=this.engine.objectInstance[i];eF(r,nh)&&r.createShaderVariant()}},i.destroyBuiltinObjects=function(){for(var t,e=iD(this.builtinObjects);!(t=e()).done;)t.value.dispose();this.builtinObjects.length=0},i.dispose=function(){this.destroyBuiltinObjects()},e}(),u8=new Int32Array(2),u9=new Float32Array(u8.buffer),u7=new Float64Array(u8.buffer),ht=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];(tP=eM||(eM={}))[tP.UTF8_BYTES=1]="UTF8_BYTES",tP[tP.UTF16_STRING=2]="UTF16_STRING";var he=function(){function t(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}var e=t.prototype;return e.clear=function(){this.position_=0},e.bytes=function(){return this.bytes_},e.position=function(){return this.position_},e.setPosition=function(t){this.position_=t},e.capacity=function(){return this.bytes_.length},e.readInt8=function(t){return this.readUint8(t)<<24>>24},e.readUint8=function(t){return this.bytes_[t]},e.readInt16=function(t){return this.readUint16(t)<<16>>16},e.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},e.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},e.readUint32=function(t){return this.readInt32(t)>>>0},e.readInt64=function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readUint64=function(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readFloat32=function(t){return u8[0]=this.readInt32(t),u9[0]},e.readFloat64=function(t){return u8[ht?0:1]=this.readInt32(t),u8[ht?1:0]=this.readInt32(t+4),u7[0]},e.writeInt8=function(t,e){this.bytes_[t]=e},e.writeUint8=function(t,e){this.bytes_[t]=e},e.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeInt64=function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))},e.writeUint64=function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))},e.writeFloat32=function(t,e){u9[0]=e,this.writeInt32(t,u8[0])},e.writeFloat64=function(t,e){u7[0]=e,this.writeInt32(t,u8[ht?0:1]),this.writeInt32(t+4,u8[ht?1:0])},e.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+4+4)throw Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t},e.__offset=function(t,e){var i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0},e.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},e.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t);t+=4;var r=this.bytes_.subarray(t,t+i);return e===eM.UTF8_BYTES?r:this.text_decoder_.decode(r)},e.__union_with_string=function(t,e){return"string"==typeof t?this.__string(e):this.__union(t,e)},e.__indirect=function(t){return t+this.readInt32(t)},e.__vector=function(t){return t+this.readInt32(t)+4},e.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},e.__has_identifier=function(t){if(4!=t.length)throw Error("FlatBuffers: file identifier must be length 4");for(var e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0},e.createScalarList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n)}return i},e.createObjList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n.unpack())}return i},t.allocate=function(e){return new t(new Uint8Array(e))},t}(),hi=function(){function t(t){var e;this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder,e=t||1024,this.bb=he.allocate(e),this.space=e}var e=t.prototype;return e.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null},e.forceDefaults=function(t){this.force_defaults=t},e.dataBuffer=function(){return this.bb},e.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},e.prep=function(e,i){e>this.minalign&&(this.minalign=e);for(var r=~(this.bb.capacity()-this.space+i)+1&e-1;this.space<r+e+i;){var n=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},e.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},e.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},e.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},e.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},e.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},e.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},e.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},e.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},e.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},e.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},e.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},e.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},e.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},e.addFieldInt8=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))},e.addFieldInt16=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))},e.addFieldInt32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))},e.addFieldInt64=function(t,e,i){(this.force_defaults||e!==i)&&(this.addInt64(e),this.slot(t))},e.addFieldFloat32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))},e.addFieldFloat64=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))},e.addFieldOffset=function(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))},e.addFieldStruct=function(t,e,i){e!=i&&(this.nested(e),this.slot(t))},e.nested=function(t){if(t!=this.offset())throw TypeError("FlatBuffers: struct must be serialized inline.")},e.notNested=function(){if(this.isNested)throw TypeError("FlatBuffers: object serialization must not be nested.")},e.slot=function(t){null!==this.vtable&&(this.vtable[t]=this.offset())},e.offset=function(){return this.bb.capacity()-this.space},e.addOffset=function(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)},e.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},e.endObject=function(){if(null==this.vtable||!this.isNested)throw Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var r=(i+2)*2;this.addInt16(r);var n=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(o)){for(var s=2;s<r;s+=2)if(this.bb.readInt16(a+s)!=this.bb.readInt16(o+s))continue e;n=this.vtables[e];break}}return n?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,n-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},e.finish=function(t,e,i){var r=i?4:0;if(e){if(this.prep(this.minalign,8+r),4!=e.length)throw TypeError("FlatBuffers: file identifier must be length 4");for(var n=3;n>=0;n--)this.writeInt8(e.charCodeAt(n))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},e.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},e.requiredField=function(t,e){var i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(e<this.bb.readInt16(r)&&0!=this.bb.readInt16(r+e)))throw TypeError("FlatBuffers: field "+e+" must be set")},e.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(i,t*e)},e.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},e.createSharedString=function(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);var e=this.createString(t);return this.string_maps.set(t,e),e},e.createString=function(t){var e;return null==t?0:(eF(t,Uint8Array)?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())},e.createByteVector=function(t){return null==t?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())},e.createObjectOffset=function(t){return null===t?0:"string"==typeof t?this.createString(t):t.pack(this)},e.createObjectOffsetList=function(t){for(var e=[],i=0;i<t.length;++i){var r=t[i];if(null!==r)e.push(this.createObjectOffset(r));else throw TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e},e.createStructOffsetList=function(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()},t.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,r=he.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r},t}(),hr=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.dataType=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.data=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.dataLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.dataArray=function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new hn(this.dataType(),this.bb.createScalarList(this.data.bind(this),this.dataLength()))},e.unpackTo=function(t){t.dataType=this.dataType(),t.data=this.bb.createScalarList(this.data.bind(this),this.dataLength())},t.getRootAsFBEffectsObjectData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsObjectData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsObjectData=function(t){t.startObject(2)},t.addDataType=function(t,e){t.addFieldOffset(0,e,0)},t.addData=function(t,e){t.addFieldOffset(1,e,0)},t.createDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startDataVector=function(t,e){t.startVector(1,e,1)},t.endFBEffectsObjectData=function(t){return t.endObject()},t.createFBEffectsObjectData=function(e,i,r){return t.startFBEffectsObjectData(e),t.addDataType(e,i),t.addData(e,r),t.endFBEffectsObjectData(e)},t}(),hn=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=[]),this.dataType=t,this.data=e}return t.prototype.pack=function(t){var e=null!==this.dataType?t.createString(this.dataType):0,i=hr.createDataVector(t,this.data);return hr.createFBEffectsObjectData(t,e,i)},t}(),ha=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.exportObjects=function(t,e){var i=this.bb.__offset(this.bb_pos,4);return i?(e||new hr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.exportObjectsLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new ho(this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength()))},e.unpackTo=function(t){t.exportObjects=this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength())},t.getRootAsFBEffectsPackageData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsPackageData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsPackageData=function(t){t.startObject(1)},t.addExportObjects=function(t,e){t.addFieldOffset(0,e,0)},t.createExportObjectsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startExportObjectsVector=function(t,e){t.startVector(4,e,4)},t.endFBEffectsPackageData=function(t){return t.endObject()},t.finishFBEffectsPackageDataBuffer=function(t,e){t.finish(e)},t.finishSizePrefixedFBEffectsPackageDataBuffer=function(t,e){t.finish(e,void 0,!0)},t.createFBEffectsPackageData=function(e,i){return t.startFBEffectsPackageData(e),t.addExportObjects(e,i),t.endFBEffectsPackageData(e)},t}(),ho=function(){function t(t){void 0===t&&(t=[]),this.exportObjects=t}return t.prototype.pack=function(t){var e=ha.createExportObjectsVector(t,t.createObjectOffsetList(this.exportObjects));return ha.createFBEffectsPackageData(t,e)},t}(),hs=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.offset=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexCount=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.unpack=function(){return new hu(this.offset(),this.indexCount(),this.vertexCount())},e.unpackTo=function(t){t.offset=this.offset(),t.indexCount=this.indexCount(),t.vertexCount=this.vertexCount()},t.getRootAsFBSubMesh=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBSubMesh=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBSubMesh=function(t){t.startObject(3)},t.addOffset=function(t,e){t.addFieldInt32(0,e,0)},t.addIndexCount=function(t,e){t.addFieldInt32(1,e,0)},t.addVertexCount=function(t,e){t.addFieldInt32(2,e,0)},t.endFBSubMesh=function(t){return t.endObject()},t.createFBSubMesh=function(e,i,r,n){return t.startFBSubMesh(e),t.addOffset(e,i),t.addIndexCount(e,r),t.addVertexCount(e,n),t.endFBSubMesh(e)},t}(),hu=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.offset=t,this.indexCount=e,this.vertexCount=i}return t.prototype.pack=function(t){return hs.createFBSubMesh(t,this.offset,this.indexCount,this.vertexCount)},t}(),hh=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.semantic=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.offset=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.format=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.dimension=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.normalize=function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},e.unpack=function(){return new hl(this.semantic(),this.offset(),this.format(),this.dimension(),this.normalize())},e.unpackTo=function(t){t.semantic=this.semantic(),t.offset=this.offset(),t.format=this.format(),t.dimension=this.dimension(),t.normalize=this.normalize()},t.getRootAsFBVertexChannel=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexChannel=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexChannel=function(t){t.startObject(5)},t.addSemantic=function(t,e){t.addFieldOffset(0,e,0)},t.addOffset=function(t,e){t.addFieldInt32(1,e,0)},t.addFormat=function(t,e){t.addFieldInt32(2,e,0)},t.addDimension=function(t,e){t.addFieldInt32(3,e,0)},t.addNormalize=function(t,e){t.addFieldInt8(4,+e,0)},t.endFBVertexChannel=function(t){return t.endObject()},t.createFBVertexChannel=function(e,i,r,n,a,o){return t.startFBVertexChannel(e),t.addSemantic(e,i),t.addOffset(e,r),t.addFormat(e,n),t.addDimension(e,a),t.addNormalize(e,o),t.endFBVertexChannel(e)},t}(),hl=function(){function t(t,e,i,r,n){void 0===t&&(t=null),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=!1),this.semantic=t,this.offset=e,this.format=i,this.dimension=r,this.normalize=n}return t.prototype.pack=function(t){var e=null!==this.semantic?t.createString(this.semantic):0;return hh.createFBVertexChannel(t,e,this.offset,this.format,this.dimension,this.normalize)},t}(),hc=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.channels=function(t,e){var i=this.bb.__offset(this.bb_pos,6);return i?(e||new hh).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.channelsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new hf(this.vertexCount(),this.bb.createObjList(this.channels.bind(this),this.channelsLength()))},e.unpackTo=function(t){t.vertexCount=this.vertexCount(),t.channels=this.bb.createObjList(this.channels.bind(this),this.channelsLength())},t.getRootAsFBVertexData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexData=function(t){t.startObject(2)},t.addVertexCount=function(t,e){t.addFieldInt32(0,e,0)},t.addChannels=function(t,e){t.addFieldOffset(1,e,0)},t.createChannelsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startChannelsVector=function(t,e){t.startVector(4,e,4)},t.endFBVertexData=function(t){return t.endObject()},t.createFBVertexData=function(e,i,r){return t.startFBVertexData(e),t.addVertexCount(e,i),t.addChannels(e,r),t.endFBVertexData(e)},t}(),hf=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=[]),this.vertexCount=t,this.channels=e}return t.prototype.pack=function(t){var e=hc.createChannelsVector(t,t.createObjectOffsetList(this.channels));return hc.createFBVertexData(t,this.vertexCount,e)},t}(),hd=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.id=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.name=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.vertexData=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new hc).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},e.indexFormat=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexOffset=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):0},e.subMeshes=function(t,e){var i=this.bb.__offset(this.bb_pos,14);return i?(e||new hs).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.subMeshesLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.mode=function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):0},e.buffer=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null},e.binaryData=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.binaryDataLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.binaryDataArray=function(){var t=this.bb.__offset(this.bb_pos,20);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.boneNames=function(t,e){var i=this.bb.__offset(this.bb_pos,22);return i?this.bb.__string(this.bb.__vector(this.bb_pos+i)+4*t,e):null},e.boneNamesLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.rootBoneName=function(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null},e.inverseBindMatrices=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.inverseBindMatricesLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.inverseBindMatricesArray=function(){var t=this.bb.__offset(this.bb_pos,26);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new hp(this.id(),this.name(),null!==this.vertexData()?this.vertexData().unpack():null,this.indexFormat(),this.indexOffset(),this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),this.mode(),this.buffer(),this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),this.rootBoneName(),this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength()))},e.unpackTo=function(t){t.id=this.id(),t.name=this.name(),t.vertexData=null!==this.vertexData()?this.vertexData().unpack():null,t.indexFormat=this.indexFormat(),t.indexOffset=this.indexOffset(),t.subMeshes=this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),t.mode=this.mode(),t.buffer=this.buffer(),t.binaryData=this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),t.boneNames=this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),t.rootBoneName=this.rootBoneName(),t.inverseBindMatrices=this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength())},t.getRootAsFBGeometryData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBGeometryData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBGeometryData=function(t){t.startObject(12)},t.addId=function(t,e){t.addFieldOffset(0,e,0)},t.addName=function(t,e){t.addFieldOffset(1,e,0)},t.addVertexData=function(t,e){t.addFieldOffset(2,e,0)},t.addIndexFormat=function(t,e){t.addFieldInt32(3,e,0)},t.addIndexOffset=function(t,e){t.addFieldInt32(4,e,0)},t.addSubMeshes=function(t,e){t.addFieldOffset(5,e,0)},t.createSubMeshesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startSubMeshesVector=function(t,e){t.startVector(4,e,4)},t.addMode=function(t,e){t.addFieldInt32(6,e,0)},t.addBuffer=function(t,e){t.addFieldOffset(7,e,0)},t.addBinaryData=function(t,e){t.addFieldOffset(8,e,0)},t.createBinaryDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startBinaryDataVector=function(t,e){t.startVector(1,e,1)},t.addBoneNames=function(t,e){t.addFieldOffset(9,e,0)},t.createBoneNamesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startBoneNamesVector=function(t,e){t.startVector(4,e,4)},t.addRootBoneName=function(t,e){t.addFieldOffset(10,e,0)},t.addInverseBindMatrices=function(t,e){t.addFieldOffset(11,e,0)},t.createInverseBindMatricesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addFloat32(e[i]);return t.endVector()},t.startInverseBindMatricesVector=function(t,e){t.startVector(4,e,4)},t.endFBGeometryData=function(t){return t.endObject()},t}(),hp=function(){function t(t,e,i,r,n,a,o,s,u,h,l,c){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=[]),void 0===o&&(o=0),void 0===s&&(s=null),void 0===u&&(u=[]),void 0===h&&(h=[]),void 0===l&&(l=null),void 0===c&&(c=[]),this.id=t,this.name=e,this.vertexData=i,this.indexFormat=r,this.indexOffset=n,this.subMeshes=a,this.mode=o,this.buffer=s,this.binaryData=u,this.boneNames=h,this.rootBoneName=l,this.inverseBindMatrices=c}return t.prototype.pack=function(t){var e=null!==this.id?t.createString(this.id):0,i=null!==this.name?t.createString(this.name):0,r=null!==this.vertexData?this.vertexData.pack(t):0,n=hd.createSubMeshesVector(t,t.createObjectOffsetList(this.subMeshes)),a=null!==this.buffer?t.createString(this.buffer):0,o=hd.createBinaryDataVector(t,this.binaryData),s=hd.createBoneNamesVector(t,t.createObjectOffsetList(this.boneNames)),u=null!==this.rootBoneName?t.createString(this.rootBoneName):0,h=hd.createInverseBindMatricesVector(t,this.inverseBindMatrices);return hd.startFBGeometryData(t),hd.addId(t,e),hd.addName(t,i),hd.addVertexData(t,r),hd.addIndexFormat(t,this.indexFormat),hd.addIndexOffset(t,this.indexOffset),hd.addSubMeshes(t,n),hd.addMode(t,this.mode),hd.addBuffer(t,a),hd.addBinaryData(t,o),hd.addBoneNames(t,s),hd.addRootBoneName(t,u),hd.addInverseBindMatrices(t,h),hd.endFBGeometryData(t)},t}(),hm=function(){function t(){this.exportObjectDatas=[]}var e=t.prototype;return e.addData=function(t){this.exportObjectDatas.push(t)},e.serializeToBinary=function(){for(var t,e=new hi(1),i=new ho,r=[],n=iD(this.exportObjectDatas);!(t=n()).done;){var a=t.value,o=void 0;a.dataType===el.Geometry&&(o=new hn("Geometry",this.geometryDataToBinary(a))),o&&r.push(o)}return i.exportObjects=r,ha.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.deserializeFromBinary=function(t){for(var e=new he(t),i=ha.getRootAsFBEffectsPackageData(e),r=0;r<i.exportObjectsLength();r++){var n=i.exportObjects(r);if(n){var a=n.dataArray(),o=n.dataType();if(a){var s=void 0;o===el.Geometry&&(s=this.binaryToGeometryData(a)),s&&this.exportObjectDatas.push(s)}}}},e.geometryDataToBinary=function(t){var e=new hi(1),i=new hp,r=t.indexFormat,n=t.indexOffset,a=t.mode,o=t.id,s=t.vertexData,u=t.boneNames,h=t.rootBoneName,l=t.inverseBindMatrices,c=t.binaryData;i.indexFormat=r,i.indexOffset=n,i.mode=a,i.id=o,i.boneNames=void 0===u?[]:u,i.rootBoneName=void 0===h?"":h,i.inverseBindMatrices=void 0===l?[]:l,i.binaryData=void 0===c?[]:c;var f=new hf;f.vertexCount=s.vertexCount,f.channels=[];for(var d,p=iD(s.channels);!(d=p()).done;){var m=d.value,v=new hl(m.semantic,m.offset,m.format,m.dimension,m.normalize);f.channels.push(v)}i.vertexData=f;for(var y,g=[],x=iD(t.subMeshes);!(y=x()).done;){var b=y.value,T=new hu(b.offset,b.indexCount,b.vertexCount);g.push(T)}return i.subMeshes=g,ha.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.binaryToGeometryData=function(t){var e,i,r,n,a=new he(t),o=hd.getRootAsFBGeometryData(a),s={vertexCount:0,channels:[]},u=o.vertexData();if(u){s.vertexCount=u.vertexCount();for(var h=0;h<u.channelsLength();h++){var l,c=u.channels(h);if(c){var f={semantic:null!=(l=c.semantic())?l:"",offset:c.offset(),format:c.format(),dimension:c.dimension(),normalize:c.normalize()};s.channels.push(f)}}}for(var d=[],p=0;p<o.subMeshesLength();p++){var m=o.subMeshes(p);if(m){var v={offset:m.offset(),vertexCount:m.vertexCount(),indexCount:m.indexCount()};d.push(v)}}for(var y=[],g=0;g<o.boneNamesLength();g++){var x=o.boneNames(g);y.push(x)}var b=o.inverseBindMatricesArray();return{vertexData:s,indexFormat:o.indexFormat(),indexOffset:o.indexOffset(),subMeshes:d,mode:o.mode(),buffer:null!=(e=o.buffer())?e:"",boneNames:y,rootBoneName:null!=(i=o.rootBoneName())?i:"",inverseBindMatrices:b?Array.from(b):void 0,binaryData:null!=(r=o.binaryDataArray())?r:void 0,id:null!=(n=o.id())?n:"",dataType:el.Geometry}},t}(),hv=function(){function t(t){void 0===t&&(t=60),this.paused=!0,this.lastTime=0,this.dt=0,this.setFPS(t),this.tickers=[]}var e=t.prototype;return e.getFPS=function(){return this.targetFPS},e.setFPS=function(t){this.targetFPS=eK(t,1,120),this.interval=Math.floor(1e3/t)-2},e.getPaused=function(){return this.paused},e.start=function(){var t=this;if(this.paused=!1,this.dt=0,!this.intervalId){this.lastTime=performance.now();var e=requestAnimationFrame||function(t){return window.setTimeout(t,16.7)},i=function(){t.intervalId=e(i),t.paused||t.tick()};i()}},e.stop=function(){(cancelAnimationFrame||window.clearTimeout)(this.intervalId),this.intervalId=0,this.lastTime=0,this.paused=!0,this.dt=0,this.tickers=[]},e.pause=function(){this.paused=!0,this.dt=0},e.resume=function(){this.paused=!1,this.dt=0},e.tick=function(){if(!this.paused){var t=performance.now();if(this.dt=t-this.lastTime,this.dt>=this.interval){this.lastTime=t,this.resetTickers&&(this.tickers=this.tickers.filter(function(t){return t}),this.resetTickers=!1);for(var e=0,i=this.tickers.length;e<i;e++)(0,this.tickers[e])(this.dt)}}},e.add=function(t){if("function"!=typeof t)throw Error("The tick object must implement the tick method.");this.tickers.push(t)},rC(t,[{key:"deltaTime",get:function(){return this.dt}}]),t}(),hy=function(e){function i(t,i){var r,n,a,o,s,u;return(r=e.call(this)||this).name="NewEngine",r.speed=1,r.displayScale=1,r.offscreenMode=!1,r.renderErrors=new Set,r.compositions=[],r.assetManagers=[],r.env="",r.ticker=null,r._disposed=!1,r.textures=[],r.materials=[],r.geometries=[],r.meshes=[],r.renderPasses=[],r.canvas=t,r.env=null!=(n=null==i?void 0:i.env)?n:"",r.name=null!=(a=null==i?void 0:i.name)?a:r.name,r.pixelRatio=null!=(o=null==i?void 0:i.pixelRatio)?o:e8(),r.jsonSceneData={},r.objectInstance={},r.whiteTexture=ni(ot(r)),r.transparentTexture=nr(ot(r)),(null==i?void 0:i.manualRender)||(r.ticker=new hv(null==i?void 0:i.fps),r.runRenderLoop(r.render.bind(ot(r)))),r.eventSystem=new a$(ot(r),null!=(s=null==i?void 0:i.notifyTouch)&&s),r.eventSystem.enabled=null!=(u=null==i?void 0:i.interactive)&&u,r.eventSystem.bindListeners(r.canvas),r.assetLoader=new uc(ot(r)),r.assetService=new u6(ot(r)),r}iN(i,e);var r=i.prototype;return r.clearResources=function(){this.jsonSceneData={},this.objectInstance={}},r.addEffectsObjectData=function(t){this.jsonSceneData[t.id]=t},r.findEffectsObjectData=function(t){return this.jsonSceneData[t]},r.addInstance=function(t){this.objectInstance[t.getInstanceId()]=t},r.findObject=function(t){return ix(t)?this.objectInstance[t.id]?this.objectInstance[t.id]:this.assetLoader.loadGUID(t):t},r.removeInstance=function(t){delete this.objectInstance[t]},r.addPackageDatas=function(t){for(var e,i=t.jsonScene,r=t.textureOptions,n=i.items,a=i.materials,o=i.shaders,s=i.geometries,u=i.components,h=i.animations,l=i.bins,c=void 0===l?[]:l,f=i.miscs,d=i.compositions,p=iD(d);!(e=p()).done;){var m=e.value;this.addEffectsObjectData(m)}for(var v,y=iD(void 0===n?[]:n);!(v=y()).done;){var g=v.value;u$(g.renderLevel,t.renderLevel)||(g.components=[],g.type=tG.null),this.addEffectsObjectData(g)}for(var x,b=iD(void 0===a?[]:a);!(x=b()).done;){var T=x.value;this.addEffectsObjectData(T)}for(var _,E=iD(void 0===o?[]:o);!(_=E()).done;){var C=_.value;this.addEffectsObjectData(C)}for(var w,S=iD(void 0===s?[]:s);!(w=S()).done;){var A=w.value;this.addEffectsObjectData(A)}for(var M,I=iD(void 0===u?[]:u);!(M=I()).done;){var P=M.value;this.addEffectsObjectData(P)}for(var R,O=iD(void 0===h?[]:h);!(R=O()).done;){var N=R.value;this.addEffectsObjectData(N)}for(var L,V=iD(void 0===f?[]:f);!(L=V()).done;){var F=L.value;this.addEffectsObjectData(F)}for(var D=0;D<c.length;D++){var k=c[D],z=t.bins[D];if(k.dataType===el.BinaryAsset)k.buffer=z,k.id&&this.addEffectsObjectData(k);else{var B=new hm;B.deserializeFromBinary(new Uint8Array(z));for(var U,G=iD(B.exportObjectDatas);!(U=G()).done;){var j=U.value;this.addEffectsObjectData(j)}}}for(var W,X=iD(void 0===r?[]:r);!(W=X()).done;){var H=W.value;this.addEffectsObjectData(H)}},r.runRenderLoop=function(t){var e;null==(e=this.ticker)||e.add(t)},r.render=function(e){var i,r,n=this.renderErrors;n.size>0&&(this.emit("rendererror",n.values().next().value),null==(i=this.ticker)||i.pause()),e=Math.min(e,33)*this.speed;var a=this.compositions,o=!1;a.sort(function(t,e){return t.getIndex()-e.getIndex()});for(var s=0;s<a.length;s++){var u=a[s];if(u.textureOffloaded){o=!0,id.error("Composition "+u.name+" texture offloaded, skip render.");continue}u.update(e)}if(o)return this.emit("rendererror",Error("Play when texture offloaded.")),null==(r=this.ticker)?void 0:r.pause();this.renderer.setFramebuffer(null),this.renderer.clear({stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]});for(var h=0;h<a.length;h++)a[h].renderFrame.isDisposed||this.renderer.renderRenderFrame(a[h].renderFrame);this.renderer.renderTargetPool.flush()},r.resize=function(){var t,e,i,r,n=this.canvas.parentElement;if(n){var a=this.getTargetSize(n);t=a[0],e=a[1],i=a[2],r=a[3]}else t=i=this.canvas.width,e=r=this.canvas.height;var o=t/e;if(t&&e){var s=document.documentElement.clientWidth;i>2*s&&id.error("DPI overflowed, width "+i+" is more than 2x document width "+s+", see "+aB["DPI overflowed"]+".");var u=this.env?this.gpuCapability.detail.maxTextureSize:2048;(i>u||r>u)&&(id.error("Container size overflowed "+i+"x"+r+", see "+aB["Container size overflowed"]+"."),o>1?(i=Math.round(u),r=Math.round(u/o)):(r=Math.round(u),i=Math.round(u*o))),this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",id.info("Resize engine "+this.name+" ["+i+","+r+","+t+","+e+"]."),this.setSize(i,r)}},r.setSize=function(t,e){var i,r=this;this.renderer.resize(t,e),null==(i=this.compositions)||i.forEach(function(i){i.camera.aspect=t/e,i.camera.pixelHeight=r.renderer.getHeight(),i.camera.pixelWidth=r.renderer.getWidth()}),this.emit("resize",this)},r.getTargetSize=function(t){if(null==t)throw Error("Container is not an HTMLElement, see "+aB["Container is not an HTMLElement"]+".");var e,i,r=this.displayAspect,n=null==window.getComputedStyle?void 0:window.getComputedStyle.call(window,t),a=0,o=0;n?(a=parseInt(n.width,10),o=parseInt(n.height,10)):(a=t.clientWidth,o=t.clientHeight),r?a/o>r?e=(i=o*this.displayScale)*r:i=(e=a*this.displayScale)/r:(e=a,i=o);var s=this.pixelRatio,u=e,h=i;if(e=Math.round(e*s),i=Math.round(i*s),e<1||i<1){if(this.offscreenMode)e=i=u=h=1;else throw Error("Invalid container size "+e+"x"+i+", see "+aB["Invalid container size"]+".")}return[u,h,e,i]},r.addTexture=function(t){this.disposed||eW(this.textures,t)},r.removeTexture=function(t){this.disposed||eX(this.textures,t)},r.addMaterial=function(t){this.disposed||eW(this.materials,t)},r.removeMaterial=function(t){this.disposed||eX(this.materials,t)},r.addGeometry=function(t){this.disposed||eW(this.geometries,t)},r.removeGeometry=function(t){this.disposed||eX(this.geometries,t)},r.addMesh=function(t){this.disposed||eW(this.meshes,t)},r.removeMesh=function(t){this.disposed||eX(this.meshes,t)},r.addRenderPass=function(t){this.disposed||eW(this.renderPasses,t)},r.removeRenderPass=function(t){this.disposed||eX(this.renderPasses,t)},r.addComposition=function(t){this.disposed||eW(this.compositions,t)},r.removeComposition=function(t){this.disposed||eX(this.compositions,t)},r.getShaderLibrary=function(){return this.renderer.getShaderLibrary()},r.dispose=function(){if(!this.disposed){this._disposed=!0;var t,e,i,r=[];this.renderPasses.length>0&&r.push("Pass "+this.renderPasses.length),this.meshes.length>0&&r.push("Mesh "+this.meshes.length),this.geometries.length>0&&r.push("Geom "+this.geometries.length),this.textures.length>0&&r.push("Tex "+this.textures.length),r.length>0&&id.warn("Release GPU memory: "+r.join(", ")+"."),null==(t=this.ticker)||t.stop(),null==(e=this.eventSystem)||e.dispose(),null==(i=this.assetService)||i.dispose(),this.renderPasses.forEach(function(t){return t.dispose()}),this.meshes.forEach(function(t){return t.dispose()}),this.geometries.forEach(function(t){return t.dispose()}),this.materials.forEach(function(t){return t.dispose()}),this.textures.forEach(function(t){return t.dispose()}),this.assetManagers.forEach(function(t){return t.dispose()}),this.compositions.forEach(function(t){return t.dispose()}),this.textures=[],this.materials=[],this.geometries=[],this.meshes=[],this.renderPasses=[],this.compositions=[]}},rC(i,[{key:"disposed",get:function(){return this._disposed}}]),i}(sN),hg={format:rL.RGBA,type:rL.UNSIGNED_BYTE,minFilter:rL.LINEAR,magFilter:rL.LINEAR,wrapS:rL.CLAMP_TO_EDGE,wrapT:rL.CLAMP_TO_EDGE},hx=Symbol("dispose"),hb=function(){function e(t){this.textureCache={},this.textureRef={},this.engine=t}var i=e.prototype;return i.requestColorAttachmentTexture=function(e){var i=this,r=e.width,n=e.height,a=e.name,o={sourceType:t.TextureSourceType.framebuffer,data:{width:r,height:n},name:a},s=[a];Object.getOwnPropertyNames(hg).forEach(function(t){var i,r=null!=(i=e[t])?i:hg[t];o[t]=r,s.push(t,r)});var u=s.join(":"),h=this.textureCache[u];if(h)this.textureRef[u]++;else{var l=this.engine;ih(l),h=r7.create(l,o),this.textureCache[u]=h,this.textureRef[u]=1,h[hx]=h.dispose,h.dispose=function(){return i.removeTexture(u)}}return h},i.removeTexture=function(t){var e=this.textureRef[t];if(e<=1){e<0&&console.error("Ref count < 0.");var i=this.textureCache[t];i&&(i[hx](),i.dispose=i[hx]),delete this.textureCache[t],delete this.textureRef[t]}else this.textureRef[t]=e-1},i.dispose=function(){var t=this;Object.keys(this.textureCache).forEach(function(e){var i=t.textureCache[e];i[hx](),i.dispose=i[hx]}),this.textureCache={},this.textureRef={},this.engine=void 0},e}(),hT=function(){function t(){}return t.load=function(t,e,i){void 0===i&&(i={});var r=this;return eV(function(){var n,a,o,s,u,h,l,c,f,d,p,m,v;return ez(this,function(y){switch(y.label){case 0:return s=performance.now(),u=null==(a=e.gpuCapability)?void 0:null==(n=a.detail)?void 0:n.asyncShaderCompile,h=e.compositions.length,l=new u4(i),e.assetManagers.push(l),[4,l.loadScene(t,e.renderer)];case 1:return c=y.sent(),e.clearResources(),iM.loadResources(c,l.options,e),e.assetService.prepareAssets(c,c.assets),e.assetService.updateTextVariables(c,i.variables),e.assetService.initializeTexture(c),(f=r.createComposition(c,e,i)).setIndex(h),d=performance.now(),[4,new Promise(function(t){var i;null==(i=e.renderer.getShaderLibrary())||i.compileAllShaders(function(){return t(null)})})];case 2:return y.sent(),p=performance.now()-d,null==(o=e.ticker)||o.start(),m=f.name,v=performance.now()-s,f.statistic.compileTime=p,f.statistic.firstFrameTime=v,id.info("First frame ["+m+"]: "+v.toFixed(4)+"ms."),id.info("Shader "+(u?"async":"sync")+" compile ["+m+"]: "+p.toFixed(4)+"ms."),[2,f]}})})()},t.createComposition=function(t,e,i){void 0===i&&(i={});var r=e.renderer,n=new sk(i2({},i,{renderer:r,width:r.getWidth(),height:r.getHeight(),event:e.eventSystem}),t);return e.ticker&&i.renderLevel===tL.B&&e.ticker.setFPS(Math.min(e.ticker.getFPS(),30)),e.env!==az&&e.assetService.createShaderVariant(),n},t}();iA("camera",aH),iA("text",uu),iA("sprite",a6),iA("particle",sZ),iA("cal",sq),iA("interact",a1),id.info("Core version: 2.8.0-alpha.2.");var h_=((eI={})[rL.ONE]=eN.OneFactor,eI[rL.ZERO]=eN.ZeroFactor,eI[rL.SRC_COLOR]=eN.SrcColorFactor,eI[rL.SRC_ALPHA]=eN.SrcAlphaFactor,eI[rL.ONE_MINUS_SRC_COLOR]=eN.OneMinusSrcColorFactor,eI[rL.ONE_MINUS_SRC_ALPHA]=eN.OneMinusSrcAlphaFactor,eI[rL.DST_COLOR]=eN.DstColorFactor,eI[rL.DST_ALPHA]=eN.DstAlphaFactor,eI[rL.ONE_MINUS_DST_COLOR]=eN.OneMinusDstColorFactor,eI[rL.ONE_MINUS_DST_ALPHA]=eN.OneMinusDstAlphaFactor,eI),hE=((eP={})[rL.NEVER]=eN.NeverStencilFunc,eP[rL.EQUAL]=eN.EqualStencilFunc,eP[rL.LESS]=eN.LessStencilFunc,eP[rL.LEQUAL]=eN.LessEqualStencilFunc,eP[rL.ALWAYS]=eN.AlwaysStencilFunc,eP[rL.NOTEQUAL]=eN.NotEqualStencilFunc,eP[rL.GREATER]=eN.GreaterStencilFunc,eP[rL.GEQUAL]=eN.GreaterEqualStencilFunc,eP),hC=((eR={})[rL.KEEP]=eN.KeepStencilOp,eR[rL.ZERO]=eN.ZeroStencilOp,eR[rL.REPLACE]=eN.ReplaceStencilOp,eR[rL.INCR]=eN.IncrementStencilOp,eR[rL.DECR]=eN.DecrementStencilOp,eR[rL.INCR_WRAP]=eN.IncrementWrapStencilOp,eR[rL.DECR_WRAP]=eN.IncrementWrapStencilOp,eR[rL.INVERT]=eN.InvertStencilOp,eR),hw=((eO={})[rL.NEVER]=eN.NeverDepth,eO[rL.ALWAYS]=eN.AlwaysDepth,eO[rL.EQUAL]=eN.EqualDepth,eO[rL.LESS]=eN.LessDepth,eO[rL.LEQUAL]=eN.LessEqualDepth,eO[rL.GREATER]=eN.GreaterDepth,eO[rL.GEQUAL]=eN.GreaterEqualDepth,eO[rL.NOTEQUAL]=eN.NotEqualDepth,eO),hS=["uMaskTex","_MainTex","uColorOverLifetime","uColorOverTrail"],hA=function(e){function i(i,r){(n=e.call(this,i,r)||this).textures={},n.material=new eN.RawShaderMaterial,n.uniforms={},n.macrosDirty=!0;var n,a,o,s,u,h=null==r?void 0:r.shader,l=i.gpuCapability.level;return n.shader=new t.Shader(i),n.shader.shaderData=i2({},h,{id:i_(),dataType:el.Shader,vertex:null!=(a=null==h?void 0:h.vertex)?a:"",fragment:null!=(o=null==h?void 0:h.fragment)?o:""}),n.uniforms._MainTex=new eN.Uniform(null),n.uniforms.effects_ObjectToWorld=new eN.Uniform(new eN.Matrix4().identity()),n.uniforms.effects_MatrixInvV=new eN.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.uniforms.effects_MatrixVP=new eN.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-8,1]),n.uniforms.effects_MatrixV=new eN.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.material=new eN.RawShaderMaterial({vertexShader:nB.genFinalShaderCode({level:n.engine.gpuCapability.level,shaderType:t.ShaderType.vertex,shader:null!=(s=null==h?void 0:h.vertex)?s:"",macros:null==h?void 0:h.macros,removeVersion:!0}),fragmentShader:nB.genFinalShaderCode({level:n.engine.gpuCapability.level,shaderType:t.ShaderType.fragment,shader:null!=(u=null==h?void 0:h.fragment)?u:"",macros:null==h?void 0:h.macros,removeVersion:!0}),alphaToCoverage:!1,depthFunc:eN.LessDepth,polygonOffsetFactor:eN.ZeroFactor,polygonOffsetUnits:eN.ZeroFactor,polygonOffset:!1,uniforms:n.uniforms}),1===l?n.material.glslVersion=eN.GLSL1:n.material.glslVersion=eN.GLSL3,n}iN(i,e);var r=i.prototype;return r.onSetUniformValue=function(t,e){var i;hS.includes(t)&&(i=e.texture),this.material.uniforms[t]?this.material.uniforms[t].value=i||e:this.material.uniforms[t]=new eN.Uniform(i||e)},r.use=function(t,e){var i=this.engine,r=i.composition,n=i.threeCamera;if(n){var a=new eN.Matrix4().multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse);this.setMatrix("effects_MatrixVP",a)}else{var o=r.camera;this.setMatrix("effects_MatrixVP",o.getViewProjectionMatrix()),this.setMatrix("effects_MatrixV",o.getViewMatrix())}},r.onRemoveUniformValue=function(t){this.material.uniforms[t]&&(this.material.uniforms[t].value=null)},r.getTexture=function(t){return this.textures[t]},r.setTexture=function(t,e){this.setUniform(t,e.texture),this.textures[t]=e},r.getVector4Array=function(t){return this.uniforms[t].value},r.setVector4Array=function(t,e){for(var i,r=[],n=iD(e);!(i=n()).done;){var a=i.value;r=r.concat(a.toArray())}this.setUniform(t,r)},r.getMatrixArray=function(t){return this.uniforms[t].value},r.setMatrixArray=function(t,e){for(var i,r=[],n=iD(e);!(i=n()).done;){var a=i.value;r=r.concat(a.elements)}this.setUniform(t,r)},r.setMatrixNumberArray=function(t,e){this.setUniform(t,e)},r.getMatrix=function(t){return this.uniforms[t].value},r.setMatrix=function(t,e){this.setUniform(t,e)},r.setMatrix3=function(t,e){this.setUniform(t,e)},r.getVector2=function(t){return this.uniforms[t].value},r.setVector2=function(t,e){this.setUniform(t,e)},r.getVector3=function(t){return this.uniforms[t].value},r.setVector3=function(t,e){this.setUniform(t,e)},r.getVector4=function(t){return this.uniforms[t].value},r.setVector4=function(t,e){this.setUniform(t,e)},r.getColor=function(t){var e=this.uniforms[t].value;return new e1(e.x,e.y,e.z,e.w)},r.setColor=function(t,e){this.setUniform(t,new eN.Vector4(e.r,e.g,e.b,e.a))},r.getQuaternion=function(t){return this.uniforms[t].value},r.setQuaternion=function(t,e){this.setUniform(t,e)},r.getFloat=function(t){return this.uniforms[t].value},r.setFloat=function(t,e){this.setUniform(t,e)},r.getFloats=function(t){return this.uniforms[t].value},r.setFloats=function(t,e){this.setUniform(t,e)},r.getInt=function(t){return this.uniforms[t].value},r.setInt=function(t,e){this.setUniform(t,e)},r.hasUniform=function(t){return!!this.uniforms[t]},r.setUniform=function(t,e){var i=new eN.Uniform(e);this.uniforms[t]=this.material.uniforms[t]=i},r.enableMacro=function(t,e){this.isMacroEnabled(t)&&this.enabledMacros[t]===e||(this.enabledMacros[t]=null==e||e,this.macrosDirty=!0)},r.disableMacro=function(t){this.isMacroEnabled(t)&&(delete this.enabledMacros[t],this.macrosDirty=!0)},r.isMacroEnabled=function(t){return void 0!==this.enabledMacros[t]},r.clone=function(t){throw Error("Method not implemented.")},r.cloneUniforms=function(t){throw Error("Method not implemented.")},r.fromData=function(t){throw Error("Method not implemented.")},r.dispose=function(){this.destroyed||(this.material.dispose(),this.destroyed=!0,e.prototype.dispose.call(this))},rC(i,[{key:"blending",get:function(){return this.material.blending!==eN.NoBlending},set:function(t){this.material.blending=t?eN.CustomBlending:eN.NoBlending}},{key:"blendFunction",get:function(){var t=this.material,e=t.blendSrc,i=t.blendDst;return[e,i,t.blendSrcAlpha||e,t.blendDstAlpha||i]},set:function(t){if(t){var e=t[0],i=t[1],r=t[2],n=t[3];this.material.blendSrc=h_[e],this.material.blendDst=h_[i],this.material.blendSrcAlpha=h_[r],this.material.blendDstAlpha=h_[n]}}},{key:"blendEquation",get:function(){var t=this.material,e=t.blendEquation;return[e,t.blendEquationAlpha||e]},set:function(t){if(t){var e=t[0],i=t[1];this.material.blendEquation=e,this.material.blendEquationAlpha=i}}},{key:"depthTest",get:function(){return this.material.depthTest},set:function(t){this.material.depthTest=!!t}},{key:"depthMask",get:function(){return this.material.depthWrite},set:function(t){this.material.depthWrite=!!t}},{key:"depthFunc",get:function(){return this.material.depthFunc},set:function(t){void 0!==t&&(this.material.depthFunc=hw[t])}},{key:"polygonOffsetFill",get:function(){return this.material.polygonOffset},set:function(t){this.material.polygonOffset=!!t}},{key:"polygonOffset",get:function(){return[this.material.polygonOffsetFactor,this.material.polygonOffsetUnits]},set:function(t){if(t){var e=t[0],i=t[1];this.material.polygonOffsetFactor=e,this.material.polygonOffsetUnits=i}}},{key:"sampleAlphaToCoverage",get:function(){return this.material.alphaToCoverage},set:function(t){this.material.alphaToCoverage=!!t}},{key:"stencilTest",get:function(){return this.material.stencilWrite},set:function(t){this.material.stencilWrite=!!t}},{key:"stencilMask",get:function(){return[this.material.stencilWriteMask,this.material.stencilWriteMask]},set:function(t){t&&(this.material.stencilWriteMask=t[0])}},{key:"stencilRef",get:function(){return[this.material.stencilRef,this.material.stencilRef]},set:function(t){t&&(this.material.stencilRef=t[0])}},{key:"stencilFunc",get:function(){return[this.material.stencilFunc,this.material.stencilFunc]},set:function(t){t&&(this.material.stencilFunc=hE[t[0]])}},{key:"stencilOpFail",get:function(){return[this.material.stencilFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilFail=hC[t[0]])}},{key:"stencilOpZFail",get:function(){return[this.material.stencilZFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilZFail=hC[t[0]])}},{key:"stencilOpZPass",get:function(){return[this.material.stencilZPass,this.material.stencilZPass]},set:function(t){t&&(this.material.stencilZPass=hC[t[0]])}},{key:"culling",get:function(){return this.material.side!==eN.DoubleSide},set:function(t){this.material.side=t?eN.FrontSide:eN.DoubleSide}},{key:"cullFace",get:function(){return this.material.side},set:function(t){t===tF.FRONT?this.material.side=eN.FrontSide:t===tF.BACK&&(this.material.side=eN.BackSide)}},{key:"colorMask",get:function(){return this.material.colorWrite},set:function(t){this.material.colorWrite=t}}]),i}(nh);function hM(t,e){return e&&("object"===eD(e)||"function"==typeof e)?e:ot(t)}var hI=1,hP=function(t){function e(e,i){if((r=t.call(this,e)||this).attributes={},r.destroyed=!1,r.attributesName=[],!i)return hM(r);var r,n=i.drawStart,a=i.drawCount,o=i.indices,s=i.mode,u=i.name,h=void 0===u?"effectsGeometry:"+hI++:u;r.name=h,r.mode=null!=s?s:rL.TRIANGLES;var l=[],c={},f=new eN.BufferGeometry;return Object.keys(i.attributes).forEach(function(t){var e=i.attributes[t];if("dataSource"in e){var n=e.dataSource;if(n){void 0===c[n]&&r.setAttributeType(n,e,f,c,i.maxVertex);var a=e.size,o=e.offset,s=e.normalize,u=c[n],h=u.buffer,d=u.dataLength,p=new eN.InterleavedBufferAttribute(h,a,(null!=o?o:0)/d,s);f.setAttribute(t,p),c[t]={buffer:h,attribute:p,type:u.type,dataLength:d}}}else r.setAttributeType(t,e,f,c,i.maxVertex);l.push(t)}),o&&o.data&&f.setIndex(new eN.BufferAttribute(o.data,1)),r.geometry=f,r.attributes=c,r.attributesName=l,r.drawStart=void 0===n?0:n,r.drawCount=null!=a?a:0,r}iN(e,t);var i=e.prototype;return i.getAttributeData=function(t){if(void 0!=this.attributes[t])return this.attributes[t].buffer.array},i.setAttributeData=function(t,e){if(void 0!=this.attributes[t]){var i=this.attributes[t].buffer;if(e.length>i.array.length){var r=new eN.InterleavedBuffer(e,i.stride);i=this.attributes[t].attribute.data=r,this.attributes[t].buffer=r,this.geometry.setAttribute(t,this.attributes[t].attribute)}else i.set(e,0),i.updateRange.count=e.length,i.updateRange.offset=0;this.geometry.attributes[t].needsUpdate=!0}},i.setAttributeSubData=function(t,e,i){void 0!=this.attributes[t]&&(this.attributes[t].buffer.set(i,e),this.geometry.attributes[t].needsUpdate=!0)},i.getAttributeStride=function(t){var e=this.attributes[t];return e.buffer.stride*ny[e.type]},i.getAttributeNames=function(){return this.attributesName},i.getIndexData=function(){var t=this.geometry.getIndex();return null===t?void 0:t.array},i.setIndexData=function(t){t&&(this.geometry.setIndex(new eN.BufferAttribute(t,1)),this.geometry.index.needsUpdate=!0)},i.setIndexSubData=function(t,e){var i=this.geometry.getIndex();if(null!==i){var r=t+e.length;if(i.count<r){var n=new e.constructor(end);n.set(i.array),i.array=n}i.array.set(e,t),this.geometry.index.needsUpdate=!0}},i.setDrawStart=function(t){this.drawStart=t},i.getDrawStart=function(){return this.drawStart},i.setDrawCount=function(t){this.drawCount=t},i.getDrawCount=function(){return this.drawCount},i.getSkinProps=function(){return{}},i.dispose=function(){this.destroyed||(this.geometry.dispose(),this.destroyed=!0,t.prototype.dispose.call(this))},i.setAttributeType=function(t,e,i,r,n){var a=e.stride,o=e.size,s=e.offset,u=e.normalize,h=e.type,l=void 0===h?rL.FLOAT:h,c=e.data;if(l&&!c&&(c=nx(l)),c){var f=eF(c,Float32Array)?Float32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,d=(void 0===a?0:a)/f,p=(n=(null!=n?n:0)*d)||o*f;p&&0===c.length&&(c=eF(c,Float32Array)?new Float32Array(p):new Uint16Array(p));var m=new eN.InterleavedBuffer(c,d),v=new eN.InterleavedBufferAttribute(m,o,(null!=s?s:0)/f,u);i.setAttribute(t,v),r[t]={buffer:m,attribute:v,type:l,dataLength:f}}},rC(e,[{key:"drawCount",get:function(){return this.geometry.drawRange.count},set:function(t){this.geometry.drawRange.count=t}},{key:"drawStart",get:function(){return this.geometry.drawRange.start},set:function(t){this.geometry.drawRange.start=t}}]),e}(ng),hR=function(t){function e(e,i){if(!i)return hM(r);var r,n=i.material,a=i.geometry,o=i.priority;return(r=t.call(this,e,i)||this).geometry=a,r.material=n,a.mode===rL.LINES?r.mesh=new eN.LineSegments(a.geometry,n.material):r.mesh=new eN.Mesh(a.geometry,n.material),r.priority=void 0===o?0:o,r}iN(e,t);var i=e.prototype;return i.setVisible=function(t){this.mesh.visible=t},i.getVisible=function(){return this.mesh.visible},i.firstGeometry=function(){return this.geometry},i.setMaterial=function(t){this.material.dispose(),this.material=t,this.mesh.material=t.material},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.mesh)},i.restore=function(){},i.render=function(t){!this.isDestroyed&&this.getVisible()&&(this.material.setMatrix("effects_ObjectToWorld",this.worldMatrix),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.dispose=function(e){this.destroyed||(this.mesh.clear(),this.destroyed=!0),t.prototype.dispose.call(this)},rC(e,[{key:"priority",get:function(){return this.mesh.renderOrder},set:function(t){this.mesh&&(this.mesh.renderOrder=t)}}]),e}(nA),hO=function(e){function i(i,r,n){if(void 0===n&&(n={}),a=e.call(this,i)||this,r){var a,o=r.width,s=r.height;a.texture=a.createTextureByType(i2({},n,{sourceType:t.TextureSourceType.data,data:r})),a.width=void 0===o?1:o,a.height=void 0===s?1:s}else a.texture=a.createTextureByType(n);return a.texture.needsUpdate=!0,a.source={},a}iN(i,e);var r=i.prototype;return r.updateSource=function(t){this.texture.dispose(),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.assembleOptions=function(e){var r=e.target,n=void 0===r?rL.TEXTURE_2D:r;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=t.TextureSourceType.none),i2({},e,{target:n,format:eN.RGBAFormat,type:eN.UnsignedByteType,minFilter:i.toThreeJsTextureFilter(e.minFilter),magFilter:i.toThreeJsTextureFilter(e.magFilter),wrapS:i.toThreeJsTextureWrap(e.wrapS),wrapT:i.toThreeJsTextureWrap(e.wrapT)})},r.dispose=function(){this.texture.dispose(),e.prototype.dispose.call(this)},r.fromData=function(t){e.prototype.fromData.call(this,t),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.createTextureByType=function(e){var i=this.assembleOptions(e),r=i.flipY,n=i.type,a=i.wrapS,o=i.wrapT,s=i.minFilter,u=i.magFilter,h=i.sourceType,l=eN.UVMapping,c=i.format,f=void 0;if(this.sourceType=h,h===t.TextureSourceType.data){var d=e.data;f=new eN.DataTexture(d.data,d.width,d.height,c,n,l,a,o,u,s),this.width=d.width,this.height=d.height}else if(h===t.TextureSourceType.image){var p=e.image;f=new eN.Texture(p,l,a,o,u,s,c,n),this.width=p.width,this.height=p.height}else if(h===t.TextureSourceType.compressed){var m=0,v=0,y=e.mipmaps.map(function(t){var e=t.data,i=t.width,r=t.height;return m=m<i?i:m,v=v<r?r:v,{data:e,width:i,height:r,colorSpace:"srgb"}});c=eN.RGBA_ASTC_4x4_Format,f=new eN.CompressedTexture(y,m,v,c,n,l,a,o,u,s),this.width=m,this.height=v}else if(h===t.TextureSourceType.video)f=new eN.VideoTexture(e.video,l,a,o,u,s,c,n);else if(h===t.TextureSourceType.framebuffer){var g=e.data;if(g){var x,b,T=null!=(x=g.width)?x:0,_=null!=(b=g.height)?b:0;f=new eN.FramebufferTexture(T,_,c),this.width=T,this.height=_}}else h===t.TextureSourceType.none&&((f=new eN.DataTexture(new Uint8Array(4).fill(255),1,1)).wrapS=eN.MirroredRepeatWrapping,f.wrapT=eN.MirroredRepeatWrapping,this.width=this.height=1);if(this.source=e,f)return f.flipY=!!r,f;throw Error("Create a texture using an unknown data type.")},i.toThreeJsTextureFilter=function(t){return t===rL.LINEAR?eN.LinearFilter:eN.NearestFilter},i.toThreeJsTextureWrap=function(t){switch(t){case rL.MIRRORED_REPEAT:return eN.MirroredRepeatWrapping;case rL.REPEAT:return eN.RepeatWrapping;default:return eN.ClampToEdgeWrapping}},i}(r7),hN=function(e){function i(t,i){return e.call(this,t,i)}return iN(i,e),i.prototype.prepareRender=function(){var e=this.renderer;this.renderFrame._renderPasses[0].meshes.length=0;for(var i,r=iD(this.rootComposition.items);!(i=r()).done;)for(var n,a=i.value.getComponents(rA),o=iD(a);!(n=o()).done;){var s=n.value;s.isActiveAndEnabled&&s.render(e)}for(var u,h=iD(this.refContent);!(u=h()).done;)for(var l,c=u.value,f=iD(c.getComponent(t.CompositionComponent).items);!(l=f()).done;)for(var d,p=l.value.getComponents(rA),m=iD(p);!(d=m()).done;){var v=d.value;v.isActiveAndEnabled&&v.render(e)}},i}(sk);hN.shape={};var hL=function(t){function e(e){var i;return(i=t.call(this,e)||this).renderingData={currentFrame:{}},i}return iN(e,t),e}(n0),hV=function(t){function e(e,i){var r;return(r=t.call(this,e.canvas,i)||this).renderer=new hL(ot(r)),r.gpuCapability=new nJ(e),r}return iN(e,t),e.prototype.setOptions=function(t){var e=t.threeCamera,i=t.threeGroup,r=t.composition;this.threeCamera=e,this.threeGroup=i,this.composition=r},e}(hy),hF=function(t){function e(e,i){(r=t.call(this)||this).compositions=[],r.env="",r.baseCompositionIndex=0;var r,n=i.width,a=i.height,o=i.camera;return r.engine=new hV(e),r.assetService=new u6(r.engine),r.width=n,r.height=a,r.camera=o,r}iN(e,t);var i=e.prototype;return i.loadScene=function(t,e){var i=this;return eV(function(){var r,n,a,o,s,u,h,l,c,f,d,p;return ez(this,function(m){switch(m.label){case 0:return ih(i.renderer,"Renderer is not exist, maybe the Player has been disabled or in gl 'debug-disable' mode."),r=performance.now(),n=[],a=[],s=null==(o=null==e?void 0:e.autoplay)||o,u=i.baseCompositionIndex,iv(t)?(h=n).push.apply(h,[].concat(t)):n.push(t),[4,Promise.all(n.map(eV(function(t,r){var n,o,h,l,c,f,d;return ez(this,function(p){switch(p.label){case 0:return o=(n=i.assetService.assembleSceneLoadOptions(t,i2({autoplay:s},e))).source,[4,(l=new u4(h=n.options)).loadScene(o,i.renderer)];case 1:return c=p.sent(),(f=i.engine).clearResources(),iM.loadResources(c,l.options,f),i.assetService.prepareAssets(c,l.getAssets()),i.assetService.updateTextVariables(c,l.options.variables),i.assetService.initializeTexture(c),d=i.createComposition(c,h),i.baseCompositionIndex+=1,d.setIndex(u+r),a[r]=d,[2]}})})))];case 1:for(m.sent(),l=0;l<a.length;l++)s?a[l].play():a[l].pause();for(c=a.map(function(t){return t.name}),f=performance.now()-r,d=iD(a);!(p=d()).done;)p.value.statistic.firstFrameTime=f;return id.info("First frame ["+c+"]: "+f.toFixed(4)+"ms."),[2,iv(t)?a:a[0]]}})})()},i.createComposition=function(t,e){var i=this;void 0===e&&(e={});var r=new hN(i2({},e,{width:this.width,height:this.height,renderer:this.renderer,onItemMessage:function(t){i.dispatchEvent({type:"message",message:t})}}),t);return r.on("end",function(){i.dispatchEvent({type:"end",composition:r})}),this.renderer.engine.setOptions({threeCamera:this.camera,threeGroup:this,composition:r}),this.compositions.push(r),r},i.pause=function(){this.dispatchEvent({type:"pause"}),this.compositions.forEach(function(t){t.pause()})},i.resume=function(){this.dispatchEvent({type:"resume"}),this.compositions.forEach(function(t){t.resume()})},i.update=function(t){this.compositions.forEach(function(e){e.update(t)})},rC(e,[{key:"renderer",get:function(){return this.engine.renderer}},{key:"currentComposition",get:function(){return this.compositions[0]}}]),e}(eN.Group);t.ThreeSpriteComponent=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.setVisible=function(t){this.threeMesh.visible=t},i.getVisible=function(){return this.threeMesh.visible},i.dispose=function(){this.isActiveAndEnabled||this.threeMesh.clear(),t.prototype.dispose.call(this)},i.fromData=function(e){t.prototype.fromData.call(this,e),this.threeMesh||(this.geometry.mode===rL.LINES?this.threeMesh=new eN.LineSegments(this.geometry.geometry,this.material.material):this.threeMesh=new eN.Mesh(this.geometry.geometry,this.material.material))},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.threeMesh)},i.render=function(t){this.isActiveAndEnabled&&(this.material.setVector2("_Size",this.transform.size),this.material.setMatrix("effects_ObjectToWorld",this.transform.getWorldMatrix()),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.onDestroy=function(){this.threeMesh.clear()},rC(e,[{key:"priority",get:function(){return this.threeMesh.renderOrder},set:function(t){this.threeMesh&&(this.threeMesh.renderOrder=t)}},{key:"enabled",get:function(){return this.threeMesh.visible},set:function(t){this.threeMesh.visible=t,t&&this.onEnable()}}]),e}(t.SpriteComponent),t.ThreeSpriteComponent=ek([iU(el.SpriteComponent)],t.ThreeSpriteComponent),t.ThreeTextComponent=function(t){function e(e,i){if((r=t.call(this,e,i)||this).isDirty=!0,r.canvas=ur.getCanvas(),ur.saveCanvas(r.canvas),r.context=r.canvas.getContext("2d",{willReadFrequently:!0}),!i)return hM(r);var r,n=i.options;return r.updateWithOptions(n),r.updateTexture(),r}iN(e,t);var i=e.prototype;return i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.options;this.updateWithOptions(i),this.updateTexture(),this.material.setColor("_Color",new e1(1,1,1,1))},i.updateWithOptions=function(t){},i.updateTexture=function(t){},e}(t.ThreeSpriteComponent),t.ThreeTextComponent=ek([iU(el.TextComponent)],t.ThreeTextComponent),iC(t.ThreeTextComponent,[uo]),r7.create=function(t,e){return new hO(t,void 0,e)},r7.createWithData=function(t,e,i){return new hO(t,e,i)},nh.create=function(t,e){return new hA(t,e)},ng.create=function(t,e){return new hP(t,e)},nA.create=function(t,e){return new hR(t,e)};var hD="2.8.0-alpha.2";id.info("THREEJS plugin version: "+hD+"."),t.AbstractPlugin=iR,t.ActivationMixerPlayable=sh,t.ActivationPlayable=sl,t.AndNode=ro,t.Animatable=i4,t.AnimationClipNode=i3,t.ApplyAdditiveNode=rn,t.Asset=uh,t.AssetLoader=uc,t.AssetManager=u4,t.AssetService=u6,t.BYTES_TYPE_MAP=ny,t.Behaviour=rS,t.BezierCurve=aU,t.BezierCurvePath=aM,t.BezierCurveQuat=aI,t.BlendNode=ra,t.BoolValueNode=i$,t.CONSTANT_MAP_BLEND=h_,t.CONSTANT_MAP_DEPTH=hw,t.CONSTANT_MAP_STENCIL_FUNC=hE,t.CONSTANT_MAP_STENCIL_OP=hC,t.COPY_FRAGMENT_SHADER="precision mediump float;\nvarying vec2 vTex;\n\n#ifdef DEPTH_TEXTURE\nuniform sampler2D uDepth;\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main(){\n #ifdef DEPTH_TEXTURE\n gl_FragDepthEXT = texture2D(uDepth,vTex).r;\n #endif\n}\n",t.COPY_MESH_SHADER_ID="effects-internal-copy-mesh",t.COPY_VERTEX_SHADER="\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.0))/2.;\n}",t.CalculateLoader=sq,t.Camera=os,t.CameraVFXItemLoader=aH,t.ColorCurve=aX,t.ColorPlayable=sB,t.ColorPropertyMixerPlayable=sd,t.Component=rw,t.ComponentTimePlayable=sY,t.ComponentTimePlayableAsset=sH,t.ComponentTimeTrack=sj,t.Composition=sk,t.ConstBoolNode=rl,t.ConstFloatNode=rh,t.ConstraintTarget=rR,t.ControlParameterBoolNode=rf,t.ControlParameterFloatNode=rc,t.ControlParameterTriggerNode=rd,t.DEFAULT_FONTS=["serif","sans-serif","monospace","courier"],t.DEFAULT_FPS=60,t.Database=uf,t.Deferred=function(){var t=this;this.promise=new Promise(function(e,i){t.resolve=e,t.reject=i})},t.Downloader=rG,t.DrawObjectPass=nm,t.EFFECTS_COPY_MESH_NAME="effects-internal-copy",t.EVENT_TYPE_CLICK=aq,t.EVENT_TYPE_TOUCH_END=aJ,t.EVENT_TYPE_TOUCH_MOVE=aK,t.EVENT_TYPE_TOUCH_START=aQ,t.EffectComponentTimeTrack=sX,t.EffectsObject=iW,t.EffectsPackage=hm,t.Ellipse=s9,t.Engine=hy,t.EventEmitter=sN,t.EventSystem=a$,t.Float16ArrayWrapper=n4,t.FloatComparisonNode=ry,t.FloatComparisonNodeData=rv,t.FloatPropertyMixerPlayable=sp,t.FloatValueNode=iJ,t.Framebuffer=nc,t.GPUCapability=nJ,t.Geometry=ng,t.GlobalUniforms=nZ,t.GradientValue=aw,t.GraphInstance=r_,t.GraphNode=iZ,t.GraphNodeData=iq,t.GraphicsPath=ui,t.HELP_LINK=aB,t.InteractLoader=a1,t.InteractMesh=a3,t.InvalidIndex=-1,t.LayerBlendNode=rp,t.LineSegments=aS,t.LinearValue=aC,t.MaskProcessor=nl,t.MaskableGraphic=n2,t.Material=nh,t.MaterialDataBlock=no,t.Mesh=nA,t.MeshCollider=a5,t.NodeTransform=re,t.NotNode=ru,t.OrNode=rs,t.PLAYER_OPTIONS_ENV_EDITOR=az,t.POST_PROCESS_SETTINGS="post_process_settings",t.ParticleBehaviourPlayable=o2,t.ParticleBehaviourPlayableAsset=o3,t.ParticleLoader=sZ,t.ParticleMesh=o5,t.ParticleMixerPlayable=sm,t.ParticleSystemRenderer=o9,t.ParticleTrack=sP,t.PassTextureCache=hb,t.PathSegments=aA,t.Playable=a8,t.PlayableAsset=a7,t.PlayableOutput=a9,t.PluginSystem=iM,t.PointerEventData=aY,t.PolyStar=s7,t.Polygon=s6,t.Pose=ri,t.PoseNode=iQ,t.PropertyClipPlayable=sc,t.PropertyTrack=sI,t.RENDER_PREFER_LOOKUP_TEXTURE=oH,t.RUNTIME_ENV="runtime_env",t.RandomSetValue=aT,t.RandomValue=a_,t.RandomVectorValue=aE,t.RaycastResult=aZ,t.RenderFrame=nH,t.RenderPass=np,t.RenderPassPriorityNormal=1e3,t.RenderPassPriorityPostprocess=3e3,t.RenderPassPriorityPrepare=0,t.RenderTargetHandle=nf,t.RenderTargetPool=nQ,t.Renderbuffer=nq,t.Renderer=n0,t.RendererComponent=rA,t.RuntimeClip=sM,t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0="PRE_MAIN_COLOR_0",t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_MAIN_COLOR_SIZE_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_0="PRE_COLOR_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_COLOR_SIZE_0",t.SPRITE_VERTEX_STRIDE=6,t.SceneLoader=hT,t.SemanticMap=n1,t.SerializationHelper=ul,t.ShaderFactory=nB,t.ShaderVariant=nv,t.ShapePath=ue,t.SpriteColorMixerPlayable=sv,t.SpriteComponentTimeTrack=sW,t.SpriteLoader=a6,t.StateMachineNode=rg,t.StateNode=rx,t.StaticValue=ab,t.SubCompositionClipPlayable=sy,t.SubCompositionMixerPlayable=sg,t.TEMPLATE_USE_OFFSCREEN_CANVAS=oY,t.TEXTURE_UNIFORM_MAP=hS,t.TextComponentBase=uo,t.TextLayout=un,t.TextLoader=uu,t.TextStyle=ua,t.Texture=r7,t.TextureFactory=na,t.ThreeComposition=hN,t.ThreeDisplayObject=hF,t.ThreeEngine=hV,t.ThreeMaterial=hA,t.ThreeTexture=hO,t.Ticker=hv,t.TimelineClip=sA,t.TimelineInstance=sO,t.TrackMixerPlayable=su,t.Transform=oa,t.TransformMixerPlayable=sx,t.TransformPlayable=sS,t.TransitionNode=rb,t.ValueGetter=ax,t.ValueNode=iK,t.Vector2Curve=ak,t.Vector2PropertyMixerPlayable=s_,t.Vector3Curve=aD,t.Vector3PropertyMixerPlayable=sT,t.Vector4Curve=aF,t.Vector4PropertyMixerPlayable=sb,t.addByOrder=is,t.addItem=eW,t.addItemWithOrder=function(t,e,i,r){if(void 0===r&&(r=!1),!t.includes(e)&&(t.push(e),1!==t.length)){var n=t.length-1;if(n){var a=t[n];if(r)for(;t[n-1][i]<a[i]&&(t[n]=t[n-1],0!=--n););else for(;t[n-1][i]>a[i]&&(t[n]=t[n-1],0!=--n););t[n]=a}}},t.applyMixins=iC,t.assertExist=ih,t.asserts=function(t,e){if(void 0===e&&(e="asserts failed"),!t)throw Error(e)},t.base64ToFile=iE,t.buildLine=s0,t.calculateTranslation=n8,t.canUseBOM=e9,t.canvasPool=ur,t.closePointEps=1e-4,t.colorGradingFrag=nL,t.colorStopsFromGradient=e4,t.colorToArr=e2,t.combineImageTemplate=u1,t.createGLContext=function(t,e,i){var r;if(void 0===e&&(e="webgl"),"webgl2"!==e||(r=t.getContext("webgl2",i))||console.debug("WebGL2 context retrieval failed, falling back to WebGL context."),r&&"webgl"!==e||(r=t.getContext("webgl",i)),!r)throw Error("This browser does not support WebGL or the WebGL version is incorrect. Please check your WebGL version.");return r},t.createKeyFrameMeta=aN,t.createShape=o_,t.createValueGetter=aW,t.curveEps=1e-4,t.decimalEqual=an,t.deserializeMipmapTexture=r4,t.earcut=oz,t.effectsClass=iU,t.effectsClassStore=iB,t.enlargeBuffer=eH,t.ensureFixedNumber=up,t.ensureVec3=n9,t.gaussianDownHFrag=nV,t.gaussianDownVFrag=nF,t.gaussianUpFrag=nD,t.generateEmptyTypedArray=nx,t.generateGUID=i_,t.generateHalfFloatTexture=nt,t.generateTransparentTexture=nr,t.generateWhiteTexture=ni,t.getBackgroundImage=u0,t.getClass=function(t){return iB[t]},t.getColorFromGradientStops=e3,t.getConfig=function(t){return oZ[t]},t.getDefaultTextureFactory=function(){return ex||(ex=new na),ex},t.getGeometryByShape=oU,t.getGeometryTriangles=oB,t.getKeyFrameMetaByRawValue=aO,t.getMergedStore=iG,t.getNodeDataClass=function(t){return iH[t]},t.getParticleMeshShader=function(t,e,i){void 0===i&&(i="");var r,n,a,o=t.content,s=+((null==(r=o.renderer)?void 0:r.renderMode)||0),u=[["RENDER_MODE",s],["ENV_EDITOR",i===az]],h=e.level,l=e.detail,c=aN(),f=aN(),d=l.maxVertexUniforms>0,p=(null!=(n=o.positionOverLifetime)?n:{}).speedOverLifetime,m=0,v=0;d&&u.push(["ENABLE_VERTEX_TEXTURE",!0]),p&&(u.push(["SPEED_OVER_LIFETIME",!0]),v|=2,aO(c,p));var y=o.textureSheetAnimation;y&&y.animate&&(u.push(["USE_SPRITE",!0]),v|=4);var g=o.colorOverLifetime;g&&g.color&&(u.push(["COLOR_OVER_LIFETIME",!0]),v|=16);var x=g&&g.opacity;x&&aO(c,x);var b=o.positionOverLifetime;if(["x","y","z"].forEach(function(t,e){var i=0,r="linear"+t.toUpperCase(),n="orbital"+t.toUpperCase();(null==b?void 0:b[r])&&(aO(c,b[r]),i=1,v|=1<<7+e),u.push(["LINEAR_VEL_"+t.toUpperCase(),i]);var o=0;(null==b?void 0:b[n])&&(aO(c,b[n]),o=1,v|=1<<10+e,a=!0),u.push(["ORB_VEL_"+t.toUpperCase(),o])}),(null==b?void 0:b.asMovement)&&(u.push(["AS_LINEAR_MOVEMENT",!0]),v|=32),a&&(null==b?void 0:b.asRotation)&&(u.push(["AS_ORBITAL_MOVEMENT",!0]),v|=64),o.sizeOverLifetime){var T=o.sizeOverLifetime;T.separateAxes?(aO(c,T.x),u.push(["SIZE_Y_BY_LIFE",1]),v|=16384,aO(c,T.y)):aO(c,T.size)}if(o.rotationOverLifetime){var _=o.rotationOverLifetime;_.z&&(aO(c,null==_?void 0:_.z),v|=32768,u.push(["ROT_Z_LIFETIME",1])),_.separateAxes&&(_.x&&(aO(c,_.x),v|=65536,u.push(["ROT_X_LIFETIME",1])),_.y&&(aO(c,_.y),v|=131072,u.push(["ROT_Y_LIFETIME",1]))),(null==_?void 0:_.asRotation)&&(u.push(["ROT_LIFETIME_AS_MOVEMENT",1]),v|=262144)}aO(c,null==b?void 0:b.gravityOverLifetime),(null==b?void 0:b.forceTarget)&&(u.push(["FINAL_TARGET",!0]),v|=524288,aO(c,b.forceCurve));var E=l.halfFloatTexture;E&&f.max&&(v|=1048576);var C=l.maxVertexUniforms,w=c.max+c.curves.length-32>C;oZ[oH]&&(w=!0),2===h&&(c.max=-1,f.index>0&&(f.max=-1)),w&&E&&d&&(m=1);var S={fragment:nP,vertex:"#define LOOKUP_TEXTURE_CURVE "+m+"\n"+nR,shared:!0,cacheId:["-p:",s,v,c.index,c.max,f.index,f.max].join("+"),macros:u,name:"particle#"+t.name};return u.push(["VERT_CURVE_VALUE_COUNT",c.index],["FRAG_CURVE_VALUE_COUNT",f.index],["VERT_MAX_KEY_FRAME_COUNT",c.max],["FRAG_MAX_KEY_FRAME_COUNT",f.max]),{shader:S,vertex:c.index,fragment:f.index}},t.getPixelRatio=e8,t.getPluginUsageInfo=iP,t.getPreMultiAlpha=rk,t.getStandardComposition=uq,t.getStandardImage=uZ,t.getStandardItem=uK,t.getStandardJSON=uH,t.getTextureSize=nY,t.glContext=rL,t.glType2VertexFormatType=function(t){switch(t){case WebGLRenderingContext.FLOAT:return ef.Float32;case WebGLRenderingContext.SHORT:return ef.Int16;case WebGLRenderingContext.BYTE:return ef.Int8;case WebGLRenderingContext.UNSIGNED_SHORT:return ef.UInt16;case WebGLRenderingContext.UNSIGNED_BYTE:return ef.UInt8;default:return ef.Float32}},t.gpuTimer=function(t){var e=t.getExtension("EXT_disjoint_timer_query_webgl2");if(e){var i=t.createQuery(),r=eV(function(){return ez(this,function(n){return[2,new Promise(function(n,a){if(i){var o=t.getQueryParameter(i,t.QUERY_RESULT_AVAILABLE),s=t.getParameter(e.GPU_DISJOINT_EXT);o&&!s&&n(t.getQueryParameter(i,t.QUERY_RESULT)/1e3/1e3),(o||s)&&(t.deleteQuery(i),i=null),null!==o&&i&&window.setTimeout(function(){r().then(n).catch},1)}})]})});if(!i)return;return{begin:function(){i&&t.beginQuery(e.TIME_ELAPSED_EXT,i)},end:function(){t.endQuery(e.TIME_ELAPSED_EXT)},getTime:r}}},t.imageDataFromColor=function(t){im(t)&&(t=e2(t));for(var e=t,i={width:1,height:1,data:new Uint8Array(4)},r=i.data,n=0;n<4;n++)r[n]=e[n];return i},t.imageDataFromGradient=io,t.initErrors=rN,t.initGLContext=rF,t.integrate="float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}",t.interpolateColor=e5,t.isAlipayMiniApp=ir,t.isAndroid=it,t.isArray=iv,t.isCanvas=ib,t.isFunction=iy,t.isIOS=e7,t.isIOSByUA=function(){var t=navigator.userAgent.toLowerCase().match(/cpu (iphone )?os (.*?) like mac os/);return t?parseInt(t[2],10):0},t.isMiniProgram=function(){return ir()||ia()},t.isObject=ig,t.isOpenHarmony=ie,t.isPlainObject=ix,t.isPowerOfTwo=function(t){return(t&t-1)==0&&0!==t},t.isSimulatorCellPhone=ii,t.isString=im,t.isUniformStruct=ns,t.isUniformStructArray=function(t){return t&&void 0!==t.length&&ns(t[0])},t.isValidFontFamily=il,t.isWebGL2=function(t){return"undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name},t.isWechatMiniApp=ia,t.itemFrag=nI,t.itemVert=nM,t.loadAVIFOptional=rY,t.loadBinary=rK,t.loadBlob=function(t){return r$.apply(this,arguments)},t.loadImage=rq,t.loadMedia=r2,t.loadVideo=r0,t.loadWebPOptional=rX,t.logger=id,t.math=nw,t.modifyMaxKeyframeShader=function(t,e,i){var r,n=null==(r=t.cacheId)?void 0:r.split("+");if(n[3]=e,n[5]=i,t.cacheId=n.join("+"),t.macros)for(var a=0;a<t.macros.length;a++){var o=t.macros[a];if("VERT_CURVE_VALUE_COUNT"===o[0])o[1]=e;else if("FRAG_CURVE_VALUE_COUNT"===o[0]){o[1]=i;break}}},t.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},t.nodeDataClass=iY,t.noop=ip,t.normalizeColor=ub,t.numberToFix=aa,t.oldBezierKeyFramesToNew=aG,t.parsePercent=e6,t.particleFrag=nP,t.particleOriginTranslateMap=ae,t.particleUniformTypeMap=o4,t.particleVert=nR,t.passRenderLevel=u$,t.pluginLoaderMap=iw,t.randomInRange=iT,t.registerPlugin=iA,t.removeItem=eX,t.rotateVec2=oG,t.screenMeshVert=nN,t.serialize=function(t,e){return ij(t,e)},t.setBlendMode=rz,t.setConfig=function(t,e){return oZ[t]=e},t.setDefaultTextureFactory=function(t){ex=t},t.setMaskMode=rU,t.setRayFromCamera=ai,t.setSideMode=rB,t.setUniformValue=function(t,e,i){t[e]?t[e].value=i:t[e]=new eN.Uniform(i)},t.sortByOrder=function(t,e){void 0===e&&(e=2);var i=t.length;if(i<=1||1===e)return t;if(!(i<=30))return function t(e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=e.length-1),r>=n)return e;for(var a,o,s=e[r],u=r,h=n;u<h;){if(2===i){for(;e[h].priority>s.priority&&h>=u;)h--;for(;e[u].priority<=s.priority&&u<h;)u++}else{for(;e[h].priority<s.priority&&h>=u;)h--;for(;e[u].priority>=s.priority&&u<h;)u++}a=[e[h],e[u]],e[u]=a[0],e[h]=a[1]}return o=[e[u],e[r]],e[r]=o[0],e[u]=o[1],t(e,i,r,u-1),t(e,i,h+1,n),e}(t,e);for(var r=1;r<i;r++)iu(t,r,e);return t},t.spec=iV,t.textureLoaderRegistry=nn,t.thresholdFrag=nk,t.throwDestroyedError=function(){throw Error("Destroyed item cannot be used again.")},t.trailVert=nO,t.translatePoint=function(t,e){for(var i=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],r=0;r<8;r+=2)i[r]+=t,i[r+1]+=e;return i},t.trianglesFromRect=ar,t.unregisterPlugin=function(t){delete iw[t];var e=iS.findIndex(function(e){return e.name===t});-1!==e&&iS.splice(e,1)},t.valIfUndefined=function(t,e){return null==t?e:t},t.value="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}",t.valueDefine="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n",t.vecFill=n7,t.vecMulCombine=at,t.version=hD,t.vertexFormatType2GLType=function(t){switch(t){case ef.Float32:return WebGLRenderingContext.FLOAT;case ef.Int16:return WebGLRenderingContext.SHORT;case ef.Int8:return WebGLRenderingContext.BYTE;case ef.UInt16:return WebGLRenderingContext.UNSIGNED_SHORT;case ef.UInt8:return WebGLRenderingContext.UNSIGNED_BYTE;default:return WebGLRenderingContext.FLOAT}},Object.defineProperty(t,"__esModule",{value:!0})});
6
+ * Version: v2.8.0-alpha.3
7
+ */function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.three={}),t.THREE)}(this,function(t,e){"use strict";var i,r,n,a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,S,w,A,M,I,R,P,O,N,V,L,F,D,k,z,B,U,G,j,W,X,H,Y,Z,q,Q,K,J,$,tt,te,ti,tr,tn,ta,to,ts,tu,th,tl,tc,tf,td,tp,tm,tv,ty,tg,tx,tb,tT,t_,tE,tC,tS,tw,tA,tM,tI,tR,tP,tO,tN,tV,tL,tF,tD,tk,tz,tB,tU,tG,tj,tW,tX,tH,tY,tZ,tq,tQ,tK,tJ,t$,t0,t1,t2,t3,t4,t5,t6,t8,t9,t7,et,ee,ei,er,en,ea,eo,es,eu,eh,el,ec,ef,ed,ep,em,ev,ey,eg,ex,eb,eT,e_,eE,eC,eS,ew,eA,eM,eI,eR,eP,eO,eN=function(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(i){if("default"!==i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}}),e.default=t,Object.freeze(e)}(e);function eV(t,e,i,r,n,a,o){try{var s=t[a](o),u=s.value}catch(t){i(t);return}s.done?e(u):Promise.resolve(u).then(r,n)}function eL(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var a=t.apply(e,i);function o(t){eV(a,r,n,o,s,"next",t)}function s(t){eV(a,r,n,o,s,"throw",t)}o(void 0)})}}function eF(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):eF(t,e)}function eD(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function ek(t,e,i,r){var n,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o}function ez(t,e){var i,r,n,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(i)throw TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;for(var eB=new Uint8Array(16),eU=[],eG=0;eG<256;++eG)eU.push((eG+256).toString(16).slice(1));var ej={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eW(t,e){return t.includes(e)||t.push(e),t}function eX(t,e){var i=t.indexOf(e);return i>-1&&t.splice(i,1),t}function eH(t,e,i,r){if(void 0===r&&(r=1),t.buffer.byteLength<t.BYTES_PER_ELEMENT*e){var n=Math.ceil(e*r);Number.isNaN(i)||(n=Math.min(n,i));var a=new ArrayBuffer(t.BYTES_PER_ELEMENT*n),o=new t.constructor(a);return o.set(t),o}return t}var eY=Math.PI/180,eZ=180/Math.PI;function eq(t,e){return 1e-6>Math.abs(t-e)||t===1/0&&e===1/0||t===-1/0&&e===-1/0}var eQ=function(t,e,i){return(1-i)*t+i*e};function eK(t,e,i){var r=isNaN(e)?-1/0:e,n=isNaN(i)?1/0:i;return Math.min(Math.max(t,Math.min(r,n)),Math.max(r,n))}var eJ=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.setZero=function(){return this.x=0,this.y=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this},e.setFromArray=function(t,e){var i,r;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this},e.clone=function(){return new t(this.x,this.y)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t):eF(t,Array)?(this.x+=t[0],this.y+=t[1]):(this.x+=t.x,this.y+=t.y),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t):eF(t,Array)?(this.x-=t[0],this.y-=t[1]):(this.x-=t.x,this.y-=t.y),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t):eF(t,Array)?(this.x*=t[0],this.y*=t[1]):(this.x*=t.x,this.y*=t.y),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t):eF(t,Array)?(this.x/=t[0],this.y/=t[1]):(this.x/=t.x,this.y/=t.y),this},e.scale=function(t){return this.x*=t,this.y*=t,this},e.sum=function(){return this.x+this.y},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.cross=function(t){return this.x*t.y-this.y*t.x},e.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},e.equals=function(t){return this.x===t.x&&this.y===t.y},e.isZero=function(){var t=this.x,e=this.y;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)},e.toArray=function(){return[this.x,this.y]},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();eJ.ONE=new eJ(1,1),eJ.ZERO=new eJ(0,0);var e$=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=i}var e=t.prototype;return e.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this},e.setFromArray=function(t,e){var i,r,n;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.clone=function(){return new t(this.x,this.y,this.z)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t):eF(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2]):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t):eF(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2]):(this.x-=t.x,this.y-=t.y,this.z-=t.z),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t):eF(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2]):(this.x*=t.x,this.y*=t.y,this.z*=t.z),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t):eF(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2]):(this.x/=t.x,this.y/=t.y,this.z/=t.z),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.sum=function(){return this.x+this.y+this.z},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.cross=function(t){return this.crossVectors(this,t)},e.crossVectors=function(t,e){var i=t.x,r=t.y,n=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-n*o,this.y=n*a-i*s,this.z=i*o-r*a,this},e.reflect=function(t){return this.subtract(t.clone().multiply(2*this.dot(t)))},e.distance=function(t){return Math.sqrt(this.distanceSquared(t))},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.isZero=function(){var t=this.x,e=this.y,i=this.z;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)},e.toArray=function(){return[this.x,this.y,this.z]},e.toVector2=function(){return new eJ(this.x,this.y)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},e.applyEuler=function(t,e){return t.rotateVector3(this,e)},e.applyQuaternion=function(t,e){return t.rotateVector3(this,e)},e.applyMatrix=function(t,e){return t.transformPoint(this,e)},e.applyNormalMatrix=function(t,e){return t.transformNormal(this,e)},e.applyProjectionMatrix=function(t,e){return t.projectPoint(this,e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e$.X=new e$(1,0,0),e$.Y=new e$(0,1,0),e$.Z=new e$(0,0,1),e$.ONE=new e$(1,1,1),e$.ZERO=new e$(0,0,0);var e0=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this.w=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this.w=null!=(a=t[e+3])?a:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t,this.w+=t):eF(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2],this.w+=t[3]):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t,this.w-=t):eF(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2],this.w-=t[3]):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):eF(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2],this.w*=t[3]):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this.w=t.w*e.w,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t,this.w/=t):eF(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2],this.w/=t[3]):(this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.sum=function(){return this.x+this.y+this.z+this.w},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t),this.w=Math.min(this.w,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t),this.w=Math.max(this.w,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this.w=Math.abs(this.w),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.isZero=function(){var t=this.x,e=this.y,i=this.z,r=this.w;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)&&1e-6>=Math.abs(r)},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector3=function(){return new e$(this.x,this.y,this.z)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},e.applyMatrix=function(t,e){return t.transformVector4(this,e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e0.ONE=new e0(1,1,1,1),e0.ZERO=new e0(0,0,0,0);var e1=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=i,this.a=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.r=t,this.g=e,this.b=i,this.a=r,this},e.setZero=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this},e.setFromNumber=function(t){return this.r=t,this.g=t,this.b=t,this.a=t,this},e.setFromVector4=function(t){return this.r=t.x,this.g=t.y,this.b=t.z,this.a=t.w,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.r=null!=(i=t[e])?i:0,this.g=null!=(r=t[e+1])?r:0,this.b=null!=(n=t[e+2])?n:0,this.a=null!=(a=t[e+3])?a:0,this},e.setFromHSV=function(t,e,i,r){void 0===r&&(r=1);var n=i*e,a=t/60,o=n*(1-Math.abs(a%2-1)),s=0,u=0,h=0;a>=0&&a<=1?(s=n,u=o):a>=1&&a<=2?(s=o,u=n):a>=2&&a<=3?(u=n,h=o):a>=3&&a<=4?(u=o,h=n):a>=4&&a<=5?(s=o,h=n):a>=5&&a<=6&&(s=n,h=o);var l=i-n;return this.set(s+l,u+l,h+l,r)},e.setFromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length&&7!==t.length)return this;var e=parseInt(t.substring(1,3),16)/255,i=parseInt(t.substring(3,5),16)/255,r=parseInt(t.substring(5,7),16)/255,n=9===t.length?parseInt(t.substring(7,9),16)/255:1;return this.set(e,i,r,n)},e.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},e.clone=function(){return new t(this.r,this.g,this.b,this.a)},e.setElement=function(t,e){switch(t){case 0:this.r=e;break;case 1:this.g=e;break;case 2:this.b=e;break;case 3:this.a=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.r;case 1:return this.g;case 2:return this.b;case 3:return this.a;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.r+=t,this.g+=t,this.b+=t,this.a+=t):eF(t,Array)?(this.r+=t[0],this.g+=t[1],this.b+=t[2],this.a+=t[3]):(this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a),this},e.subtract=function(t){return"number"==typeof t?(this.r-=t,this.g-=t,this.b-=t,this.a-=t):eF(t,Array)?(this.r-=t[0],this.g-=t[1],this.b-=t[2],this.a-=t[3]):(this.r-=t.r,this.g-=t.g,this.b-=t.b,this.a-=t.a),this},e.multiply=function(t){return"number"==typeof t?(this.r*=t,this.g*=t,this.b*=t,this.a*=t):eF(t,Array)?(this.r*=t[0],this.g*=t[1],this.b*=t[2],this.a*=t[3]):(this.r*=t.r,this.g*=t.g,this.b*=t.b,this.a*=t.a),this},e.divide=function(t){return"number"==typeof t?(this.r/=t,this.g/=t,this.b/=t,this.a/=t):eF(t,Array)?(this.r/=t[0],this.g/=t[1],this.b/=t[2],this.a/=t[3]):(this.r/=t.r,this.g/=t.g,this.b/=t.b,this.a/=t.a),this},e.scale=function(t){return this.r*=t,this.g*=t,this.b*=t,this.a*=t,this},e.min=function(t){return"number"==typeof t?(this.r=Math.min(this.r,t),this.g=Math.min(this.g,t),this.b=Math.min(this.b,t),this.a=Math.min(this.a,t)):(this.r=Math.min(this.r,t.r),this.g=Math.min(this.g,t.g),this.b=Math.min(this.b,t.b),this.a=Math.min(this.a,t.a)),this},e.max=function(t){return"number"==typeof t?(this.r=Math.max(this.r,t),this.g=Math.max(this.g,t),this.b=Math.max(this.b,t),this.a=Math.max(this.a,t)):(this.r=Math.max(this.r,t.r),this.g=Math.max(this.g,t.g),this.b=Math.max(this.b,t.b),this.a=Math.max(this.a,t.a)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.lerp=function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this.a+=(t.a-this.a)*e,this},e.luminance=function(){return .3*this.r+.59*this.g+.11*this.b},e.equals=function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a},e.toLinear=function(){return this.r=t.gammaToLinear(this.r),this.g=t.gammaToLinear(this.g),this.b=t.gammaToLinear(this.b),this},e.toGamma=function(){return this.r=t.linearToGamma(this.r),this.g=t.linearToGamma(this.g),this.b=t.linearToGamma(this.b),this},e.toArray=function(){return[this.r,this.g,this.b,this.a]},e.toVector4=function(){return new e0(this.r,this.g,this.b,this.a)},e.toHSV=function(){var e=this.r,i=this.g,r=this.b,n=this.a,a=Math.max(e,i,r),o=Math.min(e,i,r),s=a-o,u=0,h=0;return 0!==a&&(h=s/a),a!=o&&(a==e?(u=(i-r)/s,i<r&&(u+=6)):a==i?u=(r-e)/s+2:a==r&&(u=(e-i)/s+4),u*=60),new t(u,h,a,n)},e.toHexString=function(e){void 0===e&&(e=!0);var i=t.ToHex(Math.round(255*this.r)),r=t.ToHex(Math.round(255*this.g)),n=t.ToHex(Math.round(255*this.b)),a=t.ToHex(Math.round(255*this.a));return e?"#"+i+r+n+a:"#"+i+r+n},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromHexString=function(e){return new t().setFromHexString(e)},t.fromHSV=function(e,i,r,n){return void 0===n&&(n=1),new t().setFromHSV(e,i,r,n)},t.gammaToLinear=function(t){return t<=0?0:t<=.04045?t/12.92:t<1?Math.pow((t+.055)/1.055,2.4):Math.pow(t,2.4)},t.linearToGamma=function(t){return t<=0?0:t<.0031308?12.92*t:t<1?1.055*Math.pow(t,.41666)-.055:Math.pow(t,.41666)},t.ToHex=function(t){var e=t.toString(16);return t<=15?("0"+e).toUpperCase():e.toUpperCase()},t}();function e2(t,e){var i=[0,0,0,0];if(im(t)){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:255*n]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else eF(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:t[3]]);if(e)for(var a=0;a<4;a++)i[a]/=255;return i}function e3(t,e,i){if(t.length){for(var r,n=1;n<=t.length-1;n++){var a=t[n-1],o=t[n];if(a.time<=e&&e<=o.time){r=e5(a.color.toArray(),o.color.toArray(),(e-a.time)/(o.time-a.time));break}}return r||(r=t[t.length-1].color.toArray()),i?r.map(function(t){return t/255}):r}return[0,0,0,0]}function e4(t){var e=[];if(eF(t,Array)?t.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3],o=t[4];e.push({time:e6(i),color:new e1(r,n,a,o)})}):Object.keys(t).forEach(function(i){var r=t[i],n=new e1().setFromArray(e2(r));e.push({time:e6(i),color:n})}),(e=e.sort(function(t,e){return t.time-e.time})).length){0!==e[0].time&&e.unshift({time:0,color:e[0].color.clone()});var i=e[e.length-1];1!==i.time&&e.push({time:1,color:i.color.clone()})}return e}function e5(t,e,i,r){var n=[],a=1-i;if(r)for(var o=0;o<4;o++)n[o]=t[o]*a+e[o]*i;else{for(var s=0;s<3;s++)n[s]=Math.round(Math.sqrt(t[s]*t[s]*a+e[s]*e[s]*i));n[3]=Math.round(t[3]*a+e[3]*i)}return n}function e6(t){var e=/^(-)?([\d+.]+)%$/.exec(t);return e?+e[2]/100*(e[1]?-1:1):+t}function e8(){if("object"==typeof screen&&"object"==typeof document){var t=Math.max(document.documentElement.clientWidth,window.innerWidth||0);return Math.min(screen.width/t*2,2)}return 1}e1.BLACK=new e1(0,0,0,1),e1.BLUE=new e1(0,0,1,1),e1.CLEAR=new e1(0,0,0,0),e1.CYAN=new e1(0,1,1,1),e1.GRAY=new e1(.5,.5,.5,1),e1.GREEN=new e1(0,1,0,1),e1.MAGENTA=new e1(1,0,1,1),e1.RED=new e1(1,0,0,1),e1.WHITE=new e1(1,1,1,1),e1.YELLOW=new e1(1,.92,.016,1);var e9="undefined"!=typeof window;function e7(){return!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)}function it(){return/\b[Aa]ndroid\b/.test(navigator.userAgent)}function ie(){return/\bOpenHarmony\b/.test(navigator.userAgent)}function ii(){return it()||ie()||/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)}function ir(){var t;return"undefined"!=typeof my&&(null==(t=my)?void 0:t.renderTarget)==="web"}function ia(){return"miniprogram"===window.__wxjs_environment}function io(t){var e={width:128,height:1,data:new Uint8Array(512)},i=e.data,r=e4(t);if(r.length){i.set(r[0].color.toArray(),0);for(var n=1;n<127;n++){for(var a=n/128,o=void 0,s=void 0,u=0;u<r.length&&(o=r[u],s=r[u+1],!(o.time<=a)||!(s.time>a));u++);var h=e5(o.color.toArray(),s.color.toArray(),(a-o.time)/(s.time-o.time));i.set(h,4*n)}i.set(r[r.length-1].color.toArray(),508)}return e}function is(t,e,i){return void 0===i&&(i=2),t.includes(e)||(t.push(e),1===t.length||1!==i&&iu(t,t.length-1,i)),t}function iu(t,e,i){var r=t[e];if(2!==i)for(;e>=1&&t[e-1].priority<r.priority&&(t[e]=t[e-1],0!=--e););else for(;e>=1&&t[e-1].priority>r.priority&&(t[e]=t[e-1],0!=--e););t[e]=r}function ih(t,e){if(void 0===e&&(e="item doesn't exist"),null==t)throw Error(e)}function il(t){return/^[^\d.][\w-]*$/.test(t)}function ic(t){return["%c[Galacean Effects]","color: #AA0100",""+t]}t.OrderType=void 0,(i=t.OrderType||(t.OrderType={}))[i.none=1]="none",i[i.ascending=2]="ascending",i[i.descending=3]="descending";var id={error:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).error.apply(e,[].concat(ic(t),[r])),null==tO||tO("error",t,r)},info:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).debug.apply(e,[].concat(ic(t))),null==tO||tO("info",t,r)},warn:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).warn.apply(e,[].concat(ic(t))),null==tO||tO("warn",t,r)},register:function(t){t&&iy(t)&&(tO=t)}};function ip(){}function im(t){return"string"==typeof t}t.DestroyOptions=void 0,(r=t.DestroyOptions||(t.DestroyOptions={}))[r.destroy=0]="destroy",r[r.keep=1]="keep",r[r.force=0]="force";var iv=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function iy(t){return"[object Function]"===Object.prototype.toString.call(t)}function ig(t){return"[object Object]"===Object.prototype.toString.call(t)}function ix(t){if(null===t||"object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return"function"==typeof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)}function ib(t){var e;return"object"==typeof t&&null!==t&&(null==(e=t.tagName)?void 0:e.toUpperCase())==="CANVAS"}function iT(t,e){return t+Math.random()*(e-t)}function i_(){return(function(t,e,i){if(ej.randomUUID&&!t)return ej.randomUUID();var r,n=(t=t||{}).random||(t.rng||function(){if(!tP&&!(tP="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tP(eB)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,void 0===r&&(r=0),eU[n[r+0]]+eU[n[r+1]]+eU[n[r+2]]+eU[n[r+3]]+"-"+eU[n[r+4]]+eU[n[r+5]]+"-"+eU[n[r+6]]+eU[n[r+7]]+"-"+eU[n[r+8]]+eU[n[r+9]]+"-"+eU[n[r+10]]+eU[n[r+11]]+eU[n[r+12]]+eU[n[r+13]]+eU[n[r+14]]+eU[n[r+15]]})().replace(/-/g,"")}function iE(t,e,i){void 0===e&&(e="base64File"),void 0===i&&(i="");for(var r=atob(t.split(",")[1]||t),n=[],a=0;a<r.length;a+=512){for(var o=r.slice(a,a+512),s=Array(o.length),u=0;u<o.length;u++)s[u]=o.charCodeAt(u);var h=new Uint8Array(s);n.push(h)}return new File([new Blob(n,{type:i})],e,{type:i})}function iC(t,e){e.forEach(function(e){Object.getOwnPropertyNames(e.prototype).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e.prototype,i);if(!r)throw Error("Cannot find property descriptor of class "+e);Object.defineProperty(t.prototype,i,r)})})}var iS={},iw=[];function iA(t,e){iS[t]&&id.error("Duplicate registration for plugin "+t+"."),iS[t]=e;var i=new e;i.name=t,i.initialize(),iw.push(i),iw.sort(function(t,e){return t.order-e.order})}var iM=function(){function t(){}return t.getPlugins=function(){return iw},t.initializeComposition=function(t,e){iw.forEach(function(i){return i.onCompositionConstructed(t,e)})},t.destroyComposition=function(t){iw.forEach(function(e){return e.onCompositionDestroyed(t)})},t.processAssets=function(t,e){return eL(function(){return ez(this,function(i){return[2,Promise.all(iw.map(function(i){return i.processAssets(t,e)}))]})})()},t.loadResources=function(t,e,i){iw.forEach(function(r){return r.prepareResource(t,e,i)})},t}(),iI={"alipay-downgrade":"@galacean/effects-plugin-alipay-downgrade",downgrade:"@galacean/effects-plugin-downgrade","editor-gizmo":"@galacean/effects-plugin-editor-gizmo",ffd:"@galacean/effects-plugin-ffd",ktx2:"@galacean/effects-plugin-ktx2",model:"@galacean/effects-plugin-model",video:"@galacean/effects-plugin-multimedia",audio:"@galacean/effects-plugin-multimedia","orientation-transformer":"@galacean/effects-plugin-orientation-transformer","rich-text":"@galacean/effects-plugin-rich-text",spine:"@galacean/effects-plugin-spine"};function iR(t){var e=iI[t];return e?"\n请按如下命令进行操作(Please follow the commands below to proceed):\n1、使用 npm 安装插件(Install Plugin):npm i "+e+"@latest --save\n2、导入插件(Import Plugin):import '"+e+"'":""}var iP=function(){function t(){this.order=100,this.name=""}var e=t.prototype;return e.initialize=function(){},e.processAssets=function(t,e){return eL(function(){return ez(this,function(t){return[2]})})()},e.prepareResource=function(t,e,i){},e.onCompositionConstructed=function(t,e){},e.onCompositionDestroyed=function(t){},t}();function iO(t,e){return(iO=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function iN(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&iO(t,e)}(n=tN||(tN={}))["1_0"]="1.0",n["1_1"]="1.1",n["1_2"]="1.2",n["1_3"]="1.3",n["1_5"]="1.5",n["1_8"]="1.8",n["2_0"]="2.0",n["2_1"]="2.1",n["2_2"]="2.2",n["2_3"]="2.3",n["2_4"]="2.4",n["3_0"]="3.0",n["3_1"]="3.1",n["3_2"]="3.2",n["3_3"]="3.3",n["3_4"]="3.4",n["3_5"]="3.5",n["3_6"]="3.6",n.LATEST="3.6",(a=tV||(tV={})).S="S",a.APlus="A+",a.A="A",a.BPlus="B+",a.B="B",(o=tL||(tL={}))[o.ALPHA=0]="ALPHA",o[o.ADD=1]="ADD",o[o.MULTIPLY=2]="MULTIPLY",o[o.BRIGHTNESS=3]="BRIGHTNESS",o[o.SUBTRACTION=4]="SUBTRACTION",o[o.STRONG_LIGHT=5]="STRONG_LIGHT",o[o.WEAK_LIGHT=6]="WEAK_LIGHT",o[o.SUPERPOSITION=7]="SUPERPOSITION",(s=tF||(tF={}))[s.DOUBLE=1032]="DOUBLE",s[s.FRONT=1028]="FRONT",s[s.BACK=1029]="BACK",(u=tD||(tD={}))[u.OBSCURED=2]="OBSCURED",u[u.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",(h=tk||(tk={}))[h.NONE=0]="NONE",h[h.SPHERE=1]="SPHERE",h[h.CONE=2]="CONE",h[h.HEMISPHERE=3]="HEMISPHERE",h[h.CIRCLE=4]="CIRCLE",h[h.DONUT=5]="DONUT",h[h.RECTANGLE=6]="RECTANGLE",h[h.RECTANGLE_EDGE=7]="RECTANGLE_EDGE",h[h.EDGE=8]="EDGE",h[h.TEXTURE=9]="TEXTURE",(l=tz||(tz={}))[l.GYROSCOPE=0]="GYROSCOPE",l[l.SPINE=1]="SPINE",(c=tB||(tB={}))[c.CLICK=0]="CLICK",c[c.MESSAGE=1]="MESSAGE",c[c.DRAG=2]="DRAG",(f=tU||(tU={}))[f.NONE=0]="NONE",f[f.NOTIFY=1]="NOTIFY",f[f.RESUME_PLAYER=2]="RESUME_PLAYER",f[f.REMOVE=3]="REMOVE",f[f.PAUSE=4]="PAUSE",(d=tG||(tG={})).base="0",d.sprite="1",d.particle="2",d.null="3",d.interact="4",d.plugin="5",d.camera="6",d.composition="7",d.spine="spine",d.mesh="mesh",d.tree="tree",d.text="text",d.light="light",d.skybox="skybox",d.effect="effect",d.shape="shape",d.postProcessVolume="postProcessVolume",d.node="node",d.video="video",d.audio="audio",d.richtext="richtext",(p=tj||(tj={}))[p.BILLBOARD=0]="BILLBOARD",p[p.MESH=1]="MESH",p[p.VERTICAL_BILLBOARD=2]="VERTICAL_BILLBOARD",p[p.HORIZONTAL_BILLBOARD=3]="HORIZONTAL_BILLBOARD",(m=tW||(tW={}))[m.PARTICLE_ORIGIN_CENTER=0]="PARTICLE_ORIGIN_CENTER",m[m.PARTICLE_ORIGIN_LEFT_TOP=1]="PARTICLE_ORIGIN_LEFT_TOP",m[m.PARTICLE_ORIGIN_LEFT_CENTER=2]="PARTICLE_ORIGIN_LEFT_CENTER",m[m.PARTICLE_ORIGIN_LEFT_BOTTOM=3]="PARTICLE_ORIGIN_LEFT_BOTTOM",m[m.PARTICLE_ORIGIN_CENTER_TOP=4]="PARTICLE_ORIGIN_CENTER_TOP",m[m.PARTICLE_ORIGIN_CENTER_BOTTOM=5]="PARTICLE_ORIGIN_CENTER_BOTTOM",m[m.PARTICLE_ORIGIN_RIGHT_TOP=6]="PARTICLE_ORIGIN_RIGHT_TOP",m[m.PARTICLE_ORIGIN_RIGHT_CENTER=7]="PARTICLE_ORIGIN_RIGHT_CENTER",m[m.PARTICLE_ORIGIN_RIGHT_BOTTOM=8]="PARTICLE_ORIGIN_RIGHT_BOTTOM",(v=tX||(tX={})).Opaque="Opaque",v.Transparent="Transparent",(y=tH||(tH={})).Both="Both",y.Back="Back",y.Front="Front",(g=tY||(tY={}))[g.portrait=1]="portrait",g[g.landscape=0]="landscape",(x=tZ||(tZ={}))[x.CONSTANT=0]="CONSTANT",x[x.CONSTANT_VEC2=1]="CONSTANT_VEC2",x[x.CONSTANT_VEC3=2]="CONSTANT_VEC3",x[x.CONSTANT_VEC4=3]="CONSTANT_VEC4",x[x.RANDOM=4]="RANDOM",x[x.LINE=5]="LINE",x[x.CURVE=6]="CURVE",x[x.BEZIER_PATH=7]="BEZIER_PATH",x[x.RGBA_COLOR=8]="RGBA_COLOR",x[x.GRADIENT_COLOR=9]="GRADIENT_COLOR",x[x.SHAPE_POINTS=10]="SHAPE_POINTS",x[x.SHAPE_SPLITS=11]="SHAPE_SPLITS",x[x.LINEAR_PATH=12]="LINEAR_PATH",x[x.COLORS=13]="COLORS",x[x.BINARY=20]="BINARY",x[x.BEZIER_CURVE=21]="BEZIER_CURVE",x[x.BEZIER_CURVE_PATH=22]="BEZIER_CURVE_PATH",x[x.BEZIER_CURVE_QUAT=23]="BEZIER_CURVE_QUAT",x[x.COLOR_CURVE=24]="COLOR_CURVE",x[x.VECTOR4_CURVE=25]="VECTOR4_CURVE",x[x.VECTOR2_CURVE=26]="VECTOR2_CURVE",x[x.VECTOR3_CURVE=27]="VECTOR3_CURVE",(b=tq||(tq={}))[b.AUTO=0]="AUTO",b[b.EASE=1]="EASE",b[b.EASE_IN=2]="EASE_IN",b[b.EASE_OUT=3]="EASE_OUT",b[b.LINE=4]="LINE",b[b.HOLD=5]="HOLD",b[b.LINE_OUT=6]="LINE_OUT",(T=tQ||(tQ={}))[T.destroy=0]="destroy",T[T.restart=5]="restart",T[T.forward=2]="forward",T[T.freeze=4]="freeze",(_=tK||(tK={}))[_.none=0]="none",_[_.removeParticle=1]="removeParticle",(E=tJ||(tJ={}))[E.RANDOM=0]="RANDOM",E[E.UNIDIRECTIONAL_CYCLE=1]="UNIDIRECTIONAL_CYCLE",E[E.BIDIRECTIONAL_CYCLE=2]="BIDIRECTIONAL_CYCLE",E[E.UNIFORM_BURST=3]="UNIFORM_BURST",(C=t$||(t$={})).point="point",C.spot="spot",C.directional="directional",C.ambient="ambient",(S=t0||(t0={}))[S.box=2]="box",S[S.sphere=3]="sphere",(w=t1||(t1={})).orthographic="orthographic",w.perspective="perspective",(A=t2||(t2={})).unlit="unlit",A.pbr="pbr",A.hair="hair",(M=t3||(t3={}))[M.opaque=100]="opaque",M[M.masked=101]="masked",M[M.translucent=102]="translucent",M[M.additive=103]="additive",(I=t4||(t4={})).none="none",I.uv="uv",I.normal="normal",I.basecolor="basecolor",I.alpha="alpha",I.metallic="metallic",I.roughness="roughness",I.ao="ao",I.emissive="emissive",I.diffuse="diffuse",(R=t5||(t5={}))[R.visible=0]="visible",R[R.display=1]="display",R[R.clip=2]="clip",R[R.ellipsis=3]="ellipsis",(P=t6||(t6={}))[P.autoWidth=0]="autoWidth",P[P.autoHeight=1]="autoHeight",P[P.fixed=2]="fixed",(O=t8||(t8={}))[O.top=0]="top",O[O.middle=1]="middle",O[O.bottom=2]="bottom",(N=t9||(t9={}))[N.left=0]="left",N[N.middle=1]="middle",N[N.right=2]="right",(V=t7||(t7={}))[V.top=0]="top",V[V.middle=1]="middle",V[V.bottom=2]="bottom",(L=et||(et={})).normal="normal",L.bold="bold",L.lighter="lighter",(F=ee||(ee={})).normal="normal",F.italic="italic",F.oblique="oblique";var iV={WhiteTexture:"whitetexture00000000000000000000",TransparentTexture:"transparenttexture00000000000000000000",PBRShader:"pbr00000000000000000000000000000",UnlitShader:"unlit000000000000000000000000000"};(D=ei||(ei={}))[D.Solid=0]="Solid",D[D.GradientLinear=1]="GradientLinear",D[D.GradientRadial=2]="GradientRadial",D[D.GradientAngular=3]="GradientAngular",D[D.Texture=4]="Texture",(k=er||(er={}))[k.Fill=0]="Fill",k[k.Fit=1]="Fit",k[k.Crop=2]="Crop",k[k.Tile=3]="Tile",(z=en||(en={}))[z.Custom=0]="Custom",z[z.Rectangle=1]="Rectangle",z[z.Ellipse=2]="Ellipse",z[z.Polygon=3]="Polygon",z[z.Star=4]="Star",(B=ea||(ea={}))[B.Butt=0]="Butt",B[B.Round=1]="Round",B[B.Square=2]="Square",(U=eo||(eo={}))[U.Round=0]="Round",U[U.Bevel=1]="Bevel",U[U.Miter=2]="Miter",(G=es||(es={})).AnimationClipNodeData="AnimationClipNodeData",G.BlendNodeData="BlendNodeData",G.ApplyAdditiveNodeData="ApplyAdditiveNodeData",G.LayerBlendNodeData="LayerBlendNodeData",G.StateMachineNodeData="StateMachineNodeData",G.TransitionNodeData="TransitionNodeData",G.StateNodeData="StateNodeData",G.ConstFloatNodeData="ConstFloatNodeData",G.ConstBoolNodeData="ConstBoolNodeData",G.ControlParameterBoolNodeData="ControlParameterBoolNodeData",G.ControlParameterFloatNodeData="ControlParameterFloatNodeData",G.ControlParameterTriggerNodeData="ControlParameterTriggerNodeData",G.NotNodeData="NotNodeData",G.AndNodeData="AndNodeData",G.OrNodeData="OrNodeData",G.EqualNodeData="EqualNodeData",G.GreaterNodeData="GreaterNodeData",G.LessNodeData="LessNodeData",(j=eu||(eu={})).video="video",j.image="image",(W=eh||(eh={})).video="video",W.audio="audio",(X=el||(el={})).VFXItemData="VFXItemData",X.Material="Material",X.Shader="Shader",X.Geometry="Geometry",X.Texture="Texture",X.Image="Image",X.AnimationClip="AnimationClip",X.BinaryAsset="BinaryAsset",X.TrackAsset="TrackAsset",X.TimelineAsset="TimelineAsset",X.ObjectBindingTrack="ObjectBindingTrack",X.TransformTrack="TransformTrack",X.SpriteColorTrack="SpriteColorTrack",X.ActivationTrack="ActivationTrack",X.SubCompositionTrack="SubCompositionTrack",X.FloatPropertyTrack="FloatPropertyTrack",X.ColorPropertyTrack="ColorPropertyTrack",X.Vector2PropertyTrack="Vector2PropertyTrack",X.Vector3PropertyTrack="Vector3PropertyTrack",X.Vector4PropertyTrack="Vector4PropertyTrack",X.TransformPlayableAsset="TransformPlayableAsset",X.SpriteColorPlayableAsset="SpriteColorPlayableAsset",X.ActivationPlayableAsset="ActivationPlayableAsset",X.SubCompositionPlayableAsset="SubCompositionPlayableAsset",X.FloatPropertyPlayableAsset="FloatPropertyPlayableAsset",X.ColorPropertyPlayableAsset="ColorPropertyPlayableAsset",X.Vector2PropertyPlayableAsset="Vector2PropertyPlayableAsset",X.Vector3PropertyPlayableAsset="Vector3PropertyPlayableAsset",X.Vector4PropertyPlayableAsset="Vector4PropertyPlayableAsset",X.MeshComponent="MeshComponent",X.SkyboxComponent="SkyboxComponent",X.LightComponent="LightComponent",X.CameraComponent="CameraComponent",X.ModelPluginComponent="ModelPluginComponent",X.TreeComponent="TreeComponent",X.AnimationComponent="AnimationComponent",X.SpineComponent="SpineComponent",X.VideoComponent="VideoComponent",X.AudioComponent="AudioComponent",X.RichTextComponent="RichTextComponent",X.OrientationComponent="OrientationComponent",X.ShapeComponent="ShapeComponent",X.SpriteComponent="SpriteComponent",X.ParticleSystem="ParticleSystem",X.InteractComponent="InteractComponent",X.CameraController="CameraController",X.PostProcessVolume="PostProcessVolume",X.EffectComponent="EffectComponent",X.TextComponent="TextComponent",X.AnimationGraphAsset="AnimationGraphAsset",X.CompositionComponent="CompositionComponent",X.FFDComponent="FFDComponent",X.Animator="Animator",X.TimelineClip="TimelineClip",(H=ec||(ec={}))[H.POINTS=0]="POINTS",H[H.LINES=1]="LINES",H[H.LINE_LOOP=2]="LINE_LOOP",H[H.LINE_STRIP=3]="LINE_STRIP",H[H.TRIANGLES=4]="TRIANGLES",H[H.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",H[H.TRIANGLE_FAN=6]="TRIANGLE_FAN",(Y=ef||(ef={}))[Y.Float16=0]="Float16",Y[Y.Float32=1]="Float32",Y[Y.Int8=2]="Int8",Y[Y.Int16=3]="Int16",Y[Y.Int32=4]="Int32",Y[Y.UInt8=5]="UInt8",Y[Y.UInt16=6]="UInt16",Y[Y.UInt32=7]="UInt32",(Z=ed||(ed={}))[Z.None=-1]="None",Z[Z.UInt8=0]="UInt8",Z[Z.UInt16=1]="UInt16",Z[Z.UInt32=2]="UInt32",(q=ep||(ep={})).Position="POSITION",q.Uv="TEXCOORD0",q.Uv2="TEXCOORD1",q.Normal="NORMAL",q.Tangent="TANGENT",q.Color="COLOR",q.Joints="JOINTS",q.Weights="WEIGHTS",q.PositionBS0="POSITION_BS0",q.PositionBS1="POSITION_BS1",q.PositionBS2="POSITION_BS2",q.PositionBS3="POSITION_BS3",q.PositionBS4="POSITION_BS4",q.PositionBS5="POSITION_BS5",q.PositionBS6="POSITION_BS6",q.PositionBS7="POSITION_BS7",q.NormalBS0="NORMAL_BS0",q.NormalBS1="NORMAL_BS1",q.NormalBS2="NORMAL_BS2",q.NormalBS3="NORMAL_BS3",q.TangentBS0="TANGENT_BS0",q.TangentBS1="TANGENT_BS1",q.TangentBS2="TANGENT_BS2",q.TangentBS3="TANGENT_BS3";var iL=Object.freeze({__proto__:null,LATEST_VERSION:tN.LATEST,get RenderLevel(){return tV},get BlendingMode(){return tL},get SideMode(){return tF},get ObscuredMode(){return tD},get ParticleEmitterShapeType(){return tk},get PluginType(){return tz},get InteractType(){return tB},get InteractBehavior(){return tU},get ItemType(){return tG},get RenderMode(){return tj},get ParticleOrigin(){return tW},get RenderType(){return tX},get RenderFace(){return tH},get CameraClipMode(){return tY},END_BEHAVIOR_DESTROY:0,END_BEHAVIOR_PAUSE:1,END_BEHAVIOR_FORWARD:2,END_BEHAVIOR_PAUSE_AND_DESTROY:3,END_BEHAVIOR_FREEZE:4,END_BEHAVIOR_RESTART:5,END_BEHAVIOR_DESTROY_CHILDREN:6,CAMERA_CLIP_MODE_VERTICAL:1,CAMERA_CLIP_MODE_NORMAL:0,MESSAGE_ITEM_PHRASE_BEGIN:2,MESSAGE_ITEM_PHRASE_END:1,get ValueType(){return tZ},get BezierKeyframeType(){return tq},get JSONSceneVersion(){return tN},get EndBehavior(){return tQ},get ParticleInteractionBehavior(){return tK},get ShapeArcMode(){return tJ},get LightType(){return t$},get ModelBoundingType(){return t0},get CameraType(){return t1},get MaterialType(){return t2},get MaterialBlending(){return t3},get RenderMode3D(){return t4},get TextOverflow(){return t5},get TextSizeMode(){return t6},get TextBaseline(){return t8},get TextAlignment(){return t9},get TextVerticalAlign(){return t7},get TextWeight(){return et},get FontStyle(){return ee},BuiltinObjectGUID:iV,get FillType(){return ei},get TexturePaintScaleMode(){return er},get ShapePrimitiveType(){return en},get LineCap(){return ea},get LineJoin(){return eo},get NodeDataType(){return es},get BackgroundType(){return eu},get MultimediaType(){return eh},get DataType(){return el},get GeometryType(){return ec},get VertexFormatType(){return ef},get IndexFormatType(){return ed},get VertexBufferSemantic(){return ep}});function iF(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function iD(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return iF(t,void 0);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return iF(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var ik=new Map,iz=new Map,iB={};function iU(t){return function(e,i){iB[t]&&console.warn("Class "+t+" is already registered."),iB[t]=e}}function iG(t){var e=t.constructor;if(iz.get(e))return iz.get(e);var i={};iz.set(e,i);for(var r=t,n=e;n;){var a=ik.get(n);for(var o in a)i[o]=a[o];var s=Object.getPrototypeOf(r);if((n=Object.getPrototypeOf(s).constructor)===Object)break;r=s}return i}function ij(t,e){return function(i,r){var n,a=(n=i.constructor,ik.get(n)||ik.set(n,{}),ik.get(n));a&&(a[r]||(a[r]={type:t,sourceName:e}))}}var iW=function(){function t(t){this.engine=t,this.guid=i_(),this.defination={},this.engine.addInstance(this)}var e=t.prototype;return e.getInstanceId=function(){return this.guid},e.setInstanceId=function(t){this.engine.removeInstance(this.guid),this.guid=t,this.engine.addInstance(this)},e.toData=function(){},e.fromData=function(t){void 0!==t.id&&this.setInstanceId(t.id)},e.dispose=function(){this.engine.removeInstance(this.guid)},t.is=function(e){return eF(e,t)&&"guid"in e},t}(),iX=function(){function t(){this.resources=[]}return t.prototype.getResource=function(t){return this.resources[t]},t}(),iH={};function iY(t){return function(e,i){iH[t]&&console.warn("NodeData Class "+t+" is already registered."),iH[t]=e}}var iZ=function(){function t(){this.initializationCount=0,this.lastUpdateID=-1}var e=t.prototype;return e.getNodeData=function(){return this.asset},e.isValid=function(){return!0},e.isInitialized=function(){return this.initializationCount>0},e.initialize=function(t){this.isInitialized()?this.initializationCount++:this.initializeInternal(t)},e.shutdown=function(t){if(!this.isInitialized())throw Error("Node not initialized!");0==--this.initializationCount&&this.shutdownInternal(t)},e.isNodeActive=function(t){return this.lastUpdateID===t},e.isUpdated=function(t){return this.isNodeActive(t.updateID)},e.markNodeActive=function(t){this.lastUpdateID=t.updateID},e.initializeInternal=function(t){this.initializationCount++},e.shutdownInternal=function(t){if(this.isInitialized())throw Error("Node still initialized!");this.lastUpdateID=-1},t}(),iq=function(){function t(){}var e=t.prototype;return e.load=function(t){this.index=t.index},e.createNode=function(t,e){var i=new t;return e.nodes[this.index]=i,i.asset=this,i},t}(),iQ=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.previousTime=0,e.currentTime=0,e}iN(e,t);var i=e.prototype;return i.getCurrentTime=function(){return this.currentTime},i.getPreviousTime=function(){return this.previousTime},i.getDuration=function(){return this.duration},i.getDebugInfo=function(){return{duration:this.duration,currentTime:this.currentTime,previousTime:this.previousTime}},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.previousTime=0,this.currentTime=this.previousTime,this.duration=0},e}(iZ),iK=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.setValue=function(t){},e}(iZ),iJ=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iK),i$=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iK);t.AnimationGraphAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.nodeDatas=[],e.graphDataSet=new iX,e.controlParameterIDs=[],e.parameterLookupMap=new Map,e.rootNodeIndex=-1,e}return iN(e,t),e.prototype.fromData=function(t){var i=t.nodeDatas;this.rootNodeIndex=t.rootNodeIndex,this.controlParameterIDs=t.controlParameterIDs;for(var r=t.controlParameterIDs.length,n=0;n<r;n++)this.parameterLookupMap.set(t.controlParameterIDs[n],n);this.nodeDatas=[];for(var a=0;a<i.length;a++)this.nodeDatas[a]=e.createNodeData(i[a].type),this.nodeDatas[a].load(i[a]);this.graphDataSet=new iX,this.graphDataSet.resources=[];for(var o,s=iD(t.graphDataSet.resources);!(o=s()).done;){var u=o.value,h=this.engine.findObject(u);this.graphDataSet.resources.push(h)}},e.createNodeData=function(t){var e=iH[t];if(e)return new e;throw Error("Unknown node type: "+t+".")},e}(iW),t.AnimationGraphAsset=ek([iU("AnimationGraphAsset")],t.AnimationGraphAsset),(Q=em||(em={}))[Q.Active=0]="Active",Q[Q.Inactive=1]="Inactive";var i0=function(){function t(){this.deltaTime=0,this.updateID=0,this.branchState=0}return t.prototype.update=function(t){this.deltaTime=t,this.updateID++,this.branchState=0},t}(),i1=function(){function t(){this.nodeDatas=[],this.nodes=[]}return t.prototype.getNode=function(t){return this.nodes[t]?this.nodes[t]:this.nodeDatas[t]?(this.nodeDatas[t].instantiate(this),this.nodes[t]):null},t}();function i2(){return(i2=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}t.AnimationClipNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.playRate=1,e.loopAnimation=!0,e.dataSlotIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(i3,t).animation=t.dataSet.getResource(this.dataSlotIndex)},i.load=function(e){t.prototype.load.call(this,e);var i=i2({playRate:1,loopAnimation:!0},e);this.dataSlotIndex=e.dataSlotIndex,this.playRate=i.playRate,this.loopAnimation=i.loopAnimation},e}(iq),t.AnimationClipNodeData=ek([iY(es.AnimationClipNodeData)],t.AnimationClipNodeData);var i3=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.animation=null,e.animatable=null,e}iN(e,t);var i=e.prototype;return i.evaluate=function(t,e){if(!this.animatable)return e;this.markNodeActive(t);var i=this.getNodeData();this.previousTime=this.currentTime,this.currentTime=this.previousTime+t.deltaTime/this.duration*i.playRate,i.loopAnimation?this.currentTime>1&&(this.currentTime=this.currentTime%1):this.currentTime=eK(this.currentTime,0,1);var r=this.currentTime*this.duration;return this.animatable.getPose(r,e.pose),e},i.initializeInternal=function(e){var i,r;t.prototype.initializeInternal.call(this,e),this.duration=null!=(r=null==(i=this.animation)?void 0:i.duration)?r:0,this.previousTime=this.currentTime=0,this.animation&&(this.animatable=new i4(e.skeleton,this.animation))},e}(iQ);(K=ev||(ev={}))[K.Position=0]="Position",K[K.Scale=1]="Scale",K[K.Rotation=2]="Rotation",K[K.Euler=3]="Euler";var i4=function(){function t(t,e){this.skeleton=t,this.animationClip=e,this.transformCurveInfos=[],this.floatCurveInfos=[],this.colorCurveInfos=[];for(var i,r=iD(e.positionCurves);!(i=r()).done;){var n=i.value;this.addTransformCurveInfo(n,0)}for(var a,o=iD(e.scaleCurves);!(a=o()).done;){var s=a.value;this.addTransformCurveInfo(s,1)}for(var u,h=iD(e.rotationCurves);!(u=h()).done;){var l=u.value;this.addTransformCurveInfo(l,2)}for(var c,f=iD(e.eulerCurves);!(c=f()).done;){var d=c.value;this.addTransformCurveInfo(d,3)}for(var p,m=iD(e.floatCurves);!(p=m()).done;){var v=p.value;this.addFloatCurveInfo(v)}for(var y,g=iD(e.colorCurves);!(y=g()).done;){var x=y.value;this.addColorCurveInfo(x)}}var e=t.prototype;return e.getPose=function(t,e){for(var i,r=eK(t,0,this.animationClip.duration),n=iD(this.transformCurveInfos);!(i=n()).done;){var a=i.value,o=a.curve.keyFrames.getValue(r),s=e.parentSpaceTransforms[a.boneIndex];switch(a.type){case 0:s.position.copyFrom(o);break;case 1:s.scale.copyFrom(o);break;case 2:s.rotation.copyFrom(o);break;case 3:s.euler.copyFrom(o)}}for(var u,h=iD(this.floatCurveInfos);!(u=h()).done;){var l=u.value,c=l.curve.keyFrames.getValue(r);e.floatPropertyValues[l.animatedObjectIndex]=c}for(var f,d=iD(this.colorCurveInfos);!(f=d()).done;){var p=f.value,m=p.curve.keyFrames.getValue(r);e.colorPropertyValues[p.animatedObjectIndex]=m}},e.addTransformCurveInfo=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t.path);void 0!==i&&this.transformCurveInfos.push({curve:t,boneIndex:i,type:e})},e.addFloatCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.floatCurveInfos.push({curve:t,animatedObjectIndex:e})},e.addColorCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.colorCurveInfos.push({curve:t,animatedObjectIndex:e})},t}(),i5=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setFromEuler=function(t){return t.toQuaternion(this),this},e.setFromAxisAngle=function(e,i){var r=i/2,n=Math.sin(r),a=t.tempVec0;return a.copyFrom(e).normalize(),this.x=a.x*n,this.y=a.y*n,this.z=a.z*n,this.w=Math.cos(r),this},e.setFromVector4=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.setFromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},e.setFromRotationMatrix=function(t){var e=t.elements,i=e[0],r=e[4],n=e[8],a=e[1],o=e[5],s=e[9],u=e[2],h=e[6],l=e[10],c=i+o+l;if(c>0){var f=.5/Math.sqrt(c+1);this.w=.25/f,this.x=(h-s)*f,this.y=(n-u)*f,this.z=(a-r)*f}else if(i>o&&i>l){var d=2*Math.sqrt(1+i-o-l);this.w=(h-s)/d,this.x=.25*d,this.y=(r+a)/d,this.z=(n+u)/d,this.negate()}else if(o>l){var p=2*Math.sqrt(1+o-i-l);this.w=(n-u)/p,this.x=(r+a)/p,this.y=.25*p,this.z=(s+h)/p,this.negate()}else{var m=2*Math.sqrt(1+l-i-o);this.w=(a-r)/m,this.x=(n+u)/m,this.y=(s+h)/m,this.z=.25*m,this.negate()}return this},e.setFromUnitVectors=function(t,e){var i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this.x=-t.y,this.y=t.x,this.z=0):(this.x=0,this.y=-t.z,this.z=t.y)):(this.x=t.y*e.z-t.z*e.y,this.y=t.z*e.x-t.x*e.z,this.z=t.x*e.y-t.y*e.x),this.w=i,this.normalize()},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.angleTo=function(t){return 2*Math.acos(Math.abs(eK(this.dot(t),-1,1)))},e.rotateTowards=function(t,e){var i=this.angleTo(t);return 0===i||this.slerp(t,Math.min(1,e/i)),this},e.identity=function(){return this.set(0,0,0,1)},e.invert=function(){return this.conjugate()},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.conjugate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){var t=this.length();return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t),this},e.multiply=function(t){return this.multiplyQuaternions(this,t)},e.premultiply=function(t){return this.multiplyQuaternions(t,this)},e.multiplyQuaternions=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,o=e.x,s=e.y,u=e.z,h=e.w;return this.x=i*h+a*o+r*u-n*s,this.y=r*h+a*s+n*o-i*u,this.z=n*h+a*u+i*s-r*o,this.w=a*h-i*o-r*s-n*u,this},e.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copyFrom(t);var i=this.x,r=this.y,n=this.z,a=this.w,o=a*t.w+i*t.x+r*t.y+n*t.z;if(o<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,o=-o):this.copyFrom(t),o>=1)return this.w=a,this.x=i,this.y=r,this.z=n,this;var s=1-o*o;if(s<=Number.EPSILON){var u=1-e;return this.w=u*a+e*this.w,this.x=u*i+e*this.x,this.y=u*r+e*this.y,this.z=u*n+e*this.z,this.normalize(),this}var h=Math.sqrt(s),l=Math.atan2(h,o),c=Math.sin((1-e)*l)/h,f=Math.sin(e*l)/h;return this.w=a*c+this.w*f,this.x=i*c+this.x*f,this.y=r*c+this.y*f,this.z=n*c+this.z*f,this},e.slerpQuaternions=function(t,e,i){this.copyFrom(t).slerp(e,i)},e.rotateVector3=function(t,e){var i=this.x,r=this.y,n=this.z,a=this.w,o=t.x,s=t.y,u=t.z,h=a*o+r*u-n*s,l=a*s+n*o-i*u,c=a*u+i*s-r*o,f=-i*o-r*s-n*u,d=null!=e?e:t;return d.x=h*a+-(f*i)+-(l*n)- -(c*r),d.y=l*a+-(f*r)+-(c*i)- -(h*n),d.z=c*a+-(f*n)+-(h*r)- -(l*i),d},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector4=function(t){return t.set(this.x,this.y,this.z,this.w)},e.toEuler=function(t){return t.setFromQuaternion(this)},e.toMatrix4=function(t){return t.compose(e$.ZERO,this,e$.ONE)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromAxisAngle=function(e,i){return new t().setFromAxisAngle(e,i)},t.fromVector4=function(e){return new t().setFromVector4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromRotationMatrix=function(e){return new t().setFromRotationMatrix(e)},t.fromUnitVectors=function(e,i){return new t().setFromUnitVectors(e,i)},t}();i5.tempVec0=new e$;var i6=new i5,i8=function(){},i9=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+(e.x-t.x)*i,r.y=t.y+(e.y-t.y)*i,r.z=t.z+(e.z-t.z)*i},i.blendQuaternion=function(t,e,i,r){r.copyFrom(t).slerp(e,i)},i.blendEuler=function(t,e,i,r){this.lerpEuler(t,e,i,r)},i.blendFloat=function(t,e,i){return t+(e-t)*i},i.blendColor=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i,r.a=t.a+(e.a-t.a)*i},i.lerpEuler=function(t,e,i,r){r.x=this.lerpAngle(t.x,e.x,i),r.y=this.lerpAngle(t.y,e.y,i),r.z=this.lerpAngle(t.z,e.z,i)},i.normalizeAngle=function(t){return(t%360+360)%360},i.shortestAngleDiff=function(t,e){var i=this.normalizeAngle(e)-this.normalizeAngle(t);return i>180&&(i-=360),i<-180&&(i+=360),i},i.lerpAngle=function(t,e,i){var r=this.shortestAngleDiff(t,e);return this.normalizeAngle(t+r*i)},e}(i8),i7=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+e.x*i,r.y=t.y+e.y*i,r.z=t.z+e.z*i},i.blendQuaternion=function(t,e,i,r){var n=i6.copyFrom(t).multiply(e);r.copyFrom(t).slerp(n,i)},i.blendEuler=function(t,e,i,r){this.blendVector3(t,e,i,r)},i.blendFloat=function(t,e,i){return t+e*i},i.blendColor=function(t,e,i,r){r.r=t.r+e.r*i,r.g=t.g+e.g*i,r.b=t.b+e.b*i,r.a=t.a+e.a*i},e}(i8),rt=function(){function t(){}return t.localBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.normalBlendFunction)},t.additiveBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.additiveBlendFunction)},t.localBlendInternal=function(t,e,i,r,n){for(var a=0;a<t.parentSpaceTransforms.length;a++){var o=t.parentSpaceTransforms[a],s=e.parentSpaceTransforms[a],u=r.parentSpaceTransforms[a],h=o.position,l=s.position,c=u.position;n.blendVector3(h,l,i,c);var f=o.rotation,d=s.rotation,p=u.rotation;n.blendQuaternion(f,d,i,p);var m=o.scale,v=s.scale,y=u.scale;n.blendVector3(m,v,i,y);var g=o.euler,x=s.euler,b=u.euler;n.blendEuler(g,x,i,b)}for(var T=0;T<t.floatPropertyValues.length;T++){var _=t.floatPropertyValues[T],E=e.floatPropertyValues[T];r.floatPropertyValues[T]=n.blendFloat(_,E,i)}for(var C=0;C<t.colorPropertyValues.length;C++){var S=t.colorPropertyValues[C],w=e.colorPropertyValues[C],A=r.colorPropertyValues[C];n.blendColor(S,w,i,A)}},t}();rt.normalBlendFunction=new i9,rt.additiveBlendFunction=new i7;var re=function(){function t(t){this.position=new e$,this.rotation=new i5,this.scale=new e$,this.euler=new e$,t&&(this.position.copyFrom(t.position),this.rotation.copyFrom(t.quat),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.rotation))}return t.prototype.copyFrom=function(t){return this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.euler),this},t}(),ri=function(){function t(t){this.skeleton=t,this.parentSpaceTransforms=[],this.floatPropertyValues=[],this.colorPropertyValues=[];for(var e,i=iD(t.parentSpaceTransforms);!(e=i()).done;){var r=e.value;this.parentSpaceTransforms.push(new re().copyFrom(r))}for(var n,a=iD(t.defaultFloatPropertyValues);!(n=a()).done;){var o=n.value;this.floatPropertyValues.push(o)}for(var s,u=iD(t.defaultColorPropertyValues);!(s=u()).done;){var h=s.value;this.colorPropertyValues.push(new e1().copyFrom(h))}}var e=t.prototype;return e.setPosition=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].position.copyFrom(e)},e.setRotation=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].rotation.copyFrom(e)},e.setEuler=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].euler.copyFrom(e)},e.setScale=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].scale.copyFrom(e)},e.setFloat=function(t,e){var i=this.skeleton.pathToObjectIndex.get(t);void 0!==i&&(this.floatPropertyValues[i]=e)},e.copyFrom=function(t){for(var e=0;e<this.parentSpaceTransforms.length;e++)this.parentSpaceTransforms[e].copyFrom(t.parentSpaceTransforms[e]);for(var i=0;i<this.colorPropertyValues.length;i++)this.colorPropertyValues[i].copyFrom(t.colorPropertyValues[i]);for(var r=0;r<this.floatPropertyValues.length;r++)this.floatPropertyValues[r]=t.floatPropertyValues[r]},t}(),rr=function(t){this.pose=new ri(t)};t.ApplyAdditiveNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rn,t);e.baseNode=t.getNode(this.baseNodeIndex),e.additiveNode=t.getNode(this.additiveNodeIndex),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.baseNodeIndex=e.baseNodeIndex,this.additiveNodeIndex=e.additiveNodeIndex,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(iq),t.ApplyAdditiveNodeData=ek([iY(es.ApplyAdditiveNodeData)],t.ApplyAdditiveNodeData);var rn=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNode=null,e.additiveNode=null,e.inputParameterValueNode=null,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.baseNodeResult=new rr(e.skeleton),this.additiveNodeResult=new rr(e.skeleton),null==(i=this.baseNode)||i.initialize(e),null==(r=this.additiveNode)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.baseNode)||i.shutdown(e),null==(r=this.additiveNode)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.baseNode&&!this.additiveNode?(this.baseNode.evaluate(t,this.baseNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)):this.baseNode&&this.additiveNode&&(this.baseNode.evaluate(t,this.baseNodeResult),this.additiveNode.evaluate(t,this.additiveNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)),e},i.applyAdditive=function(t,e,i,r){rt.additiveBlend(t,e,i,r)},e}(iQ);t.BlendNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(ra,t);e.source0=t.getNode(this.sourceNodeIndex0),e.source1=t.getNode(this.sourceNodeIndex1),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.sourceNodeIndex0=e.sourceNodeIndex0,this.sourceNodeIndex1=e.sourceNodeIndex1,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(iq),t.BlendNodeData=ek([iY(es.BlendNodeData)],t.BlendNodeData);var ra=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.source0=null,e.source1=null,e.inputParameterValueNode=null,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.source0Result=new rr(e.skeleton),this.source1Result=new rr(e.skeleton),null==(i=this.source0)||i.initialize(e),null==(r=this.source1)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.source0)||i.shutdown(e),null==(r=this.source1)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.source0&&!this.source1?(this.source0.evaluate(t,this.source0Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)):this.source0&&this.source1&&(this.source0.evaluate(t,this.source0Result),this.source1.evaluate(t,this.source1Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)),e},i.localBlend=function(t,e,i,r){rt.localBlend(t,e,i,r)},e}(iQ);t.AndNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(ro,t),r=iD(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(iq),t.AndNodeData=ek([iY(es.AndNodeData)],t.AndNodeData);var ro=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!0;for(var e,i=iD(this.conditionNodes);!(e=i()).done;)if(!e.value.getValue(t)){this.result=!1;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i$);t.OrNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rs,t),r=iD(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(iq),t.OrNodeData=ek([iY(es.OrNodeData)],t.OrNodeData);var rs=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!1;for(var e,i=iD(this.conditionNodes);!(e=i()).done;)if(e.value.getValue(t)){this.result=!0;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=iD(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i$);t.NotNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(ru,t).inputValueNode=t.getNode(this.inputValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex},e}(iq),t.NotNodeData=ek([iY(es.NotNodeData)],t.NotNodeData);var ru=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.result=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&(this.result=!this.inputValueNode.getValue(t))),this.result},i.initializeInternal=function(e){var i;t.prototype.initializeInternal.call(this,e),null==(i=this.inputValueNode)||i.initialize(e),this.result=!1},i.shutdownInternal=function(e){var i;null==(i=this.inputValueNode)||i.shutdown(e),t.prototype.shutdownInternal.call(this,e)},e}(i$);t.ConstFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rh,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ConstFloatNodeData=ek([iY(es.ConstFloatNodeData)],t.ConstFloatNodeData);var rh=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}return iN(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(iJ);t.ConstBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rl,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ConstBoolNodeData=ek([iY(es.ConstBoolNodeData)],t.ConstBoolNodeData);var rl=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}return iN(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(i$);t.ControlParameterFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rc,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ControlParameterFloatNodeData=ek([iY(es.ControlParameterFloatNodeData)],t.ControlParameterFloatNodeData);var rc=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(iJ);t.ControlParameterBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rf,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(iq),t.ControlParameterBoolNodeData=ek([iY(es.ControlParameterBoolNodeData)],t.ControlParameterBoolNodeData);var rf=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i$);t.ControlParameterTriggerNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rd,t)},i.load=function(e){t.prototype.load.call(this,e)},e}(iq),t.ControlParameterTriggerNodeData=ek([iY(es.ControlParameterTriggerNodeData)],t.ControlParameterTriggerNodeData);var rd=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iN(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i$);t.LayerBlendNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNodeIndex=-1,e.layerDatas=[],e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rp,t);e.baseLayerNode=t.getNode(this.baseNodeIndex);for(var i,r=iD(this.layerDatas);!(i=r()).done;){var n=i.value;e.layers.push({inputNode:t.getNode(n.inputNodeIndex),weightValueNode:t.getNode(n.weightValueNodeIndex),weight:0})}},i.load=function(e){if(t.prototype.load.call(this,e),this.baseNodeIndex=null!=(i=e.baseNodeIndex)?i:-1,e.layerDatas)for(var i,r,n=iD(e.layerDatas);!(r=n()).done;){var a=r.value;this.layerDatas.push(i2({inputNodeIndex:-1,weightValueNodeIndex:-1},a))}},e}(iq),t.LayerBlendNodeData=ek([iY(es.LayerBlendNodeData)],t.LayerBlendNodeData);var rp=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseLayerNode=null,e.layers=[],e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.layerNodeResult=new rr(e.skeleton),null==(i=this.baseLayerNode)||i.initialize(e);for(var i,r,n=iD(this.layers);!(r=n()).done;){var a,o,s=r.value;null==(a=s.inputNode)||a.initialize(e),null==(o=s.weightValueNode)||o.initialize(e)}},i.shutdownInternal=function(e){null==(i=this.baseLayerNode)||i.shutdown(e);for(var i,r,n=iD(this.layers);!(r=n()).done;){var a,o,s=r.value;null==(a=s.inputNode)||a.shutdown(e),null==(o=s.weightValueNode)||o.shutdown(e)}t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){return this.baseLayerNode&&this.baseLayerNode.isValid()&&(this.markNodeActive(t),this.previousTime=this.baseLayerNode.getCurrentTime(),e=this.baseLayerNode.evaluate(t,e),this.currentTime=this.baseLayerNode.getCurrentTime(),this.duration=this.baseLayerNode.getDuration(),this.updateLayers(t,e)),e},i.updateLayers=function(t,e){for(var i,r=iD(this.layers);!(i=r()).done;){var n=i.value;if(n.inputNode&&n.weightValueNode){this.layerNodeResult.pose.copyFrom(e.pose),n.inputNode.evaluate(t,this.layerNodeResult);var a=n.weightValueNode.getValue(t);rt.localBlend(e.pose,this.layerNodeResult.pose,a,e.pose)}}return e},e}(iQ);t.EqualNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rm,t);e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(iq),t.EqualNodeData=ek([iY(es.EqualNodeData)],t.EqualNodeData);var rm=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.result=!1,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);this.result=e===i}return this.result},e}(i$),rv=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}return iN(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(iq);(J=ey||(ey={}))[J.GreaterThan=0]="GreaterThan",J[J.LessThan=1]="LessThan";var ry=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.comparison=0,e.result=!1,e}iN(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);switch(this.comparison){case 0:this.result=e>i;break;case 1:this.result=e<i}}return this.result},e}(i$);t.GreaterNodeData=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.instantiate=function(t){var e=this.createNode(ry,t);e.comparison=0,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(rv),t.GreaterNodeData=ek([iY(es.GreaterNodeData)],t.GreaterNodeData),t.LessNodeData=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.instantiate=function(t){var e=this.createNode(ry,t);e.comparison=1,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(rv),t.LessNodeData=ek([iY(es.LessNodeData)],t.LessNodeData),t.StateMachineNodeData=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rg,t),r=iD(this.stateDatas);!(e=r()).done;){var n=e.value,a={stateNode:t.getNode(n.stateNodeIndex),transitions:[]};i.states.push(a);for(var o,s=iD(n.transitionDatas);!(o=s()).done;){var u=o.value,h={transitionNode:t.getNode(u.transitionNodeIndex),conditionNode:t.getNode(u.conditionNodeIndex),targetStateIndex:u.targetStateIndex};a.transitions.push(h)}}},i.load=function(e){t.prototype.load.call(this,e),this.stateDatas=e.stateDatas,this.defaultStateIndex=e.defaultStateIndex,this.machineName=e.machineName},e}(iq),t.StateMachineNodeData=ek([iY(es.StateMachineNodeData)],t.StateMachineNodeData);var rg=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.states=[],e.activeTransition=null,e.activeStateIndex=-1,e}iN(e,t);var i=e.prototype;return i.getCurrentStateName=function(){return this.states[this.activeStateIndex].stateNode.getNodeData().stateName},i.evaluate=function(t,e){if(this.markNodeActive(t),null!==this.activeTransition&&this.activeTransition.isComplete(t)&&(this.activeTransition.shutdown(t),this.activeTransition=null),null===this.activeTransition){var i=this.states[this.activeStateIndex].stateNode;e=i.evaluate(t,e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime()}else e=this.activeTransition.evaluate(t,e),this.duration=this.activeTransition.getDuration(),this.previousTime=this.activeTransition.getPreviousTime(),this.currentTime=this.activeTransition.getCurrentTime();return t.branchState===em.Active&&this.evaluateTransitions(t,e),e},i.evaluateTransitions=function(t,e){for(var i=this.states[this.activeStateIndex],r=-1,n=i.transitions.length,a=0;a<n;a++){var o=i.transitions[a];if(-1===o.targetStateIndex)throw Error("Invalid target state index.");if(!this.states[o.targetStateIndex].stateNode.isTransitioning()){var s=!1;if(o.transitionNode.hasExitTime){var u=i.stateNode;u.getElapsedTimeInState()/u.getDuration()>o.transitionNode.exitTime&&(s=!0)}else null!==o.conditionNode&&o.conditionNode.getValue(t)&&(s=!0);if(s){r=a;break}}}if(-1!==r){var h=i.transitions[r];h.transitionNode.initialize(t),e=null!==this.activeTransition?h.transitionNode.startTransitionFromTransition(t,e,this.activeTransition,e):h.transitionNode.startTransitionFromState(t,e,this.states[this.activeStateIndex].stateNode,e),this.activeTransition=h.transitionNode,this.shutdownTransitionConditions(t),this.activeStateIndex=h.targetStateIndex,this.initializeTransitionConditions(t),this.duration=this.states[this.activeStateIndex].stateNode.getDuration(),this.previousTime=this.states[this.activeStateIndex].stateNode.getPreviousTime(),this.currentTime=this.states[this.activeStateIndex].stateNode.getCurrentTime()}},i.selectDefaultState=function(t){return this.getNodeData().defaultStateIndex},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.activeStateIndex=this.selectDefaultState(e);var i=this.states[this.activeStateIndex].stateNode;i.initialize(e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime(),this.initializeTransitionConditions(e)},i.shutdownInternal=function(e){null!==this.activeTransition&&this.activeTransition.shutdown(e),this.shutdownTransitionConditions(e),this.states[this.activeStateIndex].stateNode.shutdown(e),this.activeStateIndex=-1,this.activeTransition=null,t.prototype.shutdownInternal.call(this,e)},i.initializeTransitionConditions=function(t){for(var e,i=iD(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.initialize(t)}},i.shutdownTransitionConditions=function(t){for(var e,i=iD(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.shutdown(t)}},e}(iQ);t.TransitionState=void 0,($=t.TransitionState||(t.TransitionState={}))[$.None=0]="None",$[$.TransitioningIn=1]="TransitioningIn",$[$.TransitioningOut=2]="TransitioningOut",t.StateNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rx,t).childNode=t.getNode(this.childNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.childNodeIndex=e.childNodeIndex,this.stateName=e.stateName},e}(iq),t.StateNodeData=ek([iY(es.StateNodeData)],t.StateNodeData);var rx=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNode=null,e.transitionState=0,e.elapsedTimeInState=0,e.isFirstStateUpdate=!1,e}iN(e,t);var i=e.prototype;return i.isTransitioning=function(){return 0!==this.transitionState},i.isTransitioningIn=function(){return 1===this.transitionState},i.isTransitioningOut=function(){return 2===this.transitionState},i.startTransitionIn=function(t){this.transitionState=1},i.startTransitionOut=function(t){this.transitionState=2},i.setTransitioningState=function(t){this.transitionState=t},i.getElapsedTimeInState=function(){return this.elapsedTimeInState},i.evaluate=function(t,e){return this.markNodeActive(t),null!==this.childNode&&this.childNode.isValid()&&(e=this.childNode.evaluate(t,e),this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime()),this.elapsedTimeInState+=t.deltaTime,this.isFirstStateUpdate=!1,e},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.transitionState=0,this.elapsedTimeInState=0,this.previousTime=this.currentTime=0,this.duration=0,null!==this.childNode&&(this.childNode.initialize(e),this.childNode.isValid()&&(this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime())),this.isFirstStateUpdate=!0},i.shutdownInternal=function(e){null!==this.childNode&&this.childNode.shutdown(e),this.transitionState=0,t.prototype.shutdownInternal.call(this,e)},e}(iQ);t.SourceType=void 0,(tt=t.SourceType||(t.SourceType={}))[tt.State=0]="State",tt[tt.Transition=1]="Transition",tt[tt.CachedPose=2]="CachedPose",t.TransitionNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.hasExitTime=!1,e.exitTime=.75,e.targetStateNodeIndex=-1,e}iN(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rb,t);e.targetNode=t.getNode(this.targetStateNodeIndex),e.hasExitTime=this.hasExitTime,e.exitTime=this.exitTime},i.load=function(e){t.prototype.load.call(this,e),this.duration=e.duration,this.hasExitTime=e.hasExitTime,this.exitTime=e.exitTime,this.targetStateNodeIndex=e.targetStateNodeIndex},e}(iq),t.TransitionNodeData=ek([iY(es.TransitionNodeData)],t.TransitionNodeData);var rb=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.hasExitTime=!1,t.exitTime=.75,t.transitionLength=0,t.transitionProgress=0,t.blendWeight=0,t.sourceNode=null,t.sourceType=0,t.blendedDuration=0,t}iN(i,e);var r=i.prototype;return r.evaluate=function(t,e){ih(this.sourceNode),this.markNodeActive(t),this.isSourceATransition()&&this.getSourceTransitionNode().isComplete(t)&&this.endSourceTransition(t),this.transitionProgress=this.transitionProgress+t.deltaTime/this.transitionLength,this.transitionProgress=eK(this.transitionProgress,0,1),this.calculateBlendWeight();var i=this.sourceNodeResult,r=t.branchState;t.branchState=em.Inactive,i=this.sourceNode.evaluate(t,i),t.branchState=r;var n=this.targetNode.evaluate(t,this.targetNodeResult);if(this.registerPoseTasksAndUpdateRootMotion(i,n,e),this.blendedDuration=eQ(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.blendedDuration>0){var a=t.deltaTime/this.blendedDuration;this.previousTime=this.currentTime,this.currentTime=(this.currentTime+a)%1}else this.previousTime=this.currentTime=1;return this.duration=this.targetNode.getDuration(),e},r.isComplete=function(t){return this.transitionLength<=0||this.transitionProgress+t.deltaTime/this.transitionLength>=1},r.getProgressPercentage=function(){return this.transitionProgress},r.getSourceType=function(){return this.sourceType},r.isSourceATransition=function(){return 1===this.sourceType},r.isSourceAState=function(){return 0===this.sourceType},r.startTransitionFromState=function(t,e,i,r){return this.sourceNode=i,this.sourceType=0,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.startTransitionFromTransition=function(t,e,i,r){return this.sourceNode=i,this.sourceType=1,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.getSourceStateNode=function(){return this.sourceNode},r.getSourceTransitionNode=function(){return this.sourceNode},r.notifyNewTransitionStarting=function(t,e){if(this.isSourceATransition()){var i=this.getSourceTransitionNode().targetNode;i===e&&(this.sourceType=2,i.shutdown(t),this.sourceNode=null)}else this.isSourceAState()&&this.sourceNode===e&&(this.sourceType=2,this.sourceNode.shutdown(t),this.sourceNode=null);this.isSourceATransition()&&this.getSourceTransitionNode().notifyNewTransitionStarting(t,e)},r.initializeInternal=function(t){e.prototype.initializeInternal.call(this,t),this.sourceNodeResult=new rr(t.skeleton),this.targetNodeResult=new rr(t.skeleton),this.transitionLength=this.getNodeData().duration,this.transitionProgress=0,this.blendWeight=0},r.shutdownInternal=function(i){this.targetNode.setTransitioningState(t.TransitionState.None),this.currentTime=1,this.sourceNode&&(this.isSourceATransition()&&this.endSourceTransition(i),this.sourceNode.shutdown(i),this.sourceNode=null),e.prototype.shutdownInternal.call(this,i)},r.endSourceTransition=function(e){var i,r=this.getSourceTransitionNode().targetNode;null==(i=this.sourceNode)||i.shutdown(e),this.sourceNode=r,this.sourceType=0,this.getSourceStateNode().setTransitioningState(t.TransitionState.TransitioningOut)},r.initializeTargetStateAndUpdateTransition=function(t,e,i){this.markNodeActive(t);var r=this.targetNodeResult;return 0===this.sourceType&&this.getSourceStateNode().startTransitionOut(t),this.targetNode.initialize(t),this.targetNode.startTransitionIn(t),r=this.targetNode.evaluate(t,r),this.calculateBlendWeight(),this.registerPoseTasksAndUpdateRootMotion(e,r,i),this.previousTime=0,this.currentTime=0,this.blendedDuration=eQ(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.duration=this.targetNode.getDuration(),i},r.calculateBlendWeight=function(){0===this.transitionLength?this.blendWeight=1:(this.blendWeight=this.transitionProgress,this.blendWeight=eK(this.blendWeight,0,1))},r.registerPoseTasksAndUpdateRootMotion=function(t,e,i){var r=this.blendWeight;rt.localBlend(t.pose,e.pose,r,i.pose)},i}(iQ);(te=eg||(eg={}))[te.Float=0]="Float",te[te.Color=1]="Color";var rT=function(){function t(t,e){this.rootBone=t,this.useEuler=!1,this.pathToObjectIndex=new Map,this.floatAnimatedObjects=[],this.defaultFloatPropertyValues=[],this.colorAnimatedObjects=[],this.defaultColorPropertyValues=[],this.animatedTransforms=[],this.parentSpaceTransforms=[],this.pathToBoneIndex=new Map;for(var i,r=iD(e.position);!(i=r()).done;){var n=i.value;this.addReferenceTransform(n)}for(var a,o=iD(e.rotation);!(a=o()).done;){var s=a.value;this.addReferenceTransform(s)}for(var u,h=iD(e.scale);!(u=h()).done;){var l=u.value;this.addReferenceTransform(l)}for(var c,f=iD(e.euler);!(c=f()).done;){var d=c.value;this.addReferenceTransform(d),this.useEuler=!0}for(var p=0;p<e.floats.length;p++){var m=e.floats[p];this.addRecordedProperty(m.path,m.className,m.property,0)}for(var v=0;v<e.colors.length;v++){var y=e.colors[v];this.addRecordedProperty(y.path,y.className,y.property,1)}}var e=t.prototype;return e.addReferenceTransform=function(t){if(!this.pathToBoneIndex.get(t)){var e=this.findTarget(t);e&&(this.parentSpaceTransforms.push(new re(e.transform)),this.animatedTransforms.push(e.transform),this.pathToBoneIndex.set(t,this.parentSpaceTransforms.length-1))}},e.addRecordedProperty=function(t,e,i,r){var n,a=t+e+i;if(void 0===this.pathToObjectIndex.get(a)){var o=this.findTarget(t);if(o){(n="VFXItem"===e?o:o.getComponent(iB[e]))||console.error("The "+e+" Component was not found.");for(var s=i.split("."),u=s[s.length-1],h=n,l=0;l<s.length-1;l++){var c=h[s[l]];void 0===c&&console.error("The "+s[l]+" property of "+h+" was not found."),h=c}var f={target:n,propertyPath:i,directTarget:h,propertyName:u};switch(r){case 0:this.floatAnimatedObjects.push(f),this.defaultFloatPropertyValues.push(h[u]),this.pathToObjectIndex.set(a,this.floatAnimatedObjects.length-1);break;case 1:this.colorAnimatedObjects.push(f),this.defaultColorPropertyValues.push(new e1().copyFrom(h[u])),this.pathToObjectIndex.set(a,this.colorAnimatedObjects.length-1)}}}},e.findTarget=function(t){if(""===t)return this.rootBone;for(var e,i=t.split("/"),r=this.rootBone,n=iD(i);!(e=n()).done;){var a=e.value,o=r.find(a);if(!o)return null;r=o}return r},t}(),r_=function(){function t(t,e){this.graphAsset=t,this.nodes=[],this.context=new i0;for(var i,r={position:[],scale:[],rotation:[],euler:[],floats:[],colors:[]},n=iD(t.graphDataSet.resources);!(i=n()).done;){var a=i.value;if(a){for(var o,s=iD(a.positionCurves);!(o=s()).done;){var u=o.value;r.position.push(u.path)}for(var h,l=iD(a.rotationCurves);!(h=l()).done;){var c=h.value;r.rotation.push(c.path)}for(var f,d=iD(a.scaleCurves);!(f=d()).done;){var p=f.value;r.scale.push(p.path)}for(var m,v=iD(a.eulerCurves);!(m=v()).done;){var y=m.value;r.euler.push(y.path)}for(var g,x=iD(a.floatCurves);!(g=x()).done;){var b=g.value;r.floats.push(b)}for(var T,_=iD(a.colorCurves);!(T=_()).done;){var E=T.value;r.colors.push(E)}}}this.skeleton=new rT(e,r),this.result=new rr(this.skeleton),this.context.skeleton=this.skeleton;var C=new i1;C.nodes=this.nodes,C.nodeDatas=t.nodeDatas,C.dataSet=t.graphDataSet;for(var S=0;S<t.nodeDatas.length;S++)C.nodes[S]||t.nodeDatas[S].instantiate(C);this.rootNode=this.nodes[t.rootNodeIndex]}var e=t.prototype;return e.evaluateGraph=function(t){this.context.update(t),this.rootNode.isInitialized()||this.resetGraphState(),this.rootNode&&(this.result=this.rootNode.evaluate(this.context,this.result));for(var e=0;e<this.getNumControlParameters();e++){var i=this.nodes[e];eF(i,rd)&&i.setValue(!1)}return this.result},e.isInitialized=function(){return this.rootNode&&this.rootNode.isInitialized()},e.isNodeActive=function(t){return this.isControlParameter(t)||this.nodes[t].isNodeActive(this.context.updateID)},e.getStateMachineNode=function(t){for(var e,i=null,r=iD(this.nodes);!(e=r()).done;){var n=e.value;eF(n,rg)&&n.getNodeData().machineName===t&&(i=n)}return i},e.resetGraphState=function(){this.rootNode.isInitialized()&&this.rootNode.shutdown(this.context),this.context.updateID++,this.rootNode.initialize(this.context)},e.getNumControlParameters=function(){return this.graphAsset.controlParameterIDs.length},e.getControlParameterIndex=function(t){var e=this.graphAsset.parameterLookupMap.get(t);return void 0!==e?e:(console.warn("Parameter '"+t+"' does not exist."),-1)},e.getControlParameterID=function(t){return this.graphAsset.controlParameterIDs[t]},e.setBool=function(t,e){this.setControlParameterValue(t,e)},e.setFloat=function(t,e){this.setControlParameterValue(t,e)},e.setTrigger=function(t){this.setControlParameterValue(t,!0)},e.resetTrigger=function(t){this.setControlParameterValue(t,!1)},e.getPoseNodeDebugInfo=function(t){return this.nodes[t].getDebugInfo()},e.getRuntimeNodeDebugValue=function(t){return this.nodes[t].getValue(this.context)},e.getNodeDebugInstance=function(t){return this.nodes[t]},e.isControlParameter=function(t){return t<this.getNumControlParameters()},e.setControlParameterValue=function(t,e){var i=this.getControlParameterIndex(t);-1!==i&&this.nodes[i].setValue(e)},t}();function rE(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rC(t,e,i){return e&&rE(t.prototype,e),i&&rE(t,i),t}var rS=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.isAwakeCalled=!1,e.isStartCalled=!1,e.isEnableCalled=!1,e._enabled=!0,e}iN(e,t);var i=e.prototype;return i.onAwake=function(){},i.onEnable=function(){},i.onDisable=function(){},i.onStart=function(){},i.onUpdate=function(t){},i.onLateUpdate=function(t){},i.onDestroy=function(){},i.onApplyAnimationProperties=function(){},i.enable=function(){this.item.composition&&(this.item.composition.sceneTicking.addComponent(this),this.isEnableCalled=!0),this.onEnable()},i.disable=function(){this.onDisable(),this.item.composition&&(this.isEnableCalled=!1,this.item.composition.sceneTicking.removeComponent(this))},i.setVFXItem=function(t){this.item=t,t.isDuringPlay&&(this.isAwakeCalled||(this.onAwake(),this.isAwakeCalled=!0),t.isActive&&this.enabled&&(this.start(),this.enable()))},i.fromData=function(e){t.prototype.fromData.call(this,e)},i.dispose=function(){this.isEnableCalled&&this.disable(),this.isAwakeCalled&&(this.isAwakeCalled=!1,this.onDestroy()),this.item&&eX(this.item.components,this),t.prototype.dispose.call(this)},i.start=function(){this.isStartCalled||(this.isStartCalled=!0,this.onStart())},rC(e,[{key:"transform",get:function(){return this.item.transform}},{key:"isActiveAndEnabled",get:function(){return this.item.isActive&&this.enabled}},{key:"enabled",get:function(){return this._enabled},set:function(t){this.enabled!==t&&(this._enabled=t,t?this.isActiveAndEnabled&&(this.enable(),this.isStartCalled||(this.onStart(),this.isStartCalled=!0)):this.isEnableCalled&&this.disable())}}]),e}(iW);ek([ij(void 0,void 0)],rS.prototype,"item",void 0),ek([ij(void 0,void 0)],rS.prototype,"_enabled",void 0);var rw=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.setVFXItem=function(e){t.prototype.setVFXItem.call(this,e)},i.dispose=function(){t.prototype.dispose.call(this)},e}(rS);t.Animator=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.graphInstance=null,e.graphAsset=null,e}iN(e,t);var i=e.prototype;return i.setBool=function(t,e){this.graphInstance&&this.graphInstance.setBool(t,e)},i.setFloat=function(t,e){this.graphInstance&&this.graphInstance.setFloat(t,e)},i.setTrigger=function(t){this.graphInstance&&this.graphInstance.setTrigger(t)},i.resetTrigger=function(t){this.graphInstance&&this.graphInstance.resetTrigger(t)},i.getStateMachineNode=function(t){var e=null;return this.graphInstance&&(e=this.graphInstance.getStateMachineNode(t)),e},i.onStart=function(){this.graphAsset&&(this.graphInstance=new r_(this.graphAsset,this.item))},i.onUpdate=function(t){if(this.graphInstance){for(var e=this.graphInstance.evaluateGraph(t/1e3),i=this.graphInstance.skeleton.animatedTransforms,r=0;r<i.length;r++){var n=e.pose.parentSpaceTransforms[r].position,a=e.pose.parentSpaceTransforms[r].rotation,o=e.pose.parentSpaceTransforms[r].scale,s=e.pose.parentSpaceTransforms[r].euler;i[r].setPosition(n.x,n.y,n.z),i[r].setScale(o.x,o.y,o.z),this.graphInstance.skeleton.useEuler?i[r].setRotation(s.x,s.y,s.z):i[r].setQuaternion(a.x,a.y,a.z,a.w)}for(var u=this.graphInstance.skeleton.floatAnimatedObjects,h=0;h<u.length;h++){var l=u[h],c=l.propertyName;l.directTarget[c]=e.pose.floatPropertyValues[h],eF(l.target,rS)&&l.target.onApplyAnimationProperties()}for(var f=this.graphInstance.skeleton.colorAnimatedObjects,d=0;d<f.length;d++){var p=f[d],m=p.propertyName;p.directTarget[m]=e.pose.colorPropertyValues[d],eF(p.target,rS)&&p.target.onApplyAnimationProperties()}}},i.fromData=function(t){this.graphAsset=this.engine.findObject(t.graphAsset)},e}(rS),t.Animator=ek([iU("Animator")],t.Animator);var rA=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.materials=[],e._priority=0,e}iN(e,t);var i=e.prototype;return i.render=function(t){},i.onEnable=function(){var t;null==(t=this.item.composition)||t.renderFrame.addMeshToDefaultRenderPass(this)},i.onDisable=function(){var t;null==(t=this.item.composition)||t.renderFrame.removeMeshFromDefaultRenderPass(this)},rC(e,[{key:"priority",get:function(){return this._priority},set:function(t){this._priority=t}},{key:"material",get:function(){return this.materials[0]},set:function(t){0===this.materials.length?this.materials.push(t):this.materials[0]=t}}]),e}(rS);ek([ij(void 0,void 0)],rA.prototype,"materials",void 0),ek([ij(void 0,void 0)],rA.prototype,"_priority",void 0),t.ShaderType=void 0,(ti=t.ShaderType||(t.ShaderType={}))[ti.vertex=0]="vertex",ti[ti.fragment=1]="fragment",t.MaskMode=void 0,(tr=t.MaskMode||(t.MaskMode={}))[tr.NONE=0]="NONE",tr[tr.MASK=1]="MASK",tr[tr.OBSCURED=2]="OBSCURED",tr[tr.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",t.TextureLoadAction=void 0,(tn=t.TextureLoadAction||(t.TextureLoadAction={}))[tn.whatever=0]="whatever",tn[tn.clear=2]="clear",t.TextureSourceType=void 0,(ta=t.TextureSourceType||(t.TextureSourceType={}))[ta.none=0]="none",ta[ta.data=1]="data",ta[ta.image=2]="image",ta[ta.compressed=3]="compressed",ta[ta.video=4]="video",ta[ta.canvas=5]="canvas",ta[ta.framebuffer=6]="framebuffer",ta[ta.mipmaps=7]="mipmaps";var rM=function(){function e(e){this.engine=e,this.alphaMaskEnabled=!1,this.maskMode=t.MaskMode.NONE,this.maskable=null,this.stencilClearAction={stencilAction:t.TextureLoadAction.clear}}var i=e.prototype;return i.getRefValue=function(){return 1},i.setMaskOptions=function(e){var i=e.isMask,r=e.inverted,n=e.reference,a=e.alphaMaskEnabled;this.alphaMaskEnabled=void 0!==a&&a,void 0!==i&&i?this.maskMode=t.MaskMode.MASK:(this.maskMode=void 0!==r&&r?t.MaskMode.REVERSE_OBSCURED:t.MaskMode.OBSCURED,this.maskable=this.engine.findObject(n))},i.drawStencilMask=function(t){this.maskable&&(t.clear(this.stencilClearAction),this.maskable.drawStencilMask(t))},e}(),rI=[],rR={},rP="WebGL Constants not in global, please check your environment";function rO(){"function"==typeof WebGL2RenderingContext?rN(WebGL2RenderingContext):"undefined"!=typeof WebGLRenderingContext?(rN(WebGLRenderingContext),rN(WebGLRenderingContext.prototype)):e9?rI.push(e7()?"iOS16 lockdown mode, WebGL Constants not in global":rP):rI.push(rP),rI.length||"HALF_FLOAT"in rR||(rR.HALF_FLOAT=5131)}function rN(t){for(var e in t)/^[A-Z_]/.test(e)&&(rR[e]=t[e])}function rV(t){switch(t){case tL.ALPHA:case tL.ADD:case tL.SUBTRACTION:case tL.STRONG_LIGHT:case tL.WEAK_LIGHT:return 1;case tL.SUPERPOSITION:return 2;case tL.BRIGHTNESS:return 3;case tL.MULTIPLY:return 0;default:return 1}}function rL(t,e){switch(e){case void 0:case tL.ALPHA:t.blendFunction=[rR.ONE,rR.ONE_MINUS_SRC_ALPHA,rR.ONE,rR.ONE_MINUS_SRC_ALPHA];break;case tL.ADD:t.blendFunction=[rR.ONE,rR.ONE,rR.ONE,rR.ONE];break;case tL.SUBTRACTION:t.blendFunction=[rR.ONE,rR.ONE,rR.ZERO,rR.ONE],t.blendEquation=[rR.FUNC_REVERSE_SUBTRACT,rR.FUNC_REVERSE_SUBTRACT];break;case tL.SUPERPOSITION:t.blendFunction=[rR.ONE,rR.ONE,rR.ONE,rR.ONE];break;case tL.MULTIPLY:t.blendFunction=[rR.DST_COLOR,rR.ONE_MINUS_SRC_ALPHA,rR.DST_COLOR,rR.ONE_MINUS_SRC_ALPHA];break;case tL.BRIGHTNESS:t.blendFunction=[rR.ONE,rR.ONE_MINUS_SRC_ALPHA,rR.ONE,rR.ONE_MINUS_SRC_ALPHA];break;case tL.STRONG_LIGHT:t.blendFunction=[rR.DST_COLOR,rR.DST_ALPHA,rR.ZERO,rR.ONE];break;case tL.WEAK_LIGHT:t.blendFunction=[rR.DST_COLOR,rR.ZERO,rR.ZERO,rR.ONE];break;default:console.warn("BlendMode "+e+" not in specification, please set blend params separately.")}}function rF(t,e){e===tF.DOUBLE?t.culling=!1:(t.culling=!0,t.frontFace=rR.CW,t.cullFace=e===tF.BACK?rR.BACK:rR.FRONT)}function rD(e,i){switch(i){case void 0:e.stencilTest=!1;break;case t.MaskMode.MASK:e.stencilTest=!0,e.stencilFunc=[rR.ALWAYS,rR.ALWAYS],e.stencilOpZPass=[rR.REPLACE,rR.REPLACE];break;case t.MaskMode.OBSCURED:e.stencilTest=!0,e.stencilFunc=[rR.EQUAL,rR.EQUAL];break;case t.MaskMode.REVERSE_OBSCURED:e.stencilTest=!0,e.stencilFunc=[rR.NOTEQUAL,rR.NOTEQUAL];break;case t.MaskMode.NONE:e.stencilTest=!1;break;default:console.warn("MaskMode "+i+" not in specification, please set stencil params seperately.")}}rI.length||rO();var rk=function(t){function e(e){var i;return(i=t.call(this,e)||this).meshCollider=new a3,i.getHitTestParams=function(t){var e=i.transform.getWorldMatrix();i.meshCollider.setGeometry(i.geometry,e);var r=i.meshCollider.getBoundingBoxData();if(r)return{type:r.type,triangles:r.area}},i.maskManager=new rM(e),i}iN(e,t);var i=e.prototype;return i.render=function(t){for(var e=0;e<this.materials.length;e++){var i=this.materials[e];t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),i,e)}},i.drawStencilMask=function(t){if(this.isActiveAndEnabled)for(var e=0;e<this.materials.length;e++){var i=this.materials[e],r=i.colorMask;i.colorMask=!1,t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),i,e),i.colorMask=r}},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.mask;i&&this.maskManager.setMaskOptions(i);for(var r,n=iD(this.materials);!(r=n()).done;){var a=r.value,o=this.maskManager.getRefValue();a.stencilRef=[o,o],rD(a,this.maskManager.maskMode)}},e}(rA);ek([ij(void 0,void 0)],rk.prototype,"geometry",void 0),t.EffectComponent=function(t){function e(e){var i;return(i=t.call(this,e)||this).time=0,i.name="EffectComponent",i}iN(e,t);var i=e.prototype;return i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.onUpdate=function(t){var e,i=this.time,r=null!=(e=this.material.getVector4("_Time"))?e:new e0;this.material.setVector4("_Time",r.set(i/20,i,2*i,3*i)),this.time+=t/1e3},i.fromData=function(e){t.prototype.fromData.call(this,e),this.material=this.materials[0]},e}(rk),t.EffectComponent=ek([iU(el.EffectComponent)],t.EffectComponent);var rz=new e$(0,0,0),rB=new e$(0,0,0),rU=function(){this.target=null,this.weight=1};t.PositionConstraint=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.positionAtRest=new e$(0,0,0),e.positionOffset=new e$(0,0,0),e.weight=1,e.constrainX=!0,e.constrainY=!0,e.constrainZ=!0,e.targets=[],e}iN(e,t);var i=e.prototype;return i.onStart=function(){var t=this.item.transform.getWorldPosition();this.positionAtRest.copyFrom(t)},i.onUpdate=function(t){if(0!==this.targets.length){rz.set(0,0,0);for(var e,i=0,r=iD(this.targets);!(e=r()).done;){var n=e.value;if(n.target){var a=n.target.transform.getWorldPosition(),o=n.weight;rz.x+=a.x*o,rz.y+=a.y*o,rz.z+=a.z*o,i+=o}}i>0&&(rz.x/=i,rz.y/=i,rz.z/=i),rz.x+=this.positionOffset.x,rz.y+=this.positionOffset.y,rz.z+=this.positionOffset.z,rB.set(this.lerp(this.positionAtRest.x,rz.x,this.weight),this.lerp(this.positionAtRest.y,rz.y,this.weight),this.lerp(this.positionAtRest.z,rz.z,this.weight)),rz.copyFrom(this.item.transform.getWorldPosition());var s=this.constrainX?rB.x:rz.x,u=this.constrainY?rB.y:rz.y,h=this.constrainZ?rB.z:rz.z;this.item.transform.setWorldPosition(s,u,h)}},i.addTarget=function(t,e){void 0===e&&(e=1);var i=new rU;i.target=t,i.weight=Math.max(0,Math.min(1,e)),this.targets.push(i)},i.removeTarget=function(t){var e=this.targets.findIndex(function(e){return e.target===t});-1!==e&&this.targets.splice(e,1)},i.clearTargets=function(){this.targets=[]},i.setPositionOffset=function(t,e,i){this.positionOffset.set(t,e,i)},i.setWeight=function(t){this.weight=Math.max(0,Math.min(1,t))},i.lerp=function(t,e,i){return t+(e-t)*i},i.fromData=function(e){t.prototype.fromData.call(this,e),this.positionAtRest.copyFrom(e.positionAtRest),this.positionOffset.copyFrom(e.positionOffset),this.weight=e.weight,this.constrainX=e.constrainX,this.constrainY=e.constrainY,this.constrainZ=e.constrainZ,this.targets=[];for(var i,r=iD(e.targets);!(i=r()).done;){var n=i.value,a=new rU;a.target=this.engine.findObject(n.target),a.weight=n.weight,this.targets.push(a)}},e}(rS),t.PositionConstraint=ek([iU("PositionConstraint")],t.PositionConstraint),t.PostProcessVolume=function(t){function e(e){var i;return(i=t.call(this,e)||this).bloom={threshold:0,intensity:0,active:!1},i.vignette={intensity:0,smoothness:0,roundness:0,active:!1},i.tonemapping={active:!1},i.colorAdjustments={brightness:0,saturation:0,contrast:0,active:!1},i}return iN(e,t),e.prototype.onStart=function(){var t=this.item.composition;t&&(t.renderFrame.globalVolume=this)},e}(rS),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"bloom",void 0),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"vignette",void 0),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"tonemapping",void 0),ek([ij(void 0,void 0)],t.PostProcessVolume.prototype,"colorAdjustments",void 0),t.PostProcessVolume=ek([iU(el.PostProcessVolume)],t.PostProcessVolume);var rG=function(){function t(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===o&&(o=0),void 0===s&&(s=0),void 0===u&&(u=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===c&&(c=0),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===m&&(m=1),this.elements=[t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[1]=e,v[2]=i,v[3]=r,v[4]=n,v[5]=a,v[6]=o,v[7]=s,v[8]=u,v[9]=h,v[10]=l,v[11]=c,v[12]=f,v[13]=d,v[14]=p,v[15]=m,this},e.setFromRowMajorData=function(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=i,v[12]=r,v[1]=n,v[5]=a,v[9]=o,v[13]=s,v[2]=u,v[6]=h,v[10]=l,v[14]=c,v[3]=f,v[7]=d,v[11]=p,v[15]=m,this},e.setFromColumnVectors=function(t,e,i,r){return this.set(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,i.x,i.y,i.z,i.w,r.x,r.y,r.z,r.w)},e.setFromMatrix3=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1),this},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[e+i];return this},e.setFromScale=function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)},e.setFromTranslation=function(t,e,i){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1)},e.setFromRotationX=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1)},e.setFromRotationY=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1)},e.setFromRotationZ=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1)},e.setFromRotationAxis=function(e,i){var r=t.tempVec0;r.copyFrom(e).normalize();var n=Math.cos(i),a=Math.sin(i),o=1-n,s=r.x,u=r.y,h=r.z,l=o*s,c=o*u;return this.set(l*s+n,l*u+a*h,l*h-a*u,0,l*u-a*h,c*u+n,c*h+a*s,0,l*h+a*u,c*h-a*s,o*h*h+n,0,0,0,0,1)},e.setFromEuler=function(t){return t.toMatrix4(this),this},e.setFromQuaternion=function(t){return this.compose(e$.ZERO,t,e$.ONE)},e.setFromShear=function(t,e,i){return this.set(1,t,t,0,e,1,e,0,i,i,1,0,0,0,0,1)},e.setFromBasis=function(t,e,i){return this.set(t.x,t.y,t.z,0,e.x,e.y,e.z,0,i.x,i.y,i.z,0,0,0,0,1)},e.setZero=function(){for(var t=0;t<16;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},e.isIdentity=function(){var t=this.elements;return 1===t[0]&&0===t[4]&&0===t[8]&&0===t[12]&&0===t[1]&&1===t[5]&&0===t[9]&&0===t[13]&&0===t[2]&&0===t[6]&&1===t[10]&&0===t[14]&&0===t[3]&&0===t[7]&&0===t[11]&&1===t[15]},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[4*t],this.elements[4*t+1],this.elements[4*t+2],this.elements[4*t+3])},e.lookAt=function(e,i,r){var n=t.tempVec0,a=t.tempVec1,o=t.tempVec2;o.subtractVectors(e,i),o.normalize(),n.crossVectors(r,o),n.normalize(),a.crossVectors(o,n);var s=this.elements;return s[0]=n.x,s[1]=a.x,s[2]=o.x,s[3]=0,s[4]=n.y,s[5]=a.y,s[6]=o.y,s[7]=0,s[8]=n.z,s[9]=a.z,s[10]=o.z,s[11]=0,s[12]=-n.dot(e),s[13]=-a.dot(e),s[14]=-o.dot(e),s[15]=1,this},e.addScaledMatrix=function(t,e){for(var i=this.elements,r=t.elements,n=0;n<16;n++)i[n]+=r[n]*e;return this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<16;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],o=i[4],s=i[8],u=i[12],h=i[1],l=i[5],c=i[9],f=i[13],d=i[2],p=i[6],m=i[10],v=i[14],y=i[3],g=i[7],x=i[11],b=i[15],T=r[0],_=r[4],E=r[8],C=r[12],S=r[1],w=r[5],A=r[9],M=r[13],I=r[2],R=r[6],P=r[10],O=r[14],N=r[3],V=r[7],L=r[11],F=r[15];return n[0]=a*T+o*S+s*I+u*N,n[4]=a*_+o*w+s*R+u*V,n[8]=a*E+o*A+s*P+u*L,n[12]=a*C+o*M+s*O+u*F,n[1]=h*T+l*S+c*I+f*N,n[5]=h*_+l*w+c*R+f*V,n[9]=h*E+l*A+c*P+f*L,n[13]=h*C+l*M+c*O+f*F,n[2]=d*T+p*S+m*I+v*N,n[6]=d*_+p*w+m*R+v*V,n[10]=d*E+p*A+m*P+v*L,n[14]=d*C+p*M+m*O+v*F,n[3]=y*T+g*S+x*I+b*N,n[7]=y*_+g*w+x*R+b*V,n[11]=y*E+g*A+x*P+b*L,n[15]=y*C+g*M+x*O+b*F,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[4],r=t[8],n=t[12],a=t[1],o=t[5],s=t[9],u=t[13],h=t[2],l=t[6],c=t[10],f=t[14];return t[3]*(+n*s*l-r*u*l-n*o*c+i*u*c+r*o*f-i*s*f)+t[7]*(+e*s*f-e*u*c+n*a*c-r*a*f+r*u*h-n*s*h)+t[11]*(+e*u*l-e*o*f-n*a*l+i*a*f+n*o*h-i*u*h)+t[15]*(-r*o*h-e*s*l+e*o*c+r*a*l-i*a*c+i*s*h)},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.invert=function(){var t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],a=t[4],o=t[5],s=t[6],u=t[7],h=t[8],l=t[9],c=t[10],f=t[11],d=t[12],p=t[13],m=t[14],v=t[15],y=l*m*u-p*c*u+p*s*f-o*m*f-l*s*v+o*c*v,g=d*c*u-h*m*u-d*s*f+a*m*f+h*s*v-a*c*v,x=h*p*u-d*l*u+d*o*f-a*p*f-h*o*v+a*l*v,b=d*l*s-h*p*s-d*o*c+a*p*c+h*o*m-a*l*m,T=e*y+i*g+r*x+n*b;if(0===T)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var _=1/T;return t[0]=y*_,t[1]=(p*c*n-l*m*n-p*r*f+i*m*f+l*r*v-i*c*v)*_,t[2]=(o*m*n-p*s*n+p*r*u-i*m*u-o*r*v+i*s*v)*_,t[3]=(l*s*n-o*c*n-l*r*u+i*c*u+o*r*f-i*s*f)*_,t[4]=g*_,t[5]=(h*m*n-d*c*n+d*r*f-e*m*f-h*r*v+e*c*v)*_,t[6]=(d*s*n-a*m*n-d*r*u+e*m*u+a*r*v-e*s*v)*_,t[7]=(a*c*n-h*s*n+h*r*u-e*c*u-a*r*f+e*s*f)*_,t[8]=x*_,t[9]=(d*l*n-h*p*n-d*i*f+e*p*f+h*i*v-e*l*v)*_,t[10]=(a*p*n-d*o*n+d*i*u-e*p*u-a*i*v+e*o*v)*_,t[11]=(h*o*n-a*l*n-h*i*u+e*l*u+a*i*f-e*o*f)*_,t[12]=b*_,t[13]=(h*p*r-d*l*r+d*i*c-e*p*c-h*i*m+e*l*m)*_,t[14]=(d*o*r-a*p*r-d*i*s+e*p*s+a*i*m-e*o*m)*_,t[15]=(a*l*r-h*o*r+h*i*s-e*l*s-a*i*c+e*o*c)*_,this},e.extractBasis=function(t,e,i){var r=this.elements;return t.set(r[0],r[1],r[2]),e.set(r[4],r[5],r[6]),i.set(r[8],r[9],r[10]),this},e.compose=function(t,e,i,r){void 0===r&&(r=e$.ZERO);var n=this.elements,a=e.x,o=e.y,s=e.z,u=e.w,h=-r.x,l=-r.y,c=-r.z,f=a+a,d=o+o,p=s+s,m=a*f,v=a*d,y=a*p,g=o*d,x=o*p,b=s*p,T=u*f,_=u*d,E=u*p,C=i.x,S=i.y,w=i.z;return n[0]=(1-(g+b))*C,n[1]=(v+E)*C,n[2]=(y-_)*C,n[3]=0,n[4]=(v-E)*S,n[5]=(1-(m+b))*S,n[6]=(x+T)*S,n[7]=0,n[8]=(y+_)*w,n[9]=(x-T)*w,n[10]=(1-(m+g))*w,n[11]=0,n[12]=h*n[0]+l*n[4]+c*n[8]-h+t.x,n[13]=h*n[1]+l*n[5]+c*n[9]-l+t.y,n[14]=h*n[2]+l*n[6]+c*n[10]-c+t.z,this},e.decompose=function(e,i,r){var n=t.tempVec0,a=this.elements,o=n.set(a[0],a[1],a[2]).length(),s=n.set(a[4],a[5],a[6]).length(),u=n.set(a[8],a[9],a[10]).length();0>this.determinant()&&(o=-o),e.x=a[12],e.y=a[13],e.z=a[14];var h=t.tempMat0;h.copyFrom(this);var l=1/o,c=1/s,f=1/u;return h.elements[0]*=l,h.elements[1]*=l,h.elements[2]*=l,h.elements[4]*=c,h.elements[5]*=c,h.elements[6]*=c,h.elements[8]*=f,h.elements[9]*=f,h.elements[10]*=f,i.setFromRotationMatrix(h),r.x=o,r.y=s,r.z=u,this},e.getTranslation=function(t){var e=this.elements;return t.set(e[12],e[13],e[14])},e.getScale=function(t){var e=this.elements;return t.set(Math.hypot(e[0],e[1],e[2]),Math.hypot(e[4],e[5],e[6]),Math.hypot(e[8],e[9],e[10]))},e.getTransform=function(){var t=new e$,e=new i5,i=new e$;return this.decompose(t,e,i),{translation:t,rotation:e,scale:i}},e.orthographic=function(t,e,i,r,n,a){var o=1/(e-t),s=1/(i-r),u=1/(a-n),h=-(e+t)*o,l=-(i+r)*s,c=-(a+n)*u;o*=2,s*=2,u*=-2;var f=this.elements;return f[0]=o,f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[5]=s,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[10]=u,f[11]=0,f[12]=h,f[13]=l,f[14]=c,f[15]=1,this},e.perspective=function(t,e,i,r,n){var a=1/Math.tan(.5*t),o=1/(i-r),s=this.elements;return s[0]=n?a:a/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=n?a*e:a,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(r+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*r*i*o,s[15]=0,(null===r||r===1/0)&&(s[10]=-1,s[14]=-2*i),this},e.projectPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;o.x=a[0]*i+a[4]*r+a[8]*n+a[12],o.y=a[1]*i+a[5]*r+a[9]*n+a[13],o.z=a[2]*i+a[6]*r+a[10]*n+a[14];var s=a[3]*i+a[7]*r+a[11]*n+a[15];return o.multiply(1/s)},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[4]*r+a[8]*n+a[12],o.y=a[1]*i+a[5]*r+a[9]*n+a[13],o.z=a[2]*i+a[6]*r+a[10]*n+a[14],o},e.transformNormal=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[4]*r+a[8]*n,o.y=a[1]*i+a[5]*r+a[9]*n,o.z=a[2]*i+a[6]*r+a[10]*n,o.normalize()},e.transformVector4=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,o=this.elements,s=null!=e?e:t;return s.x=o[0]*i+o[4]*r+o[8]*n+o[12]*a,s.y=o[1]*i+o[5]*r+o[9]*n+o[13]*a,s.z=o[2]*i+o[6]*r+o[10]*n+o[14]*a,s.w=o[3]*i+o[7]*r+o[11]*n+o[15]*a,s},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<16;r++)if(!eq(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15]},t.fromIdentity=function(){return new t(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},t.fromLookAt=function(e,i,r){return new t().lookAt(e,i,r)},t.fromPerspective=function(e,i,r,n,a){return new t().perspective(e,i,r,n,a)},t.fromColumnVectors=function(e,i,r,n){return new t().setFromColumnVectors(e,i,r,n)},t.fromMatrix3=function(e){return new t().setFromMatrix3(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromScale=function(e,i,r){return new t().setFromScale(e,i,r)},t.fromTranslation=function(e,i,r){return new t().setFromTranslation(e,i,r)},t.fromRotationX=function(e){return new t().setFromRotationX(e)},t.fromRotationY=function(e){return new t().setFromRotationY(e)},t.fromRotationZ=function(e){return new t().setFromRotationZ(e)},t.fromRotationAxis=function(e,i){return new t().setFromRotationAxis(e,i)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromShear=function(e,i,r){return new t().setFromShear(e,i,r)},t.fromBasis=function(e,i,r){return new t().setFromBasis(e,i,r)},t.fromRowMajorData=function(e,i,r,n,a,o,s,u,h,l,c,f,d,p,m,v){return new t(e,a,h,d,i,o,l,p,r,s,c,m,n,u,f,v)},t}();rG.IDENTITY=new rG(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),rG.ZERO=new rG(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),rG.tempVec0=new e$,rG.tempVec1=new e$,rG.tempVec2=new e$,rG.tempMat0=new rG;var rj=function(){function t(){this.callbacks={}}var e=t.prototype;return e.downloadJSON=function(t,e,i){this.download(t,"json",e,i)},e.downloadBinary=function(t,e,i){this.download(t,"arraybuffer",e,i)},e.downloadBlob=function(t,e,i){this.download(t,"blob",e,i)},e.downloadText=function(t,e,i){this.download(t,"text",e,i)},e.download=function(e,i,r,n){var a=this;if(void 0===i&&(i="json"),!this.start(e,r,n)){var o=new XMLHttpRequest,s=function(){a.finish(e,o.status,o.response)};o.responseType=i,o.addEventListener("load",function(){200==o.status||0==o.status&&t.trustXHRStatusZero?a.finish(e,200,o.response):s()}),o.addEventListener("error",s),o.open("GET",e,!0),o.send()}},e.start=function(t,e,i){var r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,i)}},e.finish=function(e,i,r){var n=this.callbacks[e];delete this.callbacks[e];for(var a=200==i||0==i&&t.trustXHRStatusZero?[r]:[i,r],o=a.length-1,s=n.length;o<s;o+=2)n[o].apply(null,a)},t}();rj.trustXHRStatusZero=!1;var rW=!1,rX=!1;function rH(t,e){return rY.apply(this,arguments)}function rY(){return(rY=eL(function(t,e){return ez(this,function(i){switch(i.label){case 0:if(!(rW||!e))return[3,2];return[4,rQ(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rQ(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rW=!0,[4,rQ(t)];case 6:return[2]}})})).apply(this,arguments)}function rZ(t,e){return rq.apply(this,arguments)}function rq(){return(rq=eL(function(t,e){return ez(this,function(i){switch(i.label){case 0:if(!(rX||!e))return[3,2];return[4,rQ(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rQ(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rX=!0,[4,rQ(t)];case 6:return[2]}})})).apply(this,arguments)}function rQ(t){return rK.apply(this,arguments)}function rK(){return(rK=eL(function(t){var e,i;return ez(this,function(r){if(e="",eF(t,HTMLImageElement)){if(t.complete)return[2,t];e=t.src}else eF(t,Blob)?(e=URL.createObjectURL(t),i=!0):"string"==typeof t&&(e=t);if(!e)throw Error("Invalid url type: "+JSON.stringify(t)+".");return[2,new Promise(function(t,r){var n=new Image;/^data:/.test(e)||(n.crossOrigin="*"),n.onload=function(){return n.onload=null,i&&URL.revokeObjectURL(e),t(n)},n.onerror=function(t){return n.onerror=null,i&&URL.revokeObjectURL(e),r("Load image fail: "+e+", reason: "+JSON.stringify(t))},n.src=e})]})})).apply(this,arguments)}function rJ(t){return r$.apply(this,arguments)}function r$(){return(r$=eL(function(t){return ez(this,function(e){return[2,new Promise(function(e,i){new rj().downloadBinary(t,e,function(e,r){i("Couldn't load bins "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r0(){return(r0=eL(function(t){return ez(this,function(e){return[2,new Promise(function(e,i){new rj().downloadBlob(t,e,function(e,r){i("Couldn't load blob "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r1(t){return r2.apply(this,arguments)}function r2(){return(r2=eL(function(t){var e;return ez(this,function(i){return e=document.createElement("video"),"string"==typeof t?e.src=t:e.srcObject=t,e.crossOrigin="anonymous",e.muted=!0,it()&&e.setAttribute("renderer","standard"),e.setAttribute("playsinline","playsinline"),[2,new Promise(function(t,i){var r=e.play().catch(function(t){i(t)});r?r.then(function(){return t(e)}):e.addEventListener("loadeddata",function i(){t(e),e.removeEventListener("loadeddata",i)},!0),e.addEventListener("error",function(t){i("Load video fail.")})})]})})).apply(this,arguments)}function r3(t,e){return r4.apply(this,arguments)}function r4(){return(r4=eL(function(t,e){return ez(this,function(i){switch(i.label){case 0:if(!Array.isArray(t))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,e(t[0])];case 2:case 4:return[2,i.sent()];case 3:return i.sent(),[4,e(t[1])];case 5:return[2,e(t)]}})})).apply(this,arguments)}function r5(t,e,i){return r6.apply(this,arguments)}function r6(){return(r6=eL(function(e,i,r,n){var a,o,s,u,h,l,c;return ez(this,function(f){switch(f.label){case 0:if(void 0===n&&(n=[]),34067!==e.target)return[3,2];return a=e.mipmaps,o=e.target,[4,Promise.all(a.map(function(t){return Promise.all(t.map(function(t){return t.id?r[t.id]:r8(t,i)}))}))];case 1:return s=f.sent(),[2,i2({keepImageSource:!1},e,{mipmaps:s,sourceFrom:{target:o,type:t.TextureSourceType.mipmaps}})];case 2:return u=e.mipmaps,h=e.target,[4,Promise.all(u.map(function(t){return r8(t,i)}))];case 3:return l=f.sent(),c=n[u[0][1][0]].url,[2,i2({keepImageSource:!1},e,{mipmaps:l,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{target:h,bin:c,type:t.TextureSourceType.mipmaps,mipmaps:u.map(function(t){return[t[1][1],t[1][2]]})}})];case 4:return[2]}})})).apply(this,arguments)}function r8(t,e){return r9.apply(this,arguments)}function r9(){return(r9=eL(function(t,e){var i,r,n,a,o;return ez(this,function(s){if(r=(i=t[1])[0],n=i[1],a=i[2],!(o=e[r]))throw Error("Invalid bin pointer: "+JSON.stringify(t)+".");return[2,rQ(new Blob([new Uint8Array(o,n,a)]))]})})).apply(this,arguments)}var r7=1,nt=function(e){function i(t){var i;return(i=e.call(this,t)||this).destroyed=!1,i.id="Tex"+r7++,i}iN(i,e);var r=i.prototype;return r.getWidth=function(){return this.width||0},r.getHeight=function(){return this.height||0},r.uploadCurrentVideoFrame=function(){},r.offloadData=function(){},r.reloadData=function(){},r.initialize=function(){},r.assembleOptions=function(e){var i=e.target,r=void 0===i?rR.TEXTURE_2D:i,n=e.format,a=void 0===n?rR.RGBA:n;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=0),i2({minFilter:rR.NEAREST,magFilter:rR.NEAREST,wrapS:rR.CLAMP_TO_EDGE,wrapT:rR.CLAMP_TO_EDGE,target:r,format:rR.RGBA,internalFormat:a,type:rR.UNSIGNED_BYTE},e)},i.fromImage=function(e,r,n){return eL(function(){var a,o;return ez(this,function(s){switch(s.label){case 0:return[4,rQ(e)];case 1:return a=s.sent(),(o=i.create(r,i2({sourceType:t.TextureSourceType.image,image:a,target:rR.TEXTURE_2D,id:i_(),flipY:!0},n))).initialize(),[2,o]}})})()},i.fromVideo=function(e,r,n){return eL(function(){var a,o;return ez(this,function(s){switch(s.label){case 0:return[4,r1(e)];case 1:return a=s.sent(),(o=i.create(r,i2({sourceType:t.TextureSourceType.video,video:a,id:i_(),flipY:!0},n))).initialize(),[2,o]}})})()},rC(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(iW);function ne(t,e,i,r){var n,a,o=e.length/i/r;return a=n=4===o||0===o?rR.RGBA:3===o?rR.RGB:2===o?rR.LUMINANCE_ALPHA:rR.LUMINANCE,nt.createWithData(t,{data:e,width:i,height:r},{type:rR.HALF_FLOAT,format:n,internalFormat:a,wrapS:rR.CLAMP_TO_EDGE,wrapT:rR.CLAMP_TO_EDGE})}var ni={type:rR.UNSIGNED_BYTE,format:rR.RGBA,internalFormat:rR.RGBA,wrapS:rR.MIRRORED_REPEAT,wrapT:rR.MIRRORED_REPEAT,minFilter:rR.NEAREST,magFilter:rR.NEAREST};function nr(e){return nt.create(e,i2({id:iV.WhiteTexture,data:{width:1,height:1,data:new Uint8Array([255,255,255,255])},sourceType:t.TextureSourceType.data},ni))}function nn(e){return nt.create(e,i2({id:iV.TransparentTexture,data:{width:1,height:1,data:new Uint8Array([0,0,0,0])},sourceType:t.TextureSourceType.data},ni))}var na=new(function(){function t(){this.loaders=new Map,this.instances=new Map}var e=t.prototype;return e.register=function(t,e){this.loaders.has(t)&&console.warn('TextureLoader for type "'+t+'" is already registered, overwriting.'),this.loaders.set(t,e)},e.unregister=function(t){var e=this.instances.get(t);e&&(e.dispose(),this.instances.delete(t)),this.loaders.delete(t)},e.getLoader=function(t){if(this.instances.has(t))return this.instances.get(t);var e=this.loaders.get(t);if(!e)return console.error('TextureLoader for type "'+t+'" is not registered.'),null;var i=e();return this.instances.set(t,i),i},e.has=function(t){return this.loaders.has(t)},e.getRegisteredTypes=function(){return Array.from(this.loaders.keys())},e.dispose=function(){this.instances.forEach(function(t){return t.dispose()}),this.instances.clear(),this.loaders.clear()},t}()),no=function(){function e(){this.reloadPending={}}var i=e.prototype;return i.reload=function(t){var e=this;return eL(function(){var i,r;return ez(this,function(n){switch(n.label){case 0:if(i=t.id,e.reloadPending[i])return[2];if(!t.sourceFrom)return[3,2];return e.reloadPending[i]=!0,[4,e.loadSource(t.sourceFrom)];case 1:return r=n.sent(),t.updateSource(r),e.reloadPending[i]=!1,[3,3];case 2:throw Error("No source from.");case 3:return[2]}})})()},i.canOffloadTexture=function(e){if(e){var i=e.type;if(i===t.TextureSourceType.compressed||i===t.TextureSourceType.image){var r=e.target,n=e.map,a=e.url;return r===rR.TEXTURE_CUBE_MAP?"object"==typeof n&&!!n:im(a)&&a.length>0}if(i===t.TextureSourceType.mipmaps){var o=e.bin,s=e.mipmaps,u=e.target,h=e.maps,l=e.urls;return o?s.length>0:u===rR.TEXTURE_CUBE_MAP?h.every(function(t){return"object"==typeof t&&t}):l.every(function(t){return im(t)&&t.length>0})}}return!1},i.loadSource=function(e,i){var r=this;return eL(function(){var n,a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,S;return ez(this,function(w){switch(w.label){case 0:if(n=e.type,a=e.target,o=e.map,s=e.url,u=e.bin,h=e.mipmaps,l=e.urls,c=e.maps,!(a===rR.TEXTURE_CUBE_MAP&&n!==t.TextureSourceType.mipmaps))return[3,2];return[4,r.loadCubeMap(o)];case 1:return f=w.sent(),[2,i2({},i,{cube:f,target:rR.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.image,sourceFrom:{type:t.TextureSourceType.image,map:i2({},o),target:rR.TEXTURE_CUBE_MAP}})];case 2:if(n!==t.TextureSourceType.image)return[3,4];return[4,rQ(s)];case 3:return d=w.sent(),[2,i2({},i,{image:d,sourceType:t.TextureSourceType.image,sourceFrom:{type:n,url:s,target:rR.TEXTURE_2D}})];case 4:if(n!==t.TextureSourceType.video)return[3,6];return[4,r1(s)];case 5:return p=w.sent(),[2,i2({},i,{video:p,sourceType:t.TextureSourceType.video})];case 6:if(n!==t.TextureSourceType.compressed)return[3,14];return[4,rJ(s)];case 7:if(m=w.sent(),!(v=na.getLoader("ktx2")))return[3,12];w.label=8;case 8:return w.trys.push([8,10,,11]),[4,v.loadFromBuffer(m)];case 9:if((y=w.sent()).sourceType===t.TextureSourceType.compressed)return[2,i2({sourceType:y.sourceType,type:y.type,target:y.target,internalFormat:y.internalFormat,format:y.format,mipmaps:y.mipmaps,minFilter:rR.LINEAR,magFilter:rR.LINEAR,sourceFrom:e},i)];return[3,11];case 10:throw g=w.sent(),Error("Failed to parse KTX2 from "+(null!=(x=null==e?void 0:e.url)?x:"buffer")+": "+(g.message||g));case 11:return[3,13];case 12:throw Error("KTX2 loader not found. Please register it first.");case 13:return[3,23];case 14:if(n!==t.TextureSourceType.mipmaps)return[3,23];if(!u)return[3,19];return[4,rJ(u)];case 15:if(b=w.sent(),_=(T=null!=a?a:rR.TEXTURE_2D)===rR.TEXTURE_2D?h.slice():h.map(function(t){return t.slice()}),a!==rR.TEXTURE_CUBE_MAP)return[3,17];return[4,Promise.all(h.map(function(t){return r.loadMipmapImages(t,b)}))];case 16:return E=w.sent(),[3,18];case 17:E=r.loadMipmapImages(h,b),w.label=18;case 18:return[2,i2({},i,{mipmaps:E,target:T,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{bin:u,mipmaps:_,target:T,type:t.TextureSourceType.mipmaps}})];case 19:if(!(a===rR.TEXTURE_2D||!a))return[3,21];return[4,Promise.all(l.map(function(t){return rQ(t)}))];case 20:return C=w.sent(),[2,i2({},i,{mipmaps:C,target:rR.TEXTURE_2D,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,urls:l.slice(),target:rR.TEXTURE_2D}})];case 21:if(a!==rR.TEXTURE_CUBE_MAP)return[3,23];return[4,Promise.all(c.map(function(t){return r.loadCubeMap(t)}))];case 22:return S=w.sent(),[2,i2({},i,{mipmaps:S,target:rR.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,maps:c.map(function(t){return i2({},t)}),target:rR.TEXTURE_CUBE_MAP}})];case 23:throw Error("Invalid resource type: "+n+".")}})})()},i.loadMipmapImages=function(t,e){return eL(function(){return ez(this,function(i){return[2,Promise.all(t.map(function(t){return rQ(new Blob([new Uint8Array(e,t[0],t[1])]))}))]})})()},i.loadCubeMap=function(t){return eL(function(){return ez(this,function(e){return[2,Promise.all(t.map(function(t){return rQ(t)}))]})})()},e}(),ns=function(){function t(t){this.destroyed=!1;var e=t.name;this.name=void 0===e?"defaultDataBlock":e}var e=t.prototype;return e.setUniformValues=function(t){var e=this;Object.keys(t).forEach(function(i){e.setUniformValue(i,t[i])})},e.invalidAllFlags=function(){},e.updateUniformSubData=function(t,e,i){},t}();function nu(t){return"object"==typeof t&&t&&void 0===t.length&&eF(t,nt)}t.MaterialRenderType=void 0,(to=t.MaterialRenderType||(t.MaterialRenderType={}))[to.normal=0]="normal",to[to.transformFeedback=1]="transformFeedback";var nh=1,nl=function(t){function e(e,i){var r;if((r=t.call(this,e)||this).stringTags={},r.enabledMacros={},r.destroyed=!1,r.initialized=!1,r.shaderDirty=!0,i){var n=i.name,a=void 0===n?"Material"+nh++:n,o=i.renderType,s=i.shader;r.name=a,r.renderType=void 0===o?0:o,r.shaderSource=s,r.props=i}else r.name="Material"+nh++,r.renderType=0;return r}iN(e,t);var i=e.prototype;return i.initialize=function(){},i.createShaderVariant=function(){},i.use=function(t,e){},rC(e,[{key:"shader",get:function(){return this._shader},set:function(t){this._shader!==t&&(this._shader=t,this.shaderDirty=!0)}},{key:"mainTexture",get:function(){return this.getTexture("_MainTex")},set:function(t){this.setTexture("_MainTex",t)}},{key:"color",get:function(){return this.getColor("_Color")},set:function(t){this.setColor("_Color",t)}},{key:"blending",set:function(t){}},{key:"blendFunction",set:function(t){}},{key:"blendEquation",set:function(t){}},{key:"depthTest",set:function(t){}},{key:"depthMask",set:function(t){}},{key:"stencilTest",set:function(t){}},{key:"stencilRef",set:function(t){}},{key:"stencilFunc",set:function(t){}},{key:"stencilOpZPass",set:function(t){}},{key:"culling",set:function(t){}},{key:"frontFace",set:function(t){}},{key:"cullFace",set:function(t){}},{key:"blendColor",set:function(t){}},{key:"depthRange",set:function(t){}},{key:"depthFunc",set:function(t){}},{key:"polygonOffsetFill",set:function(t){}},{key:"polygonOffset",set:function(t){}},{key:"sampleAlphaToCoverage",set:function(t){}},{key:"stencilMask",set:function(t){}},{key:"stencilOpFail",set:function(t){}},{key:"stencilOpZFail",set:function(t){}}]),e}(iW);t.FilterMode=void 0,(ts=t.FilterMode||(t.FilterMode={}))[ts.Nearest=0]="Nearest",ts[ts.Linear=1]="Linear",t.RenderTextureFormat=void 0,(tu=t.RenderTextureFormat||(t.RenderTextureFormat={}))[tu.RGBA32=0]="RGBA32",tu[tu.RGBAHalf=1]="RGBAHalf";var nc=function(){function t(){}var e=t.prototype;return e.resize=function(t,e,i,r){},e.resetColorTextures=function(t){},e.unbind=function(){},e.bind=function(){},e.getDepthTexture=function(){},e.getStencilTexture=function(){},e.getColorTextures=function(){return[]},e.dispose=function(t){},rC(t,[{key:"stencilStorage",get:function(){}},{key:"depthStorage",get:function(){}}]),t}();t.RenderPassAttachmentStorageType=void 0,(th=t.RenderPassAttachmentStorageType||(t.RenderPassAttachmentStorageType={}))[th.none=0]="none",th[th.color=1]="color",th[th.stencil_8_opaque=2]="stencil_8_opaque",th[th.depth_16_opaque=3]="depth_16_opaque",th[th.depth_stencil_opaque=4]="depth_stencil_opaque",th[th.depth_16_texture=5]="depth_16_texture",th[th.depth_24_stencil_8_texture=6]="depth_24_stencil_8_texture",t.TextureStoreAction=void 0,(tl=t.TextureStoreAction||(t.TextureStoreAction={}))[tl.store=0]="store",tl[tl.clear=2]="clear";var nf=function(){function e(e,i){if(this.destroyed=!1,i){var r=i.texture,n=i.size;if(eF(r,nt))this.texture=r,this.externalTexture=!0;else if(r){var a=r.wrapT,o=r.wrapS,s=r.minFilter,u=r.magFilter,h=r.internalFormat,l=r.format,c=void 0===l?rR.RGBA:l,f=r.type,d=void 0===f?rR.UNSIGNED_BYTE:f;this.externalTexture=!1,this.textureOptions={size:n,format:c,type:d,internalFormat:h||c,wrapT:a,wrapS:o,minFilter:s,magFilter:u,name:i.name},this.texture=nt.create(e,i2({},this.textureOptions,{sourceType:t.TextureSourceType.framebuffer,data:{width:n[0],height:n[1]}}))}}}return e.prototype.dispose=function(){this.destroyed||(this.texture.dispose(),this.destroyed=!0)},rC(e,[{key:"isDestroyed",get:function(){return this.destroyed}},{key:"storageType",get:function(){return 1}},{key:"size",get:function(){var t=this.texture;return t?[t.getWidth(),t.getHeight()]:[0,0]}},{key:"width",get:function(){return this.texture.getWidth()||0}},{key:"height",get:function(){return this.texture.getHeight()||0}}]),e}();t.RenderPassDestroyAttachmentType=void 0,(tc=t.RenderPassDestroyAttachmentType||(t.RenderPassDestroyAttachmentType={}))[tc.force=0]="force",tc[tc.keep=1]="keep",tc[tc.keepExternal=2]="keepExternal",tc[tc.destroy=0]="destroy";var nd=1,np=function(){function e(t){this.priority=0,this.name="RenderPass"+nd++,this.meshes=[],this.disposed=!1,this.framebuffer=null,this.renderer=t}var i=e.prototype;return i.addMesh=function(t){is(this.meshes,t)},i.removeMesh=function(t){eX(this.meshes,t)},i.configure=function(t){},i.execute=function(t){},i.onCameraCleanup=function(t){},i.getViewport=function(){var t,e=null==(t=this.framebuffer)?void 0:t.viewport;if(e)return e;var i=this.renderer;return i?[0,0,i.getWidth(),i.getHeight()]:[0,0,0,0]},i.dispose=function(e){if(!this.disposed){var i=(null==e?void 0:e.meshes)||void 0;i!==t.DestroyOptions.keep&&this.meshes.forEach(function(t){t.dispose(i)}),this.meshes.length=0,this.disposed=!0}},rC(e,[{key:"isDisposed",get:function(){return this.disposed}},{key:"viewport",get:function(){return this.getViewport()}}]),e}(),nm=function(e){function i(t){var i;return(i=e.call(this,t)||this).useRenderTarget=!1,i.priority=1e3,i.name="DrawObjectPass",i}iN(i,e);var r=i.prototype;return r.setup=function(t){this.useRenderTarget=t},r.configure=function(e){this.useRenderTarget&&(this.framebuffer=e.getTemporaryRT("DrawObjectPass",e.getWidth(),e.getHeight(),16,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),e.setFramebuffer(this.framebuffer))},r.execute=function(e){this.useRenderTarget&&e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear}),e.renderMeshes(this.meshes)},r.onCameraCleanup=function(t){this.useRenderTarget&&this.framebuffer&&t.releaseTemporaryRT(this.framebuffer)},i}(np);t.ShaderCompileResultStatus=void 0,(tf=t.ShaderCompileResultStatus||(t.ShaderCompileResultStatus={}))[tf.noShader=0]="noShader",tf[tf.success=1]="success",tf[tf.fail=2]="fail",tf[tf.compiling=3]="compiling",t.GLSLVersion=void 0,(td=t.GLSLVersion||(t.GLSLVersion={})).GLSL1="100",td.GLSL3="300 es";var nv=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).source=i,r}return iN(e,t),e}(iW);t.Shader=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.createVariant=function(t){var e=[];if(t)for(var i,r=iD(Object.keys(t));!(i=r()).done;){var n=i.value;e.push([n,t[n]])}var a=this.engine.getShaderLibrary().createShader(this.shaderData,e);return a.shader=this,a},i.fromData=function(e){t.prototype.fromData.call(this,e),this.shaderData=e},e}(iW),t.Shader=ek([iU(el.Shader)],t.Shader);var ny=((eb={})[rR.FLOAT]=Float32Array.BYTES_PER_ELEMENT,eb[rR.INT]=Int32Array.BYTES_PER_ELEMENT,eb[rR.SHORT]=Int16Array.BYTES_PER_ELEMENT,eb[rR.BYTE]=Int8Array.BYTES_PER_ELEMENT,eb),ng=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="",e.subMeshes=[],e}iN(e,t);var i=e.prototype;return i.initialize=function(){},i.flush=function(){},e}(iW);function nx(t){return t===rR.INT?new Int32Array(0):t===rR.SHORT?new Int16Array(0):new Float32Array(0)}(tp=eT||(eT={}))[tp.XYZ=0]="XYZ",tp[tp.XZY=1]="XZY",tp[tp.YXZ=2]="YXZ",tp[tp.YZX=3]="YZX",tp[tp.ZXY=4]="ZXY",tp[tp.ZYX=5]="ZYX";var nb=function(){function t(e,i,r,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=t.DEFAULT_ORDER),this.x=e,this.y=i,this.z=r,this.order=n}var e=t.prototype;return e.set=function(t,e,i,r){return void 0===r&&(r=this.order),this.x=t,this.y=e,this.z=i,this.order=r,this},e.setZero=function(t){return void 0===t&&(t=this.order),this.set(0,0,0,t)},e.setFromRotationMatrix4=function(t,e){void 0===e&&(e=this.order);var i=t.elements,r=i[0],n=i[4],a=i[8],o=i[1],s=i[5],u=i[9],h=i[2],l=i[6],c=i[10];switch(e){case eT.XYZ:this.y=Math.asin(eK(a,-1,1)),.9999999>Math.abs(a)?(this.x=Math.atan2(-u,c),this.z=Math.atan2(-n,r)):(this.x=Math.atan2(l,s),this.z=0);break;case eT.YXZ:this.x=Math.asin(-eK(u,-1,1)),.9999999>Math.abs(u)?(this.y=Math.atan2(a,c),this.z=Math.atan2(o,s)):(this.y=Math.atan2(-h,r),this.z=0);break;case eT.ZXY:this.x=Math.asin(eK(l,-1,1)),.9999999>Math.abs(l)?(this.y=Math.atan2(-h,c),this.z=Math.atan2(-n,s)):(this.y=0,this.z=Math.atan2(o,r));break;case eT.ZYX:this.y=Math.asin(-eK(h,-1,1)),.9999999>Math.abs(h)?(this.x=Math.atan2(l,c),this.z=Math.atan2(o,r)):(this.x=0,this.z=Math.atan2(-n,s));break;case eT.YZX:this.z=Math.asin(eK(o,-1,1)),.9999999>Math.abs(o)?(this.x=Math.atan2(-u,s),this.y=Math.atan2(-h,r)):(this.x=0,this.y=Math.atan2(a,c));break;case eT.XZY:this.z=Math.asin(-eK(n,-1,1)),.9999999>Math.abs(n)?(this.x=Math.atan2(l,s),this.y=Math.atan2(a,r)):(this.x=Math.atan2(-u,c),this.y=0);break;default:console.error("setFromRotationMatrix: unknown order: "+e)}return this.x*=eZ,this.y*=eZ,this.z*=eZ,this.order=e,this},e.setFromQuaternion=function(e,i){void 0===i&&(i=this.order);var r=t.tempMat0;return r.setFromQuaternion(e),this.setFromRotationMatrix4(r,i)},e.setFromVector3=function(t,e){return void 0===e&&(e=this.order),this.set(t.x,t.y,t.z,e)},e.setFromArray=function(t,e,i){var r,n,a,o;return void 0===e&&(e=0),void 0===i&&(i=this.order),this.x=null!=(r=t[e])?r:0,this.y=null!=(n=t[e+1])?n:0,this.z=null!=(a=t[e+2])?a:0,this.order=null!=(o=t[e+3])?o:i,this},e.clone=function(){return new t(this.x,this.y,this.z,this.order)},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.order=t.order,this},e.add=function(t){return this.order!=t.order?console.error("add euler with different order"):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addEulers=function(t,e){return t.order!=e.order?console.error("add euler with different order"):(this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.order=t.order),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.reorder=function(t){var e=new i5;return e.setFromEuler(this),this.setFromQuaternion(e,t)},e.rotateVector3=function(e,i){return t.tempQuat0.setFromEuler(this).rotateVector3(e,i)},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.order===this.order},e.toVector3=function(t){return t.set(this.x,this.y,this.z)},e.toArray=function(){return[this.x,this.y,this.z]},e.toQuaternion=function(t){var e=this.x,i=this.y,r=this.z,n=this.order,a=Math.cos(e*eY*.5),o=Math.cos(i*eY*.5),s=Math.cos(r*eY*.5),u=Math.sin(e*eY*.5),h=Math.sin(i*eY*.5),l=Math.sin(r*eY*.5);switch(n){case eT.XYZ:t.set(u*o*s+a*h*l,a*h*s-u*o*l,a*o*l+u*h*s,a*o*s-u*h*l);break;case eT.YXZ:t.set(u*o*s+a*h*l,a*h*s-u*o*l,a*o*l-u*h*s,a*o*s+u*h*l);break;case eT.ZXY:t.set(u*o*s-a*h*l,a*h*s+u*o*l,a*o*l+u*h*s,a*o*s-u*h*l);break;case eT.ZYX:t.set(u*o*s-a*h*l,a*h*s+u*o*l,a*o*l-u*h*s,a*o*s+u*h*l);break;case eT.YZX:t.set(u*o*s+a*h*l,a*h*s+u*o*l,a*o*l-u*h*s,a*o*s-u*h*l);break;case eT.XZY:t.set(u*o*s-a*h*l,a*h*s-u*o*l,a*o*l+u*h*s,a*o*s+u*h*l);break;default:console.error("unknown euler order: "+n)}return t},e.toMatrix4=function(t){var e=t.elements,i=this.x,r=this.y,n=this.z,a=this.order,o=Math.cos(i*eY),s=Math.sin(i*eY),u=Math.cos(r*eY),h=Math.sin(r*eY),l=Math.cos(n*eY),c=Math.sin(n*eY);if(a===eT.XYZ){var f=o*l,d=o*c,p=s*l,m=s*c;e[0]=u*l,e[4]=-u*c,e[8]=h,e[1]=d+p*h,e[5]=f-m*h,e[9]=-s*u,e[2]=m-f*h,e[6]=p+d*h,e[10]=o*u}else if(a===eT.YXZ){var v=u*l,y=u*c,g=h*l,x=h*c;e[0]=v+x*s,e[4]=g*s-y,e[8]=o*h,e[1]=o*c,e[5]=o*l,e[9]=-s,e[2]=y*s-g,e[6]=x+v*s,e[10]=o*u}else if(a===eT.ZXY){var b=u*l,T=u*c,_=h*l,E=h*c;e[0]=b-E*s,e[4]=-o*c,e[8]=_+T*s,e[1]=T+_*s,e[5]=o*l,e[9]=E-b*s,e[2]=-o*h,e[6]=s,e[10]=o*u}else if(a===eT.ZYX){var C=o*l,S=o*c,w=s*l,A=s*c;e[0]=u*l,e[4]=w*h-S,e[8]=C*h+A,e[1]=u*c,e[5]=A*h+C,e[9]=S*h-w,e[2]=-h,e[6]=s*u,e[10]=o*u}else if(a===eT.YZX){var M=o*u,I=o*h,R=s*u,P=s*h;e[0]=u*l,e[4]=P-M*c,e[8]=R*c+I,e[1]=c,e[5]=o*l,e[9]=-s*l,e[2]=-h*l,e[6]=I*c+R,e[10]=M-P*c}else if(a===eT.XZY){var O=o*u,N=o*h,V=s*u,L=s*h;e[0]=u*l,e[4]=-c,e[8]=h*l,e[1]=O*c+L,e[5]=o*l,e[9]=N*c-V,e[2]=V*c-N,e[6]=s*l,e[10]=L*c+O}else console.error("toMatrix4: Invalid order "+a);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,t},t.fromRotationMatrix4=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromRotationMatrix4(e,i)},t.fromQuaternion=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromQuaternion(e,i)},t.fromVector3=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromVector3(e,i)},t.fromArray=function(e,i,r){return void 0===i&&(i=0),void 0===r&&(r=t.DEFAULT_ORDER),new t().setFromArray(e,i,r)},t}();nb.DEFAULT_ORDER=eT.ZYX,nb.tempQuat0=new i5,nb.tempMat0=new rG;var nT=function(){function t(t,e,i,r,n,a,o,s,u){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===u&&(u=1),this.elements=[t,e,i,r,n,a,o,s,u]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,o,s,u){var h=this.elements;return h[0]=t,h[3]=r,h[6]=o,h[1]=e,h[4]=n,h[7]=s,h[2]=i,h[5]=a,h[8]=u,this},e.setFromRowMajorData=function(t,e,i,r,n,a,o,s,u){var h=this.elements;return h[0]=t,h[3]=e,h[6]=i,h[1]=r,h[4]=n,h[7]=a,h[2]=o,h[5]=s,h[8]=u,this},e.setFromColumnVectors=function(t,e,i){return this.set(t.x,t.y,t.z,e.x,e.y,e.z,i.x,i.y,i.z)},e.setFromMatrix4=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[e+i];return this},e.setFromQuaternion=function(t){var e=t.x,i=t.y,r=t.z,n=t.w,a=e+e,o=i+i,s=r+r,u=e*a,h=e*o,l=e*s,c=i*o,f=i*s,d=r*s,p=n*a,m=n*o,v=n*s,y=this.elements;return y[0]=1-(c+d),y[1]=h+v,y[2]=l-m,y[3]=h-v,y[4]=1-(u+d),y[5]=f+p,y[6]=l+m,y[7]=f-p,y[8]=1-(u+c),this},e.setZero=function(){for(var t=0;t<9;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,1,0,0,0,1)},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[3*t],this.elements[3*t+1],this.elements[3*t+2])},e.scale=function(t,e){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},e.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.elements,n=r[0],a=r[3],o=r[6],s=r[1],u=r[4],h=r[7];return r[0]=e*n+i*s,r[3]=e*a+i*u,r[6]=e*o+i*h,r[1]=-i*n+e*s,r[4]=-i*a+e*u,r[7]=-i*o+e*h,this},e.translate=function(t,e){var i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<9;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],o=i[3],s=i[6],u=i[1],h=i[4],l=i[7],c=i[2],f=i[5],d=i[8],p=r[0],m=r[3],v=r[6],y=r[1],g=r[4],x=r[7],b=r[2],T=r[5],_=r[8];return n[0]=a*p+o*y+s*b,n[3]=a*m+o*g+s*T,n[6]=a*v+o*x+s*_,n[1]=u*p+h*y+l*b,n[4]=u*m+h*g+l*T,n[7]=u*v+h*x+l*_,n[2]=c*p+f*y+d*b,n[5]=c*m+f*g+d*T,n[8]=c*v+f*x+d*_,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],o=t[7],s=t[2],u=t[5],h=t[8];return e*(a*h-u*o)+n*(u*r-i*h)+s*(i*o-a*r)},e.invert=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],o=t[7],s=t[2],u=t[5],h=t[8],l=h*a-u*o,c=u*r-h*i,f=o*i-a*r,d=e*l+n*c+s*f;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var p=1/d;return t[0]=l*p,t[1]=(s*o-h*n)*p,t[2]=(u*n-s*a)*p,t[3]=c*p,t[4]=(h*e-s*r)*p,t[5]=(s*i-u*e)*p,t[6]=f*p,t[7]=(n*r-o*e)*p,t[8]=(a*e-n*i)*p,this},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[3]*r+a[6]*n,o.y=a[1]*i+a[4]*r+a[7]*n,o.z=a[2]*i+a[5]*r+a[8]*n,o},e.transformNormal=function(t,e){return this.transformPoint(t,e).normalize()},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<9;r++)if(!eq(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8]},t.fromIdentity=function(){return new t(1,0,0,0,1,0,0,0,1)},t.fromColumnVectors=function(e,i,r){return new t().setFromColumnVectors(e,i,r)},t.fromMatrix4=function(e){return new t().setFromMatrix4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromRowMajorData=function(e,i,r,n,a,o,s,u,h){return new t(e,n,s,i,a,u,r,o,h)},t}(),n_=function(){function t(t,e){void 0===t&&(t=e$.ZERO),void 0===e&&(e=e$.X),this.origin=new e$,this.direction=new e$,this.origin.copyFrom(t),this.direction.copyFrom(e).normalize()}var e=t.prototype;return e.set=function(t,e){return this.origin.copyFrom(t),this.direction.copyFrom(e).normalize(),this},e.clone=function(){return new t(this.origin,this.direction)},e.copyFrom=function(t){return this.set(t.origin,t.direction)},e.recast=function(e){return this.origin.copyFrom(this.at(e,t.tempVec0)),this},e.at=function(t,e){var i=e||new e$;return i.copyFrom(this.origin),i.addScaledVector(this.direction,t)},e.equals=function(t){return this.origin.equals(t.origin)&&this.direction.equals(t.direction)},e.applyMatrix=function(t){return this.origin.applyProjectionMatrix(t),this.direction.applyNormalMatrix(t),this},e.intersectBox=function(t,e){var i,r,n,a,o,s,u=this.origin,h=u.x,l=u.y,c=u.z,f=this.direction,d=f.x,p=f.y,m=f.z,v=t.min,y=v.x,g=v.y,x=v.z,b=t.max,T=b.x,_=b.y,E=b.z,C=1/d,S=1/p,w=1/m;if(C>=0?(i=(y-h)*C,r=(T-h)*C):(i=(T-h)*C,r=(y-h)*C),S>=0?(n=(g-l)*S,a=(_-l)*S):(n=(_-l)*S,a=(g-l)*S),!(i>a)&&!(n>r)&&((n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),(n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),w>=0?(o=(x-c)*w,s=(E-c)*w):(o=(E-c)*w,s=(x-c)*w),!(i>s)&&!(o>r))&&((o>i||i!=i)&&(i=o),(s<r||r!=r)&&(r=s),!(r<0)))return i>=0?this.at(i,e):this.at(r,e)},e.intersectPlane=function(t,e){var i=t.normal,r=t.distance,n=i.dot(this.direction);if(0===n)return 0===i.dot(this.origin)+r?(e||new e$).copyFrom(this.origin):void 0;var a=-(this.origin.dot(i)+r)/n;return a>=0?this.at(a,e):void 0},e.intersectSphere=function(e,i){var r=e.center,n=t.tempVec0.subtractVectors(r,this.origin),a=n.dot(this.direction),o=n.dot(n)-a*a,s=e.radius*e.radius;if(!(o>s)){var u=Math.sqrt(s-o),h=a-u,l=a+u;if(!(l<0))return h>=0?this.at(h,i):this.at(l,i)}},e.intersectTriangle=function(e,i,r){var n,a=e.p0,o=e.p1,s=e.p2,u=t.tempVec0.subtractVectors(o,a),h=t.tempVec1.subtractVectors(s,a),l=t.tempVec2.subtractVectors(this.origin,a),c=t.tempVec3.crossVectors(u,h),f=this.direction.dot(c);if(f>0){if(r)return;n=1}else{if(!(f<0))return;n=-1,f=-f}h.crossVectors(l,h);var d=n*this.direction.dot(h);if(!(d<0)){u.cross(l);var p=n*this.direction.dot(u);if(!(p<0)&&!(d+p>f)){var m=-n*l.dot(c);if(!(m<0))return this.at(m/f,i)}}},t}();n_.tempVec0=new e$,n_.tempVec1=new e$,n_.tempVec2=new e$,n_.tempVec3=new e$;var nE=function(){function t(t,e){void 0===t&&(t=new e$(1/0,1/0,1/0)),void 0===e&&(e=new e$(-1/0,-1/0,-1/0)),this.min=t.clone(),this.max=e.clone()}var e=t.prototype;return e.set=function(t,e){return this.min.copyFrom(t),this.max.copyFrom(e),this},e.setFromArray=function(t){for(var e=Number(1/0),i=Number(1/0),r=Number(1/0),n=-1/0,a=-1/0,o=-1/0,s=0,u=t.length;s<u;s+=3){var h=t[s],l=t[s+1],c=t[s+2];h<e&&(e=h),l<i&&(i=l),c<r&&(r=c),h>n&&(n=h),l>a&&(a=l),c>o&&(o=c)}return this.min.set(e,i,r),this.max.set(n,a,o),this},e.setFromPoints=function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},e.setFromCenterAndSize=function(t,e){var i=e.clone().multiply(.5);return this.min.copyFrom(t).subtract(i),this.max.copyFrom(t).add(i),this},e.setFromObject=function(t){return this.makeEmpty(),this.expandByObject(t)},e.clone=function(){return new t().copyFrom(this)},e.copyFrom=function(t){return this.min.copyFrom(t.min),this.max.copyFrom(t.max),this},e.makeEmpty=function(){return this.min.x=this.min.y=this.min.z=Number(1/0),this.max.x=this.max.y=this.max.z=-1/0,this},e.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},e.getCenter=function(t){return void 0===t&&(t=new e$),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiply(.5)},e.getSize=function(t){return void 0===t&&(t=new e$),this.isEmpty()?t.set(0,0,0):t.subtractVectors(this.max,this.min)},e.expandByPoint=function(t){return this.min.min(t),this.max.max(t),this},e.expandByVector=function(t){return this.min.subtract(t),this.max.add(t),this},e.expandByScalar=function(t){return this.min.add(-t),this.max.add(t),this},e.expandByBox=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.expandByObject=function(e){e.updateWorldMatrix(!1,!1);var i=e.geometry;if(void 0!==i){null===i.boundingBox&&i.computeBoundingBox();var r=new t;r.copyFrom(i.boundingBox),r.applyMatrix4(e.matrixWorld),this.union(r)}for(var n=e.children,a=0,o=n.length;a<o;a++)this.expandByObject(n[a]);return this},e.containsPoint=function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},e.containsBox=function(t){return this.min.x<=t.min.x&&this.max.x>=t.max.x&&this.min.y<=t.min.y&&this.max.y>=t.max.y&&this.min.z<=t.min.z&&this.max.z>=t.max.z},e.getParameter=function(t,e){return void 0===e&&(e=new e$),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},e.intersectsBox=function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},e.intersectsSphere=function(t){var e=new e$;return this.clampPoint(t.center,e),e.distanceSquared(t.center)<=t.radius*t.radius},e.clampPoint=function(t,e){return void 0===e&&(e=new e$),e.copyFrom(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return t.clone().clamp(this.min,this.max).subtract(t).length()},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.applyMatrix4=function(t,e){if(void 0===e&&(e=new e$),this.isEmpty())return this;var i=this.getOBBPoints(t,e);return this.setFromPoints(i),this},e.getOBBPoints=function(t,e){if(void 0===e&&(e=new e$),this.isEmpty())return[];var i=[];return i[0]=new e$(this.min.x,this.min.y,this.min.z),i[1]=new e$(this.min.x,this.min.y,this.max.z),i[2]=new e$(this.min.x,this.max.y,this.min.z),i[3]=new e$(this.min.x,this.max.y,this.max.z),i[4]=new e$(this.max.x,this.min.y,this.min.z),i[5]=new e$(this.max.x,this.min.y,this.max.z),i[6]=new e$(this.max.x,this.max.y,this.min.z),i[7]=new e$(this.max.x,this.max.y,this.max.z),i.forEach(function(i){i.subtract(e),i.applyMatrix(t),i.add(e)}),i},e.getBoundingSphere=function(t){this.getCenter(t.center);var e=new e$;return t.radius=.5*this.getSize(e).length(),t},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}(),nC=function(){function t(t,e){void 0===t&&(t=e$.ZERO),void 0===e&&(e=-1),this.center=t.clone(),this.radius=e}var e=t.prototype;return e.set=function(t,e){return this.center.copyFrom(t),this.radius=e,this},e.setFromPoints=function(t,e){var i=this.center;if(void 0!==e){i.copyFrom(e);for(var r=0,n=0;n<t.length;n++)r=Math.max(r,i.distanceSquared(t[n]));this.radius=Math.sqrt(r)}else{var a=new nE().setFromPoints(t);a.getCenter(i),this.radius=a.getSize().length()/2}return this},e.copyFrom=function(t){return this.center.copyFrom(t.center),this.radius=t.radius,this},e.isEmpty=function(){return this.radius<0},e.makeEmpty=function(){return this.center.set(0,0,0),this.radius=-1,this},e.containsPoint=function(t){return t.distanceSquared(this.center)<=this.radius*this.radius},e.distanceToPoint=function(t){return t.distance(this.center)-this.radius},e.intersectsSphere=function(t){var e=this.radius+t.radius;return t.center.distanceSquared(this.center)<=e*e},e.intersectsBox=function(t){return t.intersectsSphere(this)},e.clampPoint=function(t,e){var i=this.center.distanceSquared(t);return void 0===e&&(e=new e$),e.copyFrom(t),i>this.radius*this.radius&&(e.subtract(this.center).normalize(),e.multiply(this.radius).add(this.center)),e},e.getBoundingBox=function(t){return(void 0===t&&(t=new nE),this.isEmpty())?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t},e.applyMatrix4=function(t){var e=t.elements,i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return this.center.applyMatrix(t),this.radius=this.radius*Math.sqrt(Math.max(i,r,n)),this},e.translate=function(t){return this.center.add(t),this},e.expandByPoint=function(t){var e=new e$().subtractVectors(t,this.center),i=e.lengthSquared();if(i>this.radius*this.radius){var r=Math.sqrt(i),n=(r-this.radius)*.5;this.center.add(e.multiply(n/r)),this.radius+=n}return this},e.union=function(t){var e=new e$,i=new e$;return i.subtractVectors(t.center,this.center).normalize().multiply(t.radius),this.expandByPoint(e.copyFrom(t.center).add(i)),this.expandByPoint(e.copyFrom(t.center).subtract(i)),this},e.intersect=function(t){var e=new e$().subtractVectors(this.center,t.center),i=e.length();return i>this.radius+t.radius?this.makeEmpty():(this.center=this.center.add(e.normalize().multiply(i/2)),this.radius=this.radius+t.radius-i,this)},e.equals=function(t){return t.center.equals(this.center)&&t.radius===this.radius},e.clone=function(){return new t().copyFrom(this)},t}(),nS=Object.freeze({__proto__:null,get EulerOrder(){return eT},Euler:nb,Quaternion:i5,Vector2:eJ,Vector3:e$,Vector4:e0,Matrix3:nT,Matrix4:rG,Ray:n_,PI2:2*Math.PI,DEG2RAD:eY,RAD2DEG:eZ,NumberEpsilon:1e-6,isZero:function(t){return isNaN(t)||1e-6>Math.abs(t)},isEqual:eq,damp:function(t,e,i,r){return eQ(t,e,1-Math.exp(-i*r))},lerp:eQ,degToRad:function(t){return t*eY},radToDeg:function(t){return t*eZ},clamp:eK,Color:e1,Box3:nE,Sphere:nC}),nw=1,nA=function(e){function i(t,i){var r;if((r=e.call(this,t)||this).destroyed=!1,r.visible=!0,i){var n=i.material,a=i.geometry,o=i.name,s=i.priority,u=i.worldMatrix,h=void 0===u?rG.fromIdentity():u;r.id="Mesh"+nw++,r.name=void 0===o?"<unnamed>":o,r.geometry=a,r.material=n,r.priority=void 0===s?0:s,r.worldMatrix=h}else r.id="Mesh"+nw++,r.name="<unnamed>",r.worldMatrix=rG.fromIdentity(),r._priority=0;return r}iN(i,e);var r=i.prototype;return r.setVisible=function(t){this.visible=t},r.getVisible=function(){return this.visible},r.render=function(t){!this.isDestroyed&&this.getVisible()&&t.drawGeometry(this.geometry,this.worldMatrix,this.material)},r.firstGeometry=function(){return this.geometry},r.setMaterial=function(e,i){i!==t.DestroyOptions.keep&&this.material.dispose(),this.material=e},r.restore=function(){},r.dispose=function(i){this.destroyed||((null==i?void 0:i.geometries)!==t.DestroyOptions.keep&&this.geometry.dispose(),(null==i?void 0:i.material)!==t.DestroyOptions.keep&&this.material.dispose(),this.destroyed=!0,void 0!==this.engine&&this.engine.removeMesh(this),e.prototype.dispose.call(this))},rC(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(rA),nM="precision highp float;attribute vec2 aUV;attribute vec3 aPos;varying vec2 vTexCoord;varying vec3 vParams;varying vec4 vColor;uniform vec2 _Size;uniform vec3 _Scale;uniform vec4 _Color;uniform vec4 _TexParams;uniform vec4 _TexOffset;uniform mat4 effects_MatrixVP;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;void main(){vec4 texParams=_TexParams;vTexCoord=vec2(aUV.xy*_TexOffset.zw+_TexOffset.xy);vColor=_Color;vParams=vec3(texParams.w,texParams.y,texParams.x);if(texParams.z==1.0){vec4 pos=vec4(aPos.xy*_Size,aPos.z,1.0);gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}else{mat4 view=effects_MatrixV;vec3 camRight=vec3(view[0][0],view[1][0],view[2][0]);vec3 camUp=vec3(view[0][1],view[1][1],view[2][1]);vec3 worldPosition=vec3(effects_ObjectToWorld*vec4(0.0,0.0,0.0,1.0));vec3 vertexPosition=worldPosition+camRight*aPos.x*_Size.x*_Scale.x+camUp*aPos.y*_Size.y*_Scale.y;gl_Position=effects_MatrixVP*vec4(vertexPosition,1.0);}}",nI="precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);\n#ifdef TRANSPARENT_VIDEO\nfloat halfX=vTexCoord.x*0.5;vec2 uv_rgb=vec2(halfX,vTexCoord.y);vec2 uv_alpha=vec2(halfX+0.5,vTexCoord.y);vec3 rgb=texture2D(_MainTex,uv_rgb).rgb;float alpha=max(texture2D(_MainTex,uv_alpha).r,1e-5);vec4 texColor=vec4(rgb/alpha,alpha);\n#else\nvec4 texColor=texture2D(_MainTex,vTexCoord.xy);\n#endif\ncolor=blendColor(texColor,vColor,floor(0.5+vParams.y));\n#ifdef ALPHA_CLIP\nif(color.a<0.04){discard;}\n#endif\ncolor.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}",nR="#version 100\nprecision mediump float;\n#define PATICLE_SHADER 1\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;uniform vec3 emissionColor;uniform float emissionIntensity;uniform sampler2D uMaskTex;uniform vec4 uColorParams;uniform vec2 uTexOffset;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\n#ifdef USE_SPRITE\nvarying vec4 vTexCoordBlend;\n#endif\nvarying float vSeed;\n#ifdef PREVIEW_BORDER\nuniform vec4 uPreviewColor;\n#endif\n#ifdef USE_SPRITE\nvec4 getTextureColor(sampler2D tex,vec2 texCoord){if(vTexCoordBlend.w>0.){return mix(texture2D(tex,texCoord),texture2D(tex,vTexCoordBlend.xy+texCoord),vTexCoordBlend.z);}return texture2D(tex,texCoord);}\n#else\n#define getTextureColor texture2D\n#endif\n#ifndef WEBGL2\n#define round(a) floor(0.5+a)\n#endif\nvec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}\n#ifdef PREVIEW_BORDER\nvoid main(){gl_FragColor=uPreviewColor;}\n#else\nvoid main(){vec4 color=vec4(1.0);vec4 tempColor=vColor;vec2 texOffset=uTexOffset;if(vLife<0.){discard;}if(uColorParams.x>0.0){color=getTextureColor(uMaskTex,vTexCoord);}\n#ifdef COLOR_OVER_LIFETIME\n#ifndef ENABLE_VERTEX_TEXTURE\ntempColor*=texture2D(uColorOverLifetime,vec2(vLife,0.));\n#endif\n#endif\ncolor=blendColor(color,tempColor,round(uColorParams.y));if(color.a<=0.01&&uColorParams.w>0.){float _at=texture2D(uMaskTex,vTexCoord+texOffset).a+texture2D(uMaskTex,vTexCoord+texOffset*-1.).a;if(_at<=0.02){discard;}}vec3 emission=emissionColor*pow(2.0,emissionIntensity);color=vec4(pow(pow(color.rgb,vec3(2.2))+emission,vec3(1.0/2.2)),color.a);gl_FragColor=color;}\n#endif\n",nP="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#define PATICLE_SHADER 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}const float d2r=3.141592653589793/180.;attribute vec3 aPos;attribute vec4 aOffset;attribute vec4 aColor;attribute vec3 aDirX;attribute vec3 aDirY;attribute vec3 aTranslation;attribute vec3 aRotation0;attribute vec3 aRotation1;attribute vec3 aRotation2;attribute vec3 aLinearMove;\n#ifdef USE_SPRITE\nattribute vec3 aSprite;uniform vec4 uSprite;struct UVDetail{vec2 uv0;vec3 uv1;};UVDetail getSpriteUV(vec2 uv,float lifeTime);varying vec4 vTexCoordBlend;\n#endif\n#ifdef FINAL_TARGET\nuniform vec3 uFinalTarget;uniform vec4 uForceCurve;\n#endif\nuniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;uniform mat4 effects_MatrixVP;uniform vec4 uParams;uniform vec4 uOpacityOverLifetimeValue;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nuniform vec4 uOrbXByLifetimeValue;uniform vec4 uOrbYByLifetimeValue;uniform vec4 uOrbZByLifetimeValue;uniform vec3 uOrbCenter;uniform vec4 uSizeByLifetimeValue;\n#ifdef SIZE_Y_BY_LIFE\nuniform vec4 uSizeYByLifetimeValue;\n#endif\nvarying float vLife;varying vec4 vColor;varying vec2 vTexCoord;vec3 calOrbitalMov(float _life,float _dur){vec3 orb=vec3(0.0);\n#ifdef AS_ORBITAL_MOVEMENT\n#define FUNC(a) getValueFromTime(_life,a)\n#else\n#define FUNC(a) getIntegrateFromTime0(_life,a) * _dur\n#endif\n#if ORB_VEL_X\norb.x=FUNC(uOrbXByLifetimeValue);\n#endif\n#if ORB_VEL_Y\norb.y=FUNC(uOrbYByLifetimeValue);\n#endif\n#if ORB_VEL_Z\norb.z=FUNC(uOrbZByLifetimeValue);\n#endif\n#undef FUNC\nreturn orb;}mat3 mat3FromRotation(vec3 rotation){vec3 sinR=sin(rotation*d2r);vec3 cosR=cos(rotation*d2r);return mat3(cosR.z,-sinR.z,0.,sinR.z,cosR.z,0.,0.,0.,1.)*mat3(cosR.y,0.,sinR.y,0.,1.,0.,-sinR.y,0,cosR.y)*mat3(1.,0.,0.,0,cosR.x,-sinR.x,0.,sinR.x,cosR.x);}\n#ifdef USE_SPRITE\nUVDetail getSpriteUV(vec2 uv,float lifeTime){float t=fract(clamp((lifeTime-aSprite.x)/aSprite.y,0.0,1.)*aSprite.z);float frame=uSprite.z*t;float frameIndex=max(ceil(frame)-1.,0.);float row=floor((frameIndex+0.1)/uSprite.x);float col=frameIndex-row*uSprite.x;vec2 retUV=(vec2(col,row)+uv)/uSprite.xy;UVDetail ret;if(uSprite.w>0.){float blend=frame-frameIndex;float frameIndex1=min(ceil(frame),uSprite.z-1.);float row1=floor((frameIndex1+0.1)/uSprite.x);float col1=frameIndex1-row1*uSprite.x;vec2 coord=(vec2(col1,row1)+uv)/uSprite.xy-retUV;ret.uv1=vec3(coord.x,1.-coord.y,blend);}ret.uv0=vec2(retUV.x,1.-retUV.y);return ret;}\n#endif\nvoid main(){float time=uParams.x-aOffset.z;float dur=aOffset.w;if(time<0.||time>dur){gl_Position=vec4(-3.,-3.,-3.,1.);}else{float life=clamp(time/dur,0.0,1.0);vLife=life;\n#ifdef USE_SPRITE\nUVDetail uvD=getSpriteUV(aOffset.xy,time);vTexCoord=uvD.uv0;vTexCoordBlend=vec4(uvD.uv1,uSprite.w);\n#else\nvTexCoord=aOffset.xy;\n#endif\nvColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(life,0.));\n#endif\n#endif\nvColor.a*=clamp(getValueFromTime(life,uOpacityOverLifetimeValue),0.,1.);vec3 size=vec3(vec2(getValueFromTime(life,uSizeByLifetimeValue)),1.0);\n#ifdef SIZE_Y_BY_LIFE\nsize.y=getValueFromTime(life,uSizeYByLifetimeValue);\n#endif\nmat3 aRotation=mat3(aRotation0,aRotation1,aRotation2);vec3 point=aRotation*(aDirX*size.x+aDirY*size.y);vec3 _pos=aPos+aTranslation;\n#if ORB_VEL_X + ORB_VEL_Y + ORB_VEL_Z\n_pos=mat3FromRotation(calOrbitalMov(life,dur))*(_pos-uOrbCenter);_pos+=uOrbCenter;\n#endif\n_pos.xyz+=aLinearMove;\n#ifdef FINAL_TARGET\nfloat force=getValueFromTime(life,uForceCurve);vec4 pos=vec4(mix(_pos,uFinalTarget,force),1.);\n#else\nvec4 pos=vec4(_pos,1.0);\n#endif\n#if RENDER_MODE == 1\npos.xyz+=point;pos=effects_ObjectToWorld*pos;\n#elif RENDER_MODE == 3\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[2].xyz*point.y;\n#elif RENDER_MODE == 2\npos=effects_ObjectToWorld*pos;pos.xy+=point.xy;\n#elif RENDER_MODE == 0\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[1].xyz*point.y;\n#endif\ngl_Position=effects_MatrixVP*pos;vSeed=aSeed;gl_PointSize=6.0;}}",nO="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}attribute vec4 aPos;attribute vec3 aDir;attribute vec3 aInfo;attribute vec4 aColor;attribute float aTime;\n#ifdef ATTR_TRAIL_START\nattribute float aTrailStart;\n#else\nuniform float uTrailStart[64];attribute float aTrailStartIndex;\n#endif\nuniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixVP;uniform vec4 uTextureMap;uniform float uTime;uniform vec4 uParams;uniform vec4 uColorParams;uniform vec4 uOpacityOverLifetimeValue;uniform vec4 uWidthOverTrail;\n#ifdef COLOR_OVER_TRAIL\nuniform sampler2D uColorOverTrail;\n#endif\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;void main(){vec4 _pa=effects_MatrixVP*vec4(aPos.xyz,1.);vec4 _pb=effects_MatrixVP*vec4(aPos.xyz+aDir,1.);vec2 dir=normalize(_pb.xy/_pb.w-_pa.xy/_pa.w);vec2 screen_xy=vec2(-dir.y,dir.x);vec4 pos=effects_ObjectToWorld*vec4(aPos.xyz,1.);\n#ifdef ATTR_TRAIL_START\nfloat ts=aTrailStart;\n#else\nfloat ts=uTrailStart[int(aTrailStartIndex)];\n#endif\nfloat trail=(ts-aInfo.y)/uParams.y;float width=aPos.w*getValueFromTime(trail,uWidthOverTrail)/max(abs(screen_xy.x),abs(screen_xy.y));pos.xyz+=(effects_MatrixInvV[0].xyz*screen_xy.x+effects_MatrixInvV[1].xyz*screen_xy.y)*width;float time=min((uTime-aTime)/aInfo.x,1.0);gl_Position=effects_MatrixVP*pos;vColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(time,0.));\n#endif\n#endif\n#ifdef COLOR_OVER_TRAIL\nvColor*=texture2D(uColorOverTrail,vec2(trail,0.));\n#endif\nvColor.a*=clamp(getValueFromTime(time,uOpacityOverLifetimeValue),0.,1.);vLife=time;vTexCoord=uTextureMap.xy+vec2(trail,aInfo.z)*uTextureMap.zw;vSeed=aSeed;}",nN="precision highp float;attribute vec2 aPos;varying vec2 uv;void main(){gl_Position=vec4(aPos,0.,1.0);uv=(aPos+vec2(1.0))/2.;}",nV="precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor.rgb=pow(hdrColor.rgb,vec3(2.2));vec3 finalColor=hdrColor.rgb;if(_UseBloom){vec4 bloomColor=texture2D(_GaussianTex,uv);bloomColor.rgb*=_BloomIntensity;finalColor+=bloomColor.rgb;}if(_VignetteIntensity>0.0){finalColor=ApplyVignette(finalColor,uv,_VignetteCenter,_VignetteIntensity,_VignetteRoundness,_VignetteSmoothness,_VignetteColor);}finalColor=finalColor*_Brightness;vec3 colorLog=LinearToLogC(finalColor);colorLog=(colorLog-ACEScc_MIDGRAY)*_Contrast+ACEScc_MIDGRAY;finalColor=LogCToLinear(colorLog);finalColor=max(finalColor,0.0);float luminance=0.2125*finalColor.r+0.7154*finalColor.g+0.0721*finalColor.b;vec3 luminanceColor=vec3(luminance,luminance,luminance);finalColor=(finalColor-luminanceColor)*_Saturation+luminanceColor;finalColor=max(finalColor,0.0);if(_UseToneMapping){finalColor=max(vec3(0.0),ACESToneMapping(finalColor));}float alpha=min(hdrColor.a,1.0);gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),alpha);}",nL="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussH(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[9];offsets[0]=-4.0;offsets[1]=-3.0;offsets[2]=-2.0;offsets[3]=-1.0;offsets[4]=0.0;offsets[5]=1.0;offsets[6]=2.0;offsets[7]=3.0;offsets[8]=4.0;float weights[9];weights[0]=0.01621622;weights[1]=0.05405405;weights[2]=0.12162162;weights[3]=0.19459459;weights[4]=0.22702703;weights[5]=0.19459459;weights[6]=0.12162162;weights[7]=0.05405405;weights[8]=0.01621622;for(int i=0;i<9;i++){vec2 offset=vec2(offsets[i]*2.0*(1.0/_TextureSize.x),0);color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussH(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",nF="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussV(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[5];offsets[0]=-3.23076923;offsets[1]=-1.38461538;offsets[2]=0.0;offsets[3]=1.38461538;offsets[4]=3.23076923;float weights[5];weights[0]=0.07027027;weights[1]=0.31621622;weights[2]=0.22702703;weights[3]=0.31621622;weights[4]=0.07027027;for(int i=0;i<5;i++){vec2 offset=vec2(0,offsets[i]*(1.0/_TextureSize.y));color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussV(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",nD="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform sampler2D _GaussianDownTex;uniform vec2 _GaussianDownTextureSize;float GaussWeight2D(float x,float y,float sigma){float PI=3.14159265358;float E=2.71828182846;float sigma_2=pow(sigma,2.0);float a=-(x*x+y*y)/(2.0*sigma_2);return pow(E,a)/(2.0*PI*sigma_2);}vec3 GaussNxN(sampler2D tex,vec2 uv,vec2 stride,float sigma){vec3 color=vec3(0.,0.,0.);const int r=1;float weight=0.0;for(int i=-r;i<=r;i++){for(int j=-r;j<=r;j++){float w=GaussWeight2D(float(i),float(j),sigma);vec2 coord=uv+vec2(i,j)*stride;color+=texture2D(tex,coord).rgb*w;weight+=w;}}color/=weight;return color;}void main(){vec3 lowResColor=GaussNxN(_MainTex,uv,0.5/_GaussianDownTextureSize,1.0);vec3 highResColor=GaussNxN(_GaussianDownTex,uv,1.0/_GaussianDownTextureSize,1.0);vec3 color=mix(highResColor,lowResColor,0.7);gl_FragColor=vec4(color,1.0);}",nk="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform float _Threshold;void main(){vec4 mainTex=texture2D(_MainTex,uv);mainTex.rgb=pow(mainTex.rgb,vec3(2.2));float brightness=max(mainTex.r,max(mainTex.g,mainTex.b));float w=max(0.0,brightness-_Threshold)/max(brightness,0.00001);mainTex.rgb*=w;mainTex.rgb*=mainTex.a;gl_FragColor=vec4(mainTex.rgb,1.0);}",nz={},nB=function(){function e(){}return e.registerInclude=function(t,e){nz[t]&&id.warn('The "'+t+'" shader include already exist.'),nz[t]=e},e.unRegisterInclude=function(t){delete nz[t]},e.unRegisterAllIncludes=function(){Object.keys(nz).forEach(function(t){e.unRegisterInclude(t)})},e.genFinalShaderCode=function(i){var r=i.level,n=i.shaderType,a=i.shader,o=i.macros,s=i.removeVersion,u=e.genMacroString(r,o),h=e.genShaderVersion(r),l=e.parseIncludes(a),c=e.isVersion300(l);return(l=e.removeWebGLVersion(l),2!==r||c||(l=e.convertTo300(l,n===t.ShaderType.fragment)),s)?u+l:h+u+l},e.convertTo300=function(t,i){if(t=(t=(t=t.replace(/\bvarying\b/g,i?"in":"out")).replace(/\btexture(2D|Cube)\b/g,"texture")).replace(/#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,""),i){if(t=(t=(t=t.replace(/\btexture(2D|Cube)LodEXT\b/g,"textureLod")).replace(/\btexture(2D|Cube)GradEXT\b/g,"textureGrad")).replace(/\bgl_FragDepthEXT\b/g,"gl_FragDepth"),!e.has300Output(t)){if(/\bgl_FragData\[.+?\]/g.test(t)){var r=(t=t.replace(/\bgl_FragColor\b/g,"gl_FragData[0]")).match(/\bgl_FragData\[.+?\]/g);r&&(t=e.replaceMRTShader(t,r))}else t=(t=t.replace(/void\s+?main\s*\(/g,"out vec4 glFragColor;\nvoid main(")).replace(/\bgl_FragColor\b/g,"glFragColor")}}else t=t.replace(/\battribute\b/g,"in");return t},e.parseIncludes=function(t,e){for(void 0===e&&(e=/#include <(.+)>/gm);null!==(i=e.exec(t));){var i,r=i[1],n=nz[r];if(void 0===n)throw Error("Can't find include shader name "+r);t=t.replace(i[0],n)}return t},e.genMacroString=function(t,e,i){void 0===i&&(i=!0);var r=[],n="WEBGL"+t;return(r.push("#ifndef "+n),r.push("#define "+n),r.push("#endif"),i&&r.push("#define GE_RUNTIME"),e&&e.length&&e.forEach(function(t){var e=t[0],i=t[1];!0===i?r.push("#define "+e):Number.isFinite(i)&&r.push("#define "+e+" "+i)}),r.length)?r.join("\n")+"\n":""},e.genShaderVersion=function(t){return 1===t?"#version 100\n":"#version 300 es\n"},e.isVersion300=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return(e?e[0]:"").includes("300")},e.removeWebGLVersion=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return e?t.replace(e[0],""):t},e.has300Output=function(t){return/\bout\s+(?:\w+\s+)?(?:vec4)\s+(?:\w+)\s*;/.test(t)},e.replaceMRTShader=function(t,e){for(var i=new Set,r="",n=0;n<e.length;n++){var a=e[n].match(/\bgl_FragData\[(.+?)\]/);a&&i.add(a[1])}return i.forEach(function(t){r+="layout(location="+t+") out vec4 fragOutColor"+t+";\n"}),r+="void main(",t=(t=t.replace(/\bgl_FragData\[(.+?)\]/g,"fragOutColor$1")).replace(/void\s+?main\s*\(/g,r)},e}(),nU=function(e){function i(i,r){void 0===r&&(r=4),(n=e.call(this,i)||this).tempRTs=[],n.iterationCount=r;var n,a=n.renderer.engine;return n.thresholdMaterial=nl.create(a,{shader:{vertex:nN,fragment:nk,glslVersion:t.GLSLVersion.GLSL1}}),n.thresholdMaterial.blending=!1,n.thresholdMaterial.depthTest=!1,n.thresholdMaterial.culling=!1,n.downSampleHMaterial=nl.create(a,{shader:{vertex:nN,fragment:nL,glslVersion:t.GLSLVersion.GLSL1}}),n.downSampleHMaterial.blending=!1,n.downSampleHMaterial.depthTest=!1,n.downSampleHMaterial.culling=!1,n.downSampleVMaterial=nl.create(a,{shader:{vertex:nN,fragment:nF,glslVersion:t.GLSLVersion.GLSL1}}),n.downSampleVMaterial.blending=!1,n.downSampleVMaterial.depthTest=!1,n.downSampleVMaterial.culling=!1,n.upSampleMaterial=nl.create(a,{shader:{vertex:nN,fragment:nD,glslVersion:t.GLSLVersion.GLSL1}}),n.upSampleMaterial.blending=!1,n.upSampleMaterial.depthTest=!1,n.upSampleMaterial.culling=!1,n.priority=5e3,n.name="BloomPass",n}iN(i,e);var r=i.prototype;return r.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture=this.mainTexture},r.execute=function(e){var i,r,n,a=e.getWidth(),o=e.getHeight(),s=null!=(n=null==(r=e.renderingData.currentFrame.globalVolume)?void 0:null==(i=r.bloom)?void 0:i.threshold)?n:1;this.thresholdRT=e.getTemporaryRT("_BloomThreshold",a,o,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),this.thresholdMaterial.setFloat("_Threshold",s),e.blit(this.mainTexture,this.thresholdRT,this.thresholdMaterial);for(var u=this.thresholdRT.getColorTextures()[0],h=0;h<this.iterationCount;h++){var l=Math.floor(a/Math.pow(2,h+1)),c=Math.floor(o/Math.pow(2,h+1)),f=e.getTemporaryRT("_BloomDownH"+h,l,c,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf);this.downSampleHMaterial.setVector2("_TextureSize",nX(u)),e.blit(u,f,this.downSampleHMaterial);var d=e.getTemporaryRT("_BloomDownV"+h,l,c,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf);this.downSampleVMaterial.setVector2("_TextureSize",nX(f.getColorTextures()[0])),e.blit(f.getColorTextures()[0],d,this.downSampleVMaterial),e.releaseTemporaryRT(f),this.tempRTs.push(d),u=d.getColorTextures()[0]}e.releaseTemporaryRT(this.thresholdRT);for(var p=this.iterationCount-1;p>0;p--){var m=Math.floor(a/Math.pow(2,p-1)),v=Math.floor(o/Math.pow(2,p-1)),y=e.getTemporaryRT("_BloomUp"+p,m,v,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),g=this.tempRTs[p-1].getColorTextures()[0];this.upSampleMaterial.setTexture("_GaussianDownTex",g),this.upSampleMaterial.setVector2("_GaussianDownTextureSize",nX(g)),e.blit(u,y,this.upSampleMaterial),u=y.getColorTextures()[0],this.tempRTs.push(y)}e.setFramebuffer(this.tempRTs[this.tempRTs.length-1])},r.onCameraCleanup=function(t){for(var e=0;e<this.tempRTs.length;e++)t.releaseTemporaryRT(this.tempRTs[e]);this.tempRTs=[]},r.dispose=function(t){this.thresholdMaterial.dispose(),this.downSampleHMaterial.dispose(),this.downSampleVMaterial.dispose(),this.upSampleMaterial.dispose(),e.prototype.dispose.call(this,t)},i}(np),nG=function(e){function i(i,r){n=e.call(this,i)||this;var n,a="PostProcess",o=n.renderer.engine;n.sceneTextureHandle=r||new nf(o);var s=ng.create(o,{name:a,mode:rR.TRIANGLE_STRIP,attributes:{aPos:{type:rR.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),u=nl.create(o,{name:a,shader:{vertex:nN,fragment:nV,glslVersion:t.GLSLVersion.GLSL1}});return u.blending=!1,u.depthTest=!1,u.culling=!1,n.screenMesh=nA.create(o,{name:a,geometry:s,material:u,priority:0}),n.priority=5e3,n.name="ToneMappingPass",n}iN(i,e);var r=i.prototype;return r.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture||(this.sceneTextureHandle.texture=this.mainTexture),t.setFramebuffer(null)},r.execute=function(e){e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear});var i=e.renderingData.currentFrame.globalVolume,r=i2({threshold:0,intensity:0,active:!1},null==i?void 0:i.bloom),n=i2({intensity:0,smoothness:0,roundness:0,active:!1},null==i?void 0:i.vignette),a=i2({brightness:0,saturation:0,contrast:0,active:!1},null==i?void 0:i.colorAdjustments),o=i2({active:!1},null==i?void 0:i.tonemapping);this.screenMesh.material.setTexture("_SceneTex",this.sceneTextureHandle.texture),this.screenMesh.material.setFloat("_Brightness",Math.pow(2,a.brightness)),this.screenMesh.material.setFloat("_Saturation",.01*a.saturation+1),this.screenMesh.material.setFloat("_Contrast",.01*a.contrast+1),this.screenMesh.material.setInt("_UseBloom",Number(r.active)),r.active&&(this.screenMesh.material.setTexture("_GaussianTex",this.mainTexture),this.screenMesh.material.setFloat("_BloomIntensity",r.intensity)),n.intensity>0&&(this.screenMesh.material.setFloat("_VignetteIntensity",n.intensity),this.screenMesh.material.setFloat("_VignetteSmoothness",n.smoothness),this.screenMesh.material.setFloat("_VignetteRoundness",n.roundness),this.screenMesh.material.setVector2("_VignetteCenter",new eJ(.5,.5)),this.screenMesh.material.setVector3("_VignetteColor",new e$(0,0,0))),this.screenMesh.material.setInt("_UseToneMapping",Number(o.active)),e.renderMeshes([this.screenMesh])},i}(np),nj=1,nW=function(){function e(t){this.disposed=!1,this.postProcessingEnabled=!1,this.enableHDR=!0;var e=t.camera,i=t.renderer,r=t.editorTransform,n=t.globalVolume,a=t.postProcessingEnabled,o=void 0!==a&&a,s=i.engine;if(n&&(this.globalVolume=n),this.postProcessingEnabled=o,this.globalUniforms=new nH,this.renderer=i,o&&this.enableHDR&&!this.renderer.engine.gpuCapability.detail.halfFloatTexture)throw Error("Half float texture is not supported.");this.drawObjectPass=new nm(i);var u=[this.drawObjectPass];if(this.setRenderPasses(u),o){var h=new nf(s),l=new nU(i,7);l.sceneTextureHandle=h,this.addRenderPass(l);var c=new nG(i,h);this.addRenderPass(c)}this.name="RenderFrame"+nj++,this.camera=e,this.editorTransform=e0.fromArray(void 0===r?[1,1,0,0]:r)}var i=e.prototype;return i.setup=function(){this.drawObjectPass.setup(this.postProcessingEnabled)},i.addMeshToDefaultRenderPass=function(t){this.drawObjectPass.addMesh(t)},i.removeMeshFromDefaultRenderPass=function(t){this.drawObjectPass.removeMesh(t)},i.dispose=function(e){var i=(null==e?void 0:e.passes)?e.passes:void 0;i!==t.DestroyOptions.keep&&this._renderPasses.forEach(function(t){t.dispose(i)}),this._renderPasses.length=0,this.disposed=!0},i.setRenderPasses=function(t){this._renderPasses=t.slice()},i.addRenderPass=function(t){this._renderPasses.push(t)},i.removeRenderPass=function(t){eX(this._renderPasses,t)},rC(e,[{key:"renderPasses",get:function(){return this._renderPasses.slice()}},{key:"isDisposed",get:function(){return this.disposed}}]),e}();function nX(t){return t?new eJ(t.getWidth(),t.getHeight()):new eJ}var nH=function(){this.floats={},this.ints={},this.vector3s={},this.vector4s={},this.matrices={},this.samplers=[],this.uniforms=[]},nY=function(){function t(t){this.size=[0,0],this.multiSample=1,this.destroyed=!1;var e=t.storageType,i=t.format,r=t.attachment;this.storageType=e,this.format=i,this.attachment=r}return rC(t,[{key:"isDestroyed",get:function(){return this.destroyed}}]),t}(),nZ=function(){function e(t){this.engine=t,this.temporaryRTs=[],this.currentFrame=0,this.maxUnusedFrames=4}var i=e.prototype;return i.flush=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=-1),this.currentFrame++;for(var i=e>=0?e:this.maxUnusedFrames,r=0;r<this.temporaryRTs.length;r++){var n=this.temporaryRTs[r];!n.isOccupied&&(t||this.currentFrame-n.lastFrameReleased>i)&&(n.RT.dispose(),this.temporaryRTs.splice(r--,1))}},i.get=function(e,i,r,n,a,o){void 0===n&&(n=0),void 0===a&&(a=t.FilterMode.Linear),void 0===o&&(o=t.RenderTextureFormat.RGBA32);for(var s,u,h,l=i+"_"+r+"_"+n+"_"+a+"_"+o,c=iD(this.temporaryRTs);!(h=c()).done;){var f=h.value;if(!f.isOccupied&&f.descriptionHash===l)return f.isOccupied=!0,f.RT.name=e,f.RT}var d=t.RenderPassAttachmentStorageType.none;a===t.FilterMode.Linear?s=rR.LINEAR:a===t.FilterMode.Nearest&&(s=rR.NEAREST),o===t.RenderTextureFormat.RGBA32?u=rR.UNSIGNED_BYTE:o===t.RenderTextureFormat.RGBAHalf&&(u=rR.HALF_FLOAT),0===n?d=t.RenderPassAttachmentStorageType.none:16===n?d=t.RenderPassAttachmentStorageType.depth_stencil_opaque:24===n&&(d=t.RenderPassAttachmentStorageType.depth_24_stencil_8_texture);var p=nt.create(this.engine,{sourceType:t.TextureSourceType.framebuffer,minFilter:s,magFilter:s,internalFormat:rR.RGBA,format:rR.RGBA,type:u}),m={RT:nc.create({name:e,storeAction:{},viewport:[0,0,i,r],attachments:[p],depthStencilAttachment:{storageType:d}},this.engine.renderer),lastFrameReleased:0,descriptionHash:l,isOccupied:!0};return this.temporaryRTs.push(m),m.RT},i.release=function(t){for(var e,i=iD(this.temporaryRTs);!(e=i()).done;){var r=e.value;if(r.RT===t){r.isOccupied=!1,r.lastFrameReleased=this.currentFrame;break}}},i.dispose=function(){for(var t,e=iD(this.temporaryRTs);!(t=e()).done;)t.value.RT.dispose()},e}(),nq="function"==typeof WebGL2RenderingContext,nQ=function(){function t(t){this.setupCapability(t)}var e=t.prototype;return e.isCompressedFormatSupported=function(t){return!!this.compressTextureCapabilityList.get(t)},e.setupCapability=function(t){var e,i,r=nq&&eF(t,WebGL2RenderingContext)?2:1,n=2===r,a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),o=t.getExtension("WEBGL_depth_texture"),s=!!t.getExtension("OES_texture_half_float_linear"),u=!!t.getExtension("OES_texture_float_linear");this.level=r,this.type=n?"webgl2":"webgl",this.vaoExt=t.getExtension("OES_vertex_array_object"),this.glAsyncCompileExt=t.getExtension("KHR_parallel_shader_compile"),this.UNSIGNED_INT_24_8=t.UNSIGNED_INT_24_8,this.drawBufferExtension=t.getExtension("WEBGL_draw_buffers"),o&&(this.UNSIGNED_INT_24_8=o.UNSIGNED_INT_24_8_WEBGL),n&&!s&&(s=nK(t,t.HALF_FLOAT)),n&&!u&&(u=nK(t,t.FLOAT)),this.internalFormatDepth16=n?t.DEPTH_COMPONENT16:t.DEPTH_COMPONENT,this.internalFormatDepth24_stencil8=n?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL;var h=n||t.getExtension("OES_texture_float")?t.FLOAT:0,l=n?WebGL2RenderingContext.HALF_FLOAT:(null==(i=t.getExtension("OES_texture_half_float"))?void 0:i.HALF_FLOAT_OES)||0;this.compressTextureCapabilityList=new Map([["WEBGL_compressed_texture_astc",!!t.getExtension("WEBGL_compressed_texture_astc")],["WEBKIT_WEBGL_compressed_texture_astc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_astc")],["WEBGL_compressed_texture_etc",!!t.getExtension("WEBGL_compressed_texture_etc")],["WEBKIT_WEBGL_compressed_texture_etc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_etc")],["WEBGL_compressed_texture_etc1",!!t.getExtension("WEBGL_compressed_texture_etc1")],["WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBGL_compressed_texture_pvrtc")||!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["WEBKIT_WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["EXT_sRGB",!!t.getExtension("EXT_sRGB")]]);var c={floatTexture:h,halfFloatTexture:l,maxSample:n?t.getParameter(t.MAX_SAMPLES):1,maxVertexUniforms:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxVertexTextures:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxFragmentUniforms:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxFragmentTextures:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),floatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):h>0&&!!t.getExtension("WEBGL_color_buffer_float"),halfFloatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):l>0&&!!t.getExtension("EXT_color_buffer_half_float"),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxShaderTexCount:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),halfFloatLinear:s,floatLinear:u,maxTextureAnisotropy:a?t.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,shaderTextureLod:n||!!t.getExtension("EXT_shader_texture_lod"),instanceDraw:n||!!t.getExtension("ANGLE_instanced_arrays"),ktx2Support:!!((e=this.compressTextureCapabilityList).get("WEBGL_compressed_texture_astc")||e.get("WEBKIT_WEBGL_compressed_texture_astc")),drawBuffers:n||!!this.drawBufferExtension,asyncShaderCompile:!!this.glAsyncCompileExt,intIndexElementBuffer:!!t.getExtension("OES_element_index_uint"),standardDerivatives:n||!!t.getExtension("OES_standard_derivatives"),readableDepthStencilTextures:n||!!o,writableFragDepth:n||!!t.getExtension("EXT_frag_depth")};this.detail=c,a&&(this.textureMaxAnisotropyExt=a.TEXTURE_MAX_ANISOTROPY_EXT)},e.framebufferTexture2D=function(t,e,i,r,n){var a=this.drawBufferExtension;if(1===this.level&&!a&&i>0)throw Error("Draw multiple color buffers not available.");var o=a?a["COLOR_ATTACHMENT"+i+"_WEBGL"]:t["COLOR_ATTACHMENT"+i];o?t.framebufferTexture2D(e,o,r,n,0):console.error("Invalid color attachment index: "+i+".")},e.drawBuffers=function(t,e){var i=this.drawBufferExtension;if(1===this.level&&!i){if(!(e.length>1))return;throw Error("Draw buffers not available.")}var r=e.map(function(e,r){return e?i?i["COLOR_ATTACHMENT"+r+"_WEBGL"]:t["COLOR_ATTACHMENT"+r]:t.NONE});i?i.drawBuffersWEBGL(r):t.drawBuffers(r)},e.setTextureAnisotropic=function(t,e,i){var r=this.detail.maxTextureAnisotropy;r&&t.texParameterf(e,this.textureMaxAnisotropyExt,Math.min(r,i||4))},rC(t,[{key:"isWebGL2",get:function(){return 2===this.level}}]),t}();function nK(t,e){var i=t.createTexture(),r=!1;return t.getError(),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.R16F,1,1,0,t.RED,e,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.getError()||(r=!0),t.deleteTexture(i),r}t.CompressTextureCapabilityType=void 0,(tm=t.CompressTextureCapabilityType||(t.CompressTextureCapabilityType={})).astc="WEBGL_compressed_texture_astc",tm.astc_webkit="WEBKIT_WEBGL_compressed_texture_astc",tm.etc="WEBGL_compressed_texture_etc",tm.etc_webkit="WEBKIT_WEBGL_compressed_texture_etc",tm.etc1="WEBGL_compressed_texture_etc1",tm.pvrtc="WEBGL_compressed_texture_pvrtc",tm.pvrtc_webkit="WEBKIT_WEBGL_compressed_texture_pvrtc",tm.sRGB="EXT_sRGB";var nJ=function(){function t(t){this.engine=t,this.currentFramebuffer=null,this.renderTargetPool=new nZ(t)}var e=t.prototype;return e.setGlobalFloat=function(t,e){},e.setGlobalInt=function(t,e){},e.setGlobalVector4=function(t,e){},e.setGlobalVector3=function(t,e){},e.setGlobalMatrix=function(t,e){},e.getFramebuffer=function(){return this.currentFramebuffer},e.setFramebuffer=function(t){},e.setViewport=function(t,e,i,r){},e.resize=function(t,e){},e.clear=function(t){},e.getWidth=function(){return 0},e.getHeight=function(){return 0},e.lost=function(t){},e.restore=function(){},e.getShaderLibrary=function(){},e.renderRenderFrame=function(t){},e.renderMeshes=function(t){},e.drawGeometry=function(t,e,i,r){},e.getTemporaryRT=function(t,e,i,r,n,a){return this.renderTargetPool.get(t,e,i,r,n,a)},e.releaseTemporaryRT=function(t){this.renderTargetPool.release(t)},e.blit=function(t,e,i){},e.dispose=function(){},t}(),n$=function(){function t(t){void 0===t&&(t={}),this.semantics=i2({},t)}var e=t.prototype;return e.toObject=function(){return i2({},this.semantics)},e.setSemantic=function(t,e){void 0===e?delete this.semantics[t]:this.semantics[t]=e},e.getSemanticValue=function(t,e){var i=this.semantics[t];return iy(i)?i(e):i},e.hasSemanticValue=function(t){return t in this.semantics},e.dispose=function(){var t=this;Object.keys(this.semantics).forEach(function(e){delete t.semantics[e]})},t}(),n0=function(e){function i(t){(i=e.call(this,t)||this).visible=!0,i.meshCollider=new a3,i._color=new e1(1,1,1,1),i.getHitTestParams=function(t){var e=rG.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix()),r=i.interaction;if(t||r){i.meshCollider.setGeometry(i.geometry,e);var n,a=i.meshCollider.getBoundingBoxData();if(a)return{behavior:(null==(n=i.interaction)?void 0:n.behavior)||0,type:a.type,triangles:a.area,backfaceCulling:i.renderer.side===tF.FRONT}}},i.renderer={renderMode:tj.MESH,blending:tL.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tF.DOUBLE,mask:0},i.defaultGeometry=ng.create(i.engine,{attributes:{aPos:{type:rR.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},aUV:{size:2,offset:0,releasable:!0,type:rR.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rR.TRIANGLES,drawCount:6}),i.geometry=i.defaultGeometry;var i,r=nl.create(i.engine,{shader:{fragment:nI,vertex:nM,shared:!0}});return i.material=r,i.material.setColor("_Color",new e1(1,1,1,1)),i.maskManager=new rM(t),i.configureMaterial(i.renderer),i}iN(i,e);var r=i.prototype;return r.setVisible=function(t){this.visible=t},r.getVisible=function(){return this.visible},r.setColor=function(t){eF(t,e1)?this._color.copyFrom(t):this._color.setFromArray(t),this.material.setColor("_Color",this._color)},r.setTexture=function(t){var e=this;return eL(function(){var i;return ez(this,function(r){switch(r.label){case 0:if("string"!=typeof t)return[3,2];return[4,nt.fromImage(t,e.item.engine)];case 1:return i=r.sent(),[3,3];case 2:i=t,r.label=3;case 3:return e.renderer.texture=i,e.material.setTexture("_MainTex",i),[2]}})})()},r.render=function(t){this.getVisible()&&(this.maskManager.drawStencilMask(t),this.draw(t))},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){var e=this.material.colorMask;this.material.colorMask=!1,this.draw(t),this.material.colorMask=e}},r.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},r.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},r.configureMaterial=function(t){var e=t.side,i=t.occlusion,r=t.blending,n=t.mask,a=t.texture,o=this.maskManager.maskMode,s=this.material;s.blending=!0,s.depthTest=!0,s.depthMask=i,s.stencilRef=void 0!==n?[n,n]:void 0,rL(s,r),rD(s,o),rF(s,e),s.shader.shaderData.properties='_MainTex("_MainTex",2D) = "white" {}',s.setVector4("_TexOffset",new e0(0,0,1,1)),s.setTexture("_MainTex",a);var u=rV(r),h=new e0;return h.x=t.occlusion?+t.transparentOcclusion:1,h.y=u,h.z=t.renderMode,h.w=o,s.setVector4("_TexParams",h),0===h.x||this.maskManager.alphaMaskEnabled?s.enableMacro("ALPHA_CLIP"):s.disableMacro("ALPHA_CLIP"),s},r.draw=function(t){for(var e=0;e<this.materials.length;e++){var i=this.materials[e];i.setVector2("_Size",this.transform.size),(this.renderer.renderMode===tj.BILLBOARD||this.renderer.renderMode===tj.VERTICAL_BILLBOARD||this.renderer.renderMode===tj.HORIZONTAL_BILLBOARD)&&i.setVector3("_Scale",this.transform.scale),t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),i,e)}},r.fromData=function(i){e.prototype.fromData.call(this,i);var r,n,a,o,s=null!=(r=i.renderer)?r:{},u=i.mask;u&&this.maskManager.setMaskOptions(u),this.renderer={renderMode:null!=(n=s.renderMode)?n:tj.MESH,blending:null!=(a=s.blending)?a:tL.ALPHA,texture:s.texture?this.engine.findObject(s.texture):this.engine.whiteTexture,occlusion:!!s.occlusion,transparentOcclusion:!!s.transparentOcclusion||this.maskManager.maskMode===t.MaskMode.MASK,side:null!=(o=s.side)?o:tF.DOUBLE,mask:this.maskManager.getRefValue()},this.configureMaterial(this.renderer)},rC(i,[{key:"color",get:function(){return this._color},set:function(t){this.setColor(t)}}]),i}(rA),n1=(ty=new Int32Array((tv=new Float32Array(1)).buffer),function(t){tv[0]=t;var e=ty[0],i=e>>16&32768,r=e>>12&2047,n=e>>23&255;return n<103?i:n>142?(i|=31744,i|=(255==n?0:1)&&8388607&e):n<113?(r|=2048,i|=(r>>114-n)+(r>>113-n&1)):(i|=n-112<<10|r>>1,i+=1&r)}),n2=function(){function t(t){if(Number.isInteger(t))this.data=new Uint16Array(t);else if(t&&"object"==typeof t&&Number.isInteger(t.length))for(var e=this.data=new Uint16Array(t.length),i=0;i<e.length;i++)e[i]=n1(t[i])}return t.prototype.set=function(t,e){for(var i=0;i<t.length;i++)this.data[i+e]=n1(t[i])},t}(),n3=new nb,n4=new rG;function n5(t,e,i,r,n,a,o){var s=r/n,u=r,h=e.speedOverLifetime;h&&(u=h.getIntegrateValue(0,r,n));var l=e.gravityModifier?e.gravityModifier.getIntegrateByTime(0,r):0;t.copyFrom(a),t.addScaledVector(o,u),t.addScaledVector(i,l);var c=e.linearVelOverLifetime||{},f=e.orbitalVelOverLifetime||{};if(f.enabled){var d=new e$;f.center&&d.setFromArray(f.center);var p=t.clone().subtract(d),m=f.asRotation,v=["x","y","z"].map(function(t){var e=f[t];return e?m?e.getValue(s):e.getIntegrateValue(0,r,n):0});n3.setFromArray(v).negate(),n4.setFromEuler(n3);var y=n4.transformPoint(p);t.addVectors(d,y)}if(c.enabled){var g=c.asMovement,x=c.x,b=c.y,T=c.z;if(x){var _=g?x.getValue(s):x.getIntegrateValue(0,r,n);t.x=t.x+_}if(b){var E=g?b.getValue(s):b.getIntegrateValue(0,r,n);t.y=t.y+E}if(T){var C=g?T.getValue(s):T.getIntegrateValue(0,r,n);t.z=t.z+C}}return t}function n6(t){return Array.isArray(t)?[t[0],t[1],t[2]]:[0,0,0]}function n8(t,e){for(var i=0,r=t.length;i<r;i++)t[i]=e;return t}function n9(t,e,i){if(e&&i)for(var r=0,n=e.length;r<n;r++)t[r]=e[r]*i[r];else if(e){if(t!==e)for(var a=0;a<e.length;a++)t[a]=e[a]}else if(i&&t!==i)for(var o=0;o<i.length;o++)t[o]=i[o];return t}var n7=((e_={})[tW.PARTICLE_ORIGIN_CENTER]=[0,0],e_[tW.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],e_[tW.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],e_[tW.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],e_[tW.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],e_[tW.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],e_[tW.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],e_[tW.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],e_[tW.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],e_);function at(t,e,i){var r=i.position,n=new e$(t,e,0),a=new e$;return i.getInverseViewProjectionMatrix().projectPoint(n,a),a.subtract(r),new n_(r,a)}function ae(t,e,i){var r=t.x,n=t.y,a=t.z,o=new e$(r-e,n+i,a),s=new e$(r-e,n-i,a),u=new e$(r+e,n-i,a),h=new e$(r+e,n+i,a);return[{p0:o,p1:s,p2:u},{p0:o.clone(),p1:u.clone(),p2:h}]}function ai(t,e,i){return void 0===i&&(i=1e-6),Math.abs(t-e)<i}function ar(t,e){void 0===e&&(e=2);var i=Math.pow(10,e);return Math.floor(t*i)/i}var an={pointIndexCache:{xIndex:0,yIndex:0},getPointInCurve:function(t){t[0];var e=t[1],i=this.getPointIndexInCurve(t,this.pointIndexCache),r=i.xIndex,n=i.yIndex;return new eJ(e[r],e[n])},getPointIndexInCurve:function(t,e){var i=t[0],r=t[2],n=i===tq.LINE?0:i===tq.EASE_OUT?0:i===tq.EASE_IN?2:i===tq.EASE?2:i===tq.HOLD&&r===tq.EASE_IN?2:0;return e?(e.xIndex=n,e.yIndex=n+1,e):{xIndex:n,yIndex:n+1}},isLeftSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===tq.HOLD&&this.isKeyframeTypeLeftSideEase(i))||this.isKeyframeTypeLeftSideEase(e)},isRightSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===tq.HOLD&&this.isKeyframeTypeRightSideEase(i))||this.isKeyframeTypeRightSideEase(e)},isKeyframeTypeLeftSideEase:function(t){return[tq.EASE,tq.EASE_IN,tq.AUTO].includes(t)},isKeyframeTypeRightSideEase:function(t){return[tq.EASE,tq.EASE_OUT,tq.AUTO].includes(t)},isHoldInKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===tq.HOLD&&[tq.HOLD,tq.LINE_OUT,tq.EASE_OUT].includes(i)},isHoldOutKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===tq.HOLD&&[tq.HOLD,tq.LINE,tq.EASE_IN].includes(i)}},aa=function(t,e){this.points=t,this.totalLength=e},ao={},as={};function au(t,e,i){return(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t}function ah(t,e,i){return 3*(1-3*i+3*e)*t*t+2*(3*i-6*e)*t+3*e}var al=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.catching={lastPoint:0,lastAddedLength:0};var n=function(t,e,i,r){var n=ar(e.x-t.x,3)+"_"+ar(e.y-t.y,3)+"_"+ar(e.z-t.z,3)+"&"+(ar(i.x-t.x,3)+"_"+ar(i.y-t.y,3))+"_"+ar(i.z-t.z,3)+"&"+(ar(r.x-t.x,3)+"_"+ar(r.y-t.y,3))+"_"+ar(r.z-t.z,3);if(as[n])return{data:as[n],interval:t};for(var a=[],o=null,s=0,u=0,h=0;h<300;h+=1){var l=new e$,c=h/299;u=0,l.x=3*Math.pow(1-c,2)*c*(i.x-t.x)+3*(1-c)*Math.pow(c,2)*(r.x-t.x)+Math.pow(c,3)*(e.x-t.x),l.y=3*Math.pow(1-c,2)*c*(i.y-t.y)+3*(1-c)*Math.pow(c,2)*(r.y-t.y)+Math.pow(c,3)*(e.y-t.y),l.z=3*Math.pow(1-c,2)*c*(i.z-t.z)+3*(1-c)*Math.pow(c,2)*(r.z-t.z)+Math.pow(c,3)*(e.z-t.z),null!==o&&(u+=Math.pow(l.x-o.x,2)+Math.pow(l.y-o.y,2)+Math.pow(l.z-o.z,2)),o=l,s+=u=Math.sqrt(u),a[h]={partialLength:u,point:l}}var f=new aa(a,s);return as[n]=f,{data:f,interval:new e$(t.x,t.y,t.z)}}(t,e,i,r),a=n.data,o=n.interval;this.lengthData=a,this.interval=o,this.totalLength=a.totalLength}return t.prototype.getPointInPercent=function(t){var e=this.lengthData;if(0===t)return e.points[0].point.clone().add(this.interval);if(ai(1-t,0))return e.points[299].point.clone().add(this.interval);if(ai(e.totalLength,0))return this.p1.clone();var i=new e$,r=ar(e.totalLength*t,4),n=this.catching.lastAddedLength,a=this.catching.lastPoint;if(ai(n,r))return e.points[a].point.clone().add(this.interval);var o=!0,s=1;for(r<n&&(s=-1);o;){if(r>=n){if(299===a){i.x=e.points[a].point.x,i.y=e.points[a].point.y,i.z=e.points[a].point.z;break}if(r<n+e.points[a+1].partialLength){var u=(r-n)/e.points[a+1].partialLength;i.x=e.points[a].point.x+(e.points[a+1].point.x-e.points[a].point.x)*u,i.y=e.points[a].point.y+(e.points[a+1].point.y-e.points[a].point.y)*u,i.z=e.points[a].point.z+(e.points[a+1].point.z-e.points[a].point.z)*u;break}}s>0&&a<299?(a+=s,n+=ar(e.points[a].partialLength,5)):s<0&&a>0?(n-=ar(e.points[a].partialLength,5),a+=s):o=!1}return this.catching.lastPoint=a,this.catching.lastAddedLength=n,i.add(this.interval),i},t}(),ac=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.temp=new i5,this.totalLength=0}return t.prototype.getPointInPercent=function(t){return 0===t?this.temp.copyFrom(this.p1):ai(1-t,0)?this.temp.copyFrom(this.p2):(am.slerpFlat(this.temp,this.p1,this.p2,t),this.temp)},t}(),af=function(){function t(t,e,i,r){this.precomputed=!1,this.control1=new eJ,this.control2=new eJ,this.weighted=!1,this.isConstant=!1,this.mSampleValues=Array(11),void 0!==t&&void 0!==e&&void 0!==i&&void 0!==r?(this.control1.x=t,this.control1.y=e,this.control2.x=i,this.control2.y=r,this.weighted=!0):void 0!==t&&void 0!==e?(this.control1.x=1/3,this.control1.y=t,this.control2.x=2/3,this.control2.y=e):this.isConstant=!0}var e=t.prototype;return e.getValue=function(t){return this.isConstant?0:this.control1.x===this.control1.y&&this.control2.x===this.control2.y||0===t||1===t?t:this.weighted?(this.precomputed||this.precompute(),au(this.getTForX(t),this.control1.y,this.control2.y)):this.bezierInterpolate(0,this.control1.y,this.control2.y,1,t)},e.bezierInterpolate=function(t,e,i,r,n){var a=1-n,o=a*a,s=n*n;return o*a*t+e*o*n*3+i*a*s*3+s*n*r},e.calcSampleValues=function(){for(var t=0;t<11;++t)this.mSampleValues[t]=au(.1*t,this.control1.x,this.control2.x)},e.getTForX=function(t){for(var e=this.mSampleValues,i=0,r=1;10!==r&&e[r]<=t;++r)i+=.1;var n=i+(t-e[--r])/(e[r+1]-e[r])*.1,a=ah(n,this.control1.x,this.control2.x);return a>=.001?function(t,e,i,r){for(var n=0;n<4;++n){var a=ah(e,i,r);if(0===a)break;var o=au(e,i,r)-t;e-=o/a}return e}(t,n,this.control1.x,this.control2.x):0===a?n:function(t,e,i,r,n){var a,o,s=0;do(a=au(o=e+(i-e)/2,r,n)-t)>0?i=o:e=o;while(Math.abs(a)>1e-7&&++s<10);return o}(t,i,i+.1,this.control1.x,this.control2.x)},e.precompute=function(){this.precomputed=!0,(this.control1.x!==this.control1.y||this.control2.x!==this.control2.y)&&this.calcSampleValues()},t}();function ad(t,e){var i,r,n,a=ap(t,e,!0),o=a.p0,s=a.p1,u=a.p2,h=a.p3;ih(u),ih(h);var l=h.x-o.x,c=h.y-o.y,f=ar((s.x-o.x)/l,5),d=ar((u.x-o.x)/l,5);ai(c,0)?i=r=NaN:(i=ar((s.y-o.y)/c,5),r=ar((u.y-o.y)/c,5)),f<0&&(console.error("Invalid bezier points, x1 < 0",o,s,u,h),f=0),d<0&&(console.error("Invalid bezier points, x2 < 0",o,s,u,h),d=0),f>1&&(console.error("Invalid bezier points, x1 >= 1",o,s,u,h),f=1),d>1&&(console.error("Invalid bezier points, x2 >= 1",o,s,u,h),d=1);var p=("bez_"+f+"_"+i+"_"+d+"_"+r).replace(/\./g,"p");return ao[p]?n=ao[p]:(n=ai(c,0)?new af:new af(f,i,d,r),ao[p]=n),{points:[o,s,u,h],timeInterval:l,valueInterval:c,curve:n}}function ap(t,e,i){var r=t[1],n=an.isHoldOutKeyframe(t),a=an.isHoldInKeyframe(e),o=!a&&an.isRightSideEase(t),s=!n&&an.isLeftSideEase(e);if(o&&!s&&!a){var u=new eJ(r[r.length-4],r[r.length-3]),h=new eJ(r[r.length-2],r[r.length-1]),l=an.getPointInCurve(e),c=new eJ(l.x,l.y),f=new eJ(c.x-(c.x-u.x)/10,c.y);return{type:"ease",p0:u,p1:h,p2:f,p3:c}}if(!o&&s&&!n){var d=e[1],p=an.getPointInCurve(t),m=new eJ(p.x,p.y),v=new eJ(d[0],d[1]),y=new eJ(d[2],d[3]),g=new eJ(m.x+(y.x-m.x)/10,m.y);return{type:"ease",p0:m,p1:g,p2:v,p3:y}}if(o&&s){var x=e[1];return{type:"ease",p0:new eJ(r[r.length-4],r[r.length-3]),p1:new eJ(r[r.length-2],r[r.length-1]),p2:new eJ(x[0],x[1]),p3:new eJ(x[2],x[3])}}var b=an.getPointInCurve(t),T=an.getPointInCurve(e);if(n?T.y=b.y:a&&(b.y=T.y),!i)return{type:"line",p0:b,p1:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a};var _=new eJ((T.x-b.x)/3+b.x,(T.y-b.y)/3+b.y),E=new eJ((T.x-b.x)/3*2+b.x,(T.y-b.y)/3*2+b.y);return{type:"line",p0:b,p1:_,p2:E,p3:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a}}var am=function(){function t(){}return t.slerpFlat=function(t,e,i,r){var n=e.x,a=e.y,o=e.z,s=e.w,u=i.x,h=i.y,l=i.z,c=i.w;if(0===r){t.x=n,t.y=a,t.z=o,t.w=s;return}if(1===r){t.x=u,t.y=h,t.z=l,t.w=c;return}if(s!==c||n!==u||a!==h||o!==l){var f=1-r,d=n*u+a*h+o*l+s*c,p=d>=0?1:-1,m=1-d*d;if(m>Number.EPSILON){var v=Math.sqrt(m),y=Math.atan2(v,d*p);f=Math.sin(f*y)/v,r=Math.sin(r*y)/v}var g=r*p;if(n=n*f+u*g,a=a*f+h*g,o=o*f+l*g,s=s*f+c*g,f===1-r){var x=1/Math.sqrt(n*n+a*a+o*o+s*s);n*=x,a*=x,o*=x,s*=x}}t.x=n,t.y=a,t.z=o,t.w=s},t}(),av="not_implement",ay=function(){function t(t){this.onCreate(t)}var e=t.prototype;return e.onCreate=function(t){throw Error(av)},e.getIntegrateValue=function(t,e,i){throw Error(av)},e.getIntegrateByTime=function(t,e){throw Error(av)},e.getValue=function(t){throw Error(av)},e.getMaxTime=function(){throw Error(av)},e.toUniform=function(t){throw Error(av)},e.map=function(t){throw Error(av)},e.scaleXCoord=function(t){return this},e.toData=function(){throw Error(av)},t.getAllData=function(t,e){for(var i=new(e?n2:Float32Array)(4*t.index),r=0,n=0,a=t.curves;r<a.length;r++){var o=a[r].toData();i.set(o,n),n+=o.length}return e?i.data:i},t}(),ag=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.value=t},i.getIntegrateValue=function(t,e,i){return this.value*(e-t)},i.getIntegrateByTime=function(t,e){return .5*this.value*(e*e-t*t)},i.getValue=function(t){return this.value},i.toUniform=function(){return new Float32Array([0,this.value,0,0])},i.map=function(t){var e=this.value;return this.value=t(e),this},i.getMaxTime=function(){return 0},e}(ay),ax=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.items=t},i.getValue=function(t){var e=this.items;return e[Math.floor(Math.random()*e.length)]},i.map=function(t){return this.items=this.items.map(t),this},e}(ay),ab=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t,e){return this.min+(null!=e?e:Math.random())*(this.max-this.min)},i.getIntegrateValue=function(t,e,i){return(this.min+(null!=i?i:1)*(this.max-this.min))*(e-t)},i.toUniform=function(){return new Float32Array([4,this.min,this.max,0])},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},e}(ay),aT=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t){for(var e=this.min,i=this.max,r=[],n=0;n<e.length;n++){var a=Math.random();r[n]=e[n]*(1-a)+i[n]*a}return r},i.map=function(t){return this.min=this.min.map(t),this.max=this.max.map(t),this},e}(ay),a_=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1],this.xCoord=1},i.getValue=function(t){return t/=this.xCoord,this.min*(1-t)+this.max*t},i.toUniform=function(){return new Float32Array([1,this.min,this.max,this.xCoord])},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=this.min,n=this.max,a=this.xCoord*i;return((r+e/a*(n-r)+r)*e-(r+t/a*(n-r)+r)*t)/2},i.getIntegrateByTime=function(t,e){return aI(e,0,this.xCoord,this.min,this.max)-aI(t,0,this.xCoord,this.min,this.max)},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},i.scaleXCoord=function(t){return this.xCoord=t,this},e}(ay),aE=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.stops=e4(t)},i.getStops=function(){return this.stops},i.getValue=function(t){for(var e=this.stops,i=e.length-1,r=0;r<i;r++){var n=e[r],a=e[r+1];if(n.time<=t&&a.time>t){var o=(t-n.time)/(a.time-n.time);return e5(n.color.toArray(),a.color.toArray(),o,!0)}}return e[i].color.toArray()},e}(ay),aC=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t.map(function(t){return t.slice?t.slice(0,2):[t.time,t.value]}).sort(function(t,e){return t[0]-e[0]});var e=this.keys[this.keys.length-1];e[0]<1&&this.keys.push([1,e[1]]);var i=this.keys[0];i[0]>0&&this.keys.unshift([0,i[1]]),this.isLineSeg=!0},i.getValue=function(t){var e=this.keys;if(t<e[0][0])return e[0][1];for(var i=e.length-1,r=0;r<i;r++){var n=e[r],a=e[r+1],o=n[0],s=a[0];if(t>=o&&t<=s){var u=(t-o)/(s-o),h=n[1];return h+u*(a[1]-h)}}return e[i][1]},i.getIntegrateValue=function(t,e,i){return void 0===i&&(i=1),(this.integrate(e,!1)-this.integrate(t,!1))*i},i.getIntegrateByTime=function(t,e){return this.integrate(e,!0)-this.integrate(t,!0)},i.integrate=function(t,e){var i=this.keys;if(t<=i[0][0])return 0;for(var r=0,n=i.length-1,a=e?aI:aM,o=0;o<n;o++){var s=i[o],u=i[o+1],h=s[0],l=u[0];if(t>h&&t<=l)return r+a(t,h,l,s[1],u[1]);r+=a(l,h,l,s[1],u[1])}return r},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*Math.ceil(t.length/2)),i=0,r=0;i<t.length;i++,r+=2)e.set(t[i],r);return e.set(t[t.length-1],e.length-2),e},i.toUniform=function(t){var e=t.index,i=Math.ceil(this.keys.length/2);return t.lineSegCount+=i,t.curves.push(this),t.index+=i,t.max=Math.max(t.max,i),new Float32Array([3,e,i,0])},i.map=function(t){return this.keys.forEach(function(e){return e[1]=t(e[1])}),this},i.scaleXCoord=function(t){return this.keys.forEach(function(e){return e[0]=t*e[0]}),this},e}(ay),aS=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t[0],this.values=t[1]},i.getValue=function(t){for(var e=this.keys,i=this.values,r=0;r<e.length-1;r++){var n=e[r],a=e[r+1];if(n[0]<=t&&a[0]>=t){var o=a[1]-n[1],s=void 0;return s=0===o?(t-n[0])/(a[0]-n[0]):(function(t,e,i){var r=i[0]-e[0],n=e[3]*r,a=i[2]*r,o=(t-e[0])/r,s=o*o,u=s*o;return(2*u-3*s+1)*e[1]+(u-2*s+o)*n+(u-s)*a+(-2*u+3*s)*i[1]}(t,n,a)-n[1])/o,this.calculateVec(r,s)}}return t<=e[0][0]?i[0].slice():i[i.length-1].slice()},i.calculateVec=function(t,e){for(var i=this.values[t],r=this.values[t+1],n=[0,0,0],a=0;a<i.length;a++)n[a]=i[a]*(1-e)+r[a]*e;return n},e}(ay),aw=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length){for(var n=0;n<e.length-1;n++){var a=e[n],o=e[n+1],s=new e$(i[n][0],i[n][1],i[n][2]),u=new e$(i[n+1][0],i[n+1][1],i[n+1][2]),h=new e$(r[2*n][0],r[2*n][1],r[2*n][2]),l=new e$(r[2*n+1][0],r[2*n+1][1],r[2*n+1][2]),c=ad(a,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new al(s,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g,timeStart:Number(v.x),timeEnd:Number(y.x)}}this.keyTimeData=Object.keys(this.curveSegments)}},i.getValue=function(t){var e=ar(t,5),i=0,r=new e$,n=this.keyTimeData;if(!n.length)return r;var a=this.curveSegments[n[0]].timeStart,o=this.curveSegments[n[n.length-1]].timeEnd;if(e<=a)return this.curveSegments[n[0]].pathCurve.getPointInPercent(0);if(e>=o)return this.curveSegments[n[n.length-1]].pathCurve.getPointInPercent(1);for(var s=0;s<n.length;s++){var u=this.curveSegments[n[s]].timeStart,h=this.curveSegments[n[s]].timeEnd;if(e>=Number(u)&&e<Number(h)){var l=this.curveSegments[n[s]].pathCurve;i=this.getPercValue(n[s],e),r=l.getPointInPercent(i)}}return r},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=ar((e-r.x)/n,4);return eK(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=this.keyTimeData;return this.curveSegments[t[t.length-1]].timeEnd},e}(ay),aA=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length)for(var n=0;n<e.length-1;n++){var a=e[n],o=e[n+1],s=i5.fromArray(i[n]),u=i5.fromArray(i[n+1]),h=i5.fromArray(r[2*n]),l=i5.fromArray(r[2*n+1]),c=ad(a,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new ac(s,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g}}},i.getValue=function(t){var e=0,i=ar(t,5),r=Object.keys(this.curveSegments),n=Number(r[0].split("&")[0]),a=Number(r[r.length-1].split("&")[1]);if(i<=n)return this.curveSegments[r[0]].pathCurve.getPointInPercent(0);if(i>=a)return this.curveSegments[r[r.length-1]].pathCurve.getPointInPercent(1);for(var o=0;o<r.length;o++){var s=r[o].split("&"),u=s[0],h=s[1];if(i>=Number(u)&&i<Number(h)){var l=this.curveSegments[r[o]].pathCurve;return e=this.getPercValue(r[o],i),l.getPointInPercent(e)}}return this.curveSegments[r[0]].pathCurve.getPointInPercent(0)},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=ar((e-r.x)/n,4);return eK(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=Object.keys(this.curveSegments);return Number(t[t.length-1].split("&")[1])},e}(ay);function aM(t,e,i,r,n){var a=t-e;return(r+r+(n-r)*a/(i-e))*a/2}function aI(t,e,i,r,n){var a=t*t,o=e*e;return(a*t*2*(r-n)+3*a*(e*n-i*r)-o*e*(2*r+n)+3*o*i*r)/(6*(e-i))}function aR(t,e){if(e){var i=e[0],r=e[1];if(i===tZ.CURVE){t.curves.push(r);var n=r.length;r[0][0]>0&&n++,r[r.length-1][0]<1&&n++,t.index+=n,t.max=Math.max(t.max,n),t.curveCount+=n}else if(i===tZ.LINE){var a=r.length;if(2===a&&0===r[0][0]&&1===r[1][0])return;r[0][0]>0&&a++,r[r.length-1][0]<1&&a++;var o=Math.ceil(a/2);t.lineSegCount+=o,t.curves.push(r),t.index+=o,t.max=Math.max(t.max,o)}else if(i===tZ.BEZIER_CURVE){var s=r.length-1;t.index+=2*s,t.curves.push(r),t.max=Math.max(t.max,2*s),t.curveCount+=2*s}}}function aP(){return{curves:[],index:0,max:0,lineSegCount:0,curveCount:0}}function aO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(aO=function(){return!!t})()}function aN(t,e,i){return(aN=aO()?Reflect.construct:function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&iO(n,i.prototype),n}).apply(null,arguments)}var aV=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e0,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aG(t[0]),this.yCurve=aG(t[1]),this.zCurve=aG(t[2]),this.wCurve=aG(t[3])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t),n=this.wCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime(),this.wCurve.getMaxTime())},e}(ay),aL=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e$,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aG(t[0]),this.yCurve=aG(t[1]),this.zCurve=aG(t[2])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t);return this.value.set(e,i,r),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime())},e}(ay),aF=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new eJ,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aG(t[0]),this.yCurve=aG(t[1])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t);return this.value.set(e,i),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime())},e}(ay),aD="editor",ak={"Item duration can't be less than 0":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS","ValueType: 21/22 is not supported":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b","Container size overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#MvjnY","Container is not an HTMLElement":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#WZaWg","Invalid container size":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#lLlSW","DPI overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#ulfNT"};t.TangentMode=void 0,(tg=t.TangentMode||(t.TangentMode={}))[tg.Cubic=0]="Cubic",tg[tg.Linear=1]="Linear",tg[tg.Constant=2]="Constant",t.WeightedMode=void 0,(tx=t.WeightedMode||(t.WeightedMode={}))[tx.None=0]="None",tx[tx.In=1]="In",tx[tx.Out=2]="Out",tx[tx.Both=3]="Both";var az=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.keyFrames=aB(t);var e=this.keyFrames;this.curveMap={},this.keys=[],this.curveInfos=[];for(var i=0;i<e.length-1;i++){var r=function(t,e){var i,r,n,a=new eJ(t.time,t.value),o=new eJ,s=new eJ,u=new eJ,h=2===t.weightedMode||3===t.weightedMode||1===e.weightedMode||3===e.weightedMode,l=2===t.tangentMode,c=(h?t.outWeight:1)*(e.time-t.time)/3;o.x=t.time+c,o.y=t.value+c*(l?0:t.outSlope);var f=(h?e.inWeight:1)*(e.time-t.time)/3;s.x=e.time-f,s.y=e.value-f*(l?0:e.inSlope),u.x=e.time,u.y=l?t.value:e.value,ih(s),ih(u);var d=u.x-a.x,p=u.y-a.y,m=ar((o.x-a.x)/d,5),v=ar((s.x-a.x)/d,5);ai(p,0)?i=r=NaN:(i=ar((o.y-a.y)/p,5),r=ar((s.y-a.y)/p,5)),m<0&&(console.error("Invalid bezier points, x1 < 0",a,o,s,u),m=0),v<0&&(console.error("Invalid bezier points, x2 < 0",a,o,s,u),v=0),m>1&&(console.error("Invalid bezier points, x1 >= 1",a,o,s,u),m=1),v>1&&(console.error("Invalid bezier points, x2 >= 1",a,o,s,u),v=1);var y=("bez_"+m+"_"+i+"_"+v+"_"+r).replace(/\./g,"p");return ao[y]?n=ao[y]:(n=ai(p,0)?new af:h?new af(m,i,v,r):new af(i,r),ao[y]=n),{points:[a,o,s,u],timeInterval:d,valueInterval:p,curve:n}}(e[i],e[i+1]),n=r.points,a=r.curve,o=r.timeInterval,s=r.valueInterval,u=n[0],h=n[n.length-1];this.keys.push([].concat(u.toArray(),n[1].toArray())),this.keys.push([].concat(h.toArray(),n[2].toArray()));var l={points:n,timeInterval:o,valueInterval:s,curve:a,timeStart:Number(u.x),timeEnd:Number(h.x)};this.curveMap[u.x+"&"+h.x]=l,this.curveInfos.push(l)}},i.getValue=function(t){var e=0,i=this.keyFrames.length;if(t<=this.keyFrames[0].time)e=this.keyFrames[0].value;else if(t<this.keyFrames[i-1].time)for(var r=0;r<this.keyFrames.length-1;r++){var n=this.keyFrames[r].time,a=this.keyFrames[r+1].time;if(t>=n&&t<a){var o=this.curveInfos[r],s=o.points[0],u=o.timeInterval,h=o.valueInterval,l=(t-s.x)/u,c=0;c=1===this.keyFrames[r].tangentMode?l:o.curve.getValue(l),e=s.y+h*c;break}}else t>=this.keyFrames[i-1].time&&(e=this.keyFrames[i-1].value);return e},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=(e-t)/i,n=0,a=Object.keys(this.curveMap);if(r<=this.curveMap[a[0]].timeStart)return 0;for(var o=0;o<a.length;o++){var s=this.curveMap[a[o]].timeStart,u=this.curveMap[a[o]].timeEnd;if(r>=Number(u)&&(n+=i*this.getCurveIntegrateValue(a[o],Number(u))),r>=Number(s)&&r<Number(u)){n+=i*this.getCurveIntegrateValue(a[o],r);break}}return n},i.getIntegrateByTime=function(t,e){return this.getIntegrateValue(0,e)-this.getIntegrateValue(0,t)},i.getCurveIntegrateValue=function(t,e){for(var i=this.curveMap[t],r=i.points[0],n=i.timeInterval,a=i.valueInterval,o=0,s=(e-r.x)/20,u=0;u<=20;u++){var h=u*s/n,l=r.y+a*i.curve.getValue(h);0===u||20===u?o+=l:u%2==1?o+=4*l:o+=2*l}return s/3*o},i.toUniform=function(t){var e=t.index,i=this.keys.length;return t.curves.push(this),t.index=e+i,t.max=Math.max(t.max,i),t.curveCount+=i,new Float32Array([5,e+1/i,e,i])},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*t.length),i=0,r=0;i<t.length;i++,r+=4)e.set(t[i],r);return e},i.getMaxTime=function(){return this.keyFrames[this.keyFrames.length-1].time},e}(ay);function aB(t){for(var e=[],i=[],r={x:0,y:0},n=0;n<t.length;n++){var a=t[n],o=ap(a,n+1<t.length?t[n+1]:t[n],!0),s=o.p0,u=o.p1,h=o.p2,l=o.p3,c=o.type;ih(h),ih(l);var f={leftControl:r,value:s,rightControl:u,tangentMode:"line"===c?1:0};a[0]===tq.HOLD&&(f.tangentMode=2),i.push(f),r=h}for(var d=function(t,e){return(e.y-t.y)/(e.x-t.x+1e-6)},p=0;p<i.length;p++){var m=i[p].leftControl,v=i[p].value,y=i[p].rightControl,g=0,x=0;p>0&&(g=d(m,v)),p<i.length-1&&(x=d(v,y));var b={time:v.x,value:v.y,inSlope:g,outSlope:x,inWeight:0,outWeight:0,tangentMode:i[p].tangentMode,weightedMode:3};e.push(b),p>0&&(b.inWeight=(v.x-m.x)/((v.x-i[p-1].value.x)/3)),p+1<i.length&&(b.outWeight=(y.x-v.x)/((i[p+1].value.x-v.x)/3))}return e}var aU=((eE={})[tZ.RANDOM]=function(t){return eF(t[0],Array)?new aT(t):new ab(t)},eE[tZ.CONSTANT]=function(t){return new ag(t)},eE[tZ.CONSTANT_VEC2]=function(t){return new ag(t)},eE[tZ.CONSTANT_VEC3]=function(t){return new ag(t)},eE[tZ.CONSTANT_VEC4]=function(t){return new ag(t)},eE[tZ.RGBA_COLOR]=function(t){return new ag(t)},eE[tZ.COLORS]=function(t){return new ax(t.map(function(t){return e2(t,!1)}))},eE[tZ.LINE]=function(t){return 2===t.length&&0===t[0][0]&&1===t[1][0]?new a_([t[0][1],t[1][1]]):new aC(t)},eE[tZ.GRADIENT_COLOR]=function(t){return new aE(t)},eE[tZ.LINEAR_PATH]=function(t){return new aS(t)},eE[tZ.BEZIER_CURVE]=function(t){return 1===t.length?new ag(t[0][1][1]):new az(t)},eE[tZ.BEZIER_CURVE_PATH]=function(t){return 1===t[0].length?new ag(aN(e$,[].concat(t[1][0]))):new aw(t)},eE[tZ.BEZIER_CURVE_QUAT]=function(t){return 1===t[0].length?new ag(aN(i5,[].concat(t[1][0]))):new aA(t)},eE[tZ.COLOR_CURVE]=function(t){return new aj(t)},eE[tZ.VECTOR4_CURVE]=function(t){return new aV(t)},eE[tZ.VECTOR2_CURVE]=function(t){return new aF(t)},eE[27]=function(t){return new aL(t)},eE);function aG(t){if(!t||!isNaN(+t))return new ag(t||0);if(eF(t,ay))return t;if(iy(aU[t[0]]))return aU[t[0]](t[1]);throw Error("ValueType: "+t[0]+" is not supported, see "+ak["ValueType: 21/22 is not supported"]+".")}var aj=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e1,e}iN(e,t);var i=e.prototype;return i.onCreate=function(t){this.rCurve=aG(t[0]),this.gCurve=aG(t[1]),this.bCurve=aG(t[2]),this.aCurve=aG(t[3])},i.getValue=function(t){var e=this.rCurve.getValue(t),i=this.gCurve.getValue(t),r=this.bCurve.getValue(t),n=this.aCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.rCurve.getMaxTime(),this.gCurve.getMaxTime(),this.bCurve.getMaxTime(),this.aCurve.getMaxTime())},e}(ay);t.TexturePaintScaleMode=void 0,(tb=t.TexturePaintScaleMode||(t.TexturePaintScaleMode={}))[tb.Fill=0]="Fill",tb[tb.Fit=1]="Fit",tb[tb.Crop=2]="Crop",tb[tb.Tile=3]="Tile",t.ShapeComponent=function(e){function i(t){(i=e.call(this,t)||this).shapeDirty=!0,i.materialDirty=!0,i.graphicsPath=new ut,i.fills=[],i.strokeAttributes={width:1,alignment:.5,cap:ea.Butt,join:eo.Miter,miterLimit:10},i.strokeWidth=1,i.strokeCap=ea.Butt,i.strokeJoin=eo.Miter,i.strokes=[],i.meshCollider=new a3,i.fillMaterials=[],i.strokeMaterials=[],i.getHitTestParams=function(t){var e=rG.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix());if(t){i.meshCollider.setGeometry(i.geometry,e);var r=i.meshCollider.getBoundingBoxData();if(r)return{behavior:0,type:r.type,triangles:r.area,backfaceCulling:i.rendererOptions.side===tF.FRONT}}},i.rendererOptions={renderMode:tj.MESH,blending:tL.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tF.DOUBLE,mask:0},i.maskManager=new rM(i.engine);var i,r={type:ei.Solid,color:new e1(1,1,1,1)};i.strokes.push(r);var n={type:ei.Solid,color:new e1(1,1,1,1)};return i.fills.push(n),i.shapeAttributes={type:en.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},i.geometry=ng.create(i.engine,{attributes:{aPos:{type:rR.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},aUV:{size:2,offset:0,releasable:!0,type:rR.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rR.TRIANGLES,drawCount:6}),i.geometry.subMeshes.push({offset:0,indexCount:0,vertexCount:0},{offset:0,indexCount:0,vertexCount:0}),i}iN(i,e);var r=i.prototype;return r.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},r.onUpdate=function(t){this.shapeDirty&&(this.buildPath(this.shapeAttributes),this.buildGeometryFromPath(this.graphicsPath.shapePath),this.shapeDirty=!1),this.materialDirty&&(this.updateMaterials(),this.materialDirty=!1)},r.render=function(t){this.maskManager.drawStencilMask(t),this.draw(t)},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){for(var e=!1,i=0;i<this.fillMaterials.length;i++)e=this.fillMaterials[i].colorMask,this.fillMaterials[i].colorMask=!1,t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[i],0),this.fillMaterials[i].colorMask=e;for(var r=0;r<this.strokeMaterials.length;r++)e=this.strokeMaterials[r].colorMask,this.strokeMaterials[r].colorMask=!1,t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[r],1),this.strokeMaterials[r].colorMask=e}},r.draw=function(t){for(var e=0;e<this.fillMaterials.length;e++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[e],0);for(var i=0;i<this.strokeMaterials.length;i++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[i],1)},r.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},r.buildGeometryFromPath=function(t){var e=t.shapePrimitives,i=[],r=[];if(this.fills.length>0)for(var n,a=iD(e);!(n=a()).done;){var o=n.value.shape,s=[],u=r.length,h=i.length/2;o.build(s),o.triangulate(s,i,h,r,u)}var l=r.length;if(this.strokes.length>0)for(var c,f=iD(e);!(c=f()).done;){var d=c.value.shape,p=[];r.length;var m=i.length/2,v=this.strokeAttributes;v.cap=this.strokeCap,v.join=this.strokeJoin,v.width=this.strokeWidth;var y=!0;this.shapeAttributes.type===en.Custom&&(y=d.closePath),d.build(p),sJ(p,v,!1,y,i,2,m,r)}var g=r.length-l,x=i.length/2,b=this.geometry.getAttributeData("aPos"),T=this.geometry.getAttributeData("aUV"),_=this.geometry.getIndexData();(!b||b.length<3*x)&&(b=new Float32Array(3*x)),(!T||T.length<2*x)&&(T=new Float32Array(2*x)),(!_||_.length<r.length)&&(_=new Uint16Array(r.length));for(var E=Number.MAX_VALUE,C=Number.MAX_VALUE,S=Number.MIN_VALUE,w=Number.MIN_VALUE,A=0;A<x;A++){var M=3*A,I=2*A,R=i[I],P=i[I+1];b[M]=R,b[M+1]=P,b[M+2]=0,E=Math.min(E,R),C=Math.min(C,P),S=Math.max(S,R),w=Math.max(w,P)}for(var O=S-E,N=w-C,V=0;V<x;V++){var L=3*V,F=2*V;T[F]=(b[L]-E)/O,T[F+1]=(b[L+1]-C)/N}_.set(r),this.geometry.setAttributeData("aPos",b),this.geometry.setAttributeData("aUV",T),this.geometry.setIndexData(_),this.geometry.setDrawCount(r.length);var D=this.geometry.subMeshes[0],k=this.geometry.subMeshes[1];D.indexCount=l,k.offset=2*l,k.indexCount=g},r.buildPath=function(e){switch(this.graphicsPath.clear(),e.type){case en.Custom:for(var i,r=this.shapeAttributes,n=r.points,a=r.easingIns,o=r.easingOuts,s=iD(r.shapes);!(i=s()).done;){var u=i.value,h=u.indexes,l=n[h[0].point];this.graphicsPath.moveTo(l.x,l.y);for(var c=1;c<h.length;c++){var f=h[c],d=h[c-1],p=n[f.point],m=n[d.point],v=o[d.easingOut],y=a[f.easingIn];this.graphicsPath.bezierCurveTo(v.x+m.x,v.y+m.y,y.x+p.x,y.y+p.y,p.x,p.y,1)}if(u.close){var g=h[0],x=h[h.length-1],b=n[g.point],T=n[x.point],_=o[x.easingOut],E=a[g.easingIn];this.graphicsPath.bezierCurveTo(_.x+T.x,_.y+T.y,E.x+b.x,E.y+b.y,b.x,b.y,1),this.graphicsPath.closePath()}}break;case en.Ellipse:this.graphicsPath.ellipse(0,0,e.xRadius,e.yRadius);break;case en.Rectangle:this.graphicsPath.rect(-e.width/2,-e.height/2,e.width,e.height,e.roundness);break;case en.Star:this.graphicsPath.polyStar(e.pointCount,e.outerRadius,e.innerRadius,e.outerRoundness,e.innerRoundness,t.StarType.Star);break;case en.Polygon:this.graphicsPath.polyStar(e.pointCount,e.radius,e.radius,e.roundness,e.roundness,t.StarType.Polygon)}},r.updateMaterials=function(){for(var t=0;t<this.fills.length;t++)this.updatePaintMaterial(this.fillMaterials[t],this.fills[t]);for(var e=0;e<this.strokes.length;e++)this.updatePaintMaterial(this.strokeMaterials[e],this.strokes[e])},r.updatePaintMaterial=function(t,e){if(t.setFloat("_FillType",e.type),e.type===ei.Solid)t.color=e.color;else if(e.type===ei.GradientLinear||e.type===ei.GradientAngular||e.type===ei.GradientRadial)this.updateGradientMaterial(t,e.gradientStops,e.startPoint,e.endPoint);else if(e.type===ei.Texture){t.setInt("_ImageScaleMode",e.scaleMode),t.setVector2("_ImageSize",new eJ(e.texture.getWidth(),e.texture.getHeight()));var i=this.getBoundingBox(),r=i.area[0].p1,n=i.area[1].p2;t.setVector2("_DestSize",new eJ(r.x-n.x,r.y-n.y)),t.setFloat("_ImageOpacity",e.opacity),t.setFloat("_ImageScalingFactor",e.scalingFactor),t.setTexture("_ImageTex",e.texture);var a=e.textureTransform;t.setMatrix3("_TextureTransform",new nT().scale(a.scale.x,a.scale.y).rotate(a.rotation).translate(a.offset.x,a.offset.y).invert())}},r.updateGradientMaterial=function(t,e,i,r){for(var n,a=[],o=[],s=iD(e.stops);!(n=s()).done;){var u=n.value,h=u.color;a.push(new e0(h.r,h.g,h.b,h.a)),o.push(u.time)}t.setVector4Array("_Colors",a),t.setFloats("_Stops",o),t.setInt("_StopsCount",o.length),t.setVector2("_StartPoint",i),t.setVector2("_EndPoint",r)},r.createMaterialFromRendererOptions=function(e){var i={shader:{vertex:"precision highp float;attribute vec3 aPos;attribute vec2 aUV;varying vec2 uv0;uniform mat4 effects_MatrixVP;uniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;void main(){vec4 pos=vec4(aPos.xyz,1.0);uv0=aUV;gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}",fragment:"precision highp float;\n#define _MAX_STOPS 8\n#define PI 3.14159265359\nuniform vec4 _Color;uniform vec4 _Colors[_MAX_STOPS];uniform float _Stops[_MAX_STOPS];uniform int _StopsCount;uniform float _FillType;uniform vec2 _StartPoint;uniform vec2 _EndPoint;uniform sampler2D _ImageTex;uniform vec2 _ImageSize;uniform vec2 _DestSize;uniform int _ImageScaleMode;uniform mat3 _TextureTransform;uniform float _ImageScalingFactor;uniform float _ImageOpacity;varying vec2 uv0;vec4 smoothMix(vec4 a,vec4 b,float t){return mix(a,b,smoothstep(0.0,1.0,t));}float calculateAngleRatio(vec2 v1,vec2 v2){float angle=atan(v2.y,v2.x)-atan(v1.y,v1.x);if(angle<0.0)angle+=2.0*PI;return angle/(2.0*PI);}vec2 applyTransform(mat3 m,vec2 uv){uv=uv-vec2(0.5,0.5);vec3 p=m*vec3(uv,1.0);p.xy=p.xy+vec2(0.5,0.5);return p.xy;}void main(){vec4 finalColor=vec4(1.0);if(_FillType==0.0){finalColor=_Color;}else if(_FillType==1.0||_FillType==2.0||_FillType==3.0){float t=0.0;if(_FillType==1.0){vec2 gradientVector=_EndPoint-_StartPoint;vec2 pixelVector=uv0-_StartPoint;float denom=max(dot(gradientVector,gradientVector),1e-6);t=clamp(dot(pixelVector,gradientVector)/denom,0.0,1.0);}else if(_FillType==2.0){float maxRadius=max(distance(_EndPoint,_StartPoint),0.001);t=clamp(distance(uv0,_StartPoint)/maxRadius,0.0,1.0);}else{vec2 center=_StartPoint;vec2 referenceVector=_EndPoint-center;vec2 targetVector=uv0-center;if(length(targetVector)>0.001){t=calculateAngleRatio(referenceVector,targetVector);}}finalColor=_Colors[0];for(int i=1;i<_MAX_STOPS;i++){if(i>=_StopsCount)break;float prevStop=_Stops[i-1];float currStop=_Stops[i];if(t>=prevStop&&t<=currStop){float localT=(t-prevStop)/max(currStop-prevStop,1e-6);finalColor=smoothMix(_Colors[i-1],_Colors[i],localT);break;}}}else if(_FillType==4.0){vec2 uv=uv0;float rSrc=_ImageSize.x/max(_ImageSize.y,1.0);float rDst=_DestSize.x/max(_DestSize.y,1.0);bool maskOutside=false;if(_ImageScaleMode==0){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(1.0,rSrc/rDst);}else{scale=vec2(rDst/rSrc,1.0);}uv=(uv-0.5)*scale+0.5;uv=clamp(uv,0.0,1.0);}else if(_ImageScaleMode==1){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(rSrc/rDst,1.0);}else{scale=vec2(1.0,rSrc/rDst);}uv=(uv-0.5)*scale+0.5;maskOutside=true;}else if(_ImageScaleMode==2){uv=applyTransform(_TextureTransform,uv0);maskOutside=true;}else if(_ImageScaleMode==3){float aspectFix=rDst/max(rSrc,1e-6);vec2 uvTile=(uv0-0.5)*vec2(aspectFix,1.0)+0.5;float s=max(abs(_ImageScalingFactor),1e-6);uv=fract(uvTile*s);}vec4 img=texture2D(_ImageTex,uv);if(maskOutside){if(uv.x<0.0||uv.x>1.0||uv.y<0.0||uv.y>1.0){img.a=0.0;}}img.a*=_ImageOpacity;finalColor=img;}finalColor.rgb*=finalColor.a;gl_FragColor=finalColor;}",glslVersion:t.GLSLVersion.GLSL1}},r=nl.create(this.engine,i),n=e.side,a=e.occlusion,o=e.blending,s=e.mask,u=e.texture,h=this.maskManager.maskMode;r.blending=!0,r.depthTest=!0,r.depthMask=a,r.stencilRef=void 0!==s?[s,s]:void 0,rL(r,o),rD(r,h),rF(r,n),r.shader.shaderData.properties='_ImageTex("_ImageTex",2D) = "white" {}',r.setVector4("_TexOffset",new e0(0,0,1,1)),r.setTexture("_ImageTex",u);var l=rV(o),c=new e0;return c.x=e.occlusion?+e.transparentOcclusion:1,c.y=l,c.z=e.renderMode,c.w=h,r.setVector4("_TexParams",c),0===c.x||this.maskManager.alphaMaskEnabled?r.enableMacro("ALPHA_CLIP"):r.disableMacro("ALPHA_CLIP"),r},r.fromData=function(i){e.prototype.fromData.call(this,i),this.shapeDirty=!0,i.mask&&this.maskManager.setMaskOptions(i.mask);var r=null!=(n=i.renderer)?n:{};this.rendererOptions={renderMode:tj.MESH,blending:null!=(a=r.blending)?a:tL.ALPHA,texture:r.texture?this.engine.findObject(r.texture):this.engine.whiteTexture,occlusion:!!r.occlusion,transparentOcclusion:!!r.transparentOcclusion||this.maskManager.maskMode===t.MaskMode.MASK,side:null!=(o=r.side)?o:tF.DOUBLE,mask:this.maskManager.getRefValue()},this.strokeCap=null!=(s=i.strokeCap)?s:ea.Butt,this.strokeWidth=null!=(u=i.strokeWidth)?u:1,this.strokeJoin=null!=(h=i.strokeJoin)?h:eo.Miter,this.fills.length=0,this.fillMaterials.length=0;for(var n,a,o,s,u,h,l,c=iD(i.fills);!(l=c()).done;){var f=l.value;this.fills.push(this.createPaint(f)),this.fillMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}this.strokes.length=0,this.strokeMaterials.length=0;for(var d,p=iD(i.strokes);!(d=p()).done;){var m=d.value;this.strokes.push(this.createPaint(m)),this.strokeMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}switch(this.materials=[].concat(this.fillMaterials,this.strokeMaterials),i.type){case en.Custom:for(var v,y={type:en.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},g=iD(i.points);!(v=g()).done;){var x=v.value;y.points.push(new eJ(x.x,x.y))}for(var b,T=iD(i.easingIns);!(b=T()).done;){var _=b.value;y.easingIns.push(new eJ(_.x,_.y))}for(var E,C=iD(i.easingOuts);!(E=C()).done;){var S=E.value;y.easingOuts.push(new eJ(S.x,S.y))}y.shapes=i.shapes,this.shapeAttributes=y;break;case en.Ellipse:var w={type:en.Ellipse,xRadius:i.xRadius,yRadius:i.yRadius};this.shapeAttributes=w;break;case en.Rectangle:var A={type:en.Rectangle,width:i.width,height:i.height,roundness:i.roundness};this.shapeAttributes=A;break;case en.Star:var M={type:en.Star,pointCount:i.pointCount,innerRadius:i.innerRadius,outerRadius:i.outerRadius,innerRoundness:i.innerRoundness,outerRoundness:i.outerRoundness};this.shapeAttributes=M;break;case en.Polygon:var I={type:en.Polygon,pointCount:i.pointCount,radius:i.radius,roundness:i.roundness};this.shapeAttributes=I}},r.createPaint=function(t){var e;switch(t.type){case ei.Solid:e={type:t.type,color:new e1().copyFrom(t.color)};break;case ei.GradientLinear:case ei.GradientAngular:case ei.GradientRadial:e={type:t.type,gradientStops:aG(t.gradientStops),startPoint:new eJ().copyFrom(t.startPoint),endPoint:new eJ().copyFrom(t.endPoint)};break;case ei.Texture:var i,r,n,a=i2({offset:{x:0,y:0},rotation:0,scale:{x:1,y:1}},null!=(i=t.textureTransform)?i:{});e={type:t.type,texture:this.engine.findObject(t.texture),scaleMode:t.scaleMode,scalingFactor:null!=(r=t.scalingFactor)?r:1,opacity:null!=(n=t.opacity)?n:1,textureTransform:{offset:new eJ().copyFrom(a.offset),rotation:a.rotation,scale:new eJ().copyFrom(a.scale)}}}return e},r.onApplyAnimationProperties=function(){this.shapeDirty=!0,this.materialDirty=!0},rC(i,[{key:"shape",get:function(){return this.shapeAttributes}}]),i}(rA),t.ShapeComponent=ek([iU("ShapeComponent")],t.ShapeComponent),t.Fake3DComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.loop=!1,t.amountOfMotion=1,t.animationLength=2,t.mode=1,t.startPositionX=0,t.startPositionY=0,t.startPositionZ=0,t.endPositionX=0,t.endPositionY=0,t.endPositionZ=0,t.amplitudeX=0,t.amplitudeY=0,t.amplitudeZ=0,t.phaseX=0,t.phaseY=0,t.phaseZ=0,t}iN(i,e);var r=i.prototype;return r.onStart=function(){this.effectComponent=this.item.getComponent(t.EffectComponent)},r.onUpdate=function(t){this.updateFake3D()},r.updateFake3D=function(){if(this.effectComponent){var t=this.item.time%this.animationLength/this.animationLength,e=0,i=0,r=0;switch(this.mode){case 0:var n=Math.PI;e=Math.sin(2*n*(t+this.phaseX))*this.amplitudeX,i=Math.sin(2*n*(t+this.phaseY))*this.amplitudeY,r=Math.sin(2*n*(t+this.phaseZ))*this.amplitudeZ;break;case 1:var a=t;this.loop&&(a>.5&&(a=1-a),a*=2),e=this.startPositionX*(1-a)+a*this.endPositionX,i=this.startPositionY*(1-a)+a*this.endPositionY,r=this.startPositionZ*(1-a)+a*this.endPositionZ}var o=this.effectComponent.material;o.setFloat("_PosX",e*this.amountOfMotion),o.setFloat("_PosY",i*this.amountOfMotion),o.setFloat("_PosZ",r*this.amountOfMotion)}},i}(rS),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"loop",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amountOfMotion",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"animationLength",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"mode",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionZ",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionZ",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeZ",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"phaseX",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"phaseY",void 0),ek([ij(void 0,void 0)],t.Fake3DComponent.prototype,"phaseZ",void 0),t.Fake3DComponent=ek([iU("Fake3DComponent")],t.Fake3DComponent),t.Fake3DAnimationMode=void 0,(tT=t.Fake3DAnimationMode||(t.Fake3DAnimationMode={}))[tT.Circular=0]="Circular",tT[tT.Linear=1]="Linear",t.CameraController=function(t){function e(e,i){var r;return r=t.call(this,e)||this,i&&r.fromData(i),r}iN(e,t);var i=e.prototype;return i.onUpdate=function(){if(this.item.composition&&this.item.transform.getValid()){var t=this.item.composition.camera;t.near=this.options.near,t.far=this.options.far,t.fov=this.options.fov,t.clipMode=this.options.clipMode,t.transform.parentTransform=this.transform.parentTransform,t.position=this.transform.position,t.setQuat(this.transform.getQuaternion().clone().conjugate())}},i.fromData=function(e){t.prototype.fromData.call(this,e),this.options=e.options},e}(rS),t.CameraController=ek([iU(el.CameraController)],t.CameraController);var aW=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iP);t.HitTestType=void 0,(t_=t.HitTestType||(t.HitTestType={}))[t_.triangle=1]="triangle",t_[t_.box=2]="box",t_[t_.sphere=3]="sphere",t_[t_.custom=4]="custom";var aX=function(){this.position=new eJ,this.delta=new eJ,this.pointerCurrentRaycast=new aH},aH=function(){this.point=null,this.item=null},aY="click",aZ="touchstart",aq="touchmove",aQ="touchend";t.PointerEventType=void 0,(tE=t.PointerEventType||(t.PointerEventType={}))[tE.PointerDown=0]="PointerDown",tE[tE.PointerUp=1]="PointerUp",tE[tE.PointerMove=2]="PointerMove";var aK=function(){function t(t,e){void 0===e&&(e=!1),this.engine=t,this.allowPropagation=e,this.enabled=!0,this.skipPointerMovePicking=!0,this.handlers={},this.nativeHandlers={},this.target=null}var e=t.prototype;return e.bindListeners=function(t){var e,i,r,n,a,o,s=this;this.target=t,a=function(t){return t};var u="mousedown",h="mousemove",l="mouseup",c="mouseleave",f=function(t,e,i,r,a){void 0===r&&(r=0),void 0===a&&(a=0);var o=0,u=0,h=performance.now();if(!s.target)return id.warn("Trigger TouchEvent after EventSystem is disposed."),{x:e,y:i,vx:0,vy:u,dx:r,dy:a,ts:h,width:0,height:0,origin:t};var l=s.target,c=l.width,f=l.height;if(n){var d=h-n.ts;o=(r-n.dx)/d||0,u=(a-n.dy)/d||0,n={dx:r,dy:a,ts:h}}return{x:e,y:i,vx:o,vy:u,dx:r,dy:a,ts:h,width:c,height:f,origin:t}};ii()&&(a=function(t){var e=t.touches,i=t.changedTouches;return e[0]||i[0]},u="touchstart",h="touchmove",l="touchend",c="touchcancel"),this.nativeHandlers=((o={})[u]=function(t){if(s.enabled){var o=a(t),u=aJ(o);e=u.x,i=u.y,n=r={clientX:o.clientX,clientY:o.clientY,ts:performance.now(),x:e,y:i},s.dispatchEvent(aZ,f(t,e,i))}},o[h]=function(t){if(r&&s.enabled){var n=aJ(a(t));e=n.x,i=n.y,s.dispatchEvent(aq,f(t,e,i,e-r.x,i-r.y))}},o[l]=function(t){if(r&&s.enabled){!s.allowPropagation&&t.cancelable&&(t.preventDefault(),t.stopPropagation());var n=a(t),o=aJ(n),u=Math.abs(r.clientX-n.clientX)+Math.abs(r.clientY-n.clientY);e=o.x,i=o.y,u<4&&s.dispatchEvent(aY,f(t,e,i)),s.dispatchEvent(aQ,f(t,e,i,e-r.x,i-r.y))}r=0},o),this.nativeHandlers[c]=this.nativeHandlers[l],Object.keys(this.nativeHandlers).forEach(function(t){var e;null==(e=s.target)||e.addEventListener(String(t),s.nativeHandlers[t])}),this.addEventListener(aY,this.onClick.bind(this)),this.addEventListener(aZ,this.onPointerDown.bind(this)),this.addEventListener(aQ,this.onPointerUp.bind(this)),this.addEventListener(aq,this.onPointerMove.bind(this))},e.dispatchEvent=function(t,e){var i=this.handlers[t];null==i||i.forEach(function(t){return t(e)})},e.addEventListener=function(t,e){var i=this.handlers[t];return i||(i=this.handlers[t]=[]),eW(i,e),function(){eX(i,e)}},e.removeEventListener=function(t,e){var i=this.handlers[t];i&&eX(i,e)},e.onClick=function(t){for(var e,i=t.x,r=t.y,n=[],a=iD(this.engine.compositions);!(e=a()).done;){var o=e.value;n.push.apply(n,[].concat(o.hitTest(i,r)))}for(var s,u=iD(n);!(s=u()).done;){var h=s.value,l=h.item.composition;if(l){var c=i2({},h,{compositionId:l.id,compositionName:l.name});h.item.emit("click",h),l.emit("click",c),this.engine.emit("click",c)}}},e.onPointerDown=function(t){this.handlePointerEvent(t,0)},e.onPointerUp=function(t){this.handlePointerEvent(t,1)},e.onPointerMove=function(t){this.handlePointerEvent(t,2)},e.handlePointerEvent=function(t,e){var i=null,r=t.x,n=t.y,a=t.width,o=t.height;if(!(2===e&&this.skipPointerMovePicking))for(var s,u=iD(this.engine.compositions);!(s=u()).done;){var h=s.value.hitTest(r,n);h.length>0&&(i=h[h.length-1])}var l=new aX;l.position.x=(r+1)/2*a,l.position.y=(n+1)/2*o,l.delta.x=t.vx*a,l.delta.y=t.vy*o;var c=l.pointerCurrentRaycast;i&&(c.point=i.position,c.item=i.item);var f="pointerdown";switch(e){case 0:f="pointerdown";break;case 1:f="pointerup";break;case 2:f="pointermove"}if(i){var d=i.item,p=d.composition;d.emit(f,l),p.emit(f,l),this.engine.emit(f,l)}},e.dispose=function(){var t=this;this.target&&(this.handlers={},Object.keys(this.nativeHandlers).forEach(function(e){var i;null==(i=t.target)||i.removeEventListener(String(e),t.nativeHandlers[e])}),this.nativeHandlers={})},t}();function aJ(t){var e=t.target,i=t.clientX,r=t.clientY,n=e.getBoundingClientRect(),a=n.left,o=n.top;return{x:(i-a)/n.width*2-1,y:1-(r-o)/n.height*2}}var a$=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iP),a0=1,a1=function(){function e(t,e,i){this.transform=e,this.engine=i,this.color=t.options.previewColor;var r=this.createMaterial(),n=this.createGeometry();this.mesh=this.createMesh(n,r),this.updateMesh()}var i=e.prototype;return i.updateMesh=function(){var t=this.mesh.material,e=t.getVector2("uSize").clone(),i=t.getVector4("uPos").clone(),r=new e$,n=new i5,a=this.transform.scale.clone();this.transform.assignWorldTRS(r,n,a),e.x=a.x,e.y=a.y,i.x=r.x,i.y=r.y,i.z=r.z,t.setVector2("uSize",e),t.setVector4("uPos",i),t.setQuaternion("uQuat",n)},i.createMaterial=function(){var e=[["ENV_EDITOR",this.engine.env===aD]],i=aG(this.color).getValue(0),r={shader:{vertex:"\nprecision highp float;\n\nattribute vec2 aPoint;\nuniform vec4 uPos;\nuniform vec2 uSize;\nuniform vec4 uQuat;\nuniform vec4 uColor;\nuniform mat4 effects_ObjectToWorld;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_MatrixVP;\nvarying vec4 vColor;\n\nvec3 rotateByQuat(vec3 a, vec4 quat){\n vec3 qvec = quat.xyz;\n vec3 uv = cross(qvec, a);\n vec3 uuv = cross(qvec, uv) * 2.;\n return a +(uv * 2. * quat.w + uuv);\n}\n\nvoid main() {\n vec4 _pos = uPos;\n vec3 point = rotateByQuat(vec3(aPoint.xy * uSize, 0.),uQuat);\n vec4 pos = vec4(_pos.xyz, 1.0);\n pos = effects_ObjectToWorld * pos;\n pos.xyz += effects_MatrixInvV[0].xyz * point.x+ effects_MatrixInvV[1].xyz * point.y;\n gl_Position = effects_MatrixVP * pos;\n vColor = uColor;\n}\n",fragment:"\nprecision highp float;\n\n#define fragColor gl_FragColor\n\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vColor*vColor.a;\n}\n",glslVersion:t.GLSLVersion.GLSL1,macros:e}},n=nl.create(this.engine,r);return n.blending=!0,n.depthTest=!1,n.setVector4("uPos",new e0(0,0,0,0)),n.setVector2("uSize",new eJ(1,1)),n.setVector4("uColor",new e0(i[0]/255,i[1]/255,i[2]/255,i[3])),n.setQuaternion("uQuat",new i5(0,0,0,0)),n},i.createGeometry=function(){var t=new Uint8Array([0,1,1,2,2,3,3,0]);return ng.create(this.engine,{attributes:{aPoint:{size:2,offset:0,stride:2*Float32Array.BYTES_PER_ELEMENT,data:new Float32Array([-.5,.5,.5,.5,.5,-.5,-.5,-.5])}},drawCount:t.length,indices:{data:t},mode:rR.LINES,maxVertex:4})},i.createMesh=function(t,e){return nA.create(this.engine,{name:"Interact_preview"+a0++,priority:0,worldMatrix:rG.fromIdentity(),geometry:t,material:e})},e}();function a2(t,e){var i=1e-5*(e||1);return t&&Math.abs(t.vx||0)<i&&Math.abs(t.vy||0)<i}t.InteractComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.downgrade=.95,t.speed=25,t.dragRatio=[1,1],t.dragRange={dxRange:[0,0],dyRange:[0,0]},t.invalidBorderRange=0,t.invalidByBorderRange=!1,t.duringPlay=!1,t._interactive=!0,t.lastTime=-1,t.getHitTestParams=function(e){if(t.clickable){var i=t.item.props.content.options.behavior,r=t.getBoundingBox();if(r)return{type:r.type,triangles:r.area,behavior:i}}},t}iN(i,e);var r=i.prototype;return r.getDragRangeX=function(){return this.dragRange.dxRange},r.setDragRangeX=function(t,e){this.dragRange.dxRange=[t,e]},r.getDragRangeY=function(){return this.dragRange.dyRange},r.setDragRangeY=function(t,e){this.dragRange.dyRange=[t,e]},r.onStart=function(){var t=this.item.engine.env,e=this.interactData.options,i=e.type,r=e.showPreview;i===tB.CLICK&&(this.clickable=!0,r&&t===aD&&(this.previewContent=new a1(this.item.props.content,this.transform,this.engine))),this.previewContent&&(this.previewContent.mesh.item=this.item,this.materials=this.previewContent.mesh.materials),this.item.getHitTestParams=this.getHitTestParams},r.onDisable=function(){e.prototype.onDisable.call(this),this.item&&this.item.composition&&(this.duringPlay&&!this.item.transform.getValid()&&this.item.composition.getSpeed()>0&&(this.item.composition.removeInteractiveItem(this.item,this.item.props.content.options.type),this.duringPlay=!1),this.clickable=!1,this.endDragTarget())},r.onEnable=function(){e.prototype.onEnable.call(this);var t=this.interactData.options.type,i=this.item.engine.env;if(t===tB.CLICK)this.clickable=!0;else if(t===tB.DRAG){var r=this.interactData.options,n=r.enableInEditor;if(i!==aD||n){var a,o=(null!=(a=this.item.composition)?a:{}).event;o&&this.beginDragTarget(r,o)}}},r.onUpdate=function(t){var e;if(this.duringPlay=!0,this.lastTime<=this.item.time){if(this.item.time>=0&&this.lastTime<0){var i,r=this.item.props.content.options;null==(i=this.item.composition)||i.addInteractiveItem(this.item,r.type)}}else if(this.item.time>=0&&t>0){var n,a=this.item.props.content.options;null==(n=this.item.composition)||n.addInteractiveItem(this.item,a.type)}this.lastTime=this.item.time,null==(e=this.previewContent)||e.updateMesh(),this.dragEvent&&this.bouncingArg&&(this.bouncingArg.vx*=this.downgrade,this.bouncingArg.vy*=this.downgrade,this.bouncingArg.dy+=this.bouncingArg.vy,this.bouncingArg.dx+=this.bouncingArg.vx,a2(this.bouncingArg)?(this.dragEvent=null,this.bouncingArg=null):this.handleDragMove(this.dragEvent,this.bouncingArg))},r.render=function(t){this.previewContent&&this.previewContent.mesh.render(t)},r.onDestroy=function(){var t;null==(t=this.previewContent)||t.mesh.dispose()},r.endDragTarget=function(){},r.handleDragMove=function(t,e){if((null==t?void 0:t.cameraParam)&&this.canInteract()&&this.item.composition){var i,r,n=t.cameraParam,a=n.position,o=n.fov,s=e.dy,u=e.dx*e.width/e.height,h=a[2],l=Math.tan(o*Math.PI/180/2)*Math.abs(h),c=this.dragRange,f=c.dxRange,d=c.dyRange,p=a[0]-this.dragRatio[0]*(u*l),m=a[1]-this.dragRatio[1]*(s*l),v=f[0],y=f[1],g=d[0],x=d[1];p=eK(p,v,y),m=eK(m,g,x),p!==v&&p!==y&&v!==y&&(null==(i=e.origin)||i.preventDefault()),m!==g&&m!==x&&g!==x&&(null==(r=e.origin)||r.preventDefault()),this.item.composition.camera.position=new e$(p,m,h)}},r.beginDragTarget=function(t,e){var r,n=this;if("camera"===t.target){var a={touchstart:function(t){if(n.canInteract()&&(n.invalidByBorderRange=n.checkInvalidBorderRange({x:t.x,y:t.y}),!n.invalidByBorderRange)){n.dragEvent=null,n.bouncingArg=null;var e,i=null==(e=n.item.composition)?void 0:e.camera;r={x:t.x,y:t.y,cameraParam:{position:(null==i?void 0:i.position.toArray())||[0,0,8],fov:(null==i?void 0:i.fov)||60}}}},touchmove:function(t){n.invalidByBorderRange||(n.handleDragMove(r,t),n.bouncingArg=t)},touchend:function(t){if(n.canInteract()){var e=n.bouncingArg;!a2(e,3)&&e&&(e.vx*=n.speed,e.vy*=n.speed,n.dragEvent=i2({},r)),r=null}}};Object.keys(a).forEach(function(t){e.addEventListener(t,a[t])}),a.touchmove({dx:0,dy:0,width:1,height:1}),this.item.getComponent(i).endDragTarget=function(){Object.keys(a).forEach(function(t){e.removeEventListener(t,a[t])})}}},r.getBoundingBox=function(){var e=this.transform.getWorldMatrix(),i=ae(e$.ZERO,.5*this.transform.size.x,.5*this.transform.size.y);return i.forEach(function(t){e.transformPoint(t.p0),e.transformPoint(t.p1),e.transformPoint(t.p2)}),{type:t.HitTestType.triangle,area:i}},r.fromData=function(t){if(e.prototype.fromData.call(this,t),this.interactData=t,t.options.type===tB.DRAG){var i=t.options;i.dxRange&&(this.dragRange.dxRange=i.dxRange),i.dyRange&&(this.dragRange.dyRange=i.dyRange)}},r.canInteract=function(){var t;return!!(null==(t=this.item.composition)?void 0:t.interactive)&&this._interactive},r.checkInvalidBorderRange=function(t){var e=this.invalidBorderRange;if(e){var i,r,n,a,o=0,s=0,u=0,h=0;if("number"==typeof e?(o=e,s=e,u=e,h=e):iv(e)&&(o=void 0===(i=e[0])?0:i,s=void 0===(r=e[1])?0:r,u=void 0===(n=e[2])?0:n,h=void 0===(a=e[3])?0:a),t.x<h-1||t.x>1-s||t.y<o-1||t.y>1-u)return!0}return!1},rC(i,[{key:"interactive",get:function(){return this._interactive},set:function(t){this._interactive=t,t||(this.bouncingArg=null)}}]),i}(rA),t.InteractComponent=ek([iU(el.InteractComponent)],t.InteractComponent);var a3=function(){function e(){this.triangles=[],this.worldMatrix=new rG,this.assemblyTriangles=function(t,e,i,r,n){for(var a=i;a<r;a+=3){var o=3*e[a],s=3*e[a+1],u=3*e[a+2],h={x:t[o],y:t[o+1],z:t[o+2]},l={x:t[s],y:t[s+1],z:t[s+2]},c={x:t[u],y:t[u+1],z:t[u+2]};n.push({p0:h,p1:l,p2:c})}}}var i=e.prototype;return i.getBoundingBoxData=function(){return this.applyWorldMatrix(this.boundingBoxData.area),this.boundingBoxData},i.getBoundingBox=function(){for(var e,i=-Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=iD(this.boundingBoxData.area);!(e=o()).done;){var s=e.value;i=Math.max(s.p0.x,s.p1.x,s.p2.x,i),r=Math.max(s.p0.y,s.p1.y,s.p2.y,r),n=Math.min(s.p0.x,s.p1.x,s.p2.x,n),a=Math.min(s.p0.y,s.p1.y,s.p2.y,a)}var u=[],h=new e$(n,r,0),l=new e$(i,r,0),c=new e$(i,a,0),f=new e$(n,a,0);return u.push({p0:h,p1:l,p2:c}),u.push({p0:h,p1:c,p2:f}),this.applyWorldMatrix(u),{type:t.HitTestType.triangle,area:u}},i.setGeometry=function(e,i){this.triangles=this.geometryToTriangles(e);for(var r,n=[],a=iD(this.triangles);!(r=a()).done;){var o=r.value;n.push({p0:o.p0,p1:o.p1,p2:o.p2})}i&&this.worldMatrix.copyFrom(i),this.boundingBoxData={type:t.HitTestType.triangle,area:n}},i.geometryToTriangles=function(t){var e=t.getIndexData(),i=t.getAttributeData("aPos"),r=[];if(!e||!i)return r;if(0===t.subMeshes.length)this.assemblyTriangles(i,e,0,e.length,r);else for(var n,a=iD(t.subMeshes);!(n=a()).done;){var o=n.value;if(void 0!==o.indexCount){var s=e.BYTES_PER_ELEMENT,u=o.offset/s,h=u+o.indexCount;this.assemblyTriangles(i,e,u,h,r)}}return r},i.applyWorldMatrix=function(t){var e=this;return t.forEach(function(t){t.p0=e.worldMatrix.transformPoint(t.p0,new e$),t.p1=e.worldMatrix.transformPoint(t.p1,new e$),t.p2=e.worldMatrix.transformPoint(t.p2,new e$)}),t},e}(),a4=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="sprite",e}return iN(e,t),e}(iP),a5=function(){function t(){this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1,this.duration=0,this.destroyed=!1,this.playState=0,this.time=0}var e=t.prototype;return e.play=function(){switch(this.playState){case 0:break;case 1:this.playState=0,this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1}},e.pause=function(){0===this.playState&&(this.playState=1,this.onPlayablePauseFlag=!0,this.onPlayablePlayFlag=!1)},e.setTime=function(t){this.time=t},e.getTime=function(){return this.time},e.setDuration=function(t){this.duration=t},e.getDuration=function(){return this.duration},e.getPlayState=function(){return this.playState},e.prepareFrame=function(t){},e.processFrame=function(t){},e.onPlayableDestroy=function(){},e.dispose=function(){this.destroyed||(this.onPlayableDestroy(),this.destroyed=!0)},t}(),a6=function(){function t(){this.context={deltaTime:0,output:this}}var e=t.prototype;return e.setUserData=function(t){this.userData=t},e.getUserData=function(){return this.userData},e.prepareFrame=function(){},e.processFrame=function(){},t}(),a8=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iW);function a9(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}t.PlayState=void 0,(tC=t.PlayState||(t.PlayState={}))[tC.Playing=0]="Playing",tC[tC.Paused=1]="Paused";var a7=new i5,ot=new e$,oe=new e$,oi=1,or=function(){function t(t,e){void 0===t&&(t={}),this.taggedProperties={},this.position=new e$(0,0,0),this.quat=new i5(0,0,0,1),this.rotation=new nb(0,0,0),this.scale=new e$(1,1,1),this.anchor=new e$(0,0,0),this.size=new eJ(1,1),this.children=[],this.worldMatrix=rG.fromIdentity(),this.localMatrix=rG.fromIdentity(),this.valid=!0,this.dirtyFlags={localData:!1,localMatrix:!1,worldMatrix:!1,parentMatrix:!1},this.worldTRSCache={position:new e$(0,0,0),quat:new i5(0,0,0,1),scale:new e$(1,1,1)},this.name="transform_"+oi++,t&&this.setTransform(t),e&&(this.parentTransform=e),void 0!==t.valid&&this.setValid(t.valid)}var e=t.prototype;return e.setPosition=function(t,e,i){(this.position.x!==t||this.position.y!==e||this.position.z!==i)&&(this.position.x=t,this.position.y=e,this.position.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.translate=function(t,e,i){(0!==t||0!==e||0!==i)&&(this.position.x+=t,this.position.y+=e,this.position.z+=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setRotation=function(t,e,i){(this.rotation.x!==t||this.rotation.y!==e||this.rotation.z!==i)&&(this.rotation.x=t,this.rotation.y=e,this.rotation.z=i,this.quat.setFromEuler(this.rotation),this.quat.conjugate(),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setQuaternion=function(t,e,i,r){(this.quat.x!==t||this.quat.y!==e||this.quat.z!==i||this.quat.w!==r)&&(this.quat.x=t,this.quat.y=e,this.quat.z=i,this.quat.w=r,this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setScale=function(t,e,i){(this.scale.x!==t||this.scale.y!==e||this.scale.z!==i)&&(this.scale.x=t,this.scale.y=e,this.scale.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setSize=function(t,e){(this.size.x!==t||this.size.y!==e)&&(this.size.x=t,this.size.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.rotateByQuat=function(t){this.quat.multiply(t),this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.scaleBy=function(t,e,i){this.scale.x*=t,this.scale.y*=e,this.scale.z*=i,this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setAnchor=function(t,e){(this.anchor.x!==t||this.anchor.y!==e)&&(this.anchor.x=t,this.anchor.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setTransform=function(t,e){var i=t.position,r=t.rotation,n=t.scale,a=t.size,o=t.quat,s=t.name,u=t.anchor;if(s&&(this.name=s),i&&(eF(i,e$)?this.setPosition(i.x,i.y,i.z):this.setPosition(i[0],i[1],i[2])),o)eF(o,i5)?this.setQuaternion(o.x,o.y,o.z,o.w):this.setQuaternion(o[0],o[1],o[2],o[3]);else if(r){var h=e?-1:1;eF(r,nb)?this.setRotation(r.x*h,r.y*h,r.z*h):this.setRotation(r[0]*h,r[1]*h,r[2]*h)}n&&(eF(n,e$)?this.setScale(n.x,n.y,n.z):this.setScale(n[0],n[1],n[2])),a&&this.setSize(a.x,a.y),u&&(eF(u,eJ)?this.setAnchor(u.x,u.y):this.setAnchor(u[0],u[1]))},e.addChild=function(t){eW(this.children,t)},e.removeChild=function(t){eX(this.children,t)},e.getRotation=function(){return t.getRotation(this.quat,new nb)},e.getQuaternion=function(){return this.quat},e.updateLocalMatrix=function(){this.valid?(this.dirtyFlags.localData&&(this.localMatrix.compose(this.position,this.quat,this.scale,this.anchor),this.dirtyFlags.localMatrix=!0),this.dirtyFlags.localData=!1):this.localMatrix.isIdentity()||(this.localMatrix.identity(),this.dirtyFlags.localMatrix=!0)},e.getMatrix=function(){return this.updateLocalMatrix(),this.localMatrix},e.getParentMatrix=function(){return this.parent&&(this.parentMatrix=this.parent.getWorldMatrix(),this.dirtyFlags.parentMatrix=this.dirtyFlags.parentMatrix||this.parent.dirtyFlags.localMatrix||this.parent.dirtyFlags.worldMatrix),this.parentMatrix},e.getWorldMatrix=function(){var t=this.getMatrix(),e=this.getParentMatrix();return(this.dirtyFlags.localMatrix||this.dirtyFlags.parentMatrix)&&(e?this.worldMatrix.multiplyMatrices(e,t):this.worldMatrix.copyFrom(t),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix=!1,this.dirtyFlags.parentMatrix=!1),this.worldMatrix},e.getWorldScale=function(){var t=this.worldTRSCache;return this.dirtyFlags.worldMatrix&&(this.getWorldMatrix().decompose(t.position,t.quat,t.scale),this.dirtyFlags.worldMatrix=!1),this.worldTRSCache.scale.clone()},e.getWorldPosition=function(){return this.updateTRSCache(),this.worldTRSCache.position.clone()},e.setWorldPosition=function(t,e,i){var r=this.getParentMatrix();r?(ot.set(0,0,0),a7.set(0,0,0,1),oe.set(1,1,1),r.decompose(ot,a7,oe),ot.set(t-ot.x,e-ot.y,i-ot.z),a7.invert(),ot.applyQuaternion(a7),ot.x=0!==oe.x?ot.x/oe.x:0,ot.y=0!==oe.y?ot.y/oe.y:0,ot.z=0!==oe.z?ot.z/oe.z:0,this.setPosition(ot.x,ot.y,ot.z)):this.setPosition(t,e,i)},e.getWorldRotation=function(){return this.updateTRSCache(),t.getRotation(this.worldTRSCache.quat,new nb)},e.assignWorldTRS=function(t,e,i){this.updateTRSCache(),t&&t.copyFrom(this.worldTRSCache.position),e&&e.copyFrom(this.worldTRSCache.quat),i&&i.copyFrom(this.worldTRSCache.scale)},e.cloneFromMatrix=function(t,e){t.decompose(this.position,this.quat,this.scale),this.rotation.setFromQuaternion(this.quat.clone().conjugate()),e&&e.copyFrom(this.scale),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setValid=function(t){this.valid!==t&&(this.valid=t,t?this.dirtyFlags.localData=!0:(this.localMatrix.identity(),this.dirtyFlags.localMatrix=!0),this.dispatchValueChange())},e.getValid=function(){return this.valid},e.toData=function(){var t=this.taggedProperties;return t.position=this.position.clone(),t.eulerHint={x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},t.scale=this.scale.clone(),t},e.fromData=function(t){var e={};e.position=new e$().copyFrom(t.position),t.quat?e.quat=new i5(t.quat.x,t.quat.y,t.quat.z,t.quat.w):e.rotation=new nb(t.eulerHint.x,t.eulerHint.y,t.eulerHint.z),e.scale=new e$().copyFrom(t.scale),t.size&&(e.size=new eJ().copyFrom(t.size)),t.anchor&&(e.anchor=new eJ().copyFrom(t.anchor)),this.setTransform(e)},e.dispose=function(){},e.updateTRSCache=function(){var t=this.getWorldMatrix();if(this.dirtyFlags.worldMatrix){var e=this.worldTRSCache;t.decompose(e.position,e.quat,e.scale),this.dirtyFlags.worldMatrix=!1}},e.dispatchValueChange=function(){this.children.forEach(function(t){t.parentMatrixDirty=!0})},t.getRotation=function(t,e){var i=a7.copyFrom(t);return i.conjugate(),e.setFromQuaternion(i)},rC(t,[{key:"parentTransform",get:function(){return this.parent},set:function(t){t&&this.parent!==t&&this!==t&&(this.parent&&this.parent.removeChild(this),t.addChild(this),this.parent=t,this.parentMatrixDirty=!0)}},{key:"parentMatrixDirty",get:function(){return this.dirtyFlags.parentMatrix},set:function(t){this.dirtyFlags.parentMatrix!==t&&(this.dirtyFlags.parentMatrix=t,this.dispatchValueChange())}}]),t}(),on=new e$(1,1,1),oa=function(){function t(t,e){void 0===e&&(e={}),this.name=t,this.transform=new or,this.pixelWidth=0,this.pixelHeight=0,this.viewportMatrix=rG.fromIdentity(),this.viewMatrix=rG.fromIdentity(),this.projectionMatrix=rG.fromIdentity(),this.viewProjectionMatrix=rG.fromIdentity(),this.inverseViewMatrix=rG.fromIdentity(),this.dirty=!0;var i=e.near,r=e.far,n=e.fov,a=e.aspect,o=e.clipMode,s=void 0===o?tY.portrait:o,u=e.position,h=void 0===u?[0,0,8]:u,l=e.rotation,c=void 0===l?[0,0,0]:l,f=e.pixelWidth,d=e.pixelHeight,p=new nb(c[0],c[1],c[2]),m=new i5().setFromEuler(p);this.options={near:void 0===i?.1:i,far:void 0===r?20:r,fov:void 0===n?60:n,aspect:void 0===a?1:a,clipMode:s},this.pixelWidth=void 0===f?0:f,this.pixelHeight=void 0===d?0:d,this.transform.setPosition(h[0],h[1],h[2]),this.transform.setQuaternion(m.x,m.y,m.z,m.w),this.dirty=!0,this.updateMatrix()}var e=t.prototype;return e.setTransform=function(t){this.transform.parentTransform=t.parentTransform,this.transform.cloneFromMatrix(t.getMatrix()),this.dirty=!0},e.setViewportMatrix=function(t){this.viewportMatrix=t.clone(),this.dirty=!0},e.getViewportMatrix=function(){return this.viewportMatrix},e.getViewMatrix=function(){return this.updateMatrix(),this.viewMatrix.clone()},e.getInverseViewMatrix=function(){return this.updateMatrix(),this.inverseViewMatrix.clone()},e.getProjectionMatrix=function(){return this.updateMatrix(),this.projectionMatrix.clone()},e.getInverseProjectionMatrix=function(){var t;return this.updateMatrix(),null==(t=this.inverseProjectionMatrix)?void 0:t.clone()},e.getViewProjectionMatrix=function(){return this.updateMatrix(),this.viewProjectionMatrix.clone()},e.getInverseViewProjectionMatrix=function(){return this.updateMatrix(),this.inverseViewProjectionMatrix||(this.inverseViewProjectionMatrix=this.viewProjectionMatrix.clone(),this.inverseViewProjectionMatrix.invert()),this.inverseViewProjectionMatrix.clone()},e.getModelViewProjection=function(t,e){return t.multiplyMatrices(this.viewProjectionMatrix,e)},e.getInverseVPRatio=function(t){var e=new e$(this.position.x,this.position.y,t),i=this.getViewProjectionMatrix(),r=this.getInverseViewProjectionMatrix();if(!this.viewportMatrix.isIdentity()){var n=this.viewportMatrix.clone();r.premultiply(n),i.multiply(n.invert())}var a=i.projectPoint(e).z,o=r.projectPoint(new e$(1,1,a)),s=o.x,u=o.y,h=r.projectPoint(new e$(-1,-1,a));return new e$((s-h.x)/2,(u-h.y)/2,0)},e.setQuat=function(t){this.transform.getQuaternion().equals(t)||(this.transform.setQuaternion(t.x,t.y,t.z,t.w),this.dirty=!0)},e.getQuat=function(){return this.transform.quat.clone()},e.getOptions=function(){return i2({},this.options,{position:this.position.clone(),rotation:this.rotation.clone()})},e.copy=function(t){var e=t.near,i=t.far,r=t.fov,n=t.clipMode,a=t.aspect,o=t.position,s=t.rotation;this.near=e,this.far=i,this.fov=r,this.clipMode=n,this.aspect=a,this.position=o,this.rotation=s,this.updateMatrix()},e.updateMatrix=function(){if(this.dirty){var t,e=this.options,i=e.fov,r=e.aspect,n=e.near,a=e.far,o=e.clipMode;this.projectionMatrix.perspective(i*eY,r,n,a,o===tY.portrait),this.projectionMatrix.premultiply(this.viewportMatrix),this.inverseViewMatrix.compose(this.position,this.getQuat(),on),this.inverseViewMatrix.premultiply(null!=(t=this.transform.getParentMatrix())?t:rG.IDENTITY),this.viewMatrix.copyFrom(this.inverseViewMatrix).invert(),this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix,this.viewMatrix),this.inverseViewProjectionMatrix=null,this.dirty=!1}},e.worldToScreenPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e$,r=this.getViewProjectionMatrix();return i.set(t.x,t.y,t.z),r.projectPoint(i,i),i.x=(i.x+1)*.5*this.pixelWidth,i.y=(i.y+1)*.5*this.pixelHeight,i.z=(i.z+1)*.5,i},e.screenToWorldPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e$,r=this.getInverseViewProjectionMatrix(),n=t.x/this.pixelWidth*2-1,a=t.y/this.pixelHeight*2-1,o=2*t.z-1;return i.set(n,a,o),r.projectPoint(i,i),i},rC(t,[{key:"near",get:function(){return this.options.near},set:function(t){this.options.near!==t&&(this.options.near=t,this.dirty=!0)}},{key:"far",get:function(){return this.options.far},set:function(t){this.options.far!==t&&(this.options.far=t,this.dirty=!0)}},{key:"fov",get:function(){return this.options.fov},set:function(t){this.options.fov!==t&&(this.options.fov=t,this.dirty=!0)}},{key:"aspect",get:function(){return this.options.aspect},set:function(t){this.options.aspect!==t&&(this.options.aspect=t,this.dirty=!0)}},{key:"clipMode",get:function(){return this.options.clipMode},set:function(t){void 0!==t&&this.options.clipMode!==t&&(this.options.clipMode=t,this.dirty=!0)}},{key:"position",get:function(){return this.transform.position.clone()},set:function(t){this.transform.position.equals(t)||(this.transform.setPosition(t.x,t.y,t.z),this.dirty=!0)}},{key:"worldPosition",get:function(){return this.transform.getWorldPosition()}},{key:"rotation",get:function(){return this.transform.rotation.clone()},set:function(t){this.transform.rotation.equals(t)||(this.transform.setRotation(t.x,t.y,t.z),this.dirty=!0)}}]),t}(),oo=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=os(this.arc,this.arcMode,t)*eY,i=new e$(Math.cos(e)*this.radius,Math.sin(e)*this.radius,0),r=Math.tan(this.angle*eY),n=i.clone().multiply(r);return n.z+=1,{position:i.multiply(iT(0,1)),direction:n.normalize()}},t}();function os(t,e,i){if(e===tJ.RANDOM)t=iT(0,t);else if(e===tJ.UNIDIRECTIONAL_CYCLE){var r=i.index%(i.total+1);t=t/i.total*r}else if(e===tJ.BIDIRECTIONAL_CYCLE){var n=i.index/(i.total+1),a=n-Math.floor(n);t*=Math.floor(n)%2?1-a:a}else e===tJ.UNIFORM_BURST&&(t=t*i.burstIndex/i.burstCount);return t}var ou=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=os(this.arc,this.arcMode,t)*eY,i=new e$(Math.cos(e),Math.sin(e),0),r=this.radius;return{direction:i,position:i.clone().multiply(r)}},t}(),oh=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2}return t.prototype.generate=function(t){var e=iT(-this._d,this._d),i=iT(-this._h,this._h);return{direction:new e$(0,0,1),position:new e$(e,i,0)}},t}(),ol=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2,this.arcMode=t.arcMode,this.arc=t.arc}return t.prototype.generate=function(t){var e=os(this.arc,this.arcMode,t)*eY,i=new e$(Math.cos(e),Math.sin(e),0),r=this._d,n=this._h,a=Math.atan2(n,r),o=Math.tan(e),s=new e$;return e<a?s.set(r,r*o,0):e>=a&&e<Math.PI-a?s.set(n/o,n,0):e<Math.PI+a?s.set(-r,-r*o,0):e<2*Math.PI-a?s.set(-n/o,-n,0):s.set(r,r*o,0),{direction:i,position:s}},t}(),oc=function(){function t(t){this._d=t.width||1,this.arcMode=t.arcMode}return t.prototype.generate=function(t){var e=this.arcMode===tJ.UNIFORM_BURST?t.burstIndex%t.burstCount/(t.burstCount-1):iT(0,1);return{direction:new e$(0,1,0),position:new e$(this._d*(e-.5),0,0)}},t}(),of=new rG,od=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=this.donutRadius,i=this.radius-e,r=iT(0,2*Math.PI),n=os(this.arc,this.arcMode,t)*eY,a=of.setFromRotationZ(n),o=new e$(Math.cos(r),Math.sin(r),0),s=new e$(i+Math.cos(r)*e,0,Math.sin(r)*e);return{direction:a.transformNormal(o),position:a.transformPoint(s)}},t}(),op=new rG,om=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}var e=t.prototype;return e.getHorizontalAngle=function(){return iT(-90,90)},e.generate=function(t){var e=os(this.arc,this.arcMode,t)*eY,i=this.getHorizontalAngle()*eY,r=this.radius,n=new e$(Math.cos(i),0,Math.sin(i)),a=op.setFromRotationZ(e).transformNormal(n);return{position:a.clone().multiply(r),direction:a}},t}(),ov=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.getHorizontalAngle=function(){return iT(0,90)},e}(om),oy=function(){function t(t){var e=t.detail||{anchors:[.5,.5],block:[0,0]};this.anchors=new Float32Array(e.anchors),this.width=t.width||1,this.height=t.height||1,this.block=e.block,this.arcMode=t.arcMode,this.random=eK(t.random||0,0,1)}return t.prototype.generate=function(t){var e=this.anchors,i=Math.floor(os(e.length/2-1,this.arcMode,t)),r=(e[2*i]+this.block[0]*this.random*Math.random())%1-.5,n=(e[2*i+1]+this.block[1]*this.random*Math.random())%1-.5,a=new e$(r,n,0);return{position:new e$(r*this.width,n*this.height,0),direction:a.normalize()}},t}(),og=function(){function t(){}return t.prototype.generate=function(){return{position:new e$,direction:new e$}},t}(),ox=((eC={})[tk.NONE]=og,eC[tk.CONE]=oo,eC[tk.SPHERE]=om,eC[tk.HEMISPHERE]=ov,eC[tk.CIRCLE]=ou,eC[tk.DONUT]=od,eC[tk.RECTANGLE]=oh,eC[tk.EDGE]=oc,eC[tk.RECTANGLE_EDGE]=ol,eC[tk.TEXTURE]=oy,eC);function ob(t){if(!t)return new og;var e=i2({radius:1,arc:360,angle:0,arcMode:tJ.RANDOM},t),i=t.type,r=ox[i];if(!r)throw Error("Invalid shape: "+i+".");var n=new r(e);if(i!==tk.NONE){var a=t.alignSpeedDirection,o=t.upDirection;n.alignSpeedDirection=a,n.upDirection=e$.fromArray(void 0===o?[0,0,1]:o).normalize()}return n}function oT(t,e,i,r,n){var a,o;if(n===function(t,e,i,r){for(var n=0,a=e,o=i-r;a<i;a+=r)n+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return n}(t,e,i,r)>0)for(a=e;a<i;a+=r)o=oN(a,t[a],t[a+1],o);else for(a=i-r;a>=e;a-=r)o=oN(a,t[a],t[a+1],o);return o&&oA(o,o.next)&&(oV(o),o=o.next),o}function o_(t,e){if(!t)return t;e||(e=t);var i,r=t;do if(i=!1,!r.steiner&&(oA(r,r.next)||0===ow(r.prev,r,r.next))){if(oV(r),(r=e=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function oE(t,e){return t.x-e.x}function oC(t,e,i,r,n){return(t=((t=((t=((t=((t=32767*(t-i)*n)|t<<8)&16711935)|t<<4)&252645135)|t<<2)&858993459)|t<<1)&1431655765)|(e=((e=((e=((e=((e=32767*(e-r)*n)|e<<8)&16711935)|e<<4)&252645135)|e<<2)&858993459)|e<<1)&1431655765)<<1}function oS(t,e,i,r,n,a,o,s){return(n-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(r-s)-(i-o)*(e-s)>=0&&(i-o)*(a-s)-(n-o)*(r-s)>=0}function ow(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function oA(t,e){return t.x===e.x&&t.y===e.y}function oM(t,e,i,r){var n=oR(ow(t,e,i)),a=oR(ow(t,e,r)),o=oR(ow(i,r,t)),s=oR(ow(i,r,e));return!!(n!==a&&o!==s||0===n&&oI(t,i,e)||0===a&&oI(t,r,e)||0===o&&oI(i,t,r)||0===s&&oI(i,e,r))}function oI(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function oR(t){return t>0?1:t<0?-1:0}function oP(t,e){return 0>ow(t.prev,t,t.next)?ow(t,e,t.next)>=0&&ow(t,t.prev,e)>=0:0>ow(t,e,t.prev)||0>ow(t,t.next,e)}function oO(t,e){var i=new oL(t.i,t.x,t.y),r=new oL(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function oN(t,e,i,r){var n=new oL(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function oV(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function oL(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var oF=0;function oD(t,e,i,r){i=i||2,oF=r||0;var n,a,o,s,u,h,l,c=e&&e.length,f=c?e[0]*i:t.length,d=oT(t,0,f,i,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(t,e,i,r){var n,a,o,s,u,h=[];for(n=0,a=e.length;n<a;n++)o=e[n]*r,s=n<a-1?e[n+1]*r:t.length,(u=oT(t,o,s,r,!1))===u.next&&(u.steiner=!0),h.push(function(t){var e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}(u));for(h.sort(oE),n=0;n<h.length;n++)(function(t,e){if(e=function(t,e){var i,r,n,a=e,o=t.x,s=t.y,u=-1/0;do{if(s<=a.y&&s>=a.next.y&&a.next.y!==a.y){var h=a.x+(s-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(h<=o&&h>u){if(u=h,h===o){if(s===a.y)return a;if(s===a.next.y)return a.next}n=a.x<a.next.x?a:a.next}}a=a.next}while(a!==e);if(!n)return null;if(o===u)return n;var l,c=n,f=n.x,d=n.y,p=1/0;a=n;do o>=a.x&&a.x>=f&&o!==a.x&&oS(s<d?o:u,s,f,d,s<d?u:o,s,a.x,a.y)&&(l=Math.abs(s-a.y)/(o-a.x),oP(a,t)&&(l<p||l===p&&(a.x>n.x||a.x===n.x&&(i=n,r=a,0>ow(i.prev,i,r.prev)&&0>ow(r.next,i,i.next))))&&(n=a,p=l)),a=a.next;while(a!==c);return n}(t,e)){var i=oO(e,t);o_(e,e.next),o_(i,i.next)}})(h[n],i),i=o_(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],a=s=t[1];for(var m=i;m<f;m+=i)u=t[m],h=t[m+1],u<n&&(n=u),h<a&&(a=h),u>o&&(o=u),h>s&&(s=h);l=0!==(l=Math.max(o-n,s-a))?1/l:0}return function t(e,i,r,n,a,o,s){if(e){!s&&o&&function(t,e,i,r){var n=t;do null===n.z&&(n.z=oC(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,a,o,s,u,h=1;do{for(i=t,t=null,a=null,o=0;i;){for(o++,r=i,s=0,e=0;e<h&&(s++,r=r.nextZ);e++);for(u=h;s>0||u>0&&r;)0!==s&&(0===u||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,u--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=r}a.nextZ=null,h*=2}while(o>1)}(n)}(e,n,a,o);for(var u,h,l=e;e.prev!==e.next;){if(u=e.prev,h=e.next,o?function(t,e,i,r){var n=t.prev,a=t.next;if(ow(n,t,a)>=0)return!1;for(var o=n.x<t.x?n.x<a.x?n.x:a.x:t.x<a.x?t.x:a.x,s=n.y<t.y?n.y<a.y?n.y:a.y:t.y<a.y?t.y:a.y,u=n.x>t.x?n.x>a.x?n.x:a.x:t.x>a.x?t.x:a.x,h=n.y>t.y?n.y>a.y?n.y:a.y:t.y>a.y?t.y:a.y,l=oC(o,s,e,i,r),c=oC(u,h,e,i,r),f=t.prevZ,d=t.nextZ;f&&f.z>=l&&d&&d.z<=c;){if(f!==t.prev&&f!==t.next&&oS(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&ow(f.prev,f,f.next)>=0||(f=f.prevZ,d!==t.prev&&d!==t.next&&oS(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&ow(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&oS(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&ow(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=c;){if(d!==t.prev&&d!==t.next&&oS(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&ow(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}(e,n,a,o):function(t){var e=t.prev,i=t.next;if(ow(e,t,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(oS(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ow(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}(e)){i.push(u.i/r+oF),i.push(e.i/r+oF),i.push(h.i/r+oF),oV(e),e=h.next,l=h.next;continue}if((e=h)===l){s?1===s?t(e=function(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!oA(n,a)&&oM(n,r,r.next,a)&&oP(n,a)&&oP(a,n)&&(e.push(n.i/i+oF),e.push(r.i/i+oF),e.push(a.i/i+oF),oV(r),oV(r.next),r=t=a),r=r.next}while(r!==t);return o_(r)}(o_(e),i,r),i,r,n,a,o,2):2===s&&function(e,i,r,n,a,o){var s=e;do{for(var u,h,l=s.next.next;l!==s.prev;){if(s.i!==l.i&&(u=s,h=l,u.next.i!==h.i&&u.prev.i!==h.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&oM(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(u,h)&&(oP(u,h)&&oP(h,u)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}(u,h)&&(ow(u.prev,u,h.prev)||ow(u,h.prev,h))||oA(u,h)&&ow(u.prev,u,u.next)>0&&ow(h.prev,h,h.next)>0))){var c=oO(s,l);s=o_(s,s.next),c=o_(c,c.next),t(s,i,r,n,a,o),t(c,i,r,n,a,o);return}l=l.next}s=s.next}while(s!==e)}(e,i,r,n,a,o):t(o_(e),i,r,n,a,o,1);break}}}}(d,p,i,n,a,l),p}function ok(t,e){for(var i,r,n=t.s,a=t.p,o=n[1],s=a[1],u=0,h=0;h<o.length;h++)u+=o[h].length-1;var l,c=new Float32Array(6*u),f=e.indexBase,d=e.uvTransform,p=0,m=0,v=0,y=1,g=1;d&&(m=d[0],v=d[1],y=(l=d[4])?d[3]:d[2],g=l?d[2]:d[3]);for(var x=[0,0],b=0===l?0:-Math.PI/2,T=0;T<o.length;T++)for(var _=o[T],E=s[T],C=s[T+1]||s[0],S=[0,0],w=0;w<_.length-1;w++)(function(t,e,i,r,n,a,o,s){var u=1-e,h=u*u*u,l=3*e*u*u,c=3*e*e*u,f=e*e*e;t[0]=h*i[0]+l*n+c*o+f*r[0],t[1]=h*i[1]+l*a+c*s+f*r[1]})(S,_[w],E,C,E[4],E[5],C[2],C[3]),i=S[0],r=S[1],c[p++]=i/2,c[p++]=r/2,d?(x[0]=i,x[1]=r,oB(x,x,b),c[p++]=m+(x[0]+1)/2*y,c[p++]=v+(x[1]+1)/2*g):(c[p++]=(i+1)/2,c[p++]=(r+1)/2),p+=2;var A=oD(Array.from(c),null,6,void 0===f?0:f);return{aPoint:c,index:new Uint16Array(A)}}function oz(t,e){for(var i,r=[],n=(i=[],("gs"in t)?t.gs.forEach(function(t){i.push({p:[tZ.SHAPE_POINTS,t.p],s:[tZ.SHAPE_SPLITS,t.s]})}):("g"in t)?i.push({p:[tZ.SHAPE_POINTS,t.g.p],s:[tZ.SHAPE_SPLITS,t.g.s]}):i.push(t),i),a=0,o=0,s=0,u=0;u<n.length;u++){var h=ok(n[u],{indexBase:a,uvTransform:e});a+=h.aPoint.length/5,r.push(h),o+=h.aPoint.length,s+=h.index.length}if(1===r.length)return r[0];for(var l=new Float32Array(o),c=new Uint16Array(s),f=0,d=0,p=0;f<r[f];f++){var m=r[f];l.set(m.aPoint,d),d+=m.aPoint.length,c.set(m.index,p),p+=m.index.length}return{aPoint:l,index:c}}function oB(t,e,i){var r=Math.cos(i),n=Math.sin(i),a=e[0],o=e[1];return t[0]=r*a+n*o,t[1]=-n*a+r*o,t}var oU=function(){function t(t){var e=t.time,i=t.interval,r=t.count,n=t.cycles,a=t.probability;this.time=+e||0,this.interval=+i||1,this.count=eF(r,ay)?r:aG(r),this.cycles=+n||1/0,this.probability=isNaN(a)?1:+a,this.reset()}var e=t.prototype;return e.getGeneratorOptions=function(t,e){if(t-this.time-this.now>this.interval*this.index&&this.internalCycles>0)return this.internalCycles--,this.index++,Math.random()<=this.probability?{index:this.index,total:1/this.interval,count:this.count.getValue(e),cycleIndex:this.cycles-this.internalCycles-1}:null},e.reset=function(){this.internalCycles=this.cycles,this.index=0,this.now=0},e.clone=function(){return new t({time:this.time,interval:this.interval,count:this.count,cycles:this.cycles,probability:this.probability})},t}(),oG=function(t){this.content=t},oj=function(){function t(t){this.sort=t,this.length=0}var e=t.prototype;return e.findNodeByContent=function(t){var e=this.first;if(e)do if(t(e.content))return e;while(e=e.next)},e.insertNode=function(t,e){var i=t.next;t.next=e,e.pre=t,e.next=i,i&&(i.pre=e)},e.shiftNode=function(t){var e=new oG(t);if(this.length++,1===this.length)return this.first=this.last=e;for(var i=this.first;i;){if(!(0>=this.sort(i.content,e.content)))return i.pre?this.insertNode(i.pre,e):(this.first=e,e.next=i,i.pre=e),e;if(!i.next)return this.insertNode(i,e),this.last=e;i=i.next}},e.pushNode=function(t){var e=new oG(t);if(this.length++,1===this.length)return this.last=this.first=e;for(var i=this.last;i;){if(!(0>=this.sort(e.content,i.content)))return this.insertNode(i,e),i===this.last&&(this.last=e),e;if(this.first===i)return i.pre=e,e.next=i,this.first=e;i=i.pre}},e.removeNode=function(t){var e=this.first;if(this.length--,e===t){var i=this.first=e.next;i&&(i.pre=null)}else if((e=this.last)===t){var r=this.last=e.pre;r&&(r.next=null)}else if(t){var n=t.pre,a=t.next;n.next=a,a&&(a.pre=n)}t.pre=null,t.next=null},e.forEach=function(t,e){var i=this.first,r=0;if(i)do t.call(e||this,i.content,r++);while(i=i.next)},e.forEachReverse=function(t,e){var i=this.last,r=this.length-1;if(i)do t.call(e||this,i.content,r--);while(i=i.pre)},e.getNodeByIndex=function(t){var e=0,i=this.first;if(!i||t>=this.length||t<0)return null;for(;e<t;)i=i.next,e++;return i},t}(),oW="lookup_texture",oX="offscreen_canvas",oH={},oY=new e$,oZ=new e$,oq=function(){function e(e,i){this.pointStart=[];var r=i.colorOverLifetime,n=i.colorOverTrail,a=i.maxTrailCount,o=i.opacityOverLifetime,s=void 0===o?aG(1):o,u=i.widthOverTrail,h=i.name,l=i.occlusion,c=i.blending,f=i.maskMode,d=i.mask,p=i.textureMap,m=i.texture,v=i.transparentOcclusion,y=i.minimumVertexDistance,g=i.lifetime,x=i.matrix,b=e.gpuCapability,T=b.detail,_=b.level,E=Math.max(i.pointCountPerTrail,2),C=aP(),S=T.maxVertexTextures>0,w=(null!=e?e:{}).env,A={},M=[["ENABLE_VERTEX_TEXTURE",S],["LOOKUP_TEXTURE_CURVE",0],["ENV_EDITOR",w===aD]],I=a>64,R=0;r&&(M.push(["COLOR_OVER_LIFETIME",!0]),R|=1,A.uColorOverLifetime=nt.createWithData(e,io(r))),n&&(M.push(["COLOR_OVER_TRAIL",!0]),R|=4,A.uColorOverTrail=nt.createWithData(e,io(n))),I?(M.push(["ATTR_TRAIL_START",1]),R|=8):A.uTrailStart=new Float32Array(a),A.uOpacityOverLifetimeValue=s.toUniform(C);var P=u.toUniform(C);M.push(["VERT_CURVE_VALUE_COUNT",C.index],["VERT_MAX_KEY_FRAME_COUNT",C.max]),A.uVCurveValues=ay.getAllData(C);var O={shader:{vertex:nO,fragment:nR,macros:M,glslVersion:1===_?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,name:"trail#"+h,cacheId:"-t:+"+R+"+"+C.index+"+"+C.max}},N=E*a*2,V=(E-1)*a,L=Float32Array.BYTES_PER_ELEMENT,F=12*L,D={attributes:{aColor:{size:4,stride:F,data:new Float32Array(12*N)},aSeed:{size:1,stride:F,offset:4*L,dataSource:"aColor"},aInfo:{size:3,stride:F,offset:5*L,dataSource:"aColor"},aPos:{size:4,stride:F,offset:8*L,dataSource:"aColor"},aTime:{size:1,data:new Float32Array(N)},aDir:{size:3,data:new Float32Array(3*N)}},indices:{data:new Uint16Array(6*N)},drawCount:6*V,name:"trail#"+h,bufferUsage:rR.DYNAMIC_DRAW};if(I)D.attributes.aTrailStart={size:1,data:new Float32Array(N)};else{var k=new Float32Array(N);D.attributes.aTrailStartIndex={size:1,data:k};for(var z=0;z<a;z++)for(var B=2*E,U=z*B,G=0;G<B;G++)k[U+G]=z}var j=rV(c),W=nl.create(e,O);W.blending=!0,W.depthMask=l,W.depthTest=!0,W.stencilRef=d?[d,d]:void 0,rD(W,f),rL(W,c);var X=this.mesh=nA.create(e,{name:"MTrail_"+h,material:W,geometry:ng.create(e,D)}),H=null!=m?m:nt.createWithData(e);Object.keys(A).map(function(t){var e=A[t];if(eF(e,nt))W.setTexture(t,e);else if("uTrailStart"===t)W.setFloats("uTrailStart",e);else if("uVCurveValues"===t){for(var i=[],r=0;r<e.length;r+=4){var n=new e0(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}W.setVector4Array(t,i)}else W.setVector4(t,e0.fromArray(e))}),W.setFloat("uTime",0),W.setVector4("uWidthOverTrail",e0.fromArray(P)),W.setVector2("uTexOffset",new eJ(0,0)),W.setVector4("uTextureMap",e0.fromArray(void 0===p?[0,0,1,1]:p)),W.setVector4("uParams",new e0(0,E-1,0,0)),W.setTexture("uMaskTex",H),W.setVector4("uColorParams",new e0(m?1:0,+j,0,+(l&&!v))),this.maxTrailCount=a,this.pointCountPerTrail=E,this.checkVertexDistance=y>0,this.minimumVertexDistance=Math.pow(y||.001,2),this.useAttributeTrailStart=I,this.lifetime=g,x&&(this.mesh.worldMatrix=x),this.geometry=X.firstGeometry(),this.trailCursors=new Uint16Array(a)}var i=e.prototype;return i.addPoint=function(t,e,i){i=i||{};var r=this.trailCursors[t],n=this.pointCountPerTrail,a=this.geometry,o=n-1,s=r%n,u=(r-1)%n,h=(r-2)%n,l=this.getTrailPosition(t,u,oY);if(!(l&&this.checkVertexDistance&&(null==l?void 0:l.distanceSquared(e))<this.minimumVertexDistance)){var c=t*n+s,f=o$(l,e),d=i.time||this.time,p=[Math.random(),i.lifetime||this.lifetime,r],m=i.size||1,v=new Float32Array(6);v.set(f,0),v.set(f,3),a.setAttributeSubData("aDir",6*c,v),a.setAttributeSubData("aTime",2*c,new Float32Array([d,d]));var y=i.color||[1,1,1,1],g=new Float32Array(24),x=e.toArray();if(g.set(y,0),g.set(p,4),g[7]=0,g.set(x,8),g[11]=.5*m,g.set(y,12),g.set(p,16),g[19]=1,g.set(x,20),g[23]=-.5*m,a.setAttributeSubData("aColor",24*c,g),u>=0){var b=new Float32Array(o$(this.getTrailPosition(t,h,oZ),l,e)),T=(t*n+u)*6;a.setAttributeSubData("aDir",T,b),a.setAttributeSubData("aDir",T+3,b);var _=t*n*2,E=new Uint16Array([2*u+_,2*u+1+_,2*s+_,2*s+_,2*u+1+_,2*s+1+_]),C=(t*o+(r-1)%o)*6;a.setIndexSubData(C,E)}r=++this.trailCursors[t];var S=this.mesh.material,w=S.getVector4("uParams"),A=p[2];if(this.useAttributeTrailStart){for(var M=2*n,I=new Float32Array(M),R=0;R<M;R++)I[R]=A;a.setAttributeSubData("aTrailStart",t*I.length,I)}else{var P=S.getFloats("uTrailStart");void 0!=P&&(P[t]=A,S.setFloats("uTrailStart",P))}w&&(w.y=Math.max(w.y,r-1)-Math.max(0,r-n),S.setVector4("uParams",w))}},i.getTrailPosition=function(t,e,i){var r=this.pointCountPerTrail;if(e>=0&&e<r){var n=(t*r+e)*24+8,a=this.geometry.getAttributeData("aColor");return ih(a),i.x=a[n],i.y=a[1+n],i.z=a[2+n],i}},i.clearAllTrails=function(){var t=this.geometry.getIndexData();ih(t),this.trailCursors=new Uint16Array(this.trailCursors.length),this.geometry.setIndexData(new Uint16Array(t.length))},i.minusTime=function(t){var e=this.geometry.getAttributeData("aTime");ih(e);for(var i=0;i<e.length;i++)e[i]-=t;this.geometry.setAttributeData("aTime",e),this.time-=t},i.clearTrail=function(t){if(0!==this.trailCursors[t]){var e=(this.pointCountPerTrail-1)*6,i=this.geometry.getIndexData();ih(i),i.set(new Uint16Array(e),t*e),this.geometry.setIndexData(i),this.trailCursors[t]=0}},i.getPointStartPos=function(t){return this.pointStart[t]},i.setPointStartPos=function(t,e){this.pointStart[t]=e},i.onUpdate=function(t){},rC(e,[{key:"time",get:function(){return this.mesh.material.getFloat("uTime")||0},set:function(t){this.mesh.material.setFloat("uTime",null!=t?t:0)}}]),e}(),oQ=new e$,oK=new e$,oJ=new e$;function o$(t,e,i){return t||i?(t?i?(oK.subtractVectors(e,t).normalize(),oK.subtractVectors(i,e),oJ.copyFrom(oK).normalize(),oQ.addVectors(oK,oJ)):oQ.subtractVectors(e,t):oQ.subtractVectors(i,e),oQ.normalize().toArray()):[0,0,0]}var o0=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.lastTime=0,t}iN(i,e);var r=i.prototype;return r.start=function(e){var i=e.output.getUserData();!this.particleSystem&&eF(i,t.VFXItem)&&(this.particleSystem=i.getComponent(t.ParticleSystem),this.particleSystem&&(this.particleSystem.name=i.name))},r.processFrame=function(t){this.time>=0&&this.start(t);var e=this.particleSystem;e&&(this.time>=0&&this.time<e.item.duration&&e.isEnded()&&e.reset(),e.update(this.time-e.time)),this.lastTime=this.time},i}(a5),o1=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new o0},e}(a8),o2={uSprite:"vec4",uParams:"vec4",uAcceleration:"vec4",uGravityModifierValue:"vec4",uOpacityOverLifetimeValue:"vec4",uRXByLifeTimeValue:"vec4",uRYByLifeTimeValue:"vec4",uRZByLifeTimeValue:"vec4",uLinearXByLifetimeValue:"vec4",uLinearYByLifetimeValue:"vec4",uLinearZByLifetimeValue:"vec4",uSpeedLifetimeValue:"vec4",uOrbXByLifetimeValue:"vec4",uOrbYByLifetimeValue:"vec4",uOrbZByLifetimeValue:"vec4",uSizeByLifetimeValue:"vec4",uSizeYByLifetimeValue:"vec4",uColorParams:"vec4",uFSprite:"vec4",uPreviewColor:"vec4",uVCurveValues:"vec4Array",uFCurveValues:"vec4",uFinalTarget:"vec3",uForceCurve:"vec4",uOrbCenter:"vec3",uTexOffset:"vec2",uPeriodValue:"vec4",uMovementValue:"vec4",uStrengthValue:"vec4",uWaveParams:"vec4"},o3=function(){function e(e,i){this.particleCount=0,this.cachedRotationVector3=new e$,this.cachedRotationMatrix=new nT,this.cachedLinearMove=new e$,this.tempMatrix3=new nT,this.VERT_MAX_KEY_FRAME_COUNT=0;var r,n,a,o,s,u,h,l,c=(null!=e?e:{}).env,f=i.speedOverLifetime,d=i.colorOverLifetime,p=i.linearVelOverLifetime,m=i.orbitalVelOverLifetime,v=i.sizeOverLifetime,y=i.rotationOverLifetime,g=i.sprite,x=i.gravityModifier,b=i.maxCount,T=i.textureFlip,_=i.useSprite,E=i.name,C=i.gravity,S=i.forceTarget,w=i.side,A=i.occlusion,M=i.anchor,I=i.blending,R=i.maskMode,P=i.mask,O=i.transparentOcclusion,N=i.meshSlots,V=i.renderMode,L=void 0===V?0:V,F=i.diffuse,D=void 0===F?nt.createWithData(e):F,k=e.gpuCapability.detail,z=k.halfFloatTexture,B=k.maxVertexUniforms,U=[["RENDER_MODE",+L],["ENV_EDITOR",c===aD]],G=e.gpuCapability.level,j=aP(),W=aP(),X=B>0,H={},Y=0,Z=0;this.useSprite=_,X&&U.push(["ENABLE_VERTEX_TEXTURE",!0]),f&&(U.push(["SPEED_OVER_LIFETIME",!0]),Z|=2,H.uSpeedLifetimeValue=f.toUniform(j)),(null==g?void 0:g.animate)&&(U.push(["USE_SPRITE",!0]),Z|=4,H.uFSprite=H.uSprite=new Float32Array([g.col,g.row,g.total,g.blend?1:0]),this.useSprite=!0),(null==d?void 0:d.color)&&(U.push(["COLOR_OVER_LIFETIME",!0]),Z|=16,H.uColorOverLifetime=eF(d.color,nt)?d.color:nt.createWithData(e,io(d.color))),(null==d?void 0:d.opacity)?H.uOpacityOverLifetimeValue=d.opacity.toUniform(j):H.uOpacityOverLifetimeValue=aG(1).toUniform(j),["x","y","z"].forEach(function(t,e){var i=0,r=0;(null==p?void 0:p[t])&&(H["uLinear"+t.toUpperCase()+"ByLifetimeValue"]=p[t].toUniform(j),i=1,Z|=1<<7+e,p.enabled=!0),U.push(["LINEAR_VEL_"+t.toUpperCase(),i]),(null==m?void 0:m[t])&&(H["uOrb"+t.toUpperCase()+"ByLifetimeValue"]=m[t].toUniform(j),r=1,Z|=1<<10+e,h=!0,m.enabled=!0),U.push(["ORB_VEL_"+t.toUpperCase(),r])}),(null==p?void 0:p.asMovement)&&(U.push(["AS_LINEAR_MOVEMENT",!0]),Z|=32),h&&((null==m?void 0:m.asRotation)&&(U.push(["AS_ORBITAL_MOVEMENT",!0]),Z|=64),H.uOrbCenter=new Float32Array((null==m?void 0:m.center)||[0,0,0])),H.uSizeByLifetimeValue=null==v?void 0:v.x.toUniform(j),(null==v?void 0:v.separateAxes)&&(U.push(["SIZE_Y_BY_LIFE",1]),Z|=16384,H.uSizeYByLifetimeValue=null==v?void 0:null==(l=v.y)?void 0:l.toUniform(j)),(null==y?void 0:y.z)&&(H.uRZByLifeTimeValue=y.z.toUniform(j),Z|=32768,U.push(["ROT_Z_LIFETIME",1])),(null==y?void 0:y.x)&&(H.uRXByLifeTimeValue=y.x.toUniform(j),Z|=65536,U.push(["ROT_X_LIFETIME",1])),(null==y?void 0:y.y)&&(H.uRYByLifeTimeValue=y.y.toUniform(j),Z|=131072,U.push(["ROT_Y_LIFETIME",1])),(null==y?void 0:y.asRotation)&&(U.push(["ROT_LIFETIME_AS_MOVEMENT",1]),Z|=262144),H.uGravityModifierValue=x.toUniform(j),S&&(U.push(["FINAL_TARGET",!0]),Z|=524288,H.uFinalTarget=new Float32Array(S.target||[0,0,0]),H.uForceCurve=S.curve.toUniform(j)),z&&W.max?(Z|=1048576,H.uFCurveValueTexture=ne(e,ay.getAllData(W,!0),W.index,1)):H.uFCurveValues=ay.getAllData(W);var q=j.max+j.curves.length-32>B;if(2===G&&(j.max=-1,j.index=N?N[0]:o5(j.index),W.index>0&&(W.max=-1,W.index=N?N[1]:o5(W.index))),q&&z&&X){var Q=ne(e,ay.getAllData(j,!0),j.index,1);H.uVCurveValueTexture=Q,Y=1}else H.uVCurveValues=ay.getAllData(j);var K=["-p:",L,Z,j.index,j.max,W.index,W.max].join("+");U.push(["VERT_CURVE_VALUE_COUNT",j.index],["FRAG_CURVE_VALUE_COUNT",W.index],["VERT_MAX_KEY_FRAME_COUNT",j.max],["FRAG_MAX_KEY_FRAME_COUNT",W.max]),this.VERT_MAX_KEY_FRAME_COUNT=j.max;var J={fragment:nR,vertex:"#define LOOKUP_TEXTURE_CURVE "+Y+"\n"+nP,glslVersion:1===G?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,cacheId:K,macros:U,name:"particle#"+E},$=rV(I);H.uTexOffset=new Float32Array(D?[1/D.getWidth(),1/D.getHeight()]:[0,0]),H.uMaskTex=D,H.uColorParams=new Float32Array([D?1:0,+$,0,+(!!A&&!O)]),H.uParams=[0,0,0,0],H.uAcceleration=[(null==C?void 0:C[0])||0,(null==C?void 0:C[1])||0,(null==C?void 0:C[2])||0,0];var tt=nl.create(e,{shader:J});tt.blending=!0,tt.depthTest=!0,tt.depthMask=!!A,tt.stencilRef=P?[P,P]:void 0,rD(tt,R),rL(tt,I),rF(tt,w),Object.keys(H).map(function(t){var e=H[t];if(eF(e,nt)){tt.setTexture(t,e);return}var i=[];switch(o2[t]){case"vec4":tt.setVector4(t,e0.fromArray(e));break;case"vec3":tt.setVector3(t,e$.fromArray(e));break;case"vec2":tt.setVector2(t,eJ.fromArray(e));break;case"vec4Array":for(var r=0;r<e.length;r+=4){var n=new e0(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}tt.setVector4Array(t,i),i.length=0;break;default:console.warn("Uniform "+t+"'s type not in typeMap.")}}),tt.setVector3("emissionColor",new e$(0,0,0)),tt.setFloat("emissionIntensity",0);var te=ng.create(e,(r=4*b,n=this.useSprite,a="particle#"+E,u={aPos:{size:3,offset:0,stride:s=12*(o=Float32Array.BYTES_PER_ELEMENT),data:new Float32Array(0)},aVel:{size:3,offset:3*o,stride:s,dataSource:"aPos"},aDirX:{size:3,offset:6*o,stride:s,dataSource:"aPos"},aDirY:{size:3,offset:9*o,stride:s,dataSource:"aPos"},aRot:{size:3,offset:0,stride:8*o,data:new Float32Array(0)},aSeed:{size:1,offset:3*o,stride:8*o,dataSource:"aRot"},aColor:{size:4,offset:4*o,stride:8*o,dataSource:"aRot"},aOffset:{size:4,stride:4*o,data:new Float32Array(0)},aTranslation:{size:3,data:new Float32Array(0)},aLinearMove:{size:3,data:new Float32Array(0)},aRotation0:{size:3,offset:0,stride:9*o,data:new Float32Array(0)},aRotation1:{size:3,offset:3*o,stride:9*o,dataSource:"aRotation0"},aRotation2:{size:3,offset:6*o,stride:9*o,dataSource:"aRotation0"}},n&&(u.aSprite={size:3,stride:3*o,data:new Float32Array(0)}),{attributes:u,indices:{data:new Uint16Array(0)},name:a,maxVertex:r})),ti=nA.create(e,{name:"MParticle_"+E,material:tt,geometry:te});this.anchor=M,this.mesh=ti,this.geometry=ti.firstGeometry(),this.forceTarget=S,this.sizeOverLifetime=v,this.speedOverLifetime=f,this.linearVelOverLifetime=p,this.orbitalVelOverLifetime=m,this.orbitalVelOverLifetime=m,this.gravityModifier=x,this.rotationOverLifetime=y,this.maxCount=b,this.textureOffsets=T?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],this.time=0}var i=e.prototype;return i.getPointColor=function(t){var e=this.geometry.getAttributeData("aRot"),i=32*t+4;return ih(e),[e[i],e[i+1],e[i+2],e[i+3]]},i.clearPoints=function(){this.resetGeometryData(this.geometry),this.particleCount=0,this.geometry.setDrawCount(0),this.maxParticleBufferCount=0},i.resetGeometryData=function(t){for(var e=t.getAttributeNames(),i=t.getIndexData(),r=0;r<e.length;r++){var n=e[r],a=t.getAttributeData(n);a&&t.setAttributeData(n,new a.constructor(0))}t.setIndexData(new i.constructor(0))},i.onUpdate=function(t){var e=Math.ceil(this.geometry.getAttributeData("aPos").length/12);this.applyTranslation(e,t),this.applyRotation(e,t),this.applyLinearMove(e,t)},i.minusTime=function(t){for(var e=this.geometry.getAttributeData("aOffset"),i=0;i<e.length;i+=4)e[i+2]-=t;this.geometry.setAttributeData("aOffset",e),this.time-=t},i.removePoint=function(t){t<this.particleCount&&this.geometry.setAttributeSubData("aOffset",16*t,new Float32Array(16))},i.setPoint=function(t,e){var i=this.maxCount;if(t<i){var r,n=t+1,a=4*n,o=this.geometry,s=n>this.maxParticleBufferCount,u=1;this.particleCount>300?u=(this.particleCount+100)/this.particleCount:this.particleCount>100?u=1.4:this.particleCount>0&&(u=2);var h={aPos:new Float32Array(48),aRot:new Float32Array(32),aOffset:new Float32Array(16),aTranslation:new Float32Array(12),aLinearMove:new Float32Array(12),aRotation0:new Float32Array(36)},l=this.useSprite;l&&(h.aSprite=new Float32Array(12));var c=new e$,f=new i5,d=new e$(1,1,1);e.transform.assignWorldTRS(c,f,d);var p=or.getRotation(f,new nb),m=c.toArray(),v=p.toArray(),y=this.textureOffsets,g=[0,0,e.delay,e.lifetime],x=[0,0,1,1],b=e.vel,T=e.color,_=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],E=Math.random();l&&(r=e.sprite);for(var C=0;C<4;C++){var S=2*C,w=3*C,A=4*C,M=12*C,I=8*C;h.aPos.set(m,M),b.fill(h.aPos,M+3),h.aRot.set(v,I),h.aRot[I+3]=E,h.aRot.set(T,I+4),l&&h.aSprite.set(r,w);var R=e.uv||x;if(R){var P=l?1-y[S+1]:y[S+1];g[0]=R[0]+y[S]*R[2],g[1]=R[1]+P*R[3]}h.aOffset.set(g,A);for(var O=C+C,N=(_[O]-this.anchor.x)*d.x,V=(_[O+1]-this.anchor.y)*d.y,L=0;L<3;L++)h.aPos[M+6+L]=e.dirX.getElement(L)*N,h.aPos[M+9+L]=e.dirY.getElement(L)*V}var F=new Uint16Array([0,1,2,2,1,3].map(function(e){return e+4*t}));if(s){var D=eH(o.getIndexData(),6*n,6*i,u);D.set(F,6*t),o.setIndexData(D),this.maxParticleBufferCount=D.length/6}else o.setIndexSubData(6*t,F);Object.keys(h).forEach(function(e){var r=h[e],n=o.getAttributeStride(e)/Float32Array.BYTES_PER_ELEMENT;if(s){var l=o.getAttributeData(e);ih(l);var c=eH(l,a*n,4*i*n,u);c.set(r,r.length*t),o.setAttributeData(e,c)}else o.setAttributeSubData(e,r.length*t,r)}),this.particleCount=Math.max(n,this.particleCount),o.setDrawCount(6*this.particleCount)}},i.applyTranslation=function(t,e){var i=this.time,r=this.geometry.getAttributeData("aTranslation"),n=this.geometry.getAttributeData("aVel"),a=this.geometry.getAttributeData("aOffset");r.length<3*t&&(r=this.expandArray(r,3*t));for(var o=0,s=0,u=0,h=this.mesh.material.getVector4("uAcceleration"),l=this.mesh.material.getVector4("uGravityModifierValue"),c=0;c<t;c+=4){var f=12*c+3;o=n[f],s=n[f+1],u=n[f+2];var d=i-a[4*c+2],p=a[4*c+3];if(h&&l){var m=this.gravityModifier.getIntegrateValue(0,d,p),v=h.x*m,y=h.y*m,g=h.z*m;if(this.speedOverLifetime){var x=this.speedOverLifetime.getValue(d/p);o=o*x+v,s=s*x+y,u=u*x+g}else o+=v,s+=y,u+=g}var b=3*c;if(a[4*c+2]<i){var T=e/1e3*o,_=e/1e3*s,E=e/1e3*u;r[b]+=T,r[b+1]+=_,r[b+2]+=E,r[b+3]+=T,r[b+4]+=_,r[b+5]+=E,r[b+6]+=T,r[b+7]+=_,r[b+8]+=E,r[b+9]+=T,r[b+10]+=_,r[b+11]+=E}}this.geometry.setAttributeData("aTranslation",r)},i.applyRotation=function(t,e){var i=this.geometry.getAttributeData("aRotation0"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aRot"),a=this.geometry.getAttributeData("aSeed"),o=this.time,s=this.cachedRotationMatrix;i.length<9*t&&(i=this.expandArray(i,9*t));for(var u=0;u<t;u+=4){var h=eK((o-r[4*u+2])/r[4*u+3],0,1),l=8*u,c=this.cachedRotationVector3.set(n[l],n[l+1],n[l+2]),f=a[8*u+3];this.rotationOverLifetime?(this.rotationOverLifetime.x&&(eF(this.rotationOverLifetime.x,ab)?c.x+=this.rotationOverLifetime.x.getValue(h,f):c.x+=this.rotationOverLifetime.x.getValue(h)),this.rotationOverLifetime.y&&(eF(this.rotationOverLifetime.y,ab)?c.y+=this.rotationOverLifetime.y.getValue(h,f):c.y+=this.rotationOverLifetime.y.getValue(h)),this.rotationOverLifetime.z&&(eF(this.rotationOverLifetime.z,ab)?c.z+=this.rotationOverLifetime.z.getValue(h,f):c.z+=this.rotationOverLifetime.z.getValue(h))):s.setZero(),0===c.dot(c)&&s.identity();var d=Math.PI/180,p=c.x*d,m=c.y*d,v=c.z*d,y=Math.sin(p),g=Math.sin(m),x=Math.sin(v),b=Math.cos(p),T=Math.cos(m),_=Math.cos(v);s.set(_,-x,0,x,_,0,0,0,1),s.multiply(this.tempMatrix3.set(T,0,g,0,1,0,-g,0,T)),s.multiply(this.tempMatrix3.set(1,0,0,0,b,-y,0,y,b));var E=9*u,C=s.elements;i.set(C,E),u+4<=t&&(i.set(C,E+9),i.set(C,E+18),i.set(C,E+27))}this.geometry.setAttributeData("aRotation0",i)},i.applyLinearMove=function(t,e){var i=this.geometry.getAttributeData("aLinearMove"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aSeed"),a=this.time;i.length<3*t&&(i=this.expandArray(i,3*t));var o=this.cachedLinearMove;if(this.linearVelOverLifetime&&this.linearVelOverLifetime.enabled)for(var s=0;s<t;s+=4){var u=a-r[4*s+2],h=r[4*s+3],l=u/h,c=n[8*s+3];o.setZero(),this.linearVelOverLifetime.asMovement?(this.linearVelOverLifetime.x&&(eF(this.linearVelOverLifetime.x,ab)?o.x=this.linearVelOverLifetime.x.getValue(l,c):o.x=this.linearVelOverLifetime.x.getValue(l)),this.linearVelOverLifetime.y&&(eF(this.linearVelOverLifetime.y,ab)?o.y=this.linearVelOverLifetime.y.getValue(l,c):o.y=this.linearVelOverLifetime.y.getValue(l)),this.linearVelOverLifetime.z&&(eF(this.linearVelOverLifetime.z,ab)?o.z=this.linearVelOverLifetime.z.getValue(l,c):o.z=this.linearVelOverLifetime.z.getValue(l))):(this.linearVelOverLifetime.x&&(eF(this.linearVelOverLifetime.x,ab)?o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,c):o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.y&&(eF(this.linearVelOverLifetime.y,ab)?o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,c):o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.z&&(eF(this.linearVelOverLifetime.z,ab)?o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,c):o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,h)));var f=3*s;i[f]=o.x,i[f+1]=o.y,i[f+2]=o.z,i[f+3]=o.x,i[f+4]=o.y,i[f+5]=o.z,i[f+6]=o.x,i[f+7]=o.y,i[f+8]=o.z,i[f+9]=o.x,i[f+10]=o.y,i[f+11]=o.z}this.geometry.setAttributeData("aLinearMove",i)},i.expandArray=function(t,e){var i=new Float32Array(e);return i.set(t),i},e}(),o4=[10,32,64,160];function o5(t){for(var e=0;e<o4.length;e++){var i=o4[e];if(i>t)return i}return t||o4[0]}var o6=function(t){function e(e,i,r){(n=t.call(this,e)||this).name="ParticleSystemRenderer",i&&(n.particleMesh=new o3(e,i)),r&&(n.trailMesh=new oq(e,r));var n,a=[n.particleMesh.mesh];return n.materials.push(n.particleMesh.mesh.material),n.trailMesh&&(a.push(n.trailMesh.mesh),n.materials.push(n.trailMesh.mesh.material)),n.meshes=a,n}iN(e,t);var i=e.prototype;return i.onStart=function(){this._priority=this.item.renderOrder;for(var t,e=iD(this.meshes);!(t=e()).done;)t.value.onStart()},i.onUpdate=function(t){var e,i=this.particleMesh.time,r=null!=(e=this.particleMesh.mesh.material.getVector4("uParams"))?e:new e0;this.particleMesh.mesh.material.setVector4("uParams",r.set(i,this.item.duration,0,0))},i.render=function(t){this.maskManager.drawStencilMask(t);for(var e,i=iD(this.meshes);!(e=i()).done;)e.value.render(t)},i.reset=function(){var t;this.particleMesh.clearPoints(),null==(t=this.trailMesh)||t.clearAllTrails()},i.updateTime=function(t,e){this.particleMesh.time=t,this.particleMesh.onUpdate(e),this.trailMesh&&(this.trailMesh.time=t,this.trailMesh.onUpdate(e))},i.minusTimeForLoop=function(t){var e;this.particleMesh.minusTime(t),null==(e=this.trailMesh)||e.minusTime(t)},i.updateWorldMatrix=function(t){this.particleMesh.mesh.worldMatrix=t,this.trailMesh&&(this.trailMesh.mesh.worldMatrix=t)},i.setVisible=function(t){var e;this.particleMesh.mesh.setVisible(t),null==(e=this.trailMesh)||e.mesh.setVisible(t)},i.getTextures=function(){var t=[],e=this.particleMesh.mesh.material.textures;if(Object.keys(e).forEach(function(i){t.push(e[i])}),this.trailMesh){var i=this.trailMesh.mesh.material.textures;Object.keys(i).forEach(function(e){t.push(i[e])})}return t},i.setParticlePoint=function(t,e){this.particleMesh.setPoint(t,e)},i.removeParticlePoint=function(t){this.particleMesh.removePoint(t)},i.getParticlePointColor=function(t){return this.particleMesh.getPointColor(t)},i.hasTrail=function(){return void 0!==this.trailMesh},i.clearTrail=function(t){var e;null==(e=this.trailMesh)||e.clearTrail(t)},i.addTrailPoint=function(t,e,i){var r;null==(r=this.trailMesh)||r.addPoint(t,e,i)},i.setTrailStartPosition=function(t,e){var i;null==(i=this.trailMesh)||i.setPointStartPos(t,e)},i.getTrailStartPosition=function(t){return this.trailMesh.getPointStartPos(t)},e}(rA);t.ParticleSystem=function(e){function i(i,r){var n;return(n=e.call(this,i)||this).destroyed=!1,n.getHitTestParams=function(e){var i=n.interaction;if(e||i)return{type:t.HitTestType.custom,collect:function(t){return n.raycast({radius:(null==i?void 0:i.radius)||.4,multiple:!!(null==i?void 0:i.multiple),removeParticle:(null==i?void 0:i.behavior)===tK.removeParticle,ray:t})}}},n.maskManager=new rM(i),r&&n.fromData(r),n}iN(i,e);var r=i.prototype;return r.isFrozen=function(){return this.frozen},r.isEnded=function(){return this.ended},r.initEmitterTransform=function(){var t,e=this.item.transform.position.clone(),i=this.item.transform.rotation.clone(),r=this.props.emitterTransform&&this.props.emitterTransform.path;r&&(r[0]===tZ.CONSTANT_VEC3?e.add(r[1]):t=aG(r)),this.basicTransform={position:e,rotation:i,path:t};var n=e.clone();if(t&&n.add(t.getValue(0)),this.transform.setPosition(n.x,n.y,n.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.updateEmitterTransform=function(t){var e=this.basicTransform,i=e.path,r=e.position.clone();if(i){var n=this.item.duration;r.add(i.getValue(t/n))}if(this.transform.setPosition(r.x,r.y,r.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.addParticle=function(t,e){var i,r=this.particleLink,n=[t.delay+t.lifetime,0,t.delay,t];if(r.length<e)i=n[1]=r.length;else{var a=r.first;r.removeNode(a),i=n[1]=a.content[1]}r.pushNode(n),this.renderer.setParticlePoint(i,t),this.clearPointTrail(i),this.transform.parentTransform&&this.renderer.setTrailStartPosition(i,this.transform.parentTransform.position.clone())},r.setVisible=function(t){this.renderer.setVisible(t)},r.getTextures=function(){return this.renderer.getTextures()},r.startEmit=function(){(!this.started||this.ended)&&(this.reset(),this.started=!0,this.ended=!1)},r.stop=function(){this.ended=!0,this.started=!1},r.reset=function(){this.renderer.reset(),this.time=0,this.loopStartTime=0,this.lastEmitTime=-1/this.emission.rateOverTime.getValue(0),this.generatedCount=0,this.particleLink=new oj(function(t,e){return t[0]-e[0]}),this.emission.bursts.forEach(function(t){return t.reset()}),this.frozen=!1,this.ended=!1,this.destroyed=!1},r.onStart=function(){this.startEmit(),this.initEmitterTransform()},r.onUpdate=function(t){this.update(t)},r.update=function(t){var e=this;if(this.started&&!this.frozen){var i=this.time+t/1e3,r=this.options,n=this.loopStartTime,a=this.emission;this.time=i,this.upDirectionWorld=null,this.renderer.updateTime(i,t);var o=this.particleLink,s=(i-n)/this.item.duration,u=this.timePassed,h=!1,l=function(){e.trails&&!h&&(h=!0,o.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3];i<u?e.clearPointTrail(r):u>n&&e.updatePointTrail(r,s,a,n)}))};if(this.ended){if(this.item.endBehavior!==tQ.restart&&tQ.destroy===this.item.endBehavior){var c=o.last;c&&c.content[0]<this.time&&(this.destroyed=!0)}}else{var f=this.item.duration,d=this.lifetime;if(u<f){var p=1/a.rateOverTime.getValue(d),m=Math.floor((u-this.lastEmitTime)/p),v=p/m,y=r.maxCount;this.updateEmitterTransform(u);for(var g=function(){var t=o.first;return e.emissionStopped||o.length===y&&t&&t.content[0]-n>u},x=0;x<m&&x<y&&!g();x++){var b=this.createPoint(d);b.delay+=i+x*v,this.addParticle(b,y),this.lastEmitTime=u}for(var T=a.bursts,_=(null==T?void 0:T.length)-1,E=0;_>=0&&E<y&&!g();_--){var C=T[_],S=!C.disabled&&C.getGeneratorOptions(u,d);if(S){var w=[0,0,0],A=a.burstOffsets[_],M=A&&A[S.cycleIndex]||w;C.once&&this.removeBurst(_);for(var I=0;I<S.count&&E<y&&!g();I++){var R,P=this.initPoint(this.shape.generate({total:S.total,index:S.index,burstIndex:I,burstCount:S.count}));P.delay+=i,E++,(R=P.transform).translate.apply(R,[].concat(M)),this.addParticle(P,y)}}}}else this.item.endBehavior===tQ.restart?(l(),this.loopStartTime=i-f,this.lastEmitTime-=f,this.time-=f,a.bursts.forEach(function(t){return t.reset()}),this.particleLink.forEach(function(t){t[0]-=f,t[2]-=f,t[3].delay-=f}),this.renderer.minusTimeForLoop(f)):(this.ended=!0,this.item.endBehavior===tQ.freeze&&(this.frozen=!0))}l()}},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){for(var e=[],i=0;i<this.renderer.meshes.length;i++){var r=this.renderer.meshes[i].material;e.push(r.colorMask),r.colorMask=!1}for(var n,a=iD(this.renderer.meshes);!(n=a()).done;)n.value.render(t);for(var o=0;o<this.renderer.meshes.length;o++)this.renderer.meshes[o].material.colorMask=e[o]}},r.onDestroy=function(){this.item&&this.item.composition&&this.meshes.forEach(function(t){return t.dispose()})},r.getParticleBoxes=function(){var t=this.particleLink,e=this.renderer,i=[],r=this.particleCount,n=0;if(!(t&&e))return i;for(var a=t.last,o=!1;!o;){var s=a.content[0],u=a.content[3];if(s>this.timePassed){var h=this.getPointPosition(u);i.push({center:h,size:u.transform.scale}),a.pre?a=a.pre:o=!0}++n>r&&(o=!0)}return i},r.raycast=function(t){var e=this.particleLink,i=this.renderer;if(e&&i){var r=e.last,n=[],a=new e$,o=!1;if(r&&r.content)do{var s=r.content,u=s[0],h=s[1];s[2];var l=s[3];if(u>this.timePassed){var c=this.getPointPosition(l),f=t.ray,d=!1;f&&(d=!!f.intersectSphere({center:c,radius:t.radius},a)),d&&(t.removeParticle&&(i.removeParticlePoint(h),this.clearPointTrail(h),r.content=[0]),n.push(c),t.multiple||(o=!0))}}while((r=r.pre)&&!o);return n}},r.clearPointTrail=function(t){this.trails&&this.trails.dieWithParticles&&this.renderer.clearTrail(t)},r.updatePointTrail=function(t,e,i,r){var n=this.renderer;if(n.hasTrail()){var a=this.trails,o=this.getPointPosition(i),s=a.inheritParticleColor?n.getParticlePointColor(t):[1,1,1,1],u=i.transform.getWorldScale().toArray(),h=1,l=a.lifetime.getValue(e);if(a.sizeAffectsWidth&&(h*=u[0]),a.sizeAffectsLifetime&&(l*=u[0]),a.parentAffectsPosition&&this.transform.parentTransform){o.add(this.transform.parentTransform.position);var c=n.getTrailStartPosition(t);c&&o.subtract(c)}n.addTrailPoint(t,o,{color:s,lifetime:l,size:h,time:r})}},r.getPointPositionByIndex=function(t){var e=this.particleLink.getNodeByIndex(t);return e?this.getPointPosition(e.content[3]):(console.error("Get point error."),null)},r.getPointPosition=function(t){var e=t.transform,i=t.vel,r=t.lifetime,n=t.delay,a=t.gravity,o=this.options.forceTarget,s=this.time-n,u=new e$,h=e$.fromArray(void 0===a?[]:a);e.assignWorldTRS(u);var l=n5(new e$,this.options,h,s,r,u,i);if(o){var c=o.target||[0,0,0],f=o.curve.getValue(s/r),d=1-f;l.x=l.x*d+c[0]*f,l.y=l.y*d+c[1]*f,l.z=l.z*d+c[2]*f}return l},r.initPoint=function(t){var e,i,r,n,a=this.options,o=this.lifetime,s=this.shape,u=a.startSpeed.getValue(o),h=a.particleFollowParent?rG.IDENTITY:this.transform.getWorldMatrix(),l=t.position,c=new or({position:h.transformPoint(l,new e$),valid:!0}),f=t.direction;if(f=h.transformNormal(f,o8).normalize(),a.startTurbulence&&a.turbulence){for(var d=0;d<3;d++)si.setElement(d,a.turbulence[d].getValue(o));sr.setFromVector3(si.negate()),sa.setFromEuler(sr).transformNormal(f).normalize()}s.alignSpeedDirection?(se.copyFrom(f),this.upDirectionWorld||(s.upDirection?this.upDirectionWorld=s.upDirection.clone():this.upDirectionWorld=e$.Z.clone(),h.transformNormal(this.upDirectionWorld)),st.crossVectors(se,this.upDirectionWorld).normalize(),st.isZero()&&st.set(1,0,0)):(st.set(1,0,0),se.set(0,1,0));var p=this.textureSheetAnimation;p&&p.animate&&((n=sn)[0]=p.animationDelay.getValue(o),n[1]=p.animationDuration.getValue(o),n[2]=p.cycles.getValue(o)),a.start3DRotation?o7.set(a.startRotationX.getValue(o),a.startRotationY.getValue(o),a.startRotationZ.getValue(o)):a.startRotation?o7.set(0,0,a.startRotation.getValue(o)):o7.set(0,0,0),c.setRotation(o7.x,o7.y,o7.z);var m=a.startColor.getValue(o);if(3===m.length&&(m[3]=1),a.start3DSize)o9.x=a.startSizeX.getValue(o),o9.y=a.startSizeY.getValue(o);else{var v=a.startSize.getValue(o),y=a.sizeAspect.getValue(o);o9.x=v,o9.y=0===y?0:v/y}var g=f.clone();if(g.multiply(u),!a.particleFollowParent){var x=new e$;this.transform.assignWorldTRS(void 0,void 0,x),o9.x*=x.x,o9.y*=x.y}return c.setScale(o9.x,o9.y,1),{size:o9,vel:g,color:m,delay:a.startDelay.getValue(o),lifetime:a.startLifetime.getValue(o),uv:(i=Math.floor(Math.random()*(e=this.uvs).length),r=e[i],r),gravity:a.gravity,sprite:n,dirY:se,dirX:st,transform:c}},r.addBurst=function(t,e){var i=!1;if(this.emission.bursts.includes(t)||(this.emission.bursts.push(t),i=!0),i&&eF(e,Array)){var r=this.emission.bursts.indexOf(t);return this.emission.burstOffsets[r]=e,r}return -1},r.removeBurst=function(t){t<this.emission.bursts.length&&(this.emission.burstOffsets[t]=null,this.emission.bursts.splice(t,1))},r.createPoint=function(t){var e={total:this.emission.rateOverTime.getValue(t),index:this.generatedCount,burstIndex:0,burstCount:0};return this.generatedCount++,this.initPoint(this.shape.generate(e))},r.stopParticleEmission=function(){this.emissionStopped=!0},r.resumeParticleEmission=function(){this.emissionStopped=!1},r.getBoundingBox=function(){var e=this.getParticleBoxes();return{type:t.HitTestType.sphere,area:e}},r.fromData=function(t){e.prototype.fromData.call(this,t),this.props=t,this.destroyed=!1;var i,r,n,a,o,s,u,h,l,c,f,d,p,m=t.options,v=t.positionOverLifetime,y=void 0===v?{}:v,g=t.shape,x=null==y?void 0:y.gravityOverLifetime,b=n6(null==y?void 0:y.gravity),T=t.textureSheetAnimation,_=T?{animationDelay:aG(T.animationDelay||0),animationDuration:aG(T.animationDuration||1),cycles:aG(T.cycles||1),animate:T.animate,col:T.col,row:T.row,total:T.total||T.col*T.row}:void 0,E=!!(g&&g.turbulenceX||(null==g?void 0:g.turbulenceY)||(null==g?void 0:g.turbulenceZ));E&&(n=[aG(null!=(a=g.turbulenceX)?a:0),aG(null!=(o=g.turbulenceY)?o:0),aG(null!=(s=g.turbulenceZ)?s:0)]),this.name="ParticleSystem",this.shape=ob(g),this.emission={rateOverTime:aG(t.emission.rateOverTime),burstOffsets:(i=null!=(u=t.emission.burstOffsets)?u:[],r={},Array.isArray(i)&&i.forEach(function(t){var e=eF(t,Array),i=e?t[0]:t.index,n=r[i];n||(n=r[i]=[]),e?n.push(t.slice(1,4)):n.push([+t.x,+t.y,+t.z])}),r),bursts:(t.emission.bursts||[]).map(function(t){return new oU(t)})},this.textureSheetAnimation=_;var C=t.renderer||{},S=t.rotationOverLifetime;S&&((h={}).asRotation=!!S.asRotation,h.z=S.z?aG(S.z):aG(0),S.separateAxes&&(h.x=S.x&&aG(S.x),h.y=S.y&&aG(S.y))),(null==y?void 0:y.forceTarget)&&(l={target:y.target||[0,0,0],curve:aG(y.forceCurve||[tZ.LINE,[[0,0],[1,1]]])});var w={x:y.linearX&&aG(y.linearX||0),y:y.linearY&&aG(y.linearY||0),z:y.linearZ&&aG(y.linearZ||0),asMovement:y.asMovement},A={x:y.orbitalX&&aG(y.orbitalX),y:y.orbitalY&&aG(y.orbitalY),z:y.orbitalZ&&aG(y.orbitalZ),center:y.orbCenter,asRotation:y.asRotation},M=t.sizeOverLifetime||{},I=t.colorOverLifetime,R=(null==M?void 0:M.separateAxes)?{separateAxes:!0,x:aG(M.x),y:aG(M.y)}:{separateAxes:!1,x:aG(("size"in M?M.size:M.x)||1)};C.anchor=C.anchor||[0,0];var P=eJ.fromArray(C.anchor);this.options={particleFollowParent:!!m.particleFollowParent,startLifetime:aG(m.startLifetime),startDelay:aG(m.startDelay||0),startSpeed:aG(y.startSpeed||0),startColor:aG(m.startColor),looping:!1,maxCount:null!=(c=m.maxCount)?c:0,gravityModifier:aG(x||0),gravity:b,start3DSize:!!m.start3DSize,startTurbulence:E,turbulence:n,speedOverLifetime:y.speedOverLifetime&&aG(y.speedOverLifetime),linearVelOverLifetime:w,orbitalVelOverLifetime:A,forceTarget:l},m.startRotationZ&&(this.options.startRotation=aG(m.startRotationZ||0)),(m.startRotationX||m.startRotationY)&&(this.options.start3DRotation=!0,this.options.startRotationX=aG(m.startRotationX||0),this.options.startRotationY=aG(m.startRotationY||0),this.options.startRotationZ=aG(m.startRotationZ||0)),m.start3DSize?(this.options.startSizeX=aG(m.startSizeX),this.options.startSizeY=aG(m.startSizeY)):(this.options.startSize=aG(m.startSize),this.options.sizeAspect=aG(m.sizeAspect||1)),t.mask&&this.maskManager.setMaskOptions(t.mask);var O={meshSlots:m.meshSlots,name:this.name,matrix:rG.IDENTITY,shaderCachePrefix:"",renderMode:C.renderMode||tj.BILLBOARD,side:C.side||tF.DOUBLE,gravity:b,blending:C.blending||tL.ALPHA,rotationOverLifetime:h,gravityModifier:this.options.gravityModifier,linearVelOverLifetime:this.options.linearVelOverLifetime,orbitalVelOverLifetime:this.options.orbitalVelOverLifetime,speedOverLifetime:this.options.speedOverLifetime,sprite:_,occlusion:!!C.occlusion,transparentOcclusion:!!C.transparentOcclusion,maxCount:m.maxCount,mask:this.maskManager.getRefValue(),maskMode:this.maskManager.maskMode,forceTarget:l,diffuse:C.texture?this.engine.findObject(C.texture):void 0,sizeOverLifetime:R,anchor:P};if(I){var N=I.color,V=I.opacity;O.colorOverLifetime={},V&&(O.colorOverLifetime.opacity=aG(I.opacity)),N&&(N[0]===tZ.GRADIENT_COLOR?O.colorOverLifetime.color=I.color[1]:N[0]===tZ.RGBA_COLOR?O.colorOverLifetime.color=nt.createWithData(this.engine,{data:new Uint8Array(N[1]),width:1,height:1}):eF(N,nt)&&(O.colorOverLifetime.color=N))}var L=[],F=[0,0,1,1];if(t.splits){var D=t.splits[0];F=(f=D[4])?[D[0],D[1],D[3],D[2]]:[D[0],D[1],D[2],D[3]]}if(_&&!_.animate)for(var k=f?_.row:_.col,z=f?_.col:_.row,B=_.total||k*z,U=0,G=0;G<k;G++)for(var j=0;j<z&&U<B;j++,U++)L.push([G*F[2]/k+F[0],j*F[3]/z+F[1],F[2]/k,F[3]/z]);else L.push(F);this.uvs=L,O.textureFlip=f;var W=t.trails;W&&(this.trails={lifetime:aG(W.lifetime),dieWithParticles:!1!==W.dieWithParticles,sizeAffectsWidth:!!W.sizeAffectsWidth,sizeAffectsLifetime:!!W.sizeAffectsLifetime,inheritParticleColor:!!W.inheritParticleColor,parentAffectsPosition:!!W.parentAffectsPosition},W.mask&&this.maskManager.setMaskOptions(W.mask),d={name:"Trail",matrix:rG.IDENTITY,minimumVertexDistance:W.minimumVertexDistance||.02,maxTrailCount:m.maxCount,pointCountPerTrail:Math.round(W.maxPointPerTrail)||32,blending:W.blending,texture:W.texture?this.engine.findObject(W.texture):void 0,opacityOverLifetime:aG(W.opacityOverLifetime||1),widthOverTrail:aG(W.widthOverTrail||1),shaderCachePrefix:"",lifetime:this.trails.lifetime,occlusion:!!W.occlusion,transparentOcclusion:!!W.transparentOcclusion,textureMap:W.textureMap,mask:this.maskManager.getRefValue(),maskMode:this.maskManager.maskMode},W.colorOverLifetime&&W.colorOverLifetime[0]===tZ.GRADIENT_COLOR&&(d.colorOverLifetime=W.colorOverLifetime[1]),W.colorOverTrail&&W.colorOverTrail[0]===tZ.GRADIENT_COLOR&&(d.colorOverTrail=W.colorOverTrail[1])),this.renderer=new o6(this.engine,O,d),this.renderer.item=this.item,this.renderer.maskManager=this.maskManager,this.meshes=this.renderer.meshes;var X=t.interaction;X&&(this.interaction={multiple:X.multiple,radius:null!=(p=X.radius)?p:.4,behavior:X.behavior}),this.item.getHitTestParams=this.getHitTestParams},rC(i,[{key:"timePassed",get:function(){return this.time-this.loopStartTime}},{key:"lifetime",get:function(){return this.timePassed/this.item.duration}},{key:"particleCount",get:function(){return this.particleLink.length}},{key:"maxParticles",get:function(){return this.options.maxCount},set:function(t){var e;this.options.maxCount=t,(null==(e=this.renderer)?void 0:e.particleMesh)&&(this.renderer.particleMesh.maxCount=t)}}]),i}(rS),t.ParticleSystem=ek([iU(el.ParticleSystem)],t.ParticleSystem);var o8=new e$,o9=new eJ,o7=new nb,st=new e$,se=new e$,si=new e$,sr=new nb,sn=[0,0,0],sa=new rG,so=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.clipPlayables=[],e.clipWeights=[],e}iN(e,t);var i=e.prototype;return i.processFrame=function(t){for(var e,i=iD(this.clipPlayables);!(e=i()).done;)e.value.processFrame(t);this.evaluate(t)},i.setClipWeight=function(t,e){if(eF(t,a5)){for(var i=0;i<this.clipPlayables.length;i++)if(this.clipPlayables[i]===t){this.clipWeights[i]=e;return}}else this.clipWeights.length<t+1&&(this.clipWeights.length=t+1),this.clipWeights[t]=e},i.getClipWeight=function(t){return this.clipWeights[t]},i.getClipPlayable=function(t){return this.clipPlayables[t]},i.evaluate=function(t){},e}(a5),ss=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(eF(i,t.VFXItem)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?(i.transform.setValid(!0),i.setActive(!0)):(i.transform.setValid(!1),i.setActive(!1))}},i}(so),su=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();eF(i,t.VFXItem)&&(i.time=this.time)},i}(a5),sh=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.processFrame=function(t){this.value=this.curve.getValue(this.time/this.getDuration())},e}(a5),sl=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyPath="",e.propertyName="",e}iN(e,t);var i=e.prototype;return i.evaluate=function(t){var e=t.output.getUserData();if(e){this.directTarget||this.preparePath(e);var i=!1;if(this.propertyValue=this.directTarget[this.propertyName],void 0!==this.propertyValue&&null!==this.propertyValue){this.resetPropertyValue();for(var r=0;r<this.clipPlayables.length;r++){var n=this.getClipWeight(r);if(n>0){var a=this.getClipPlayable(r);if(!eF(a,sh)){console.error("PropertyTrack added non-PropertyPlayableAsset");continue}var o=a.value;this.addWeightedValue(o,n),i=!0}}i&&(this.directTarget[this.propertyName]=this.propertyValue,eF(e,rS)&&e.onApplyAnimationProperties())}}},i.preparePath=function(t){for(var e=this.propertyPath.split("."),i=t,r=0;r<e.length-1;r++){var n=i[e[r]];void 0===n&&console.error("The "+e[r]+" property of "+t+" was not found"),i=n}e.length>0&&(this.propertyName=e[e.length-1]),this.directTarget=i},e}(so),sc=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.setZero()},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.r+=t.r*e,i.g+=t.g*e,i.b+=t.b*e,i.a+=t.a*e},e}(sl),sf=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue=0},i.addWeightedValue=function(t,e){this.propertyValue+=t*e},e}(sl),sd=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.evaluate=function(t){},e}(so),sp=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.evaluate=function(t){},e}(so),sm=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();eF(i,t.CompositionComponent)&&(i.time=this.getTime())},i}(a5),sv=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(eF(i,t.CompositionComponent)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?i.item.setActive(!0):i.item.setActive(!1)}},i}(so),sy=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.evaluate=function(t){},e}(so),sg=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0,this.propertyValue.w=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e,i.w+=t.w*e},e}(sl),sx=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e},e}(sl),sb=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e},e}(sl),sT=new nb,s_=new e$(1,1,1),sE=new e$,sC=function(e){function i(){return e.apply(this,arguments)}iN(i,e);var r=i.prototype;return r.start=function(){var t,e=this.boundObject,i=e.transform.scale;this.originalTransform={position:e.transform.position.clone(),rotation:e.transform.getRotation().clone(),scale:new e$(i.x,i.y,i.x)};var r=this.data.positionOverLifetime,n=this.data.rotationOverLifetime,a=this.data.sizeOverLifetime;if(r&&0!==Object.keys(r).length){this.positionOverLifetime=r,r.path&&(this.originalTransform.path=aG(r.path));var o=r.linearX||r.linearY||r.linearZ;o&&(this.linearVelOverLifetime={x:r.linearX&&aG(r.linearX),y:r.linearY&&aG(r.linearY),z:r.linearZ&&aG(r.linearZ),asMovement:r.asMovement,enabled:!!o});var s=r.orbitalX||r.orbitalY||r.orbitalZ;s&&(this.orbitalVelOverLifetime={x:r.orbitalX&&aG(r.orbitalX),y:r.orbitalY&&aG(r.orbitalY),z:r.orbitalZ&&aG(r.orbitalZ),center:n6(r.orbCenter),asRotation:r.asRotation,enabled:!!s}),this.speedOverLifetime=r.speedOverLifetime&&aG(r.speedOverLifetime)}if(a&&(a.separateAxes?(this.sizeSeparateAxes=!0,this.sizeXOverLifetime=aG(a.x||1),this.sizeYOverLifetime=aG(a.y||1),this.sizeZOverLifetime=aG(a.z||1)):this.sizeXOverLifetime=aG(a.size||1)),n&&(this.rotationOverLifetime={asRotation:n.asRotation,separateAxes:n.separateAxes,z:aG(n.z||0)},n.separateAxes)){var u=this.rotationOverLifetime;u.x=aG(n.x||0),u.y=aG(n.y||0)}this.gravity=e$.fromArray((null==r?void 0:r.gravity)||[]),this.gravityModifier=aG(null!=(t=null==r?void 0:r.gravityOverLifetime)?t:0),this.direction=(null==r?void 0:r.direction)?e$.fromArray(r.direction).normalize():new e$,this.startSpeed=(null==r?void 0:r.startSpeed)||0,this.velocity=this.direction.clone(),this.velocity.multiply(this.startSpeed)},r.processFrame=function(e){if(!this.boundObject){var i=e.output.getUserData();eF(i,t.VFXItem)&&(this.boundObject=i,this.start())}this.boundObject&&this.boundObject.composition&&this.sampleAnimation()},r.sampleAnimation=function(){var t=this,e=this.boundObject,i=this.getDuration(),r=this.time/i;if(r=r<0?0:r>1?1:r,this.sizeXOverLifetime){s_.x=this.sizeXOverLifetime.getValue(r),this.sizeSeparateAxes?(s_.y=this.sizeYOverLifetime.getValue(r),s_.z=this.sizeZOverLifetime.getValue(r)):s_.z=s_.y=s_.x;var n=this.originalTransform.scale;e.transform.setScale(s_.x*n.x,s_.y*n.y,s_.z*n.z)}if(this.rotationOverLifetime){var a=function(e){return t.rotationOverLifetime.asRotation?e.getValue(r):e.getIntegrateValue(0,r,i)},o=a(this.rotationOverLifetime.z),s=this.rotationOverLifetime.separateAxes;sT.x=s?a(this.rotationOverLifetime.x):0,sT.y=s?a(this.rotationOverLifetime.y):0,sT.z=o;var u=sT.addEulers(this.originalTransform.rotation,sT);e.transform.setRotation(u.x,u.y,u.z)}this.positionOverLifetime&&(n5(sE,this,this.gravity,this.time,i,this.originalTransform.position,this.velocity),this.originalTransform.path&&sE.add(this.originalTransform.path.getValue(r)),e.transform.setPosition(sE.x,sE.y,sE.z))},i}(a5);t.TransformPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new sC;return t.data=this.transformAnimationData,t},i.fromData=function(t){this.transformAnimationData=t},e}(a8),t.TransformPlayableAsset=ek([iU(el.TransformPlayableAsset)],t.TransformPlayableAsset);var sS=function(){function t(){this.start=0,this.duration=0}return t.prototype.toLocalTime=function(t){var e=t-this.start,i=this.duration;return e-i>0&&(this.endBehavior===tQ.restart?e%=i:this.endBehavior===tQ.freeze&&(e=Math.min(i,e))),e},t}();t.TrackAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.trackType=0,e.clipSeed=0,e.clips=[],e.children=[],e}iN(e,t);var i=e.prototype;return i.updateAnimatedObject=function(t){return t},i.createTrackMixer=function(){return new so},i.createOutput=function(){return new a6},i.createPlayableGraph=function(t){return this.createMixerPlayableGraph(t)},i.createMixerPlayableGraph=function(t){for(var e,i=[],r=iD(this.clips);!(e=r()).done;){var n=e.value;i.push(n)}return this.compileClips(i,t)},i.compileClips=function(t,e){for(var i,r=this.createTrackMixer(),n=iD(t);!(i=n()).done;){var a=i.value,o=this.createClipPlayable(a);o.setDuration(a.duration);var s=new sw(a,o,r);e.push(s),r.clipPlayables.push(o),r.setClipWeight(o,0)}return r},i.createPlayable=function(){return new a5},i.getChildTracks=function(){return this.children},i.addChild=function(t){this.children.push(t),t.parent=this},i.createClip=function(t,e){var i=new sS;return i.asset=new t(this.engine),i.name=e||"TimelineClip"+i.id,this.addClip(i),i},i.getClips=function(){return this.clips},i.findClip=function(t){for(var e,i=iD(this.clips);!(e=i()).done;){var r=e.value;if(r.name===t)return r}},i.addClip=function(t){t.id=(this.clipSeed++).toString(),this.clips.push(t)},i.createClipPlayable=function(t){return t.asset.createPlayable()},i.fromData=function(e){t.prototype.fromData.call(this,e);for(var i,r=iD(this.children);!(i=r()).done;)i.value.parent=this},e}(a8),ek([ij(sS,void 0)],t.TrackAsset.prototype,"clips",void 0),ek([ij(void 0,void 0)],t.TrackAsset.prototype,"children",void 0),t.TrackAsset=ek([iU(el.TrackAsset)],t.TrackAsset),t.TrackType=void 0,(tS=t.TrackType||(t.TrackType={}))[tS.MasterTrack=0]="MasterTrack",tS[tS.ObjectTrack=1]="ObjectTrack";var sw=function(){function e(t,e,i){this.clip=t,this.playable=e,this.parentMixer=i}var i=e.prototype;return i.getParticleSystem=function(){return!this.particleSystem&&eF(this.parentMixer.trackInstance.boundObject,t.VFXItem)&&(this.particleSystem=this.parentMixer.trackInstance.boundObject.getComponent(t.ParticleSystem)),this.particleSystem},i.evaluateAt=function(e){var i=this.clip,r=1,n=!1,a=!1,o=this.parentMixer.trackInstance.boundObject;e>=i.start+i.duration&&i.endBehavior===tQ.destroy?eF(o,t.VFXItem)&&t.VFXItem.isParticle(o)&&this.getParticleSystem()&&!this.getParticleSystem().destroyed?r=1:(r=0,n=!0):e-this.clip.start>=0?(r=1,a=!0):e<i.start&&(r=0),a&&this.playable.getPlayState()!==t.PlayState.Playing&&this.playable.play(),this.parentMixer.setClipWeight(this.playable,r);var s=i.toLocalTime(e);this.playable.setTime(s),n&&this.playable.getPlayState()===t.PlayState.Playing&&this.playable.pause()},rC(e,[{key:"enable",set:function(t){t?this.playable.play():(this.parentMixer.setClipWeight(this.playable,0),this.playable.pause())}}]),e}();t.ActivationTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new ss},e}(t.TrackAsset),t.ActivationTrack=ek([iU(el.ActivationTrack)],t.ActivationTrack);var sA=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyNames=[],e.path="",e}return iN(e,t),e.prototype.fromData=function(e){t.prototype.fromData.call(this,e);var i=this.path.split(".");this.propertyNames=i},e}(t.TrackAsset);ek([ij(void 0,void 0)],sA.prototype,"path",void 0),t.FloatPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sf;return t.propertyPath=this.path,t},e}(sA),t.FloatPropertyTrack=ek([iU(el.FloatPropertyTrack)],t.FloatPropertyTrack),t.SpriteColorTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new sp},e}(t.TrackAsset),t.SpriteColorTrack=ek([iU(el.SpriteColorTrack)],t.SpriteColorTrack),t.SubCompositionTrack=function(e){function i(){return e.apply(this,arguments)}iN(i,e);var r=i.prototype;return r.updateAnimatedObject=function(e){if(!eF(e,t.VFXItem))throw Error("SubCompositionTrack needs to be set under the VFXItem track.");return e.getComponent(t.CompositionComponent)},r.createTrackMixer=function(){return new sv},i}(t.TrackAsset),t.SubCompositionTrack=ek([iU(el.SubCompositionTrack)],t.SubCompositionTrack),t.TransformTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new sy},e}(t.TrackAsset),t.TransformTrack=ek([iU(el.TransformTrack)],t.TransformTrack),t.MaterialTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.updateAnimatedObject=function(t){if(!eF(t,rA))throw Error("MaterialTrack: expected a RendererComponent bound object.");var e=t.materials;if(this.index>=e.length)throw Error("MaterialTrack: material index "+this.index+" out of bounds (length="+e.length+").");return e[this.index]},e}(t.TrackAsset),ek([ij(void 0,void 0)],t.MaterialTrack.prototype,"index",void 0),t.MaterialTrack=ek([iU("MaterialTrack")],t.MaterialTrack);var sM=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new sd},e}(t.TrackAsset);t.Vector4PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sg;return t.propertyPath=this.path,t},e}(sA),t.Vector4PropertyTrack=ek([iU(el.Vector4PropertyTrack)],t.Vector4PropertyTrack),t.Vector3PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sx;return t.propertyPath=this.path,t},e}(sA),t.Vector3PropertyTrack=ek([iU(el.Vector3PropertyTrack)],t.Vector3PropertyTrack),t.Vector2PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sb;return t.propertyPath=this.path,t},e}(sA),t.Vector2PropertyTrack=ek([iU(el.Vector2PropertyTrack)],t.Vector2PropertyTrack),t.ColorPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){var t=new sc;return t.propertyPath=this.path,t},e}(sA),t.ColorPropertyTrack=ek([iU(el.ColorPropertyTrack)],t.ColorPropertyTrack),t.ObjectBindingTrack=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.create=function(e,i){var r=i[this.getInstanceId()];if(eF(r,t.VFXItem))for(var n,a=iD(this.getChildTracks());!(n=a()).done;){var o=n.value;if(eF(o,t.ActivationTrack)){if(r.getComponent(t.ParticleSystem))for(var s,u=e.createTrack(sM,this,"ParticleTrack"),h=iD(o.getClips());!(s=h()).done;){var l=s.value,c=u.createClip(o1);c.start=l.start,c.duration=l.duration,c.endBehavior=l.endBehavior}if(r.getComponent(t.SpriteComponent))for(var f,d=e.createTrack(sG,this,"SpriteComponentTimeTrack"),p=iD(o.getClips());!(f=p()).done;){var m=f.value,v=d.createClip(sW);v.start=m.start,v.duration=m.duration,v.endBehavior=m.endBehavior}if(r.getComponent(t.EffectComponent))for(var y,g=e.createTrack(sj,this,"EffectComponentTimeTrack"),x=iD(o.getClips());!(y=x()).done;){var b=y.value,T=g.createClip(sW);T.start=b.start,T.duration=b.duration,T.endBehavior=b.endBehavior}break}}},i}(t.TrackAsset),t.ObjectBindingTrack=ek([iU(el.ObjectBindingTrack)],t.ObjectBindingTrack),t.ActivationPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new su},e}(a8),t.ActivationPlayableAsset=ek([iU(el.ActivationPlayableAsset)],t.ActivationPlayableAsset),t.ColorPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sh;return t.curve=aG(this.curveData),t.value=t.curve.getValue(0),t},e}(a8),ek([ij(void 0,void 0)],t.ColorPropertyPlayableAsset.prototype,"curveData",void 0),t.ColorPropertyPlayableAsset=ek([iU(el.ColorPropertyPlayableAsset)],t.ColorPropertyPlayableAsset),t.FloatPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sh;return t.curve=aG(this.curveData),t.value=t.curve.getValue(0),t},e}(a8),ek([ij(void 0,void 0)],t.FloatPropertyPlayableAsset.prototype,"curveData",void 0),t.FloatPropertyPlayableAsset=ek([iU(el.FloatPropertyPlayableAsset)],t.FloatPropertyPlayableAsset),t.SubCompositionPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new sm},e}(a8),t.SubCompositionPlayableAsset=ek([iU(el.SubCompositionPlayableAsset)],t.SubCompositionPlayableAsset),t.Vector4PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sh;return t.curve=aG(this.curveData),t.value=t.curve.getValue(0),t},e}(a8),ek([ij(void 0,void 0)],t.Vector4PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector4PropertyPlayableAsset=ek([iU(el.Vector4PropertyPlayableAsset)],t.Vector4PropertyPlayableAsset),t.Vector3ropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sh;return t.curve=aG(this.curveData),t.value=t.curve.getValue(0),t},e}(a8),ek([ij(void 0,void 0)],t.Vector3ropertyPlayableAsset.prototype,"curveData",void 0),t.Vector3ropertyPlayableAsset=ek([iU(el.Vector3PropertyPlayableAsset)],t.Vector3ropertyPlayableAsset),t.Vector2PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){var t=new sh;return t.curve=aG(this.curveData),t.value=t.curve.getValue(0),t},e}(a8),ek([ij(void 0,void 0)],t.Vector2PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector2PropertyPlayableAsset=ek([iU(el.Vector2PropertyPlayableAsset)],t.Vector2PropertyPlayableAsset);var sI=function(){function t(t,e,i){this.children=[],this.trackAsset=t,this.mixer=e,this.output=i,this.mixer.trackInstance=this}return t.prototype.addChild=function(t){this.children.push(t)},t}();t.TimelineAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.tracks=[],e.cacheFlattenedTracks=null,e}iN(e,t);var i=e.prototype;return i.createTrack=function(t,e,i){var r=new t(this.engine);return r.name=i||t.name,e.addChild(r),this.invalidate(),r},i.invalidate=function(){this.cacheFlattenedTracks=null},i.addSubTracksRecursive=function(t,e){for(var i,r=iD(t.getChildTracks());!(i=r()).done;){var n=i.value;e.push(n)}for(var a,o=iD(t.getChildTracks());!(a=o()).done;){var s=a.value;this.addSubTracksRecursive(s,e)}},rC(e,[{key:"flattenedTracks",get:function(){if(!this.cacheFlattenedTracks){this.cacheFlattenedTracks=[];for(var t,e=iD(this.tracks);!(t=e()).done;){var i=t.value;this.cacheFlattenedTracks.push(i),this.addSubTracksRecursive(i,this.cacheFlattenedTracks)}}return this.cacheFlattenedTracks}}]),e}(iW),ek([ij(void 0,void 0)],t.TimelineAsset.prototype,"tracks",void 0),t.TimelineAsset=ek([iU(el.TimelineAsset)],t.TimelineAsset);var sR=function(){function e(e,i){this.time=0,this.clips=[],this.masterTrackInstances=[];for(var r,n={},a=iD(i);!(r=a()).done;){var o=r.value;n[o.key.getInstanceId()]=o.value}for(var s,u=iD(e.tracks);!(s=u()).done;){var h=s.value;eF(h,t.ObjectBindingTrack)&&h.create(e,n)}this.compileTracks(e.flattenedTracks,i)}var i=e.prototype;return i.setTime=function(t){this.time=t},i.getTime=function(){return this.time},i.evaluate=function(t){for(var e,i=this.getTime(),r=iD(this.clips);!(e=r()).done;)e.value.evaluateAt(i);for(var n,a=iD(this.masterTrackInstances);!(n=a()).done;){var o=n.value;this.tickTrack(o,t)}},i.compileTracks=function(t,e){for(var i,r={},n=iD(t);!(i=n()).done;){var a=i.value,o=a.createPlayableGraph(this.clips),s=a.createOutput(),u=new sI(a,o,s);r[a.getInstanceId()]=u,a.parent||this.masterTrackInstances.push(u)}for(var h,l=iD(t);!(h=l()).done;)for(var c,f=h.value,d=r[f.getInstanceId()],p=iD(f.getChildTracks());!(c=p()).done;){var m=r[c.value.getInstanceId()];d.addChild(m)}for(var v,y=iD(e);!(v=y()).done;){var g=v.value;r[g.key.getInstanceId()].boundObject=g.value}for(var x,b=iD(this.masterTrackInstances);!(x=b()).done;){var T=x.value;this.updateTrackAnimatedObject(T)}},i.tickTrack=function(e,i){var r=e.output.context;r.deltaTime=i,e.output.setUserData(e.boundObject);for(var n,a=iD(e.mixer.clipPlayables);!(n=a()).done;){var o=n.value;o.getPlayState()===t.PlayState.Playing&&o.processFrame(r)}e.mixer.evaluate(r);for(var s,u=iD(e.children);!(s=u()).done;){var h=s.value;this.tickTrack(h,i)}},i.updateTrackAnimatedObject=function(t){for(var e,i=iD(t.children);!(e=i()).done;){var r=e.value;if(!r.boundObject){var n=r.trackAsset.updateAnimatedObject(t.boundObject);r.boundObject=n}this.updateTrackAnimatedObject(r)}},e}();t.CompositionComponent=function(e){function i(){var i;return i=e.apply(this,arguments)||this,i.time=0,i.items=[],i.state=t.PlayState.Playing,i.reusable=!1,i.sceneBindings=[],i}iN(i,e);var r=i.prototype;return r.onStart=function(){var e;this.timelineAsset||(this.timelineAsset=new t.TimelineAsset(this.engine)),this.timelineInstance=new sR(this.timelineAsset,this.sceneBindings),null==(e=this.item.composition)||e.refContent.push(this.item)},r.getReusable=function(){return this.reusable},r.pause=function(){this.state=t.PlayState.Paused},r.resume=function(){this.state=t.PlayState.Playing},r.onUpdate=function(e){if(this.state!==t.PlayState.Paused){var i=this.time;this.timelineInstance.setTime(i),this.timelineInstance.evaluate(e/1e3)}},r.onEnable=function(){for(var t,e=iD(this.items);!(t=e()).done;)t.value.setActive(!0)},r.onDisable=function(){for(var t,e=iD(this.items);!(t=e()).done;)t.value.setActive(!1)},r.onDestroy=function(){this.item.composition&&this.items&&(this.items.forEach(function(t){return t.dispose()}),this.items.length=0)},r.hitTest=function(e,i,r,n,a,o){for(var s,u=[],h=(null==o?void 0:o.stop)||ip,l=(null==o?void 0:o.skip)||ip,c=(null==o?void 0:o.maxCount)||this.items.length,f=0;f<this.items.length&&n.length<c;f++){var d=(s=this,function(o){var c=s.items[o];if(c.isActive&&c.transform.getValid()&&!t.VFXItem.isComposition(c)&&!l(c)){var f=c.getHitTestParams(a);if(f){var d=!1,p=new e$;if(f.type===t.HitTestType.triangle)for(var m=f.triangles,v=f.backfaceCulling,y=0;y<m.length;y++){var g=m[y];if(e.intersectTriangle(g,p,v)){d=!0,u.push(p);break}}else if(f.type===t.HitTestType.box){var x=f.center,b=f.size,T=x.clone().addScaledVector(b,.5),_=x.clone().addScaledVector(b,-.5);e.intersectBox({min:T,max:_},p)&&(d=!0,u.push(p))}else if(f.type===t.HitTestType.sphere){var E=f.center,C=f.radius;e.intersectSphere({center:E,radius:C},p)&&(d=!0,u.push(p))}else if(f.type===t.HitTestType.custom){var S=f.collect(e,new eJ(i,r));S&&S.length>0&&(S.forEach(function(t){u.push(t)}),d=!0)}if(d){var w={compContent:s.item,id:c.getInstanceId(),name:c.name,position:u[u.length-1],parentId:c.parentId,hitPositions:u,behavior:f.behavior,item:c,composition:s.item.composition};if(n.push(w),h(w))return{v:n}}}}}(f));if("object"===eD(d))return d.v}return n},r.setChildrenRenderOrder=function(t){for(var e,r=iD(this.items);!(e=r()).done;){var n=e.value;n.renderOrder=t++;var a=n.getComponent(i);a&&(t=a.setChildrenRenderOrder(t))}return t},r.fromData=function(t){e.prototype.fromData.call(this,t)},i}(rS),ek([ij(void 0,void 0)],t.CompositionComponent.prototype,"items",void 0),ek([ij(void 0,void 0)],t.CompositionComponent.prototype,"sceneBindings",void 0),ek([ij(void 0,void 0)],t.CompositionComponent.prototype,"timelineAsset",void 0),t.CompositionComponent=ek([iU("CompositionComponent")],t.CompositionComponent);var sP=function(){var t=this,e=this;this.listeners={},this.off=function(e,i){t.listeners[e]&&(t.listeners[e]=t.listeners[e].filter(function(t){return t.listener!==i}))},this.on=function(e,i,r){return t.listeners[e]=t.listeners[e]||[],t.listeners[e].push({listener:i,options:r}),function(){return t.off(e,i)}},this.once=function(e,i){t.on(e,i,{once:!0})},this.emit=function(t){for(var i,r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];null==(i=e.listeners[t])||i.forEach(function(i){var r=i.listener,a=i.options;r.apply(void 0,[].concat(n)),(null==a?void 0:a.once)&&e.off(t,r)})},this.getListeners=function(e){var i;return(null==(i=t.listeners[e])?void 0:i.map(function(t){return t.listener}))||[]}},sO=function(){function t(){this.update=new sV,this.lateUpdate=new sL}var e=t.prototype;return e.addComponent=function(t){t.onUpdate!==rS.prototype.onUpdate&&this.update.addComponent(t),t.onLateUpdate!==rS.prototype.onLateUpdate&&this.lateUpdate.addComponent(t)},e.removeComponent=function(t){t.onUpdate!==rS.prototype.onUpdate&&this.update.removeComponent(t),t.onLateUpdate!==rS.prototype.onLateUpdate&&this.lateUpdate.removeComponent(t)},e.clear=function(){this.update.clear(),this.lateUpdate.clear()},t}(),sN=function(){function t(){this.components=[],this.ticks=[]}var e=t.prototype;return e.tick=function(t){this.tickComponents(this.components,t);for(var e=0;e<this.ticks.length;e++)this.ticks[e](t)},e.tickComponents=function(t,e){},e.addComponent=function(t){this.components.includes(t)||this.components.push(t)},e.removeComponent=function(t){var e=this.components.indexOf(t);e>-1&&this.components.splice(e,1)},e.addTick=function(t,e){var i=t.bind(e);this.ticks.includes(i)||this.ticks.push(i)},e.clear=function(){this.components=[]},t}(),sV=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=iD(t);!(i=r()).done;)i.value.onUpdate(e)},e}(sN),sL=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=iD(t);!(i=r()).done;)i.value.onLateUpdate(e)},e}(sN),sF=function(e){function i(r,n){(y=e.call(this)||this).sceneTicking=new sO,y.speed=1,y.isEnded=!1,y.loaderData={},y.refContent=[],y.startTime=0,y.postProcessingEnabled=!1,y.destroyed=!1,y.paused=!1,y.isEndCalled=!1,y._textures=[],y.videos=[];var a,o,s,u=r.reusable,h=void 0!==u&&u,l=r.speed,c=r.baseRenderOrder,f=r.renderer,d=r.event,p=r.width,m=r.height,v=r.onItemMessage;y.renderer=f,y.renderer.engine.addComposition(a9(y)),y._textures=n.textures;for(var y,g,x,b=iD(Object.keys(n.assets));!(x=b()).done;){var T=x.value,_=n.assets[T];eF(_,HTMLVideoElement)&&y.videos.push(_)}y.postProcessingEnabled=null!=(E=null==(g=n.jsonScene.renderSettings)?void 0:g.postProcessingEnabled)&&E,y.getEngine().renderLevel=n.renderLevel,h&&(n.consumed=!0);for(var E,C,S=n.jsonScene.compositions[0],w=iD(n.jsonScene.compositions);!(C=w()).done;){var A=C.value;A.id===n.jsonScene.compositionId&&(S=A)}ih(S),y.rootItem=new t.VFXItem(y.getEngine()),y.rootItem.setInstanceId(S.id),y.rootItem.name="rootItem",y.rootItem.duration=S.duration,y.rootItem.endBehavior=S.endBehavior,y.rootItem.composition=a9(y);for(var M,I=S.components,R=iD(I);!(M=R()).done;){var P=M.value,O=y.getEngine().findObject(P);y.rootItem.components.push(O),O.item=y.rootItem}return y.rootComposition=y.rootItem.getComponent(t.CompositionComponent),y.width=p,y.height=m,y.renderOrder=void 0===c?0:c,y.id=S.id,y.startTime=null!=(a=S.startTime)?a:0,y.renderer=f,y.event=d,y.statistic={loadStart:null!=(o=n.startTime)?o:0,loadTime:null!=(s=n.totalTime)?s:0,compileTime:0,firstFrameTime:0},y.reusable=h,y.speed=void 0===l?1:l,y.name=S.name,iM.initializeComposition(a9(y),n),y.camera=new oa(y.name,i2({},null==S?void 0:S.camera,{aspect:p/m,pixelWidth:p,pixelHeight:m})),y.url=n.url,y.interactive=!0,v&&(y.onItemMessage=v),y.createRenderFrame(),i.buildItemTree(y.rootItem),y.rootComposition.setChildrenRenderOrder(0),y}iN(i,e);var r=i.prototype;return r.getDuration=function(){return this.rootItem.duration},r.restart=function(){this.reset(),this.forwardTime(this.startTime)},r.setIndex=function(t){this.renderOrder=t},r.getIndex=function(){return this.renderOrder},r.setSpeed=function(t){this.speed=t},r.setVisible=function(t){this.rootItem.setVisible(t)},r.getSpeed=function(){return this.speed},r.play=function(){this.isEnded&&this.reusable&&this.restart(),this.rootComposition.isStartCalled?this.setTime(this.time-this.startTime):this.setTime(0),this.resume()},r.pause=function(){this.paused=!0,this.emit("pause")},r.getPaused=function(){return this.paused},r.resume=function(){this.paused=!1,this.isEnded&&this.reusable&&this.restart();var t=this.time;this.emit("play",{time:t})},r.gotoAndPlay=function(t){this.setTime(t),this.emit("goto",{time:t}),this.resume()},r.gotoAndStop=function(t){this.setTime(t),this.emit("goto",{time:t}),this.pause()},r.createRenderFrame=function(){this.renderFrame=new nW({camera:this.camera,renderer:this.renderer,globalVolume:this.globalVolume,postProcessingEnabled:this.postProcessingEnabled})},r.setTime=function(t){var e=this.speed,i=this.getPaused();i&&this.resume(),this.setSpeed(1),this.forwardTime(t+this.startTime),this.setSpeed(e),i&&(this.paused=!0)},r.addItem=function(t){this.items.push(t),t.setParent(this.rootItem)},r.getComponent=function(t){return this.rootItem.getComponent(t)},r.forwardTime=function(t){for(var e=1e3*t-1e3*this.time,i=e<0,r=Math.abs(e),n=i?-15:15;r>15;r-=15)this.update(n);this.update(i?-r:r)},r.reset=function(){this.isEnded=!1,this.isEndCalled=!1,this.rootComposition.time=0},r.prepareRender=function(){},r.update=function(t){if(!this.getPaused()){this.rootItem.isDuringPlay||(this.rootItem.awake(),this.rootItem.beginPlay());var e=this.time;this.updateCompositionTime(t*this.speed/1e3);var i=(this.time-e)*1e3;this.sceneTicking.update.tick(i),this.sceneTicking.lateUpdate.tick(i),this.updateCamera(),this.prepareRender(),this.isEnded&&!this.isEndCalled&&(this.isEndCalled=!0,this.emit("end",{composition:this})),this.shouldDispose()&&this.dispose()}},r.shouldDispose=function(){return this.isEnded&&this.rootItem.endBehavior===tQ.destroy&&!this.reusable},r.updateCamera=function(){this.camera.updateMatrix()},r.updateCompositionTime=function(e){if(this.rootComposition.state!==t.PlayState.Paused&&this.rootComposition.isActiveAndEnabled){var i=this.time+e-this.startTime;e<0&&i<0&&(i=0);var r=this.rootItem.duration,n=this.rootItem.endBehavior,a=!1;if(i>=r)switch(a=!0,n){case tQ.restart:i%=r,this.restart();break;case tQ.freeze:i=Math.min(r,i);case tQ.forward:case tQ.destroy:}this.rootComposition.time=i+this.startTime,this.isEnded!==a&&(a?this.isEnded=!0:(this.isEnded=!1,this.isEndCalled=!1))}},r.getItemByName=function(t){return this.rootItem.find(t)},r.getHitTestRay=function(t,e){var i=this.renderFrame.editorTransform,r=i.x,n=i.y;return at((t-i.z)/r,(e-i.w)/n,this.camera)},r.getEngine=function(){var t;return null==(t=this.renderer)?void 0:t.engine},r.hitTest=function(e,i,r,n){if(this.isDestroyed||!this.interactive)return[];var a=[],o=this.getHitTestRay(e,i);return this.refContent.forEach(function(s){var u;null==(u=s.getComponent(t.CompositionComponent))||u.hitTest(o,e,i,a,r,n)}),a},r.addInteractiveItem=function(t,e){if(e===tB.MESSAGE)return null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:2,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:2,id:t.id}),t.id},r.removeInteractiveItem=function(t,e){e===tB.MESSAGE&&(null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:1,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:1,id:t.id}))},r.destroyItem=function(t){t.type!==tG.composition&&eX(this.items,t)},r.lost=function(t){this.videoState=this.textures.map(function(t){if("video"in t.source)return t.source.video.pause(),t.source.video.currentTime}),this.textures.map(function(t){return t.dispose()}),this.dispose()},r.dispose=function(){var e=this;if(!this.destroyed){this.destroyed=!0;for(var i,r=iD(this.textures);!(i=r()).done;)i.value.dispose();this._textures=[];for(var n,a=iD(this.videos);!(n=a()).done;){var o=n.value;o.pause(),o.removeAttribute("src"),o.load()}this.videos=[],this.rootItem.dispose(),this.renderFrame.dispose(),iM.destroyComposition(this),this.update=function(){id.error("Update disposed composition: "+e.name+".")},this.dispose=ip,this.renderer.engine.removeComposition(this),this.getEngine().env!==aD&&this.renderer.clear({stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]})}},r.setEditorTransform=function(t,e,i){this.renderFrame.editorTransform.set(t,t,e,i)},r.translateByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.rootItem.translateByPixel(t,e)},r.setPositionByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.rootItem.setPositionByPixel(t,e)},r.translate=function(t,e,i){this.rootItem.translate(t,e,i)},r.setPosition=function(t,e,i){this.rootItem.setPosition(t,e,i)},r.rotate=function(t,e,i){this.rootItem.rotate(t,e,i)},r.setRotation=function(t,e,i){this.rootItem.setRotation(t,e,i)},r.scale=function(t,e,i){this.rootItem.scale(t,e,i)},r.setScale=function(t,e,i){this.rootItem.setScale(t,e,i)},r.offloadTexture=function(){this.textureOffloaded||(this.textures.forEach(function(t){return t&&t.offloadData()}),this.textureOffloaded=!0)},r.reloadTexture=function(){var t=this;return eL(function(){return ez(this,function(e){switch(e.label){case 0:if(!t.textureOffloaded)return[3,2];return[4,Promise.all(t.textures.map(function(t){return null==t?void 0:t.reloadData()}))];case 1:e.sent(),t.textureOffloaded=!1,e.label=2;case 2:return[2]}})})()},i.buildItemTree=function(e){for(var i,r=new Map,n=e.getComponent(t.CompositionComponent).items,a=iD(n);!(i=a()).done;){var o=i.value;r.set(o.id,o)}for(var s,u=iD(n);!(s=u()).done;){var h=s.value;if(void 0===h.parentId)h.setParent(e);else{var l=r.get(h.parentId);if(l)h.setParent(l);else throw Error("The element references a non-existent element, please check the data.")}}},rC(i,[{key:"transform",get:function(){return this.rootItem.transform}},{key:"textures",get:function(){return this._textures}},{key:"items",get:function(){return this.rootComposition.items}},{key:"time",get:function(){return this.rootComposition.time}},{key:"isDestroyed",get:function(){return this.destroyed}},{key:"viewportMatrix",get:function(){return this.camera.getViewportMatrix()},set:function(t){this.camera.setViewportMatrix(t)}}]),i}(sP);t.VFXItem=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).children=[],r.transform=new or,r.time=-1,r.duration=0,r.endBehavior=tQ.forward,r.type=tG.base,r.components=[],r.isDuringPlay=!1,r.active=!0,r.visible=!0,r.listIndex=0,r.isEnabled=!1,r.eventProcessor=new sP,r.name="VFXItem",r.transform.name=r.name,r.transform.engine=t,i&&r.fromData(i),r}iN(i,e);var r=i.prototype;return r.on=function(t,e,i){this.eventProcessor.on(t,e,i)},r.off=function(t,e){this.eventProcessor.off(t,e)},r.once=function(t,e){this.eventProcessor.once(t,e)},r.emit=function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=this.eventProcessor).emit.apply(e,[].concat([t],r))},r.getListeners=function(t){return this.eventProcessor.getListeners(t)},r.addComponent=function(t){var e=new t(this.engine);return this.components.push(e),e.setVFXItem(this),e},r.getComponent=function(t){for(var e,i,r=iD(this.components);!(i=r()).done;){var n=i.value;if(eF(n,t)){e=n;break}}return e},r.getComponents=function(t){for(var e,i=[],r=iD(this.components);!(e=r()).done;){var n=e.value;eF(n,t)&&i.push(n)}return i},r.setParent=function(t){(t!==this||t)&&(this.parent&&eX(this.parent.children,this),this.parent=t,this.transform.parentTransform=t.transform,t.children.push(this),!this.composition&&t.composition&&(this.composition=t.composition),!this.isDuringPlay&&t.isDuringPlay&&(this.awake(),this.beginPlay()))},r.setColor=function(t,e,i,r){},r.setOpacity=function(t){},r.setActive=function(t){!!t!==this.active&&(this.active=!!t,this.onActiveChanged())},r.setVisible=function(t){for(var e,i=iD(this.components);!(e=i()).done;)e.value.enabled=t;this.visible=t},r.getVisible=function(){return this.visible},r.getWorldTransform=function(t){var e=null!=t?t:new or({valid:!0});return e.cloneFromMatrix(this.transform.getWorldMatrix()),e},r.translate=function(t,e,i){this.transform.translate(t,e,i)},r.rotate=function(t,e,i){var r=new nb(t,e,i),n=i5.fromEuler(r);n.conjugate(),this.transform.rotateByQuat(n)},r.scale=function(t,e,i){this.transform.scaleBy(t,e,i)},r.setPositionByPixel=function(t,e){if(this.composition){var i=this.transform.getWorldPosition().z,r=this.composition.camera.getInverseVPRatio(i),n=r.x,a=r.y,o=this.composition.renderer.getWidth()/2,s=this.composition.renderer.getHeight()/2;this.transform.setPosition((2*t/o-1)*n,(1-2*e/s)*a,i)}},r.setPosition=function(t,e,i){this.transform.setPosition(t,e,i)},r.setRotation=function(t,e,i){this.transform.setRotation(t,e,i)},r.setScale=function(t,e,i){this.transform.setScale(t,e,i)},r.setWorldPosition=function(t,e,i){this.transform.setWorldPosition(t,e,i)},r.getBoundingBox=function(){},r.getHitTestParams=function(t){},r.getCurrentPosition=function(){var t=new e$;return this.transform.assignWorldTRS(t),t},r.find=function(t){if(this.name===t)return this;var e=[];e.push.apply(e,[].concat(this.children));for(var i=0;i<e.length;){var r=e[i];if(i++,r.name===t)return r;e.push.apply(e,[].concat(r.children))}},r.duplicate=function(){var t=new Map;this.gatherPreviousObjectID(t),this.resetGUID();var e=this.engine.findObject({id:this.defination.id});return e.resetGUID(),this.resetGUID(t),this.composition&&e.setParent(this.composition.rootItem),e},r.beginPlay=function(){this.isDuringPlay=!0,this.composition&&this.active&&!this.isEnabled&&this.onEnable();for(var t,e=iD(this.children);!(t=e()).done;){var i=t.value;i.isDuringPlay||i.beginPlay()}},r.awake=function(){for(var t,e=iD(this.components);!(t=e()).done;){var i=t.value;i.isAwakeCalled||(i.onAwake(),i.isAwakeCalled=!0)}for(var r,n=iD(this.children);!(r=n()).done;)r.value.awake()},r.onActiveChanged=function(){this.isEnabled?this.onDisable():this.onEnable()},r.onEnable=function(){this.isEnabled=!0;for(var t,e=iD(this.components);!(t=e()).done;){var i=t.value;i.enabled&&!i.isStartCalled&&(i.onStart(),i.isStartCalled=!0)}for(var r,n=iD(this.components);!(r=n()).done;){var a=r.value;a.enabled&&!a.isEnableCalled&&a.enable()}},r.onDisable=function(){this.isEnabled=!1;for(var t,e=iD(this.components);!(t=e()).done;){var i=t.value;i.enabled&&i.isEnableCalled&&i.disable()}},r.fromData=function(r){e.prototype.fromData.call(this,r);var n=r.id,a=r.name,o=r.parentId,s=r.endBehavior,u=r.transform,h=r.duration,l=void 0===h?0:h,c=r.visible;if(this.props=r,this.type=r.type,this.id=n.toString(),this.name=a,u&&this.transform.fromData(u),this.transform.name=this.name,this.transform.engine=this.engine,this.parentId=o,this.duration=l,this.endBehavior=s,r.content||(r.content={options:{}}),l<0)throw Error("Item duration can't be less than 0, see "+ak["Item duration can't be less than 0"]+".");if(r.components){this.components.length=0;for(var f,d=iD(r.components);!(f=d()).done;){var p=f.value,m=this.engine.findObject(p);this.components.push(m),eF(m,t.ParticleSystem)&&!this.components.includes(m.renderer)&&this.components.push(m.renderer)}}i.isComposition(this)&&this.instantiatePreComposition(),this.setVisible(void 0===c||c)},r.toData=function(){if(this.defination.id=this.guid,this.defination.transform=this.transform.toData(),this.defination.dataType=el.VFXItemData,(null==(e=this.parent)?void 0:e.name)!=="rootItem"&&(this.defination.parentId=null==(i=this.parent)?void 0:i.guid),!this.defination.components){this.defination.components=[];for(var e,i,r,n=iD(this.components);!(r=n()).done;){var a=r.value;eF(a,t.EffectComponent)&&this.defination.components.push(a)}}this.defination.content={}},r.translateByPixel=function(t,e){if(this.composition){var i=this.composition.getEngine().canvas.getBoundingClientRect(),r=i.width,n=i.height,a=this.transform.getWorldPosition().z,o=this.composition.camera.getInverseVPRatio(a),s=o.x,u=o.y;this.transform.translate(2*t*s/r,-2*e*u/n,0)}},r.dispose=function(){if(this.resetChildrenParent(),this.composition){this.composition.destroyItem(this);for(var t,i=iD(this.components.slice());!(t=i()).done;)t.value.dispose();this.components=[],this._composition=null,this.transform.setValid(!1)}e.prototype.dispose.call(this)},r.resetChildrenParent=function(){for(var t,e,i=iD(this.children);!(e=i()).done;){var r=e.value;this.parent&&r.setParent(this.parent)}this.parent&&eX(null==(t=this.parent)?void 0:t.children,this)},r.instantiatePreComposition=function(){var e=this.props.content.options.refId,i=this.engine.findEffectsObjectData(e);if(!i)throw Error("Referenced precomposition with Id: "+e+" does not exist.");var r=i.components,n=this.getInstanceId();this.setInstanceId(i.id);for(var a,o=iD(r);!(a=o()).done;){var s=a.value,u=this.engine.findObject(s);if(u.item=this,this.components.push(u),u.setInstanceId(i_()),eF(u,t.CompositionComponent))for(var h,l=iD(u.items);!(h=l()).done;){var c=h.value;c.setInstanceId(i_());for(var f,d=iD(c.components);!(f=d()).done;)f.value.setInstanceId(i_())}}this.setInstanceId(n),sF.buildItemTree(this)},r.resetGUID=function(t){var e=null!=(i=null==t?void 0:t.get(this))?i:i_();this.setInstanceId(e);for(var i,r,n=iD(this.components);!(r=n()).done;){var a,o=r.value,s=null!=(a=null==t?void 0:t.get(o))?a:i_();o.setInstanceId(s)}for(var u,h=iD(this.children);!(u=h()).done;)u.value.resetGUID(t)},r.gatherPreviousObjectID=function(t){t.set(this,this.getInstanceId());for(var e,i=iD(this.components);!(e=i()).done;){var r=e.value;t.set(r,r.getInstanceId())}for(var n,a=iD(this.children);!(n=a()).done;)n.value.gatherPreviousObjectID(t)},i.isComposition=function(t){return t.type===tG.composition},i.isSprite=function(t){return t.type===tG.sprite},i.isParticle=function(t){return t.type===tG.particle},i.isNull=function(t){return t.type===tG.null},i.isTree=function(t){return t.type===tG.tree},i.isCamera=function(t){return t.type===tG.camera},i.isAncestor=function(t,e){for(var i=e.parent;i;){if(i===t)return!0;i=i.parent}return!1},rC(i,[{key:"composition",get:function(){return this._composition},set:function(t){this._composition=t;for(var e,i=iD(this.children);!(e=i()).done;){var r=e.value;r.composition||(r.composition=t)}}},{key:"compositionReusable",get:function(){var t,e;return null!=(e=null==(t=this.composition)?void 0:t.reusable)&&e}},{key:"renderOrder",get:function(){return this.listIndex},set:function(t){if(this.listIndex!==t){this.listIndex=t;for(var e,i=iD(this.components);!(e=i()).done;){var r=e.value;eF(r,rA)&&(r.priority=t)}}}},{key:"isActive",get:function(){return this.active},set:function(t){this.setActive(t)}},{key:"isVisible",get:function(){return this.visible}}]),i}(iW),t.VFXItem=ek([iU(el.VFXItemData)],t.VFXItem),t.Item=void 0,(tw=t.Item||(t.Item={})).is=function(t,e){return t.type===e},tw.isComposition=function(t){return t.type===tG.composition},tw.isParticle=function(t){return t.type===tG.particle},tw.isNull=function(t){return t.type===tG.null};var sD=[1,1,1,1],sk=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.renderColor=[1,1,1,1],t}iN(i,e);var r=i.prototype;return r.processFrame=function(e){var i,r,n,a=e.output.getUserData();if(eF(a,t.VFXItem)){if(this.activeComponent||(this.activeComponent=this.getActiveComponent(a)),!this.activeMaterial){this.activeMaterial=null==(o=this.activeComponent)?void 0:o.material;var o,s,u=null==(s=this.activeMaterial)?void 0:s.getColor("_Color");u&&(this.startColor=u.toArray())}var h=n8(sD,1),l=this.time/this.getDuration(),c=this.opacityOverLifetime,f=this.colorOverLifetime;f&&(h=e3(f,l,!0),i=!0),c&&(h[3]*=c.getValue(l),i=!0),i&&(n9(this.renderColor,h,this.startColor),null==(n=this.activeMaterial)||null==(r=n.getColor("_Color"))||r.setFromArray(this.renderColor))}},r.create=function(t){this.clipData=t;var e,i=t.colorOverLifetime;return i&&(this.opacityOverLifetime=aG(null!=(e=i.opacity)?e:1),i.color&&i.color[0]===tZ.GRADIENT_COLOR&&(this.colorOverLifetime=e4(i.color[1]))),this},r.getActiveComponent=function(t){return t.getComponent(n0)},i}(a5);t.AnimationClip=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.positionCurves=[],e.rotationCurves=[],e.eulerCurves=[],e.scaleCurves=[],e.floatCurves=[],e.colorCurves=[],e}iN(e,t);var i=e.prototype;return i.sampleAnimation=function(t,e){for(var i,r=eK(e,0,this.duration),n=iD(this.positionCurves);!(i=n()).done;){var a=i.value,o=a.keyFrames.getValue(r),s=this.findTarget(t,a.path);null==s||s.transform.setPosition(o.x,o.y,o.z)}for(var u,h=iD(this.rotationCurves);!(u=h()).done;){var l=u.value,c=l.keyFrames.getValue(r),f=this.findTarget(t,l.path);null==f||f.transform.setQuaternion(c.x,c.y,c.z,c.w)}for(var d,p=iD(this.eulerCurves);!(d=p()).done;){var m=d.value,v=m.keyFrames.getValue(r),y=this.findTarget(t,m.path);null==y||y.transform.setRotation(v.x,v.y,v.z)}for(var g,x=iD(this.scaleCurves);!(g=x()).done;){var b=g.value,T=b.keyFrames.getValue(r),_=this.findTarget(t,b.path);null==_||_.transform.setScale(T.x,T.y,T.z)}},i.fromData=function(t){this.positionCurves.length=0,this.scaleCurves.length=0,this.rotationCurves.length=0,this.eulerCurves.length=0,this.floatCurves.length=0,this.colorCurves.length=0;var e=0;if(t.positionCurves)for(var i,r=iD(t.positionCurves);!(i=r()).done;){var n=i.value,a={path:n.path,keyFrames:aG(n.keyFrames)};e=Math.max(e,a.keyFrames.getMaxTime()),this.positionCurves.push(a)}if(t.rotationCurves)for(var o,s=iD(t.rotationCurves);!(o=s()).done;){var u=o.value,h={path:u.path,keyFrames:aG(u.keyFrames)};e=Math.max(e,h.keyFrames.getMaxTime()),this.rotationCurves.push(h)}if(t.eulerCurves)for(var l,c=iD(t.eulerCurves);!(l=c()).done;){var f=l.value,d={path:f.path,keyFrames:aG(f.keyFrames)};e=Math.max(e,d.keyFrames.getMaxTime()),this.eulerCurves.push(d)}if(t.scaleCurves)for(var p,m=iD(t.scaleCurves);!(p=m()).done;){var v=p.value,y={path:v.path,keyFrames:aG(v.keyFrames)};e=Math.max(e,y.keyFrames.getMaxTime()),this.scaleCurves.push(y)}if(t.floatCurves)for(var g,x=iD(t.floatCurves);!(g=x()).done;){var b=g.value,T={path:b.path,keyFrames:aG(b.keyFrames),property:b.property,className:b.className};e=Math.max(e,T.keyFrames.getMaxTime()),this.floatCurves.push(T)}if(t.colorCurves)for(var _,E=iD(t.colorCurves);!(_=E()).done;){var C=_.value,S={path:C.path,keyFrames:aG(C.keyFrames),property:C.property,className:C.className};e=Math.max(e,S.keyFrames.getMaxTime()),this.colorCurves.push(S)}void 0!==t.duration?this.duration=t.duration:this.duration=e},i.findTarget=function(t,e){for(var i,r=t,n=e.split("."),a=iD(n);!(i=a()).done;){for(var o,s=i.value,u=!1,h=iD(r.children);!(o=h()).done;){var l=o.value;if(l.name===s){r=l,u=!0;break}}if(!u)return}return r},e}(iW),t.AnimationClip=ek([iU(el.AnimationClip)],t.AnimationClip);var sz=[[0,0,1,1,0]],sB=0;t.SpriteColorPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new sk;return t.create(this.data),t},i.fromData=function(t){this.data=t},e}(a8),t.SpriteColorPlayableAsset=ek([iU(el.SpriteColorPlayableAsset)],t.SpriteColorPlayableAsset);var sU=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createTrackMixer=function(){return new so},e}(t.TrackAsset),sG=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.SpriteComponent)},i}(sU),sj=function(e){function i(){return e.apply(this,arguments)}return iN(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.EffectComponent)},i}(sU),sW=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.createPlayable=function(){return new sX},e}(a8),sX=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e.prototype.processFrame=function(t){var e=t.output.getUserData();"time"in e&&(e.time=this.time)},e}(a5);t.SpriteComponent=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).time=0,r.duration=1,r.loop=!0,r.splits=sz,r.name="MSprite"+sB++,i&&r.fromData(i),r}iN(i,e);var r=i.prototype;return r.onUpdate=function(t){var e=this,i=this.time,r=this.duration;i>r&&this.loop&&(i%=r);var n=Math.min(Math.max(i/r,0),1),a=this.textureSheetAnimation,o=this.renderer.texture.source.video;if(o&&(0===i?o.pause():o.play().catch(function(t){e.engine.renderErrors.add(t)}),this.renderer.texture.uploadCurrentVideoFrame()),a){var s,u,h,l,c,f=a.total||a.row*a.col,d=0,p=0,m=1,v=1;if(this.splits){var y=this.splits[0];u=y[4],d=y[0],p=y[1],u?(m=y[3],v=y[2]):(m=y[2],v=y[3])}if(u?(h=1/a.row*m,l=1/a.col*v):(h=1/a.col*m,l=1/a.row*v),a.animate){var g=Math.round(n*(f-1)),x=Math.floor(g/a.col),b=g-x*a.col;c=u?[h*x,l*(a.col-b)]:[h*b,l*(1+x)]}else c=[0,l];null==(s=this.material.getVector4("_TexOffset"))||s.setFromArray([d+c[0],v+p-c[1],h,l])}this.time=i+t/1e3},r.onDisable=function(){e.prototype.onDisable.call(this),this.time=0},r.onDestroy=function(){var e=this.renderer.texture.source;e.sourceType===t.TextureSourceType.video&&(null==e?void 0:e.video)&&(e.video.pause(),e.video.src="",e.video.load())},r.updateGeometry=function(t){var e=this.textureSheetAnimation?[0,0,1,1,this.splits[0][4]]:this.splits[0],i=e[0],r=e[1],n=!!e[4],a=n?e[3]:e[2],o=n?e[2]:e[3],s=n?-Math.PI/2:0,u=t.getAttributeData("aUV"),h=t.getAttributeData("aPos"),l=t.getIndexData(),c=[0,0];if(u&&h&&l){for(var f=u.length/2,d=0;d<f;d++){var p=3*d,m=2*d,v=h[p],y=h[p+1];c[0]=v,c[1]=y,oB(c,c,s),u[m]=(c[0]+.5)*a+i,u[m+1]=(c[1]+.5)*o+r}this.geometry.setAttributeData("aPos",h.slice()),this.geometry.setAttributeData("aUV",u.slice()),this.geometry.setIndexData(l.slice()),this.geometry.setDrawCount(l.length)}this.geometry.subMeshes.length=0;for(var g,x=iD(t.subMeshes);!(g=x()).done;){var b=g.value;this.geometry.subMeshes.push({offset:b.offset,indexCount:b.indexCount,vertexCount:b.vertexCount})}},r.updateGeometryFromMultiSplit=function(){for(var t=this.splits,e=this.textureSheetAnimation,i=this.defaultGeometry,r=[],n=[],a=[],o=0;o<2;o++)for(var s=0;s<2;s++){var u=(2*s+o)*4,h=e?[0,0,1,1,t[0][4]]:t[2*s+o],l=h[4]?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],c=((o+o+1)/2-1)/2,f=((s+s+1)/2-1)/2,d=h[0],p=h[1],m=h[4]?h[3]:h[2],v=h[4]?h[2]:h[3],y=[-.25+c,.25+f,-.25+c,-.25+f,.25+c,.25+f,.25+c,-.25+f];r.push(l[0]*m+d,l[1]*v+p,l[2]*m+d,l[3]*v+p,l[4]*m+d,l[5]*v+p,l[6]*m+d,l[7]*v+p),a.push(1*y[0],1*y[1],0,1*y[2],1*y[3],0,1*y[4],1*y[5],0,1*y[6],1*y[7],0),n.push(u,1+u,2+u,2+u,1+u,3+u)}i.setAttributeData("aPos",new Float32Array(a)),i.setIndexData(new Uint16Array(n)),i.setAttributeData("aUV",new Float32Array(r)),i.setDrawCount(n.length)},r.fromData=function(t){e.prototype.fromData.call(this,t);var i,r,n,a=null!=(i=t.splits)?i:sz,o=t.textureSheetAnimation;this.splits=a,this.textureSheetAnimation=o;var s=t.geometry?this.engine.findObject(t.geometry):this.defaultGeometry;1===a.length?this.updateGeometry(s):this.updateGeometryFromMultiSplit(),this.interaction=t.interaction;var u=t.options.startColor||[1,1,1,1];this.material.setColor("_Color",new e1().setFromArray(u)),this.duration=null!=(r=t.duration)?r:this.item.duration,this.loop=null==(n=t.loop)||n},i}(n0),t.SpriteComponent=ek([iU(el.SpriteComponent)],t.SpriteComponent);var sH=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iP),sY=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iP),sZ=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){return this.set(t.x,t.y),this},e.copyTo=function(t){return t.set(this.x,this.y),t},e.equals=function(t){return t.x===this.x&&t.y===this.y},e.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},rC(t,null,[{key:"shared",get:function(){return sq.x=0,sq.y=0,sq}}]),t}(),sq=new sZ;function sQ(t,e,i,r,n,a,o,s){o?(u=r,h=-i):(u=-r,h=i);var u,h,l=t-i*n+u,c=e-r*n+h,f=t+i*a+u,d=e+r*a+h;return s.push(l,c),s.push(f,d),2}function sK(t,e,i,r,n,a,o,s){var u=i-t,h=r-e,l=Math.atan2(u,h),c=Math.atan2(n-t,a-e);s&&l<c?l+=2*Math.PI:!s&&l>c&&(c+=2*Math.PI);var f=l,d=c-l,p=Math.sqrt(u*u+h*h),m=(15*Math.abs(d)*Math.sqrt(p)/Math.PI>>0)+1,v=d/m;if(f+=v,s){o.push(t,e),o.push(i,r);for(var y=1,g=f;y<m;y++,g+=v)o.push(t,e),o.push(t+Math.sin(g)*p,e+Math.cos(g)*p);o.push(t,e),o.push(n,a)}else{o.push(i,r),o.push(t,e);for(var x=1,b=f;x<m;x++,b+=v)o.push(t+Math.sin(b)*p,e+Math.cos(b)*p),o.push(t,e);o.push(n,a),o.push(t,e)}return 2*m}function sJ(t,e,i,r,n,a,o,s,u){if(0!==t.length){var h=e.alignment;if(.5!==e.alignment){var l=function(t){var e=t.length;if(e<6)return 1;for(var i=0,r=0,n=t[e-2],a=t[e-1];r<e;r+=2){var o=t[r],s=t[r+1];i+=(o-n)*(s+a),n=o,a=s}return i<0?-1:1}(t);i&&(l*=-1),h=(h-.5)*l+.5}var c=new sZ(t[0],t[1]),f=new sZ(t[t.length-2],t[t.length-1]),d=1e-4>Math.abs(c.x-f.x)&&1e-4>Math.abs(c.y-f.y);if(r){t=t.slice(),d&&(t.pop(),t.pop(),f.set(t[t.length-2],t[t.length-1]));var p=(c.x+f.x)*.5,m=(f.y+c.y)*.5;t.unshift(p,m),t.push(p,m)}var v=t.length/2,y=t.length,g=n.length/2,x=e.width/2,b=x*x,T=e.miterLimit*e.miterLimit,_=t[0],E=t[1],C=t[2],S=t[3],w=0,A=0,M=-(E-S),I=_-C,R=0,P=0,O=Math.sqrt(M*M+I*I)+1e-6;M/=O,I/=O,M*=x,I*=x;var N=h,V=(1-N)*2,L=2*N;r||(e.cap===ea.Round?y+=sK(_-M*(V-L)*.5,E-I*(V-L)*.5,_-M*V,E-I*V,_+M*L,E+I*L,n,!0)+2:e.cap===ea.Square&&(y+=sQ(_,E,M,I,V,L,!0,n))),n.push(_-M*V,E-I*V),n.push(_+M*L,E+I*L);for(var F=1;F<v-1;++F){_=t[(F-1)*2],E=t[(F-1)*2+1],C=t[2*F],S=t[2*F+1],w=t[(F+1)*2],A=t[(F+1)*2+1],O=Math.sqrt((M=-(E-S))*M+(I=_-C)*I)+1e-6,M/=O,I/=O,M*=x,I*=x,O=Math.sqrt((R=-(S-A))*R+(P=C-w)*P)+1e-6,R/=O,P/=O,R*=x,P*=x;var D=C-_,k=E-S,z=C-w,B=A-S,U=D*z+k*B,G=k*z-B*D,j=G<0;if(Math.abs(G)<.001*Math.abs(U)){n.push(C-M*V,S-I*V),n.push(C+M*L,S+I*L),U>=0&&(e.join===eo.Round?y+=sK(C,S,C-M*V,S-I*V,C-R*V,S-P*V,n,!1)+4:y+=2,n.push(C-R*L,S-P*L),n.push(C+R*V,S+P*V));continue}var W=(-M+_)*(-I+S)-(-M+C)*(-I+E),X=(-R+w)*(-P+S)-(-R+C)*(-P+A),H=(D*X-z*W)/G,Y=(B*W-k*X)/G,Z=(H-C)*(H-C)+(Y-S)*(Y-S),q=C+(H-C)*V,Q=S+(Y-S)*V,K=C-(H-C)*L,J=S-(Y-S)*L,$=j?V:L;Z<=Math.min(D*D+k*k,z*z+B*B)+$*$*b?e.join===eo.Bevel||Z/b>T?(j?(n.push(q,Q),n.push(C+M*L,S+I*L),n.push(q,Q),n.push(C+R*L,S+P*L)):(n.push(C-M*V,S-I*V),n.push(K,J),n.push(C-R*V,S-P*V),n.push(K,J)),y+=2):e.join===eo.Round?j?(n.push(q,Q),n.push(C+M*L,S+I*L),y+=sK(C,S,C+M*L,S+I*L,C+R*L,S+P*L,n,!0)+4,n.push(q,Q),n.push(C+R*L,S+P*L)):(n.push(C-M*V,S-I*V),n.push(K,J),y+=sK(C,S,C-M*V,S-I*V,C-R*V,S-P*V,n,!1)+4,n.push(C-R*V,S-P*V),n.push(K,J)):(n.push(q,Q),n.push(K,J)):(n.push(C-M*V,S-I*V),n.push(C+M*L,S+I*L),e.join===eo.Round?j?y+=sK(C,S,C+M*L,S+I*L,C+R*L,S+P*L,n,!0)+2:y+=sK(C,S,C-M*V,S-I*V,C-R*V,S-P*V,n,!1)+2:e.join===eo.Miter&&Z/b<=T&&(j?(n.push(K,J),n.push(K,J)):(n.push(q,Q),n.push(q,Q)),y+=2),n.push(C-R*V,S-P*V),n.push(C+R*L,S+P*L),y+=2)}_=t[(v-2)*2],E=t[(v-2)*2+1],C=t[(v-1)*2],O=Math.sqrt((M=-(E-(S=t[(v-1)*2+1])))*M+(I=_-C)*I)+1e-6,M/=O,I/=O,M*=x,I*=x,n.push(C-M*V,S-I*V),n.push(C+M*L,S+I*L),r||(e.cap===ea.Round?y+=sK(C-M*(V-L)*.5,S-I*(V-L)*.5,C-M*V,S-I*V,C+M*L,S+I*L,n,!1)+2:e.cap===ea.Square&&(y+=sQ(C,S,M,I,V,L,!1,n)));for(var tt=g;tt<y+g-2;++tt)_=n[2*tt],E=n[2*tt+1],C=n[(tt+1)*2],S=n[(tt+1)*2+1],w=n[(tt+2)*2],1e-8>Math.abs(_*(S-(A=n[(tt+2)*2+1]))+C*(A-E)+w*(E-S))||s.push(tt,tt+1,tt+2)}}var s$=function(){},s0="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s1={exports:{}};!function(t){function e(t,e){return t.b===e.b&&t.a===e.a}function i(t,e){return t.b<e.b||t.b===e.b&&t.a<=e.a}function r(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?r<n?e.a-t.a+r/(r+n)*(t.a-i.a):e.a-i.a+n/(r+n)*(i.a-t.a):0}function n(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?(e.a-i.a)*r+(e.a-t.a)*n:0}function a(t,e){return t.a<e.a||t.a===e.a&&t.b<=e.b}function o(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?r<n?e.b-t.b+r/(r+n)*(t.b-i.b):e.b-i.b+n/(r+n)*(i.b-t.b):0}function s(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?(e.b-i.b)*r+(e.b-t.b)*n:0}function u(t,e,i,r){return(t=0>t?0:t)<=(i=0>i?0:i)?0===i?(e+r)/2:e+t/(t+i)*(r-e):r+i/(t+i)*(e-r)}function h(t){var e=p(t.b);return v(e,t.c),v(e.b,t.c),y(e,t.a),e}function l(t,e){var i=!1,r=!1;t!==e&&(e.a!==t.a&&(r=!0,x(e.a,t.a)),e.d!==t.d&&(i=!0,b(e.d,t.d)),m(e,t),r||(v(e,t.a),t.a.c=t),i||(y(e,t.d),t.d.a=t))}function c(t){var e=t.b,i=!1;t.d!==t.b.d&&(i=!0,b(t.d,t.b.d)),t.c===t?x(t.a,null):(t.b.d.a=Q(t),t.a.c=t.c,m(t,Q(t)),i||y(t,t.d)),e.c===e?(x(e.a,null),b(e.d,null)):(t.d.a=Q(e),e.a.c=e.c,m(e,Q(e))),g(t)}function f(t){var e=p(t),i=e.b;return m(e,t.e),e.a=t.b.a,v(i,e.a),e.d=i.d=t.d,e=e.b,m(t.b,Q(t.b)),m(t.b,e),t.b.a=e.a,e.b.a.c=e.b,e.b.d=t.b.d,e.f=t.f,e.b.f=t.b.f,e}function d(t,e){var i=!1,r=p(t),n=r.b;return e.d!==t.d&&(i=!0,b(e.d,t.d)),m(r,t.e),m(n,e),r.a=t.b.a,n.a=e.a,r.d=n.d=t.d,t.d.a=n,i||y(r,t.d),r}function p(t){var e=new q,i=new q,r=t.b.h;return i.h=r,r.b.h=e,e.h=t,t.b.h=i,e.b=i,e.c=e,e.e=i,i.b=e,i.c=i,i.e=e}function m(t,e){var i=t.c,r=e.c;i.b.e=e,r.b.e=t,t.c=r,e.c=i}function v(t,e){var i=e.f,r=new J(e,i);i.e=r,e.f=r,i=r.c=t;do i.a=r,i=i.c;while(i!==t)}function y(t,e){var i=e.d,r=new Z(e,i);i.b=r,e.d=r,r.a=t,r.c=e.c,i=t;do i.d=r,i=i.e;while(i!==t)}function g(t){var e=t.h;t=t.b.h,e.b.h=t,t.b.h=e}function x(t,e){var i=t.c,r=i;do r.a=e,r=r.c;while(r!==i);i=t.f,(r=t.e).f=i,i.e=r}function b(t,e){var i=t.a,r=i;do r.d=e,r=r.e;while(r!==i);i=t.d,(r=t.b).d=i,i.b=r}function T(t){var e=0;return Math.abs(t[1])>Math.abs(t[0])&&(e=1),Math.abs(t[2])>Math.abs(t[e])&&(e=2),e}var _,E=4*1e150;function C(t,e){t.f+=e.f,t.b.f+=e.b.f}function S(t,e,a){return(t=t.a,e=e.a,a=a.a,e.b.a===t)?a.b.a===t?i(e.a,a.a)?0>=n(a.b.a,e.a,a.a):0<=n(e.b.a,a.a,e.a):0>=n(a.b.a,t,a.a):a.b.a===t?0<=n(e.b.a,t,e.a):(e=r(e.b.a,t,e.a))>=(t=r(a.b.a,t,a.a))}function w(t){t.a.i=null;var e=t.e;e.a.c=e.c,e.c.a=e.a,t.e=null}function A(t,e){c(t.a),t.c=!1,t.a=e,e.i=t}function M(t){var e=t.a.a;do t=tl(t);while(t.a.a===e);return t.c&&(e=d(th(t).a.b,t.a.e),A(t,e),t=tl(t)),t}function I(t,e,i){var r=new tu;return r.a=i,r.e=G(t.f,e.e,r),i.i=r}function R(t,e){switch(t.s){case 100130:return 0!=(1&e);case 100131:return 0!==e;case 100132:return 0<e;case 100133:return 0>e;case 100134:return 2<=e||-2>=e}return!1}function P(t){var e=t.a,i=e.d;i.c=t.d,i.a=e,w(t)}function O(t,e,i){for(t=e,e=e.a;t!==i;){t.c=!1;var r=th(t),n=r.a;if(n.a!==e.a){if(!r.c){P(t);break}A(r,n=d(e.c.b,n.b))}e.c!==n&&(l(Q(n),n),l(e,n)),P(t),e=r.a,t=r}return e}function N(t,e,i,r,n,a){var o=!0;do I(t,e,i.b),i=i.c;while(i!==r);for(null===n&&(n=th(e).a.b.c);(i=(r=th(e)).a.b).a===n.a;)i.c!==n&&(l(Q(i),i),l(Q(n),i)),r.f=e.f-i.f,r.d=R(t,r.f),e.b=!0,!o&&D(t,e)&&(C(i,n),w(e),c(n)),o=!1,e=r,n=i;e.b=!0,a&&z(t,e)}function V(t,e,i,r,n){var a=[e.g[0],e.g[1],e.g[2]];e.d=null,e.d=t.o&&t.o(a,i,r,t.c)||null,null===e.d&&(n?t.n||(Y(t,100156),t.n=!0):e.d=i[0])}function L(t,e,i){var r=[null,null,null,null];r[0]=e.a.d,r[1]=i.a.d,V(t,e.a,r,[.5,.5,0,0],!1),l(e,i)}function F(t,e,i,r,n){var a=Math.abs(e.b-t.b)+Math.abs(e.a-t.a),o=Math.abs(i.b-t.b)+Math.abs(i.a-t.a),s=n+1;r[n]=.5*o/(a+o),r[s]=.5*a/(a+o),t.g[0]+=r[n]*e.g[0]+r[s]*i.g[0],t.g[1]+=r[n]*e.g[1]+r[s]*i.g[1],t.g[2]+=r[n]*e.g[2]+r[s]*i.g[2]}function D(t,r){var a=th(r),o=r.a,s=a.a;if(i(o.a,s.a)){if(0<n(s.b.a,o.a,s.a))return!1;if(e(o.a,s.a)){if(o.a!==s.a){var a=t.e,u=o.a.h;if(0<=u){var a=a.b,h=a.d,c=a.e,d=a.c,p=d[u];h[p]=h[a.a],d[h[p]]=p,p<=--a.a&&(1>=p?to(a,p):i(c[h[p>>1]],c[h[p]])?to(a,p):ts(a,p)),c[u]=null,d[u]=a.b,a.b=u}else for(a.c[-(u+1)]=null;0<a.a&&null===a.c[a.d[a.a-1]];)--a.a;L(t,Q(s),o)}}else f(s.b),l(o,Q(s)),r.b=a.b=!0}else{if(0>n(o.b.a,s.a,o.a))return!1;tl(r).b=r.b=!0,f(o.b),l(Q(s),o)}return!0}function k(t,h){var c=th(h),d=h.a,p=c.a,m=d.a,v=p.a,y=d.b.a,g=p.b.a,x=new J;if(n(y,t.a,m),n(g,t.a,v),m===v||Math.min(m.a,y.a)>Math.max(v.a,g.a))return!1;if(i(m,v)){if(0<n(g,m,v))return!1}else if(0>n(y,v,m))return!1;var b,T,_=y,E=m,C=g,S=v;if(i(_,E)||(b=_,_=E,E=b),i(C,S)||(b=C,C=S,S=b),i(_,C)||(b=_,_=C,C=b,b=E,E=S,S=b),i(C,E)?i(E,S)?(0>(b=r(_,C,E))+(T=r(C,E,S))&&(b=-b,T=-T),x.b=u(b,C.b,T,E.b)):(0>(b=n(_,C,E))+(T=-n(_,S,E))&&(b=-b,T=-T),x.b=u(b,C.b,T,S.b)):x.b=(C.b+E.b)/2,a(_,E)||(b=_,_=E,E=b),a(C,S)||(b=C,C=S,S=b),a(_,C)||(b=_,_=C,C=b,b=E,E=S,S=b),a(C,E)?a(E,S)?(0>(b=o(_,C,E))+(T=o(C,E,S))&&(b=-b,T=-T),x.a=u(b,C.a,T,E.a)):(0>(b=s(_,C,E))+(T=-s(_,S,E))&&(b=-b,T=-T),x.a=u(b,C.a,T,S.a)):x.a=(C.a+E.a)/2,i(x,t.a)&&(x.b=t.a.b,x.a=t.a.a),_=i(m,v)?m:v,i(_,x)&&(x.b=_.b,x.a=_.a),e(x,m)||e(x,v))return D(t,h),!1;if(!e(y,t.a)&&0<=n(y,t.a,x)||!e(g,t.a)&&0>=n(g,t.a,x)){if(g===t.a)return f(d.b),l(p.b,d),d=th(h=M(h)).a,O(t,th(h),c),N(t,h,Q(d),d,d,!0),!0;if(y===t.a){f(p.b),l(d.e,Q(p)),v=(m=c=h).a.b.a;do m=tl(m);while(m.a.b.a===v);return m=th(h=m).a.b.c,c.a=Q(p),p=O(t,c,null),N(t,h,p.c,d.b.c,m,!0),!0}return 0<=n(y,t.a,x)&&(tl(h).b=h.b=!0,f(d.b),d.a.b=t.a.b,d.a.a=t.a.a),0>=n(g,t.a,x)&&(h.b=c.b=!0,f(p.b),p.a.b=t.a.b,p.a.a=t.a.a),!1}return f(d.b),f(p.b),l(Q(p),d),d.a.b=x.b,d.a.a=x.a,d.a.h=tt(t.e,d.a),d=d.a,p=[0,0,0,0],x=[m.d,y.d,v.d,g.d],d.g[0]=d.g[1]=d.g[2]=0,F(d,m,y,p,0),F(d,v,g,p,2),V(t,d,x,p,!0),tl(h).b=h.b=c.b=!0,!1}function z(t,e){for(var r=th(e);;){for(;r.b;)e=r,r=th(r);if(!e.b&&(r=e,null===(e=tl(e))||!e.b))break;e.b=!1;var a,o=e.a,s=r.a;if(a=o.b.a!==s.b.a)t:{var u=th(a=e),h=a.a,d=u.a,p=void 0;if(i(h.b.a,d.b.a)){if(0>n(h.b.a,d.b.a,h.a)){a=!1;break t}tl(a).b=a.b=!0,p=f(h),l(d.b,p),p.d.c=a.d}else{if(0<n(d.b.a,h.b.a,d.a)){a=!1;break t}a.b=u.b=!0,p=f(d),l(h.e,d.b),p.b.d.c=a.d}a=!0}if(a&&(r.c?(w(r),c(s),s=(r=th(e)).a):e.c&&(w(e),c(o),o=(e=tl(r)).a)),o.a!==s.a){if(o.b.a===s.b.a||e.c||r.c||o.b.a!==t.a&&s.b.a!==t.a)D(t,e);else if(k(t,e))break}o.a===s.a&&o.b.a===s.b.a&&(C(s,o),w(e),c(o),e=tl(r))}}function B(t,e){var i=new tu,r=h(t.b);r.a.b=E,r.a.a=e,r.b.a.b=-E,r.b.a.a=e,t.a=r.b.a,i.a=r,i.f=0,i.d=!1,i.c=!1,i.h=!0,i.b=!1,r=G(r=t.f,r.a,i),i.e=r}function U(t){this.a=new j,this.b=t,this.c=S}function G(t,e,i){do e=e.c;while(null!==e.b&&!t.c(t.b,e.b,i));return t=new j(i,e.a,e),e.a.c=t,e.a=t}function j(t,e,i){this.b=t||null,this.a=e||this,this.c=i||this}function W(){this.d=X,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}var X=0;function H(t,e){if(t.d!==e)for(;t.d!==e;)if(t.d<e)switch(t.d){case X:Y(t,100151),t.u(null);break;case 1:Y(t,100152),t.t()}else switch(t.d){case 2:Y(t,100154),t.v();break;case 1:Y(t,100153),t.w()}}function Y(t,e){t.p&&t.p(e,t.c)}function Z(t,e){this.b=t||this,this.d=e||this,this.a=null,this.c=!1}function q(){this.h=this,this.i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function Q(t){return t.b.e}function K(){this.c=new J,this.a=new Z,this.b=new q,this.d=new q,this.b.b=this.d,this.d.b=this.b}function J(t,e){this.e=t||this,this.f=e||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function $(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new ti}function tt(t,e){if(t.e){var i,r=t.b,n=++r.a;return 2*n>r.f&&(r.f*=2,r.c=tr(r.c,r.f+1)),0===r.b?i=n:(i=r.b,r.b=r.c[r.b]),r.e[i]=e,r.c[i]=n,r.d[n]=i,r.h&&ts(r,n),i}return r=t.a++,t.c[r]=e,-(r+1)}function te(t){if(0===t.a)return ta(t.b);var e=t.c[t.d[t.a-1]];if(0!==t.b.a&&i(tn(t.b),e))return ta(t.b);do--t.a;while(0<t.a&&null===t.c[t.d[t.a-1]]);return e}function ti(){this.d=tr([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function tr(t,e){for(var i=Array(e),r=0;r<t.length;r++)i[r]=t[r];for(;r<e;r++)i[r]=0;return i}function tn(t){return t.e[t.d[1]]}function ta(t){var e=t.d,i=t.e,r=t.c,n=e[1],a=i[n];return 0<t.a&&(e[1]=e[t.a],r[e[1]]=1,i[n]=null,r[n]=t.b,t.b=n,0<--t.a&&to(t,1)),a}function to(t,e){for(var r=t.d,n=t.e,a=t.c,o=e,s=r[o];;){var u=o<<1;u<t.a&&i(n[r[u+1]],n[r[u]])&&(u+=1);var h=r[u];if(u>t.a||i(n[s],n[h])){r[o]=s,a[s]=o;break}r[o]=h,a[h]=o,o=u}}function ts(t,e){for(var r=t.d,n=t.e,a=t.c,o=e,s=r[o];;){var u=o>>1,h=r[u];if(0===u||i(n[h],n[s])){r[o]=s,a[s]=o;break}r[o]=h,a[h]=o,o=u}}function tu(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function th(t){return t.e.c.b}function tl(t){return t.e.a.b}(_=W.prototype).x=function(){H(this,X)},_.B=function(t,e){switch(t){case 100142:return;case 100140:switch(e){case 100130:case 100131:case 100132:case 100133:case 100134:this.s=e;return}break;case 100141:this.m=!!e;return;default:Y(this,100900);return}Y(this,100901)},_.y=function(t){switch(t){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Y(this,100900)}return!1},_.A=function(t,e,i){this.j[0]=t,this.j[1]=e,this.j[2]=i},_.z=function(t,e){var i=e||null;switch(t){case 100100:case 100106:this.h=i;break;case 100104:case 100110:this.l=i;break;case 100101:case 100107:this.k=i;break;case 100102:case 100108:this.i=i;break;case 100103:case 100109:this.p=i;break;case 100105:case 100111:this.o=i;break;case 100112:this.r=i;break;default:Y(this,100900)}},_.C=function(t,e){var i=!1,r=[0,0,0];H(this,2);for(var n=0;3>n;++n){var a=t[n];-1e150>a&&(a=-1e150,i=!0),1e150<a&&(a=1e150,i=!0),r[n]=a}i&&Y(this,100155),null===(i=this.q)?l(i=h(this.b),i.b):(f(i),i=i.e),i.a.d=e,i.a.g[0]=r[0],i.a.g[1]=r[1],i.a.g[2]=r[2],i.f=1,i.b.f=-1,this.q=i},_.u=function(t){H(this,X),this.d=1,this.b=new K,this.c=t},_.t=function(){H(this,1),this.d=2,this.q=null},_.v=function(){H(this,2),this.d=1},_.w=function(){H(this,1),this.d=X;var t,r,a=this.j[0],o=this.j[1],s=this.j[2],u=!1,h=[a,o,s];if(0===a&&0===o&&0===s){for(var o=[-2*1e150,-2*1e150,-2*1e150],p=[2*1e150,2*1e150,2*1e150],s=[],v=[],u=this.b.c,a=u.e;a!==u;a=a.e)for(var y=0;3>y;++y){var b=a.g[y];b<p[y]&&(p[y]=b,v[y]=a),b>o[y]&&(o[y]=b,s[y]=a)}if(a=0,o[1]-p[1]>o[0]-p[0]&&(a=1),o[2]-p[2]>o[a]-p[a]&&(a=2),p[a]>=o[a])h[0]=0,h[1]=0,h[2]=1;else{for(o=0,p=v[a],s=s[a],v=[0,0,0],p=[p.g[0]-s.g[0],p.g[1]-s.g[1],p.g[2]-s.g[2]],y=[0,0,0],a=u.e;a!==u;a=a.e)y[0]=a.g[0]-s.g[0],y[1]=a.g[1]-s.g[1],y[2]=a.g[2]-s.g[2],v[0]=p[1]*y[2]-p[2]*y[1],v[1]=p[2]*y[0]-p[0]*y[2],v[2]=p[0]*y[1]-p[1]*y[0],(b=v[0]*v[0]+v[1]*v[1]+v[2]*v[2])>o&&(o=b,h[0]=v[0],h[1]=v[1],h[2]=v[2]);0>=o&&(h[0]=h[1]=h[2]=0,h[T(p)]=1)}u=!0}for(v=T(h),a=this.b.c,o=(v+1)%3,s=(v+2)%3,v=0<h[v]?1:-1,h=a.e;h!==a;h=h.e)h.b=h.g[o],h.a=v*h.g[s];if(u){for(h=0,a=(u=this.b.a).b;a!==u;a=a.b)if(!(0>=(o=a.a).f))do h+=(o.a.b-o.b.a.b)*(o.a.a+o.b.a.a),o=o.e;while(o!==a.a);if(0>h)for(u=(h=this.b.c).e;u!==h;u=u.e)u.a=-u.a}for(this.n=!1,a=(h=this.b.b).h;a!==h;a=u)u=a.h,o=a.e,e(a.a,a.b.a)&&a.e.e!==a&&(L(this,o,a),c(a),o=(a=o).e),o.e===a&&(o!==a&&((o===u||o===u.b)&&(u=u.h),c(o)),(a===u||a===u.b)&&(u=u.h),c(a));for(this.e=h=new $,a=(u=this.b.c).e;a!==u;a=a.e)a.h=tt(h,a);for(function(t){t.d=[];for(var e,r=0;r<t.a;r++)t.d[r]=r;t.d.sort((e=t.c,function(t,r){return i(e[t],e[r])?1:-1})),t.e=!0,function(t){for(var e=t.a;1<=e;--e)to(t,e);t.h=!0}(t.b)}(h),this.f=new U(this),B(this,-E),B(this,E);null!==(h=te(this.e));){for(;;){t:if(0===(a=this.e).a)u=tn(a.b);else if(u=a.c[a.d[a.a-1]],0!==a.b.a&&i(a=tn(a.b),u)){u=a;break t}if(null===u||!e(u,h))break;u=te(this.e),L(this,h.c,u.c)}!function t(r,a){r.a=a;for(var o=a.c;null===o.i;)if((o=o.c)===a.c){var o=r,s=a,u=new tu;u.a=s.c.b;var h=o.f,p=h.a;do p=p.a;while(null!==p.b&&!h.c(h.b,u,p.b));var h=p.b,m=th(h),u=h.a,p=m.a;if(0===n(u.b.a,s,u.a))e((u=h.a).a,s)||e(u.b.a,s)||(f(u.b),h.c&&(c(u.c),h.c=!1),l(s.c,u),t(o,s));else{var v=i(p.b.a,u.b.a)?h:m,m=void 0;h.d||v.c?(m=v===h?d(s.c.b,u.e):d(p.b.c.b,s.c).b,v.c?A(v,m):(u=o,(h=I(o,h,m)).f=tl(h).f+h.a.f,h.d=R(u,h.f)),t(o,s)):N(o,h,s.c,s.c,null,!0)}return}if(h=(u=th(o=M(o.i))).a,(u=O(r,u,null)).c===h){var h=u,u=h.c,p=th(o),m=o.a,v=p.a,y=!1;m.b.a!==v.b.a&&k(r,o),e(m.a,r.a)&&(l(Q(u),m),u=th(o=M(o)).a,O(r,th(o),p),y=!0),e(v.a,r.a)&&(l(h,Q(v)),h=O(r,p,null),y=!0),y?N(r,o,h.c,u,u,!0):(s=i(v.a,m.a)?Q(v):m,N(r,o,s=d(h.c.b,s),s.c,s.c,!1),s.b.i.c=!0,z(r,o))}else N(r,o,u.c,h,h,!0)}(this,h)}for(h=0,this.a=this.f.a.a.b.a.a;null!==(u=this.f.a.a.b);)u.h||++h,w(u);for(this.f=null,(h=this.e).b=null,h.d=null,this.e=h.c=null,a=(h=this.b).a.b;a!==h.a;a=u)u=a.b,(a=a.a).e.e===a&&(C(a.c,a),c(a));if(!this.n){if(h=this.b,this.m)for(a=h.b.h;a!==h.b;a=u)u=a.h,a.b.d.c!==a.d.c?a.f=a.d.c?1:-1:c(a);else for(a=h.a.b;a!==h.a;a=u)if(u=a.b,a.c){for(a=a.a;i(a.b.a,a.a);a=a.c.b);for(;i(a.a,a.b.a);a=a.e);for(o=a.c.b,s=void 0;a.e!==o;)if(i(a.b.a,o.a)){for(;o.e!==a&&(i((t=o.e).b.a,t.a)||0>=n(o.a,o.b.a,o.e.b.a));)o=(s=d(o.e,o)).b;o=o.c.b}else{for(;o.e!==a&&(i((r=a.c.b).a,r.b.a)||0<=n(a.b.a,a.a,a.c.b.a));)a=(s=d(a,a.c.b)).b;a=a.e}for(;o.e.e!==a;)o=(s=d(o.e,o)).b}if(this.h||this.i||this.k||this.l){if(this.m){for(u=(h=this.b).a.b;u!==h.a;u=u.b)if(u.c){this.h&&this.h(2,this.c),a=u.a;do this.k&&this.k(a.a.d,this.c),a=a.e;while(a!==u.a);this.i&&this.i(this.c)}}else{for(h=this.b,u=!!this.l,a=!1,o=-1,s=h.a.d;s!==h.a;s=s.d)if(s.c){a||(this.h&&this.h(4,this.c),a=!0),v=s.a;do u&&o!==(p=v.b.d.c?0:1)&&(o=p,this.l&&this.l(!!o,this.c)),this.k&&this.k(v.a.d,this.c),v=v.e;while(v!==s.a)}a&&this.i&&this.i(this.c)}}if(this.r){for(a=(h=this.b).a.b;a!==h.a;a=u)if(u=a.b,!a.c){s=(o=a.a).e,v=void 0;do s=(v=s).e,v.d=null,null===v.b.d&&(v.c===v?x(v.a,null):(v.a.c=v.c,m(v,Q(v))),(p=v.b).c===p?x(p.a,null):(p.a.c=p.c,m(p,Q(p))),g(v));while(v!==o);o=a.d,(a=a.b).d=o,o.b=a}this.r(this.b),this.c=this.b=null;return}}this.b=this.c=null},s0.libtess={GluTesselator:W,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},W.prototype.gluDeleteTess=W.prototype.x,W.prototype.gluTessProperty=W.prototype.B,W.prototype.gluGetTessProperty=W.prototype.y,W.prototype.gluTessNormal=W.prototype.A,W.prototype.gluTessCallback=W.prototype.z,W.prototype.gluTessVertex=W.prototype.C,W.prototype.gluTessBeginPolygon=W.prototype.u,W.prototype.gluTessBeginContour=W.prototype.t,W.prototype.gluTessEndContour=W.prototype.v,W.prototype.gluTessEndPolygon=W.prototype.w,t.exports=s0.libtess}(s1);var s2=((tA=new s1.exports.GluTesselator).gluTessCallback(s1.exports.gluEnum.GLU_TESS_VERTEX_DATA,function(t,e){e[e.length]=t[0],e[e.length]=t[1]}),tA.gluTessCallback(s1.exports.gluEnum.GLU_TESS_BEGIN,function(t){t!==s1.exports.primitiveType.GL_TRIANGLES&&console.info("expected TRIANGLES but got type: "+t)}),tA.gluTessCallback(s1.exports.gluEnum.GLU_TESS_ERROR,function(t){console.error("error callback, error number: "+t)}),tA.gluTessCallback(s1.exports.gluEnum.GLU_TESS_COMBINE,function(t,e,i){return[t[0],t[1],t[2]]}),tA.gluTessCallback(s1.exports.gluEnum.GLU_TESS_EDGE_FLAG,function(t){}),tA);function s3(t){s2.gluTessNormal(0,0,1);var e=[];s2.gluTessBeginPolygon(e);for(var i=0;i<t.length;i++){s2.gluTessBeginContour();for(var r=t[i],n=0;n<r.length;n+=2){var a=[r[n],r[n+1],0];s2.gluTessVertex(a,a)}s2.gluTessEndContour()}return s2.gluTessEndPolygon(),e}var s4=function(t){function e(){for(var e,i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(e=t.call(this)||this).points=[],e.closePath=!1;var a=Array.isArray(r[0])?r[0]:r;if("number"!=typeof a[0]){for(var o=[],s=0,u=a.length;s<u;s++)o.push(a[s].x,a[s].y);a=o}return e.points=a,e.closePath=!0,e}iN(e,t);var i=e.prototype;return i.clone=function(){var t=new e(this.points.slice());return t.closePath=this.closePath,t},i.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,a=r-1;n<r;a=n++){var o=this.points[2*n],s=this.points[2*n+1],u=this.points[2*a],h=this.points[2*a+1];s>e!=h>e&&t<(e-s)/(h-s)*(u-o)+o&&(i=!i)}return i},i.copyFrom=function(t){return this.points=t.points.slice(),this.closePath=t.closePath,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.points[this.points.length-2]},i.getY=function(){return this.points[this.points.length-1]},i.build=function(t){for(var e=0;e<this.points.length;e++)t[e]=this.points[e]},i.triangulate=function(t,e,i,r,n){var a=s3([t]),o=e.length/2;0===a.length&&this.getLineEndPointsTriangle(t,a);for(var s=0;s<a.length;s++)e[2*i+s]=a[s];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=o+h},i.getLineEndPointsTriangle=function(t,e){if(!t||t.length<2||t.length%2!=0)throw Error("Invalid points array");if(2===t.length){e.push(t[0],t[1],t[0],t[1],t[0],t[1]);return}var i=t[2]-t[0],r=t[3]-t[1],n=t[0],a=t[1],o=t[0],s=t[1];if(Math.abs(i)>=Math.abs(r))for(var u=0;u<t.length;u+=2){var h=t[u],l=t[u+1];h<n&&(n=h,a=l),h>o&&(o=h,s=l)}else for(var c=0;c<t.length;c+=2){var f=t[c],d=t[c+1];d<a&&(n=f,a=d),d>s&&(o=f,s=d)}e.push(n,a,o,s,o,s)},rC(e,[{key:"lastX",get:function(){return this.points[this.points.length-2]}},{key:"lastY",get:function(){return this.points[this.points.length-1]}}]),e}(s$);function s5(t,e,i,r,n,a,o,s,u,h){var l=(1-Math.min(.99,Math.max(0,null!=h?h:.5)))/5;return function t(e,i,r,n,a,o,s,u,h,l,c){if(!(c>8)){var f=(e+r)/2,d=(i+n)/2,p=(r+a)/2,m=(n+o)/2,v=(a+s)/2,y=(o+u)/2,g=(f+p)/2,x=(d+m)/2,b=(p+v)/2,T=(m+y)/2,_=(g+b)/2,E=(x+T)/2;if(c>0){var C=s-e,S=u-i,w=Math.abs((r-s)*S-(n-u)*C),A=Math.abs((a-s)*S-(o-u)*C);if(w>11920929e-14&&A>11920929e-14){if((w+A)*(w+A)<=l*(C*C+S*S)){h.push(_,E);return}}else if(w>11920929e-14){if(w*w<=l*(C*C+S*S)){h.push(_,E);return}}else if(A>11920929e-14){if(A*A<=l*(C*C+S*S)){h.push(_,E);return}}else if((C=_-(e+s)/2)*C+(S=E-(i+u)/2)*S<=l){h.push(_,E);return}}t(e,i,f,d,g,x,_,E,h,l,c+1),t(_,E,b,T,v,y,s,u,h,l,c+1)}}(e,i,r,n,a,o,s,u,t,l*=l,0),t.push(s,u),t}var s6=function(t){function e(e,i,r,n){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),(a=t.call(this)||this).type="ellipse",a.x=e,a.y=i,a.halfWidth=r,a.halfHeight=n,a}iN(e,t);var i=e.prototype;return i.clone=function(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)},i.contains=function(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;var i=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1},i.strokeContains=function(t,e,i){var r=this.halfWidth,n=this.halfHeight;if(r<=0||n<=0)return!1;var a=i/2,o=r-a,s=n-a,u=r+a,h=n+a,l=t-this.x,c=e-this.y;return l*l/(o*o)+c*c/(s*s)>1&&l*l/(u*u)+c*c/(h*h)<=1},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.x},i.getY=function(){return this.y},i.build=function(t){var e=this.x,i=this.y,r=this.halfWidth,n=this.halfHeight;if(!(r>=0&&n>=0))return t;var a=Math.ceil(5*Math.sqrt(r+n)),o=8*a+0+0;if(0===o)return t;if(0===a)return t[0]=t[6]=e+0,t[1]=t[3]=i+0,t[2]=t[4]=e-0,t[5]=t[7]=i-0,t;var s=0,u=4*a+0+2,h=u,l=o,c=0+r,f=0,d=e+c,p=e-c,m=i+0;t[s++]=d,t[s++]=m,t[--u]=m,t[--u]=p;for(var v=1;v<a;v++){var y=Math.PI/2*(v/a),g=0+Math.cos(y)*r,x=0+Math.sin(y)*n,b=e+g,T=e-g,_=i+x,E=i-x;t[s++]=b,t[s++]=_,t[--u]=_,t[--u]=T,t[h++]=T,t[h++]=E,t[--l]=E,t[--l]=b}c=0,f=0+n,d=e+c,p=e-c,m=i+f;var C=i-f;return t[s++]=d,t[s++]=m,t[--l]=C,t[--l]=d,t},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,o=0,s=0;s<t.length;s+=2)a+=t[s],o+=t[s+1];a/=t.length/2,o/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=o;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(s$);t.StarType=void 0,(tM=t.StarType||(t.StarType={}))[tM.Star=0]="Star",tM[tM.Polygon=1]="Polygon";var s8=function(t){function e(e,i,r,n,a,o){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=0),(s=t.call(this)||this).pointCount=e,s.outerRadius=i,s.innerRadius=r,s.outerRoundness=n,s.innerRoundness=a,s.starType=o,s.v=[],s.in=[],s.out=[],s}iN(e,t);var i=e.prototype;return i.clone=function(){return new e(this.pointCount,this.outerRadius,this.innerRadius,this.outerRoundness,this.innerRoundness,this.starType)},i.copyFrom=function(t){this.pointCount=t.pointCount,this.outerRadius=t.outerRadius,this.innerRadius=t.innerRadius,this.outerRoundness=t.outerRoundness,this.innerRoundness=t.innerRoundness,this.starType=t.starType},i.copyTo=function(t){t.copyFrom(this)},i.build=function(t){switch(this.starType){case 0:this.buildStarPath();break;case 1:this.buildPolygonPath()}for(var e=0;e<this.v.length-2;e+=2)s5(t,this.v[e],this.v[e+1],this.out[e],this.out[e+1],this.in[e+2],this.in[e+3],this.v[e+2],this.v[e+3],1);var i=this.v.length-1;s5(t,this.v[i-1],this.v[i],this.out[i-1],this.out[i],this.in[0],this.in[1],this.v[0],this.v[1],1)},i.triangulate=function(t,e,i,r,n){for(var a=s3([t]),o=e.length/2,s=0;s<a.length;s++)e[2*i+s]=a[s];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=o+h},i.buildStarPath=function(){this.v=[],this.in=[],this.out=[];var t,e,i,r,n=2*Math.floor(this.pointCount),a=2*Math.PI/n,o=!0,s=this.outerRadius,u=this.innerRadius,h=this.outerRoundness/100,l=this.innerRoundness/100,c=2*Math.PI*s/(2*n),f=2*Math.PI*u/(2*n),d=-Math.PI/2;for(t=0;t<n;t++){e=o?s:u,i=o?h:l,r=o?c:f;var p=e*Math.cos(d),m=e*Math.sin(d),v=0===p&&0===m?0:m/Math.sqrt(p*p+m*m),y=0===p&&0===m?0:-p/Math.sqrt(p*p+m*m),g=2*t;this.v[g]=p,this.v[g+1]=m,this.in[g]=p+v*r*i*1,this.in[g+1]=m+y*r*i*1,this.out[g]=p-v*r*i*1,this.out[g+1]=m-y*r*i*1,o=!o,d+=1*a}},i.buildPolygonPath=function(){this.v=[],this.in=[],this.out=[];var t,e=Math.floor(this.pointCount),i=2*Math.PI/e,r=this.outerRadius,n=this.outerRoundness/100,a=2*Math.PI*r/(4*e),o=-(.5*Math.PI);for(t=0;t<e;t++){var s=r*Math.cos(o),u=r*Math.sin(o),h=0===s&&0===u?0:u/Math.sqrt(s*s+u*u),l=0===s&&0===u?0:-s/Math.sqrt(s*s+u*u),c=2*t;this.v[c]=s,this.v[c+1]=u,this.in[c]=s+h*a*n*1,this.in[c+1]=u+l*a*n*1,this.out[c]=s-h*a*n*1,this.out[c+1]=u-l*a*n*1,o+=1*i}},e}(s$),s9=function(t){function e(e,i,r,n,a){var o;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=20),(o=t.call(this)||this).x=e,o.y=i,o.width=r,o.height=n,o.roundness=a,o}iN(e,t);var i=e.prototype;return i.getBounds=function(t){return(t=t||new e).x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.clone=function(){return new e(this.x,this.y,this.width,this.height,this.roundness)},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.roundness=t.roundness,this},i.copyTo=function(t){return t.copyFrom(this),t},i.build=function(t){var e,i=this.width/2,r=this.height/2,n=this.x+i,a=this.y+r,o=e=Math.max(0,Math.min(this.roundness/100,1)*Math.min(i,r)),s=i-o,u=r-e;if(o>=0&&e>=0&&s>=0&&u>=0){var h=5*Math.ceil(2.3*Math.sqrt(o+e)),l=8*h+(s?4:0)+(u?4:0);if(0!==l){if(0===h){t[0]=t[6]=n+s,t[1]=t[3]=a+u,t[2]=t[4]=n-s,t[5]=t[7]=a-u;return}var c=0,f=4*h+(s?2:0)+2,d=f,p=l,m=s+o,v=u,y=n+m,g=n-m,x=a+v;if(t[c++]=y,t[c++]=x,t[--f]=x,t[--f]=g,u){var b=a-v;t[d++]=g,t[d++]=b,t[--p]=b,t[--p]=y}for(var T=1;T<h;T++){var _=Math.PI/2*(T/h),E=s+Math.cos(_)*o,C=u+Math.sin(_)*e,S=n+E,w=n-E,A=a+C,M=a-C;t[c++]=S,t[c++]=A,t[--f]=A,t[--f]=w,t[d++]=w,t[d++]=M,t[--p]=M,t[--p]=S}m=s,v=u+e,y=n+m,g=n-m,x=a+v;var I=a-v;t[c++]=y,t[c++]=x,t[--p]=I,t[--p]=y,s&&(t[c++]=g,t[c++]=x,t[--p]=I,t[--p]=g)}}},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,o=0,s=0;s<t.length;s+=2)a+=t[s],o+=t[s+1];a/=t.length/2,o/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=o;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(s$),s7=function(){function t(t){this.graphicsPath=t,this.currentPoly=null,this.shapePrimitives=[]}var e=t.prototype;return e.buildPath=function(){this.currentPoly=null,this.shapePrimitives.length=0;for(var t,e=this.graphicsPath,i=iD(e.instructions);!(t=i()).done;){var r=t.value,n=r.action,a=r.data;switch(n){case"bezierCurveTo":this.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"moveTo":this.moveTo(a[0],a[1]);break;case"ellipse":this.ellipse(a[0],a[1],a[2],a[3],a[4]);break;case"polyStar":this.polyStar(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"rect":this.rect(a[0],a[1],a[2],a[3],a[4]);break;case"closePath":this.closePath()}}this.endPoly()},e.bezierCurveTo=function(t,e,i,r,n,a,o){this.ensurePoly();var s=this.currentPoly;return s5(s.points,s.lastX,s.lastY,t,e,i,r,n,a,o),this},e.moveTo=function(t,e){return this.startPoly(t,e),this},e.closePath=function(){return this.endPoly(!0),this},e.ellipse=function(t,e,i,r,n){return this.drawShape(new s6(t,e,i,r),n),this},e.polyStar=function(t,e,i,r,n,a,o){return this.drawShape(new s8(t,e,i,r,n,a),o),this},e.rect=function(t,e,i,r,n,a){return this.drawShape(new s9(t,e,i,r,n),a),this},e.drawShape=function(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this},e.startPoly=function(t,e){var i=this.currentPoly;return i&&this.endPoly(),(i=new s4).points.push(t,e),this.currentPoly=i,this},e.endPoly=function(t){void 0===t&&(t=!1);var e=this.currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this.currentPoly=null,this},e.ensurePoly=function(t){this.currentPoly||(this.currentPoly=new s4,this.currentPoly.points.push(0,0))},t}(),ut=function(){function t(){this.instructions=[],this.dirty=!1}var e=t.prototype;return e.bezierCurveTo=function(t,e,i,r,n,a,o){return this.instructions.push({action:"bezierCurveTo",data:[t,e,i,r,n,a,o]}),this.dirty=!0,this},e.moveTo=function(t,e){return this.instructions.push({action:"moveTo",data:[t,e]}),this.dirty=!0,this},e.closePath=function(){return this.instructions.push({action:"closePath",data:[]}),this.dirty=!0,this},e.ellipse=function(t,e,i,r,n){return this.instructions.push({action:"ellipse",data:[t,e,i,r,n]}),this.dirty=!0,this},e.rect=function(t,e,i,r,n,a){return this.instructions.push({action:"rect",data:[t,e,i,r,n,a]}),this.dirty=!0,this},e.polyStar=function(t,e,i,r,n,a,o){return this.instructions.push({action:"polyStar",data:[t,e,i,r,n,a,o]}),this.dirty=!0,this},e.clear=function(){return this.instructions.length=0,this.dirty=!0,this},rC(t,[{key:"shapePath",get:function(){return this._shapePath||(this._shapePath=new s7(this)),this.dirty&&(this.dirty=!1,this._shapePath.buildPath()),this._shapePath}}]),t}(),ue=new(function(){function t(){this.elements=[]}var e=t.prototype;return e.dispose=function(){this.elements.forEach(function(t){return t.remove()}),this.elements.length=0},e.getCanvas=function(){if(0!==this.elements.length){var t=this.elements.shift();return ih(t),t}if(oH[oX])return window._createOffscreenCanvas(10,10);var e=document.createElement("canvas");return e.getContext("2d",{willReadFrequently:!0}),e},e.saveCanvas=function(t){t.width=1,t.height=1,this.elements.length<3?eW(this.elements,t):t.remove()},t}()),ui=function(){function t(t){this.width=0,this.height=0,this.update(t)}var e=t.prototype;return e.update=function(t){var e=t.textHeight,i=t.textWidth,r=t.textOverflow,n=void 0===r?t5.clip:r,a=t.textVerticalAlign,o=void 0===a?t7.top:a,s=t.textAlign,u=void 0===s?t9.left:s,h=t.letterSpace,l=t.autoWidth,c=t.fontSize,f=t.lineHeight;this.letterSpace=void 0===h?0:h,this.overflow=n,this.textVerticalAlign=o,this.textAlign=u,this.width=void 0===i?100:i,this.height=void 0===e?100:e,this.lineHeight=void 0===f?c:f,this.autoWidth=void 0!==l&&l},e.getOffsetY=function(t,e,i,r,n){var a=t.outlineWidth,o=t.fontScale,s=(i-r)/3,u=r+a*o,h=void 0!==n?n:i*(e-1),l=0;switch(this.textVerticalAlign){case t7.top:l=u+s;break;case t7.middle:l=(this.height*o-h+u)/2;break;case t7.bottom:l=this.height*o-h-s}return l},e.getOffsetX=function(t,e){var i=0;switch(this.textAlign){case t9.left:i=t.outlineWidth*t.fontScale;break;case t9.middle:i=(this.width*t.fontScale-e)/2;break;case t9.right:i=this.width*t.fontScale-e}return i},e.setSize=function(t,e){this.width=t,this.height=e},t}(),ur=function(){function t(t){this.isUnderline=!1,this.underlineHeight=1,this.isOutlined=!1,this.outlineWidth=0,this.hasShadow=!1,this.fontDesc="",this.fontScale=2,this.fontOffset=0,this.update(t)}return t.prototype.update=function(t){var e,i,r,n,a,o,s=t.textColor,u=t.fontSize,h=t.outline,l=t.shadow,c=t.fontWeight,f=t.fontStyle,d=t.fontFamily;this.textColor=[].concat(void 0===s?[1,1,1,1]:s),this.textWeight=void 0===c?"normal":c,this.fontStyle=void 0===f?"normal":f,this.fontFamily=void 0===d?"sans-serif":d,this.fontSize=void 0===u?40:u,this.isOutlined=!1,this.outlineColor=[1,1,1,1],this.outlineWidth=0,h&&(this.isOutlined=!0,this.outlineColor=[].concat(null!=(e=h.outlineColor)?e:[1,1,1,1]),this.outlineWidth=null!=(i=h.outlineWidth)?i:1),this.hasShadow=!1,this.shadowBlur=2,this.shadowColor=[0,0,0,1],this.shadowOffsetX=0,this.shadowOffsetY=0,l&&(this.hasShadow=!0,this.shadowBlur=null!=(r=l.shadowBlur)?r:2,this.shadowColor=[].concat(null!=(n=l.shadowColor)?n:[0,0,0,1]),this.shadowOffsetX=null!=(a=l.shadowOffsetX)?a:0,this.shadowOffsetY=null!=(o=l.shadowOffsetY)?o:0),this.fontOffset=0,this.fontStyle!==ee.normal&&(this.fontOffset+=this.fontSize*Math.tan(.20943951))},t}(),un=function(){function t(){this.isDirty=!0,this.lineCount=0,this.maxLineWidth=0,this.SCALE_FACTOR=.1,this.ALPHA_FIX_VALUE=1/255}var e=t.prototype;return e.setText=function(t){this.text!==t&&(this.text=t.toString(),this.isDirty=!0)},e.setTextAlign=function(t){this.textLayout.textAlign!==t&&(this.textLayout.textAlign=t,this.isDirty=!0)},e.setTextVerticalAlign=function(t){this.textLayout.textVerticalAlign!==t&&(this.textLayout.textVerticalAlign=t,this.isDirty=!0)},e.setTextBaseline=function(t){console.warn("setTextBaseline 已废弃,请改用 setTextVerticalAlign。本次调用将转调用 setTextVerticalAlign。"),this.setTextVerticalAlign(t)},e.setTextColor=function(t){this.textStyle.textColor!==t&&(this.textStyle.textColor=t,this.isDirty=!0)},e.setFontFamily=function(t){if(!il(t)){console.warn("Risky font family, ignored:",t);return}this.textStyle.fontFamily!==t&&(this.textStyle.fontFamily=t,this.isDirty=!0)},e.setFontWeight=function(t){this.textStyle.textWeight!==t&&(this.textStyle.textWeight=t,this.isDirty=!0)},e.setFontStyle=function(t){this.textStyle.fontStyle!==t&&(this.textStyle.fontStyle=t,this.isDirty=!0)},e.setOutlineColor=function(t){this.textStyle.outlineColor!==t&&(this.textStyle.outlineColor=t,this.isDirty=!0)},e.setFontScale=function(t){this.textStyle.fontScale!==t&&(this.textStyle.fontScale=t,this.isDirty=!0)},e.setOverflow=function(t){this.textLayout.overflow=t,this.isDirty=!0},e.getFontDesc=function(t){var e=this.textStyle,i=e.fontSize,r=e.fontScale,n=e.fontFamily,a=e.textWeight,o=e.fontStyle,s=""+(t||i*r).toString()+"px ";return["serif","sans-serif","monospace","courier"].includes(n)?s+=n:s+='"'+n+'"',a!==et.normal&&(s=a+" "+s),o!==ee.normal&&(s=o+" "+s),s},e.setupOutline=function(){var t=this.context,e=this.textStyle,i=e.outlineColor,r=e.outlineWidth,n=i[0],a=i[1],o=i[2],s=i[3];t&&(t.strokeStyle="rgba("+255*n+", "+255*a+", "+255*o+", "+s+")",t.lineWidth=2*r)},e.setupShadow=function(){var t=this.context,e=this.textStyle,i=e.outlineColor,r=e.shadowBlur,n=e.shadowOffsetX,a=e.shadowOffsetY,o=i[0],s=i[1],u=i[2],h=i[3];t&&(t.shadowColor="rgba("+255*o+", "+255*s+", "+255*u+", "+h+")",t.shadowBlur=r,t.shadowOffsetX=n,t.shadowOffsetY=-a)},e.disposeTextTexture=function(){var t=this.renderer.texture;t&&t!==this.engine.whiteTexture&&t.dispose()},e.renderToTexture=function(t,e,i,r,n){if(void 0===n&&(n={}),this.context&&this.canvas){var a=this.context;a.save(),this.canvas.width=t,this.canvas.height=e,a.setTransform(1,0,0,1,0,0),i||(a.translate(0,e),a.scale(1,-1)),a.clearRect(0,0,t,e),a.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",r(a),a.restore();var o=a.getImageData(0,0,t,e),s=nt.createWithData(this.engine,{data:new Uint8Array(o.data),width:o.width,height:o.height},{flipY:i,magFilter:rR.LINEAR,minFilter:rR.LINEAR,wrapS:rR.CLAMP_TO_EDGE,wrapT:rR.CLAMP_TO_EDGE});!1!==n.disposeOld&&this.disposeTextTexture(),this.renderer.texture=s,this.material.setTexture("_MainTex",s)}},e.initTextBase=function(t){this.engine=t,this.canvas=ue.getCanvas(),ue.saveCanvas(this.canvas),this.context=this.canvas.getContext("2d",{willReadFrequently:!0})},t}(),ua=0;t.TextComponent=function(t){function e(e){(i=t.call(this,e)||this).isDirty=!0,i.lineCount=0,i.maxLineWidth=0,i.name="MText"+ua++,i.canvas=ue.getCanvas(),ue.saveCanvas(i.canvas),i.context=i.canvas.getContext("2d",{willReadFrequently:!0});var i,r=i.getDefaultProps().options;return i.updateWithOptions(r),i}iN(e,t);var i=e.prototype;return i.getDefaultProps=function(){return{id:"default-id-"+Math.random().toString(36).substr(2,9),item:{id:"default-item-"+Math.random().toString(36).substr(2,9)},dataType:el.TextComponent,options:{text:"默认文本",fontFamily:"AlibabaSans-BoldItalic",fontSize:40,textColor:[255,255,255,1],fontWeight:et.normal,letterSpace:0,textAlign:1,fontStyle:ee.normal,autoWidth:!1,textWidth:200,textHeight:42,lineHeight:40.148},renderer:{renderMode:1,anchor:[.5,.5]}}},i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture()},i.onDestroy=function(){t.prototype.onDestroy.call(this),this.disposeTextTexture()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.interaction,r=e.options;this.interaction=i,this.resetState(),this.updateWithOptions(r),this.renderText(r),this.material.setColor("_Color",new e1(1,1,1,1))},i.resetState=function(){this.disposeTextTexture(),this.isDirty=!0,this.lineCount=0,this.maxLineWidth=0},i.setText=function(t){this.text!==t&&(this.text=t.toString(),this.lineCount=this.getLineCount(this.text),this.isDirty=!0)},i.updateWithOptions=function(t){this.textStyle?this.textStyle.update(t):this.textStyle=new ur(t),this.textLayout?this.textLayout.update(t):this.textLayout=new ui(t),this.text=t.text.toString(),this.lineCount=this.getLineCount(t.text)},i.getLineCount=function(t){var e=this.context,i=this.textLayout,r=i.letterSpace,n=i.overflow;this.maxLineWidth=0;var a=this.textLayout.width+this.textStyle.fontOffset,o=1,s=0;e&&(e.font=this.getFontDesc(this.textStyle.fontSize));for(var u=0;u<t.length;u++){var h,l,c=t[u],f=null!=(l=null==e?void 0:null==(h=e.measureText(c))?void 0:h.width)?l:0;s+=r,n===t5.display?"\n"===c?(o++,s=0):(s+=f,this.maxLineWidth=Math.max(this.maxLineWidth,s)):((s+f>a&&u>0||"\n"===c)&&(o++,this.maxLineWidth=Math.max(this.maxLineWidth,s),s=0),"\n"!==c&&(s+=f))}return o},i.setLineHeight=function(t){var e=Math.max(this.textStyle.fontSize,t);this.textLayout.lineHeight!==e&&(this.textLayout.lineHeight=e,this.isDirty=!0)},i.setFontWeight=function(t){this.textStyle.textWeight!==t&&(this.textStyle.textWeight=t,this.isDirty=!0)},i.setFontStyle=function(t){this.textStyle.fontStyle!==t&&(this.textStyle.fontStyle=t,this.isDirty=!0)},i.setTextAlign=function(t){this.textLayout.textAlign!==t&&(this.textLayout.textAlign=t,this.isDirty=!0)},i.setTextColor=function(t){this.textStyle.textColor!==t&&(this.textStyle.textColor=t,this.isDirty=!0)},i.setOutlineColor=function(t){this.textStyle.outlineColor!==t&&(this.textStyle.outlineColor=t,this.isDirty=!0)},i.setFontScale=function(t){this.textStyle.fontScale!==t&&(this.textStyle.fontScale=t,this.isDirty=!0)},i.updateTexture=function(t){var e=this;if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){var i=this.textStyle,r=this.textLayout,n=i.fontScale,a=(r.width+i.fontOffset)*n,o=r.lineHeight*this.lineCount,s=i.fontSize*n,u=r.lineHeight*n;i.fontDesc=this.getFontDesc(s);var h=(this.text||"").split("");r.autoWidth?(this.canvas.height=o*n,this.item.transform.size.set(1,o/r.height)):this.canvas.height=r.height*n;var l=this.canvas.height;this.renderToTexture(a,l,t,function(t){e.maxLineWidth>a&&r.overflow===t5.display?t.font=e.getFontDesc(s*a/e.maxLineWidth):t.font=i.fontDesc,i.hasShadow&&e.setupShadow(),i.isOutlined&&e.setupOutline();var o=i.textColor,l=o[0],c=o[1],f=o[2],d=o[3];t.fillStyle="rgba("+l+", "+c+", "+f+", "+d+")";for(var p=[],m=0,v=r.getOffsetY(i,e.lineCount,u,s),y=[],g=[],x=0;x<h.length;x++){var b=h[x],T=t.measureText(b);((m+=r.letterSpace*n)+T.width>a&&x>0||"\n"===b)&&(p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[]),"\n"!==b&&(y.push(b),g.push(m),m+=T.width)}p.push({y:v,width:m,chars:y,charOffsetX:g}),p.forEach(function(e){var n=r.getOffsetX(i,e.width);e.chars.forEach(function(r,a){i.isOutlined&&t.strokeText(r,n+e.charOffsetX[a],e.y),t.fillText(r,n+e.charOffsetX[a],e.y)})}),i.hasShadow&&(t.shadowColor="transparent")}),this.isDirty=!1}},i.renderText=function(t){this.updateTexture()},i.setAutoWidth=function(t){var e=this.textLayout,i=!!t;e.autoWidth!==i&&(e.autoWidth=i,this.isDirty=!0)},i.setFontSize=function(t){if(this.textStyle.fontSize!==t){var e=this.textStyle.fontSize-t,i=this.textLayout;i.lineHeight+=e,this.textStyle.fontSize=t,this.isDirty=!0}},i.setOutlineWidth=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.outlineWidth!==e&&(this.textStyle.outlineWidth=e,this.isDirty=!0)},i.setShadowBlur=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.shadowBlur!==e&&(this.textStyle.shadowBlur=e,this.isDirty=!0)},i.setShadowColor=function(t){var e=null!=t?t:[0,0,0,1];this.textStyle.shadowColor!==e&&(this.textStyle.shadowColor=e,this.isDirty=!0)},i.setShadowOffsetX=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetX!==e&&(this.textStyle.shadowOffsetX=e,this.isDirty=!0)},i.setShadowOffsetY=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetY!==e&&(this.textStyle.shadowOffsetY=e,this.isDirty=!0)},e}(n0),t.TextComponent=ek([iU(el.TextComponent)],t.TextComponent),iC(t.TextComponent,[un]);var uo=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iP),us=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iW);t.BinaryAsset=function(t){function e(){return t.apply(this,arguments)}return iN(e,t),e}(iW),ek([ij(void 0,void 0)],t.BinaryAsset.prototype,"buffer",void 0),t.BinaryAsset=ek([iU(el.BinaryAsset)],t.BinaryAsset);var uu=function(){function t(){}return t.serialize=function(e,i){e.toData(),i||(i={});var r=iG(e);if(r)for(var n,a=iD(Object.keys(r));!(n=a()).done;){var o=n.value,s=e[o];"number"==typeof s||"string"==typeof s||"boolean"==typeof s||t.checkTypedArray(s)?i[o]=s:iv(s)?(i[o]||(i[o]=[]),t.serializeArrayProperty(s,i[o],0)):iW.is(s)?i[o]={id:s.getInstanceId()}:ig(s)&&(i[o]||(i[o]={}),t.serializeObjectProperty(s,i[o],0))}for(var u,h=iD(Object.keys(e.defination));!(u=h()).done;){var l=u.value,c=e.defination[l];"number"==typeof c||"string"==typeof c||"boolean"==typeof c||t.checkTypedArray(c)?i[l]=c:iv(c)?(i[l]||(i[l]=[]),t.serializeArrayProperty(c,i[l],0)):iW.is(c)?i[l]={id:c.getInstanceId()}:ig(c)&&(i[l]||(i[l]={}),t.serializeObjectProperty(c,i[l],0))}return i},t.deserialize=function(e,i){i.defination=e;var r=iG(i),n=i.engine;if(r)for(var a,o=iD(Object.keys(r));!(a=o()).done;){var s=a.value,u=e[s];if(void 0!==u){var h=r[s].type;i[s]=t.deserializeProperty(u,n,0,h)}}i.fromData(i.defination)},t.checkTypedArray=function(t){return eF(t,Int8Array)||eF(t,Uint8Array)||eF(t,Uint8ClampedArray)||eF(t,Int16Array)||eF(t,Uint16Array)||eF(t,Int32Array)||eF(t,Uint32Array)||eF(t,Float32Array)||eF(t,Float64Array)||eF(t,ArrayBuffer)},t.checkDataPath=function(t){return!!(ig(t)&&1===Object.keys(t).length&&"id"in t&&im(t.id))},t.checkGLTFNode=function(t){return ig(t)&&void 0!==t.nodeIndex&&void 0!==t.isJoint},t.checkImageSource=function(t){return ib(t)||eF(t,HTMLImageElement)},t.deserializeProperty=function(e,i,r,n,a){if(void 0===a&&(a=!0),r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}if(iv(e)){for(var o,s=[],u=iD(e);!(o=u()).done;){var h=o.value;s.push(t.deserializeProperty(h,i,r+1,n,a))}return s}if(t.checkDataPath(e)){var l=i.findObject(e);return a?l:e}if(!ix(e))return e;c=n?new n:{};for(var c,f,d=iD(Object.keys(e));!(f=d()).done;){var p=f.value;c[p]=t.deserializeProperty(e[p],i,r+1,void 0,a)}return c},t.serializeObjectProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i={});for(var n,a=iD(Object.keys(e));!(n=a()).done;){var o=n.value,s=e[o];"number"==typeof s||"string"==typeof s||"boolean"==typeof s||t.checkTypedArray(e)?i[o]=s:iv(s)?(i[o]||(i[o]=[]),t.serializeArrayProperty(s,i[o],r+1)):iW.is(s)?i[o]={id:s.getInstanceId()}:ig(s)&&(i[o]||(i[o]={}),t.serializeObjectProperty(s,i[o],r+1))}},t.serializeArrayProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i=[]);for(var n=0;n<e.length;n++){var a=e[n];"number"==typeof a||"string"==typeof a||"boolean"==typeof a||t.checkTypedArray(e)?i[n]=a:iv(a)?(i[n]||(i[n]=[]),t.serializeArrayProperty(a,i[n],r+1)):iW.is(a)?i[n]={id:a.getInstanceId()}:ig(a)&&(i[n]||(i[n]={}),t.serializeObjectProperty(a,i[n],r+1))}},t}(),uh=function(){function t(t){this.engine=t}var e=t.prototype;return e.loadGUID=function(t){if(!t)return null;var e,i=t.id,r=this.findData(i);if(!r){console.error("Object data with uuid: "+i+" not found.");return}switch(r.dataType){case el.Material:e=nl.create(this.engine);break;case el.Geometry:e=ng.create(this.engine);break;case el.Texture:e=nt.create(this.engine);break;default:var n=iB[r.dataType];n&&(e=new n(this.engine))}if(!e){console.error("Constructor for DataType: "+r.dataType+" not found.");return}return e.setInstanceId(r.id),this.engine.addInstance(e),uu.deserialize(r,e),e},e.findData=function(t){return this.engine.jsonSceneData[t]},t}(),ul=function(){function t(){}return t.prototype.loadGUID=function(t){return eL(function(){return ez(this,function(t){return[2,void 0]})})()},t}();function uc(t,e){if(!t.includes(e))return t.push(e),!0}function uf(t){if(Number.isFinite(t))return[tZ.CONSTANT,t];if(t){var e=t[0],i=t[1];if(Array.isArray(e))return;if("static"===e||e===tZ.CONSTANT)return[tZ.CONSTANT,t[1]];if("lines"===e)return[tZ.LINE,t[1]];if(e===tZ.LINE){var r=i.map(function(t){return[tq.LINE,t]});return[tZ.BEZIER_CURVE,r]}return"curve"===e||e===tZ.CURVE?[tZ.BEZIER_CURVE,uI(i)]:t}}function ud(t,e){return Array.isArray(t)&&"random"===t[0]?[tZ.CONSTANT,t[1][e]]:uf(t)}function up(t){return t&&"color"===t[0]?uy(t[1],!0):[1,1,1,1]}function um(t){return t&&"random"===t[0]?[tZ.RANDOM,t[1]]:uf(t)}function uv(t,e){if(t){var i=[];return Object.getOwnPropertyNames(t).forEach(function(r){var n,a=(n=/^(-)?([\d+.]+)%$/.exec(r))?+n[2]/100*(n[1]?-1:1):+r,o=uy(t[r],e);i.push([a,o[0],o[1],o[2],o[3]])}),i=i.sort(function(t,e){return t[0]-e[0]}),[tZ.GRADIENT_COLOR,i]}}function uy(t,e){var i;if("string"==typeof t){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:Math.round(255*n)]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else eF(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:Math.round(255*t[3])]);return e&&(i=ug(i)),i}function ug(t){if(Array.isArray(t))return t.map(function(t){return Number.isFinite(t/255)?Number((t/255).toFixed(6)):0})}function ux(t,e){return Array.isArray(t)?t[0]===tZ.GRADIENT_COLOR?t:("gradient"===t[0]||"color"===t[0])&&uv(t[1],e):uv(t,e)}function ub(t){if(t){if(3===t.length)return[tZ.CONSTANT_VEC3,t];var e=t[0];if("path"===e||"bezier"===e||e===tZ.BEZIER_PATH||e===tZ.LINEAR_PATH){var i=t[1],r=i[0],n=i[1],a=i[2],o=uI(r);if(!a){a=[];for(var s=0;s<n.length;s++){var u=n[s].slice();0===s||s<n.length-1&&a.push(u),a.push(u)}}return[tZ.BEZIER_CURVE_PATH,[o,n,a]]}return t}}function uT(t){for(var e,i=iD(Object.keys(t));!(e=i()).done;){var r=e.value;t[r]=Number(t[r])}return t}function u_(t){for(var e,i=iD(Object.keys(t));!(e=i()).done;){var r=e.value;void 0===t[r]&&delete t[r]}return t}var uE=Math.cos,uC=Math.sin,uS=Math.PI/180,uw=180/Math.PI;function uA(t,e){return t?[t[0]-.5,.5-t[1]]:e?uM[e]:[0,0]}var uM=((eS={})[tW.PARTICLE_ORIGIN_CENTER]=[0,0],eS[tW.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],eS[tW.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],eS[tW.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],eS[tW.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],eS[tW.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],eS[tW.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],eS[tW.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],eS[tW.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],eS);function uI(t){for(var e=-1e6,i=1e6,r=0;r<t.length;r++)e=Math.max(e,t[r][1]),i=Math.min(i,t[r][1]);for(var n=[[t[0][0],t[0][1]]],a=0;a<t.length-1;a++){var o=t[a][3]*(e-i),s=t[a+1][2]*(e-i),u=[t[a][0],t[a][1]],h=[t[a+1][0],t[a+1][1]];if(u[0]!=h[0]){var l=function(t,e,i,r){var n=i[0],a=i[1],o=r[0],s=r[1],u=o-n;return[[n+(o-n)/3,a+(t*=u)/3],[o-(o-n)/3,s-(e*=u)/3]]}(o,s,u,h),c=l[0],f=l[1];n[n.length-1].push(c[0]),n[n.length-1].push(c[1]),n.push([f[0],f[1],h[0],h[1]])}else n[n.length-1].push(h[0]),n[n.length-1].push(h[1])}return n.map(function(t,e){return 0===e?[tq.EASE_OUT,t]:e===n.length-1?[tq.EASE_IN,t]:[tq.EASE,t]})}function uR(t){return t.compositions.forEach(function(t){t.items.forEach(function(t){t.type===tG.null&&t.endBehavior===tQ.destroy&&(t.endBehavior=tQ.freeze)})}),t.version=tN["2_1"],t}var uP=new Map,uO=new Map;function uN(t){for(var e,i=iD(t.components);!(e=i()).done;){var r=e.value;if(r.dataType===el.ShapeComponent&&r.type===en.Custom){(null==(n=r.shapes)?void 0:n.length)>0&&r.shapes[0].fill&&(r.fill=r.shapes[0].fill);for(var n,a,o=Array(r.easingIns.length),s=Array(r.easingOuts.length).fill(!1),u=iD(r.shapes);!(a=u()).done;)for(var h,l=a.value,c=iD(l.indexes);!(h=c()).done;){var f=h.value,d=r.points[f.point],p=r.easingIns[f.easingIn],m=r.easingOuts[f.easingOut];o[f.easingIn]||(p.x-=d.x,p.y-=d.y,o[f.easingIn]=!0),s[f.easingOut]||(m.x-=d.x,m.y-=d.y,s[f.easingOut]=!0)}}}return t.version=tN["3_2"],t}function uV(e){uP.clear(),uO.clear();for(var i,r=e.compositions,n=e.items,a=e.components,o=iD(a);!(i=o()).done;){var s=i.value;uP.set(s.id,s)}for(var u,h=iD(n);!(u=h()).done;){var l=u.value;uO.set(l.id,l)}for(var c,f=iD(r);!(c=f()).done;)!function(e){for(var i,r=iD(e.items);!(i=r()).done;){var n=i.value,a=uO.get(n.id);if(!a)return;if(a.type===tG.sprite||a.type===tG.particle||a.type===tG.spine||a.type===tG.text||a.type===tG.richtext||a.type===tG.video||a.type===tG.shape){var o=uP.get(a.components[0].id);o&&function(e){var i=e.renderer,r=null==i?void 0:i.maskMode;r&&r!==t.MaskMode.NONE&&(r===t.MaskMode.MASK?(e.mask={isMask:!0},ew=e.id):(r===tD.OBSCURED||r===tD.REVERSE_OBSCURED)&&(e.mask={inverted:r===tD.REVERSE_OBSCURED,reference:{id:ew}}))}(o)}}}(c.value);return e.version=tN["3_3"],e}function uL(t){null==(e=t.plugins)||e.forEach(function(e,i){"richtext"===e&&(t.plugins[i]="rich-text")});for(var e,i,r=iD(t.items);!(i=r()).done;){var n=i.value;if(n.type===tG.sprite){var a=uP.get(n.components[0].id);if(a){var o,s=a.renderer.shape,u=void 0;u=Number.isInteger(s)?null==(o=t.shapes)?void 0:o[s]:s,a.renderer.shape=u}}}for(var h,l=t.compositionId,c={},f=iD(t.compositions);!(h=f()).done;){var d=h.value,p=i_();c[d.id]=p,d.id===l&&(t.compositionId=p),d.id=p;var m={id:i_(),dataType:"CompositionComponent",items:d.items,timelineAsset:d.timelineAsset,sceneBindings:d.sceneBindings,item:{id:d.id}};d.timelineAsset=void 0,d.sceneBindings=void 0,d.components=[{id:m.id}],t.components.push(m)}for(var v,y=iD(t.items);!(v=y()).done;){var g=v.value;if(g.content){var x=g.content.options;x&&void 0!==x.refId&&(x.refId=c[x.refId])}}return t.version=tN["3_4"],t}function uF(t){for(var e,i={},r=iD(t.components);!(e=r()).done;){var n=e.value;i[n.id]=n}for(var a,o=iD(t.compositions);!(a=o()).done;)for(var s,u=a.value,h=iD(u.components);!(s=h()).done;)i[s.value.id].item.id=u.id;for(var l,c=iD(t.components);!(l=c()).done;){var f=l.value;if(f.dataType===el.SpriteComponent){var d=f.renderer.shape;if(null!=d&&!("aPoint"in d&&"index"in d)){var p=function(t,e){void 0===e&&(e="形状");for(var i=oz(t),r=i.index,n=void 0===r?[]:r,a=i.aPoint,o=void 0===a?[]:a,s=new Float32Array(o),u=[],h=[],l=0;l<s.length;l+=6)h.push(o[l+2],o[l+3]),u.push(s[l],s[l+1],0);var c=u.length/3,f=n.length,d=4*u.length,p=d+4*h.length,m=2*n.length,v={mode:ec.TRIANGLES,vertexData:{vertexCount:c,channels:[]},name:e,indexFormat:ed.UInt16,indexOffset:p,buffer:"",id:i_(),dataType:el.Geometry,subMeshes:[]};v.vertexData.channels.push({semantic:ep.Position,offset:0,format:ef.Float32,dimension:3}),v.vertexData.channels.push({semantic:ep.Uv,offset:d,format:ef.Float32,dimension:2}),v.subMeshes.push({offset:0,indexCount:f,vertexCount:c});var y=new ArrayBuffer(p+m+(m%4==0?0:2)),g=new Float32Array(y);g.set(u,0),g.set(h,u.length),new Uint16Array(y,p).set(n,0);var x=new Uint8Array(y).slice(0,p+m);return v.binaryData=x,v}(d);f.geometry={id:p.id},t.geometries.push(p)}}if(f.dataType===el.ShapeComponent){if(f.fills=[],f.fill){var m={type:ei.Solid,color:f.fill.color};f.fills.push(m)}if(delete f.fill,f.strokes=[],f.stroke){var v={type:ei.Solid,color:f.stroke.color};f.strokes.push(v),f.strokeWidth=f.stroke.width,f.strokeCap=f.stroke.cap,f.strokeJoin=f.stroke.join,delete f.stroke}}}return t.version="3.5",t}function uD(t){if(t.components)for(var e,i=iD(t.components);!(e=i()).done;){var r,n=e.value;n.dataType===el.RichTextComponent&&n.options&&void 0===n.options.useLegacyRichText&&(void 0===n.options.lineGap?n.options.useLegacyRichText=!0:n.options.useLegacyRichText=!1),n.dataType!==el.TextComponent&&(n.dataType!==el.RichTextComponent||!n.options)||(r=n.options)&&void 0===r.TextVerticalAlign&&void 0===r.TextVerticalAlign&&(r.TextVerticalAlign=r.textBaseline)}return t.version="3.6",t}function uk(t){for(var e,i=i2({},t,{items:[],compositions:[],components:[],materials:[],shaders:[],geometries:[],animations:[],miscs:[]}),r=iD(i.images);!(e=r()).done;)e.value.id=i_();if(null!=i.textures||(i.textures=[]),i.textures.forEach(function(t){var e;t.id=i_(),t.dataType=el.Texture,t.source={id:null==(e=i.images[t.source])?void 0:e.id}}),i.textures.length<i.images.length)for(var n=i.textures.length;n<i.images.length;n++)i.textures.push({id:i_(),dataType:el.Texture,source:{id:i.images[n].id},flipY:!0});t.bins&&(a=t.bins,i.bins=a.map(function(t){return{url:t.url,dataType:"BinaryAsset",id:i_()}}));for(var a,o,s={},u={},h=iD(t.compositions);!(o=h()).done;)!function(){var t=o.value;(3===t.endBehavior||1===t.endBehavior)&&(t.endBehavior=tQ.freeze),t.items=t.items.filter(function(t){return"8"!==t.type}),t.items.forEach(function(t){t.type===tG.particle&&t.content.filter&&delete t.content.filter});for(var e,r=iD(t.items);!(e=r()).done;){var n=e.value;s[n.id]=i_(),n.oldId=n.id,n.id=s[n.id],u[n.id]=n}t.items.forEach(function(e,r){if(e.parentId){if(e.parentId.includes("^")){var n=e.parentId.split("^")[0],a=e.parentId.split("^")[1];e.parentId=s[n]+"^"+a}else e.parentId=s[e.parentId]}i.items.push(e),t.items[r]={id:e.id}});var a=i2({},t,{timelineAsset:{id:""},sceneBindings:[]});i.compositions.push(a),function(t,e,i){for(var r,n=[],a=[],o=[],s={tracks:[],id:i_(),dataType:"TimelineAsset"},u=iD(t.items);!(r=u()).done;){var h=e[r.value.id],l=[],c={id:i_(),dataType:"ActivationPlayableAsset"};o.push(c);var f={id:i_(),dataType:"ActivationTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:c.id}}]};if(l.push({id:f.id}),a.push(f),h.type!==tG.particle){var d={id:i_(),dataType:"TransformPlayableAsset",sizeOverLifetime:h.content.sizeOverLifetime,rotationOverLifetime:h.content.rotationOverLifetime,positionOverLifetime:h.content.positionOverLifetime};o.push(d);var p={id:i_(),dataType:"TransformTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:d.id}}]};l.push({id:p.id}),a.push(p)}if(h.type===tG.sprite||h.type===tG.text){var m={id:i_(),dataType:"SpriteColorPlayableAsset",colorOverLifetime:h.content.colorOverLifetime};o.push(m);var v={id:i_(),dataType:"SpriteColorTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:m.id}}]};l.push({id:v.id}),a.push(v)}if(h.type===tG.composition){var y={id:i_(),dataType:"SubCompositionPlayableAsset"};o.push(y);var g={id:i_(),dataType:"SubCompositionTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:y.id}}]};l.push({id:g.id}),a.push(g)}var x={id:i_(),dataType:"ObjectBindingTrack",children:l,clips:[]};a.push(x),s.tracks.push({id:x.id}),n.push({key:{id:x.id},value:{id:h.id}})}for(var b,T=[],_=iD(a);!(b=_()).done;){var E=b.value;T.push({id:E.id})}t.timelineAsset={id:s.id},t.sceneBindings=n,i.miscs.push(s);for(var C,S=iD(a);!(C=S()).done;){var w=C.value;i.miscs.push(w)}for(var A,M=iD(o);!(A=M()).done;){var I=A.value;i.miscs.push(I)}}(a,u,i)}();for(var l,c=iD(i.items);!(l=c()).done;){var f=l.value;if(f.content){if(f.content.renderer&&void 0!==f.content.renderer.texture){var d=f.content.renderer.texture;f.content.renderer.texture={id:i.textures[d].id}}if(f.content.trails&&void 0!==f.content.trails.texture){var p=f.content.trails.texture;f.content.trails.texture={id:i.textures[p].id}}}if(f.transform){var m=[].concat(null!=(g=f.transform.position)?g:[0,0,0]),v=[].concat(null!=(x=f.transform.rotation)?x:[0,0,0]),y=[].concat(null!=(b=f.transform.scale)?b:[1,1,1]);if(Object.assign(f,{transform:{position:{x:m[0],y:m[1],z:m[2]},eulerHint:{x:v[0],y:v[1],z:v[2]},scale:{x:y[0],y:y[1],z:y[0]}}}),f.type===tG.sprite&&(f.transform.size={x:y[0],y:y[1]},f.transform.scale={x:1,y:1,z:1}),f.type===tG.sprite){var g,x,b,T,_,E,C,S=f.content;S.renderer||(S.renderer={});var w=S.renderer,A=uA(w.anchor,w.particleOrigin),M=f.transform.size;w.anchor||void 0===w.particleOrigin||(f.transform.position.x+=-A[0]*(null!=(T=null==M?void 0:M.x)?T:1),f.transform.position.y+=-A[1]*(null!=(_=null==M?void 0:M.y)?_:1)),f.transform.anchor={x:A[0]*(null!=(E=null==M?void 0:M.x)?E:1),y:A[1]*(null!=(C=null==M?void 0:M.y)?C:1)}}}if(f.type===tG.particle){var I=f.content;I.renderer||(I.renderer={});var R=I.renderer;I.renderer.anchor=uA(R.anchor,R.particleOrigin)}if(f.type===tG.camera&&f.content.positionOverLifetime&&0!==Object.keys(f.content.positionOverLifetime).length&&(f.content.positionOverLifetime.asMovement=!0),void 0!==f.pn){var P=f.pn,O=t.plugins,N=void 0===O?[]:O;void 0!==P&&Number.isInteger(P)&&(f.pluginName=N[P])}switch("editor-gizmo"===f.pluginName&&(f.type="editor-gizmo"),"orientation-transformer"===f.pluginName&&(f.type="orientation-transformer"),f.content.options.target&&"editor-gizmo"===f.pluginName&&(f.content.options.target=s[f.content.options.target]),f.type===tG.spine&&t.spines&&0!==t.spines.length&&function(t,e,i){e.resource={atlas:{bins:{id:i.bins[t.atlas[1][0]].id},source:t.atlas[1].slice(1)},skeleton:{bins:{id:i.bins[t.skeleton[1][0]].id},source:t.skeleton[1].slice(1)},skeletonType:t.skeletonType,images:t.images.map(function(t){return{id:i.textures[t].id}})}}(t.spines[f.content.options.spine],f.content,i),(f.type===tG.sprite||f.type===tG.particle||f.type===tG.mesh||f.type===tG.skybox||f.type===tG.light||"camera"===f.type||f.type===tG.tree||f.type===tG.interact||f.type===tG.camera||f.type===tG.text||f.type===tG.spine||"editor-gizmo"===f.type||"orientation-transformer"===f.type)&&(f.components=[],i.components.push(f.content),f.content.id=i_(),f.content.item={id:f.id},f.dataType=el.VFXItemData,f.components.push({id:f.content.id})),(f.type===tG.null||f.type===tG.composition)&&(f.components=[],f.dataType=el.VFXItemData),f.type){case tG.sprite:f.content.dataType=el.SpriteComponent;break;case tG.particle:f.content.dataType=el.ParticleSystem;break;case tG.mesh:f.content.dataType=el.MeshComponent;break;case tG.skybox:f.content.dataType=el.SkyboxComponent;break;case tG.light:f.content.dataType=el.LightComponent;break;case"camera":f.content.dataType=el.CameraComponent;break;case"editor-gizmo":f.content.dataType="GizmoComponent";break;case"orientation-transformer":f.content.dataType="OrientationComponent";break;case tG.tree:f.content.dataType=el.TreeComponent;break;case tG.interact:f.content.dataType=el.InteractComponent;break;case tG.camera:f.content.dataType=el.CameraController;break;case tG.text:f.content.dataType=el.TextComponent;break;case tG.spine:f.content.dataType=el.SpineComponent}}return i.version=tN["3_0"],i}function uz(t,e){var i,r=t.options,n=t.velocityOverLifetime||{},a={path:ub(null==(i=t.transform)?void 0:i.path),gravity:r.gravity,gravityOverLifetime:uf(r.gravityModifier),direction:r.direction,startSpeed:r.startSpeed,asMovement:n.asMovement,linearX:uf(n.linearX),linearY:uf(n.linearY),linearZ:uf(n.linearZ),asRotation:n.asRotation,orbCenter:n.orbCenter,orbitalX:uf(n.orbitalX),orbitalY:uf(n.orbitalY),orbitalZ:uf(n.orbitalZ),speedOverLifetime:uf(n.speedOverLifetime)};u_(a);var o={options:{startColor:up(r.startColor)},positionOverLifetime:a};r.startSize&&(e.scale=[r.startSize,r.startSize/(r.sizeAspect||1),1]),r.startRotation&&(e.rotation?e.rotation[2]+=r.startRotation:e.rotation=[0,0,r.startRotation]);var s=t.rotationOverLifetime;if(s){var u=o.rotationOverLifetime={separateAxes:s.separateAxes,asRotation:s.asRotation};u.separateAxes?(u.x=uf(s.x),u.y=uf(s.y),u.z=uf(s.z)):u.z=uf(s.angularVelocity)}var h=t.colorOverLifetime;if(h){var l=o.colorOverLifetime={opacity:uf(h.opacity)};h.color&&(l.color=ux(h.color))}var c=t.sizeOverLifetime;return c&&(o.sizeOverLifetime={separateAxes:c.separateAxes,size:uf(c.size),x:uf(c.x),y:uf(c.y),z:uf(c.z)}),o}var uB="2.8.0-alpha.3",uU=/^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/,uG=/^(\d+)\.(\d+)$/,uj=!1;function uW(t){if(!t||"object"!=typeof t)throw Error("Invalid input: Expected a JSON object.");if(function(t){var e=(t.playerVersion||{}).web,i=void 0===e?"":e;if(i){var r,n,a=null!=(r=uU.exec(i))?r:[],o=null!=(n=uU.exec(uB))?n:[],s=a[1],u=a[2],h=o[1],l=o[2];return Number(h)<Number(s)||Number(h)===Number(s)&&Number(l)<Number(u)}return!1}(t)&&console.warn("The JSON need higher than "+(null==(d=t.playerVersion)?void 0:d.web)+" runtime version(current: "+uB+"). Some features may not work as expected."),!(f=null==(c=(l=t).version)?void 0:c.split("."))||Number(f[0])>2||2===Number(f[0])&&Number(f[1])>=2||l.compositions.forEach(function(t){t.items.forEach(function(t){(t.type===tG.mesh||t.type===tG.light)&&(t.endBehavior=1===t.endBehavior?tQ.destroy:t.endBehavior)})}),uU.test(t.version)){var e,i,r,n,a,o,s,u;return uj=(null==(p=/^(\d+)/.exec(t.version))?void 0:p[0])==="0",uD(uF(uL(uV(uN(uk(uR((e=t,uX=tN["1_0"],n=e.plugins||[],(null==(i=e.bins)?void 0:i.length)&&(uX=tN["1_3"]),a=(e.requires||[]).slice(),o=e.images.map(function(t,i){return uH(t,i,e.imageTags||[])}),s=e.textures||o.map(function(t,e){return{source:e,flipY:!0}}),u={plugins:n,shapes:e.shapes||[],type:"ge",version:uX,playerVersion:null!=(r=e.playerVersion)?r:{web:"",native:""},compositionId:e.compositionId+"",compositions:e.compositions.map(function(t){return uY(t,{plugins:n,requires:a})}),images:o,imgUsage:e._imgs,binUsage:e.binUsage,spines:e.spines,requires:e.requires,textures:s,bins:(e.bins||[]).slice()},e._textures&&(u._textures=e._textures),u))))))))}uj=!1;var h,l,c,f,d,p,m=uG.exec(t.version)||[],v=Number(m[1]),y=Number(m[2]);if(v)return(v<2||2===v&&y<4)&&((h=t).compositions.map(function(t){for(var e,i=iD(t.items);!(e=i()).done;)(function t(e){if(e)for(var i,r=iD(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],o=Array.isArray(a);o&&2===a.length&&Array.isArray(a[1])?"path"===n?e[n]=ub(a):e[n]=uf(a):o||"object"!=typeof a||t(a)}})(e.value.content)}),t=h),v<3&&(t=uk(uR(t))),v=Number((m=uG.exec(t.version)||[])[1]),y=Number(m[2]),v<4&&(y<2&&(t=uN(t)),y<3&&(t=uV(t)),y<4&&(t=uL(t)),y<5&&(t=uF(t)),y<6&&(t=uD(t))),t;throw Error("Invalid JSON version: "+t.version+".")}var uX=tN["1_0"];function uH(t,e,i){var r=i[e];if("string"==typeof t)return{id:i_(),renderLevel:r,url:t};if(t.template)return{id:i_(),url:t.url,template:t.template,webp:t.webp,renderLevel:r};if(t.compressed)return{id:i_(),url:t.url,compressed:{astc:t.compressed.android,pvrtc:t.compressed.iOS},webp:t.webp,renderLevel:r};if(t.url)return{id:i_(),url:t.url,webp:t.webp,renderLevel:r};if(t&&t.sourceType)return t;throw Error("Invalid image type.")}function uY(t,e){void 0===e&&(e={});var i,r={id:t.id+"",camera:i2({clipMode:0},t.camera),duration:t.duration,endBehavior:t.endBehavior,items:t.items.map(function(t){return uq(t,e)}),name:t.name},n=t.startTime||t.st;n&&(r.startTime=n);var a=null==(i=t.meta)?void 0:i.previewSize;return a&&a[0]===a[1]&&0===a[0]&&(a=void 0),a&&(r.previewSize=a),r}var uZ=[0,0,0,1];function uq(t,e){void 0===e&&(e={});var i=tG.base,r=t.endBehavior,n=NaN;if(t.content?(i=t.type||tG.plugin,m=t.pn,p=t.pluginName,f=t.content,c=t.content,isNaN(m)&&!p&&(p=f.options.type),t.duration&&(n=t.duration),l=t.transform||b(c.transform)):t.particle?(i=tG.particle,l=b((c=t.particle).transform,uj,!0),f=function(t){var e=t.options,i=t.transform,r={type:tk.NONE};if(t.shape){var n,a=null==(n=t.shape.shape)?void 0:n.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,"");if(r=i2({},t.shape,{type:tk[a]}),t.shape.upDirection){var o=t.shape.upDirection,s=o[0],u=o[1],h=o[2];0===s&&0===u&&0===h&&delete r.upDirection}}e.startTurbulence&&(r.turbulenceX=um(e.turbulenceX),r.turbulenceY=um(e.turbulenceY),r.turbulenceZ=um(e.turbulenceZ));var l=t.emission;l.bursts&&l.bursts.length>0&&(l.bursts=l.bursts.map(function(t){return uT(t)})),l.burstOffsets&&l.burstOffsets.length>0&&(l.burstOffsets=l.burstOffsets.map(function(t){return uT(t)})),l.rateOverTime&&(l.rateOverTime=um(l.rateOverTime));var c={renderer:t.renderer,shape:r,splits:t.splits,emission:l,options:{startLifetime:um(e.startLifetime),start3DSize:!!e.start3DSize,startSize:um(e.startSize),startSizeX:um(e.startSizeX),startSizeY:um(e.startSizeY),sizeAspect:um(e.sizeAspect),maxCount:e.maxCount,startDelay:um(e.startDelay),startColor:function(t,e){if(t)return"colors"===t[0]?[tZ.COLORS,t[1].map(function(t){return uy(t,e)})]:"gradient"===t[0]?uv(t[1],e):"color"===t[0]?[tZ.RGBA_COLOR,uy(t[1],e)]:t}(e.startColor,!0),startRotationZ:um(e.startRotation||e.startRotationZ),particleFollowParent:e.particleFollowParent}};e.start3DRotation&&(c.options.startRotationX=um(e.startRotationX),c.options.startRotationY=um(e.startRotationY)),i&&i.path&&(c.emitterTransform={path:ub(i.path)});var f=t.sizeOverLifetime;f&&(f.separateAxes?c.sizeOverLifetime={separateAxes:!0,x:um(f.x),y:um(f.y)}:c.sizeOverLifetime={size:um(f.size)});var d=t.velocityOverLifetime||{},p=d.speedOverLifetime;p=p?uf(p):void 0,c.positionOverLifetime={gravity:e.gravity,gravityOverLifetime:uf(e.gravityModifier),startSpeed:um(e.startSpeed),speedOverLifetime:p,asMovement:d.asMovement,linearX:um(d.linearX),linearY:um(d.linearY),linearZ:um(d.linearZ),asRotation:d.asRotation,orbCenter:d.orbCenter,orbitalX:um(d.orbitalX),orbitalY:um(d.orbitalY),orbitalZ:um(d.orbitalZ),forceTarget:d.forceTarget,target:d.target,forceCurve:uf(d.forceCurve)},u_(c.positionOverLifetime);var m=t.rotationOverLifetime;m&&(c.rotationOverLifetime={separateAxes:m.separateAxes,asRotation:m.asRotation,z:um(m.separateAxes?m.z:m.angularVelocity)},m.separateAxes&&(c.rotationOverLifetime.y=uf(m.y),c.rotationOverLifetime.x=uf(m.x)));var v=t.colorOverLifetime;if(v){var y=c.colorOverLifetime={opacity:uf(v.opacity)};v.color&&(y.color=ux(v.color))}var g=t.textureSheetAnimation;g&&(c.textureSheetAnimation={row:g.row,col:g.col,total:g.total,animate:g.animate,cycles:uf(g.cycles),animationDelay:ud(g.animationDelay,0),animationDuration:ud(g.animationDuration,0)});var x=t.trails;x&&(c.trails={lifetime:um(x.lifetime),dieWithParticles:x.dieWithParticles,maxPointPerTrail:x.maxPointPerTrail,minimumVertexDistance:x.minimumVertexDistance,widthOverTrail:uf(x.widthOverTrail),colorOverTrail:x.colorOverTrail&&ux(x.colorOverTrail,!1),blending:x.blending,colorOverLifetime:x.colorOverLifetime&&ux(x.colorOverLifetime,!1),inheritParticleColor:x.inheritParticleColor,occlusion:x.occlusion,transparentOcclusion:x.transparentOcclusion,orderOffset:x.orderOffset,sizeAffectsLifetime:x.sizeAffectsLifetime,sizeAffectsWidth:x.sizeAffectsWidth,texture:x.texture,parentAffectsPosition:x.parentAffectsPosition,opacityOverLifetime:um(x.opacityOverLifetime)}),c.trails&&u_(c.trails);var b=t.interaction;return b&&(c.interaction={behavior:b.behavior,radius:b.radius,multiple:b.multiple}),c}(c)):t.sprite?(i=tG.sprite,l=b((c=t.sprite).transform,!1,!0),s=uz(o=c,l),(u=o.textureSheetAnimation)&&(s.textureSheetAnimation={row:u.row,col:u.col,total:u.total||void 0,animate:u.animate}),s.renderer=o.renderer,o.splits&&(s.splits=o.splits),o.interaction&&(s.interaction=o.interaction),f=s):t.cal?(i=tG.null,l=b((c=t.cal).transform,!1,!0),f=uz(c,l)):t.ui?(i=tG.interact,l=b((c=t.ui).transform),f=function(t){var e,i=t.options;switch(i.type){case"click":e={type:tB.CLICK,showPreview:i.showPreview,previewColor:i.previewColor&&up(i.previewColor),behavior:i.behavior||tU.NOTIFY};break;case"drag":e={type:tB.DRAG,enableInEditor:!!i.enableInEditor,dxRange:i.dxRange,dyRange:i.dyRange,target:i.target};break;case"message":e={type:tB.MESSAGE}}return{options:e}}(c),l.scale=[c.options.width||1,c.options.height||1,1]):t.model&&(c=t.model,1===t.model.options.type&&(i=tG.camera,l=b(c.transform),f=function(t){var e=t.options,i={options:{fov:e.fov,far:e.far,near:e.near,clipMode:e.clipMode}},r=t.velocityOverLifetime;if(r||(null==(n=t.transform)?void 0:n.path)){var n,a,o={path:ub(null==(a=t.transform)?void 0:a.path),linearX:uf(null==r?void 0:r.translateX),linearY:uf(null==r?void 0:r.translateY),linearZ:uf(null==r?void 0:r.translateZ)};u_(o),i.positionOverLifetime=o}var s=t.rotationOverLifetime;if(s){var u={separateAxes:s.separateAxes,x:uf(null==s?void 0:s.rotateX),y:uf(null==s?void 0:s.rotateY),z:s.separateAxes?uf(null==s?void 0:s.rotateZ):uf(s.rotation)};u_(u),i.rotationOverLifetime=u}return i}(c))),null==(h=f.renderer)?void 0:h.anchor){var a=new Float32Array(f.renderer.anchor);.5==a[0]&&.5==a[1]?delete f.renderer.anchor:e.requires&&uc(e.requires,"anchor")}if(c){var o,s,u,h,l,c,f,d,p,m,v,y,g=null==(v=c.options)?void 0:v.looping;r=g?Array.isArray(g)?g[1]?tQ.restart:tQ.destroy:tQ.restart:r||(null==c?void 0:null==(y=c.options)?void 0:y.endBehavior)||tQ.destroy,c.options.renderLevel&&(d=c.options.renderLevel),isNaN(n)&&(n=c.options.duration)}var x={type:i,name:t.name,delay:t.delay,duration:n,id:t.id+"",transform:l,endBehavior:r,renderLevel:d,content:f};return p?e.plugins?(uc(e.plugins,p),x.pn=e.plugins.indexOf(p)):x.pluginName=p:Number.isInteger(m)&&(x.pn=m),t.parentId&&(x.parentId=t.parentId+""),x;function b(t,e,i){if(t){var r={},n=t.rotation;if(n&&(e?r.rotation=[-n[0],-n[1],-n[2]]:r.rotation=[n[0],n[1],n[2]],i)){var a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,S,w,A,M,I=(a=r.rotation[0],o=r.rotation[1],s=r.rotation[2],u=uE(a*uS/2),h=uE(o*uS/2),l=uE(s*uS/2),c=uC(a*uS/2),f=uC(o*uS/2),d=uC(s*uS/2),uZ[0]=c*h*l+u*f*d,uZ[1]=u*f*l-c*h*d,uZ[2]=u*h*d+c*f*l,uZ[3]=u*h*l-c*f*d,uZ);r.rotation=(p=[],m=I[0],v=I[1],y=I[2],g=I[3],x=m+m,b=v+v,T=y+y,_=m*x,E=v*x,C=v*b,S=y*T,w=g*T,A=y*x-g*b,p[1]=Math.asin((M=-A)>1?1:M<-1?-1:M)*uw,.9999999>Math.abs(A)?(p[0]=Math.atan2(y*b+g*x,1-_-C)*uw,p[2]=Math.atan2(E+w,1-C-S)*uw):(p[0]=0,p[2]=Math.atan2(-(E-w),1-_-S)*uw),p)}return t.position&&(r.position=t.position),Array.isArray(t.scale)&&(r.scale=[t.scale[0]||1,t.scale[1]||1,t.scale[2]||1]),r}return{}}}var uQ=((eA={})[tV.S]=[tV.S,tV.BPlus,tV.APlus],eA[tV.A]=[tV.A,tV.BPlus,tV.APlus],eA[tV.B]=[tV.B,tV.BPlus],eA);function uK(t,e){if(!t||!e)return!0;var i=uQ[e];return!!i&&i.includes(t)}function uJ(t,e){var i,r,n=null!=(r=null==t?void 0:t.background)?r:{},a=n.name,o=n.url;return a&&(e&&e[a]?i=e[a]:o&&(i=o)),i}function u$(t,e,i){return u0.apply(this,arguments)}function u0(){return(u0=eL(function(t,e,i){var r,n;return ez(this,function(a){switch(a.label){case 0:if("string"!=typeof t)return[3,2];return[4,rQ(t)];case 1:return r=a.sent(),[3,3];case 2:r=t,a.label=3;case 3:if(!r)throw Error("Image not provided.");if(!e)return[2,r];if(n=uJ(e,i)){if(im(n)&&n!==r.src)return[2,rQ(n)];if(eF(n,HTMLImageElement))return[2,n]}return[2,r]}})})).apply(this,arguments)}t.Scene=void 0,(tI=t.Scene||(t.Scene={})).isJSONObject=function(t){return ig(t)&&"jsonScene"in t},tI.isURL=function(t){return ig(t)&&"url"in t},tI.isWithOptions=function(t){return ig(t)&&"options"in t};var u1=1,u2=function(){function e(t,e){void 0===t&&(t={}),void 0===e&&(e=new rj),this.options=t,this.downloader=e,this.assets={},this.sourceFrom={},this.id=u1++,this.timers=[],this.updateOptions(t)}var i=e.prototype;return i.updateOptions=function(t){void 0===t&&(t={}),this.options=t,t.pluginData||(t.pluginData={});var e=t.timeout;this.timeout=void 0===e?10:e},i.loadScene=function(e,i){var r=this;return eL(function(){var n,a,o,s,u,h,l,c,f,d,p,m;return ez(this,function(v){return a=im(e)?e:r.id,o=performance.now(),s=[],l=null!=(h=null==(u=null==i?void 0:i.engine.gpuCapability)?void 0:u.detail.ktx2Support)&&h,c={},d=!1,p=new Promise(function(t,e){f=window.setTimeout(function(){d=!0,r.removeTimer(f),e(Error("Load time out: totalTime: "+(performance.now()-o).toFixed(4)+"ms "+s.join(" ")+", url: "+a+"."))},1e3*r.timeout),r.timers.push(f)}),m=eL(function(t,e){var i,r,n;return ez(this,function(a){switch(a.label){case 0:if(d)return[3,4];i=performance.now(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e()];case 2:return r=a.sent(),n=performance.now()-i,s.push("["+t+": "+n.toFixed(2)+"]"),c[t]=n,[2,r];case 3:throw Error("Load error in "+t+", "+a.sent()+".");case 4:throw Error("Load canceled.")}})}),[2,Promise.race([p,eL(function(){var i,u,h,d,p,v,y,g,x,b,T,_,E,C,S;return ez(this,function(w){switch(w.label){case 0:if(!im(e))return[3,2];return u=new URL(e,location.href).href,r.baseUrl=u,[4,m("loadJSON",function(){return r.loadJSON(u)})];case 1:return im(n=w.sent())&&(n=JSON.parse(n)),[3,3];case 2:n=e,r.baseUrl=location.href,w.label=3;case 3:if(!t.Scene.isJSONObject(n))return[3,4];return i=i2({},n),[3,9];case 4:return[4,m("processJSON",function(){return r.processJSON(n)})];case 5:return i={timeInfos:c,url:e,storage:{},jsonScene:v=w.sent().jsonScene,bins:[],textureOptions:[],textures:[],images:[],assets:r.assets},[4,m("plugin:processAssets",function(){return r.processPluginAssets(i)})];case 6:return w.sent(),g=void 0===(y=v.bins)?[]:y,x=v.images,b=v.fonts,[4,Promise.all([m("processBins",function(){return r.processBins(g)}),m("processImages",function(){return r.processImages(x,l)}),m("processFontURL",function(){return r.processFontURL(b)})])];case 7:return _=(T=w.sent())[0],E=T[1],[4,m("processTextures",function(){return r.processTextures(E,_,v)})];case 8:C=w.sent(),(h=i.bins).push.apply(h,[].concat(_)),(d=i.textureOptions).push.apply(d,[].concat(C)),(p=i.images).push.apply(p,[].concat(E)),i.renderLevel=r.options.renderLevel,w.label=9;case 9:return S=performance.now()-o,id.info("Load asset: totalTime: "+S.toFixed(4)+"ms "+s.join(" ")+", url: "+a+"."),window.clearTimeout(f),r.removeTimer(f),i.totalTime=S,i.startTime=o,i.timeInfos=c,[2,i]}})})()])]})})()},i.getAssets=function(){return this.assets},i.processJSON=function(t){return eL(function(){var e,i,r,n,a;return ez(this,function(o){for(r=iD(void 0===(i=(e=uW(t)).plugins)?[]:i);!(n=r()).done;)if(!iS[a=n.value])throw Error("The plugin '"+a+"' not found."+iR(a));return[2,{jsonScene:e}]})})()},i.processBins=function(t){var e=this;return eL(function(){var i,r;return ez(this,function(n){return i=e.options.renderLevel,r=e.baseUrl,[2,Promise.all(t.map(function(n){if(eF(n,ArrayBuffer))return n;if(uK(n.renderLevel,i))return e.loadBins(new URL(n.url,r).href);throw Error("Invalid bins source: "+JSON.stringify(t)+".")}))]})})()},i.processFontURL=function(t){var i=this;return eL(function(){return ez(this,function(r){return[2,e.loadFontFamily(t,i.baseUrl)]})})()},i.processImages=function(e,i){void 0===i&&(i=!1);var r=this;return eL(function(){var n,a,o,s,u,h,l;return ez(this,function(c){switch(c.label){case 0:return a=(n=r.options).useCompressedTexture,o=n.variables,s=n.disableWebP,u=n.disableAVIF,h=r.baseUrl,[4,Promise.all(e.map(eL(function(e,n){var l,c,f,d,p,m,v,y,g,x,b,T,_,E,C,S,w,A,M,I;return ez(this,function(n){switch(n.label){case 0:if(l=e.url,c=e.webp,f=e.avif,d=e.ktx2,p=new URL(l,h).href,m=!s&&c?new URL(c,h).href:void 0,v=!u&&f?new URL(f,h).href:void 0,y=d&&a&&i?new URL(d,h).href:void 0,g=e.id,!("template"in e))return[3,8];if(!(b=(x=e.template).background))return[3,7];T=uJ(x,o),_=b.type===eu.video,E=b&&_?r1:rQ,n.label=1;case 1:return n.trys.push([1,6,,7]),[4,r3(T,E)];case 2:if(!eF(C=n.sent(),HTMLVideoElement))return[3,3];return r.sourceFrom[g]={url:C.src,type:t.TextureSourceType.video},[2,C];case 3:return b&&Array.isArray(T)&&o&&(o[b.name]=C.src),r.sourceFrom[g]={url:C.src,type:t.TextureSourceType.image},[4,u$(C,x,o)];case 4:return[2,n.sent()];case 5:return[3,7];case 6:throw S=n.sent(),Error("Failed to load. Check the template or if the URL is "+(_?"video":"image")+" type, URL: "+T+", Error: "+(S.message||S)+".");case 7:return[3,9];case 8:if("ktx2"in e&&y)return r.sourceFrom[g]={url:y,type:t.TextureSourceType.compressed},[2,r.loadBins(y)];if(eF(e,HTMLImageElement)||eF(e,HTMLCanvasElement)||eF(e,HTMLVideoElement)||eF(e,nt))return[2,e];n.label=9;case 9:if(!v)return[3,11];return[4,rZ(p,v)];case 10:return I=n.sent(),[3,13];case 11:return[4,rH(p,m)];case 12:I=n.sent(),n.label=13;case 13:return A=(w=I).url,M=w.image,r.sourceFrom[g]={url:A,type:t.TextureSourceType.image},[2,M]}})})))];case 1:return l=c.sent(),r.assignImagesToAssets(e,l),[2,l]}})})()},i.processPluginAssets=function(t){var e=this;return eL(function(){return ez(this,function(i){switch(i.label){case 0:return[4,iM.processAssets(t,e.options)];case 1:return i.sent(),[2]}})})()},i.processTextures=function(e,i,r){var n=this;return eL(function(){var a;return ez(this,function(o){return[2,Promise.all((null!=(a=r.textures)?a:e.map(function(t,e){return{source:e}})).map(eL(function(e,a){var o,s,u,h,l;return ez(this,function(c){switch(c.label){case 0:if(eF(e,nt))return[2,e];if(!("mipmaps"in e))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r5(e,i,n.assets,r.bins)];case 2:return[2,c.sent()];case 3:throw Error("Load texture "+a+" fails, error message: "+c.sent()+".");case 4:if(o=e.source,s=e.id,h="",!ig(o))return[3,5];return u=n.assets[o.id],h=o.id,[3,7];case 5:if("string"!=typeof o)return[3,7];return[4,rQ(iE(o))];case 6:u=c.sent(),c.label=7;case 7:if(!u)return[3,9];return[4,function(t,e,i){return u3.apply(this,arguments)}(u,n.sourceFrom[h],s)];case 8:return[2,(l=c.sent()).sourceType===t.TextureSourceType.compressed?l:i2({},l,e)];case 9:throw Error("Invalid texture source: "+o+".")}})})))]})})()},i.loadJSON=function(t){var e=this;return eL(function(){return ez(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadJSON(t,i,function(e,i){r("Couldn't load JSON "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.loadBins=function(t){var e=this;return eL(function(){return ez(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadBinary(t,i,function(e,i){r("Couldn't load bins "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.assignImagesToAssets=function(t,e){for(var i=0;i<t.length;i++)this.assets[t[i].id]=e[i]},i.removeTimer=function(t){var e=this.timers.indexOf(t);-1!==e&&this.timers.splice(e,1)},i.dispose=function(){this.timers.length&&this.timers.map(function(t){return window.clearTimeout(t)}),this.assets={},this.sourceFrom={},this.timers=[]},e.loadFontFamily=function(t,i){return void 0===i&&(i=location.href),eL(function(){return ez(this,function(r){return t?[2,Promise.all(t.map(eL(function(t){var r,n,a;return ez(this,function(o){switch(o.label){case 0:if(!(t.fontURL&&!e.fontCache.has(t.fontFamily)))return[3,4];il(t.fontFamily)||console.warn("Risky font family: "+t.fontFamily+"."),o.label=1;case 1:return o.trys.push([1,3,,4]),r=new URL(t.fontURL,i).href,[4,(a=new FontFace(null!=(n=t.fontFamily)?n:"","url("+r+")")).load()];case 2:return o.sent(),document.fonts.add(a),e.fontCache.add(t.fontFamily),[3,4];case 3:return o.sent(),id.warn("Invalid font family or font source: "+JSON.stringify(t.fontURL)+"."),[3,4];case 4:return[2]}})})))]:[2]})})()},e}();function u3(){return(u3=eL(function(e,i,r){var n,a,o,s,u;return ez(this,function(h){switch(h.label){case 0:if(n={id:r,dataType:el.Texture},!eF(e,nt))return[3,1];return[2,i2({},e.source,n)];case 1:if(!(eF(e,HTMLImageElement)||ib(e)))return[3,2];return[2,i2({image:e,sourceType:t.TextureSourceType.image,sourceFrom:i,keepImageSource:!0,minFilter:rR.LINEAR,magFilter:rR.LINEAR},n)];case 2:if(!eF(e,HTMLVideoElement))return[3,3];return[2,i2({sourceType:t.TextureSourceType.video,video:e,minFilter:rR.LINEAR,magFilter:rR.LINEAR},n)];case 3:if(!eF(e,ArrayBuffer))return[3,10];if(!(a=na.getLoader("ktx2")))return[3,8];h.label=4;case 4:return h.trys.push([4,6,,7]),[4,a.loadFromBuffer(e)];case 5:return o=h.sent(),[2,i2({sourceType:o.sourceType,type:o.type,target:o.target,internalFormat:o.internalFormat,format:o.format,mipmaps:o.mipmaps,minFilter:rR.LINEAR,magFilter:rR.LINEAR,sourceFrom:i},n)];case 6:throw s=h.sent(),Error("Failed to parse KTX2 from "+(null!=(u=null==i?void 0:i.url)?u:"buffer")+": "+(s.message||s));case 7:return[3,9];case 8:throw Error("KTX2 loader not found. Please register it first.");case 9:return[3,11];case 10:if("width"in e&&"height"in e&&"data"in e)return[2,i2({sourceType:t.TextureSourceType.data,data:e,wrapS:rR.CLAMP_TO_EDGE,wrapT:rR.CLAMP_TO_EDGE,minFilter:rR.NEAREST,magFilter:rR.NEAREST},n)];h.label=11;case 11:throw Error("Invalid texture options.")}})})).apply(this,arguments)}u2.fontCache=new Set;var u4=function(){function e(t){this.engine=t,this.builtinObjects=[],this.builtinObjects.push(t.whiteTexture),this.builtinObjects.push(t.transparentTexture)}var i=e.prototype;return i.assembleSceneLoadOptions=function(e,i){void 0===i&&(i={});var r=e;return t.Scene.isURL(e)&&(t.Scene.isJSONObject(e)||(r=e.url),t.Scene.isWithOptions(e)&&(i=i2({},i,e.options))),{source:r,options:i}},i.updateTextVariables=function(t,e){var i=this;void 0===e&&(e={}),t.jsonScene.items.forEach(function(t){if(t.type===tG.text||t.type===tG.richtext){var r=e[t.name];r&&t.components.forEach(function(t){var e=t.id,n=i.engine.findEffectsObjectData(e);((null==n?void 0:n.dataType)===el.TextComponent||(null==n?void 0:n.dataType)===el.RichTextComponent)&&(n.options.text=r)})}})},i.initializeTexture=function(t){for(var e=0;e<t.textureOptions.length;e++)t.textures[e]=this.engine.findObject({id:t.textureOptions[e].id}),t.textures[e].initialize()},i.prepareAssets=function(t,e){for(var i,r=iD(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],o=new us(this.engine);o.data=a,o.setInstanceId(n)}this.engine.addPackageDatas(t);for(var s,u=iD(this.builtinObjects);!(s=u()).done;){var h=s.value;this.engine.addInstance(h)}},i.createShaderVariant=function(){for(var t,e=iD(Object.keys(this.engine.objectInstance));!(t=e()).done;){var i=t.value,r=this.engine.objectInstance[i];eF(r,nl)&&r.createShaderVariant()}},i.destroyBuiltinObjects=function(){for(var t,e=iD(this.builtinObjects);!(t=e()).done;)t.value.dispose();this.builtinObjects.length=0},i.dispose=function(){this.destroyBuiltinObjects()},e}(),u5=new Int32Array(2),u6=new Float32Array(u5.buffer),u8=new Float64Array(u5.buffer),u9=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];(tR=eM||(eM={}))[tR.UTF8_BYTES=1]="UTF8_BYTES",tR[tR.UTF16_STRING=2]="UTF16_STRING";var u7=function(){function t(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}var e=t.prototype;return e.clear=function(){this.position_=0},e.bytes=function(){return this.bytes_},e.position=function(){return this.position_},e.setPosition=function(t){this.position_=t},e.capacity=function(){return this.bytes_.length},e.readInt8=function(t){return this.readUint8(t)<<24>>24},e.readUint8=function(t){return this.bytes_[t]},e.readInt16=function(t){return this.readUint16(t)<<16>>16},e.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},e.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},e.readUint32=function(t){return this.readInt32(t)>>>0},e.readInt64=function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readUint64=function(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readFloat32=function(t){return u5[0]=this.readInt32(t),u6[0]},e.readFloat64=function(t){return u5[u9?0:1]=this.readInt32(t),u5[u9?1:0]=this.readInt32(t+4),u8[0]},e.writeInt8=function(t,e){this.bytes_[t]=e},e.writeUint8=function(t,e){this.bytes_[t]=e},e.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeInt64=function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))},e.writeUint64=function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))},e.writeFloat32=function(t,e){u6[0]=e,this.writeInt32(t,u5[0])},e.writeFloat64=function(t,e){u8[0]=e,this.writeInt32(t,u5[u9?0:1]),this.writeInt32(t+4,u5[u9?1:0])},e.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+4+4)throw Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t},e.__offset=function(t,e){var i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0},e.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},e.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t);t+=4;var r=this.bytes_.subarray(t,t+i);return e===eM.UTF8_BYTES?r:this.text_decoder_.decode(r)},e.__union_with_string=function(t,e){return"string"==typeof t?this.__string(e):this.__union(t,e)},e.__indirect=function(t){return t+this.readInt32(t)},e.__vector=function(t){return t+this.readInt32(t)+4},e.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},e.__has_identifier=function(t){if(4!=t.length)throw Error("FlatBuffers: file identifier must be length 4");for(var e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0},e.createScalarList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n)}return i},e.createObjList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n.unpack())}return i},t.allocate=function(e){return new t(new Uint8Array(e))},t}(),ht=function(){function t(t){var e;this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder,e=t||1024,this.bb=u7.allocate(e),this.space=e}var e=t.prototype;return e.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null},e.forceDefaults=function(t){this.force_defaults=t},e.dataBuffer=function(){return this.bb},e.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},e.prep=function(e,i){e>this.minalign&&(this.minalign=e);for(var r=~(this.bb.capacity()-this.space+i)+1&e-1;this.space<r+e+i;){var n=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},e.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},e.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},e.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},e.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},e.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},e.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},e.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},e.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},e.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},e.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},e.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},e.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},e.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},e.addFieldInt8=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))},e.addFieldInt16=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))},e.addFieldInt32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))},e.addFieldInt64=function(t,e,i){(this.force_defaults||e!==i)&&(this.addInt64(e),this.slot(t))},e.addFieldFloat32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))},e.addFieldFloat64=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))},e.addFieldOffset=function(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))},e.addFieldStruct=function(t,e,i){e!=i&&(this.nested(e),this.slot(t))},e.nested=function(t){if(t!=this.offset())throw TypeError("FlatBuffers: struct must be serialized inline.")},e.notNested=function(){if(this.isNested)throw TypeError("FlatBuffers: object serialization must not be nested.")},e.slot=function(t){null!==this.vtable&&(this.vtable[t]=this.offset())},e.offset=function(){return this.bb.capacity()-this.space},e.addOffset=function(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)},e.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},e.endObject=function(){if(null==this.vtable||!this.isNested)throw Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var r=(i+2)*2;this.addInt16(r);var n=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(o)){for(var s=2;s<r;s+=2)if(this.bb.readInt16(a+s)!=this.bb.readInt16(o+s))continue e;n=this.vtables[e];break}}return n?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,n-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},e.finish=function(t,e,i){var r=i?4:0;if(e){if(this.prep(this.minalign,8+r),4!=e.length)throw TypeError("FlatBuffers: file identifier must be length 4");for(var n=3;n>=0;n--)this.writeInt8(e.charCodeAt(n))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},e.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},e.requiredField=function(t,e){var i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(e<this.bb.readInt16(r)&&0!=this.bb.readInt16(r+e)))throw TypeError("FlatBuffers: field "+e+" must be set")},e.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(i,t*e)},e.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},e.createSharedString=function(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);var e=this.createString(t);return this.string_maps.set(t,e),e},e.createString=function(t){var e;return null==t?0:(eF(t,Uint8Array)?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())},e.createByteVector=function(t){return null==t?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())},e.createObjectOffset=function(t){return null===t?0:"string"==typeof t?this.createString(t):t.pack(this)},e.createObjectOffsetList=function(t){for(var e=[],i=0;i<t.length;++i){var r=t[i];if(null!==r)e.push(this.createObjectOffset(r));else throw TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e},e.createStructOffsetList=function(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()},t.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,r=u7.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r},t}(),he=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.dataType=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.data=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.dataLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.dataArray=function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new hi(this.dataType(),this.bb.createScalarList(this.data.bind(this),this.dataLength()))},e.unpackTo=function(t){t.dataType=this.dataType(),t.data=this.bb.createScalarList(this.data.bind(this),this.dataLength())},t.getRootAsFBEffectsObjectData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsObjectData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsObjectData=function(t){t.startObject(2)},t.addDataType=function(t,e){t.addFieldOffset(0,e,0)},t.addData=function(t,e){t.addFieldOffset(1,e,0)},t.createDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startDataVector=function(t,e){t.startVector(1,e,1)},t.endFBEffectsObjectData=function(t){return t.endObject()},t.createFBEffectsObjectData=function(e,i,r){return t.startFBEffectsObjectData(e),t.addDataType(e,i),t.addData(e,r),t.endFBEffectsObjectData(e)},t}(),hi=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=[]),this.dataType=t,this.data=e}return t.prototype.pack=function(t){var e=null!==this.dataType?t.createString(this.dataType):0,i=he.createDataVector(t,this.data);return he.createFBEffectsObjectData(t,e,i)},t}(),hr=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.exportObjects=function(t,e){var i=this.bb.__offset(this.bb_pos,4);return i?(e||new he).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.exportObjectsLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new hn(this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength()))},e.unpackTo=function(t){t.exportObjects=this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength())},t.getRootAsFBEffectsPackageData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsPackageData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsPackageData=function(t){t.startObject(1)},t.addExportObjects=function(t,e){t.addFieldOffset(0,e,0)},t.createExportObjectsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startExportObjectsVector=function(t,e){t.startVector(4,e,4)},t.endFBEffectsPackageData=function(t){return t.endObject()},t.finishFBEffectsPackageDataBuffer=function(t,e){t.finish(e)},t.finishSizePrefixedFBEffectsPackageDataBuffer=function(t,e){t.finish(e,void 0,!0)},t.createFBEffectsPackageData=function(e,i){return t.startFBEffectsPackageData(e),t.addExportObjects(e,i),t.endFBEffectsPackageData(e)},t}(),hn=function(){function t(t){void 0===t&&(t=[]),this.exportObjects=t}return t.prototype.pack=function(t){var e=hr.createExportObjectsVector(t,t.createObjectOffsetList(this.exportObjects));return hr.createFBEffectsPackageData(t,e)},t}(),ha=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.offset=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexCount=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.unpack=function(){return new ho(this.offset(),this.indexCount(),this.vertexCount())},e.unpackTo=function(t){t.offset=this.offset(),t.indexCount=this.indexCount(),t.vertexCount=this.vertexCount()},t.getRootAsFBSubMesh=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBSubMesh=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBSubMesh=function(t){t.startObject(3)},t.addOffset=function(t,e){t.addFieldInt32(0,e,0)},t.addIndexCount=function(t,e){t.addFieldInt32(1,e,0)},t.addVertexCount=function(t,e){t.addFieldInt32(2,e,0)},t.endFBSubMesh=function(t){return t.endObject()},t.createFBSubMesh=function(e,i,r,n){return t.startFBSubMesh(e),t.addOffset(e,i),t.addIndexCount(e,r),t.addVertexCount(e,n),t.endFBSubMesh(e)},t}(),ho=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.offset=t,this.indexCount=e,this.vertexCount=i}return t.prototype.pack=function(t){return ha.createFBSubMesh(t,this.offset,this.indexCount,this.vertexCount)},t}(),hs=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.semantic=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.offset=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.format=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.dimension=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.normalize=function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},e.unpack=function(){return new hu(this.semantic(),this.offset(),this.format(),this.dimension(),this.normalize())},e.unpackTo=function(t){t.semantic=this.semantic(),t.offset=this.offset(),t.format=this.format(),t.dimension=this.dimension(),t.normalize=this.normalize()},t.getRootAsFBVertexChannel=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexChannel=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexChannel=function(t){t.startObject(5)},t.addSemantic=function(t,e){t.addFieldOffset(0,e,0)},t.addOffset=function(t,e){t.addFieldInt32(1,e,0)},t.addFormat=function(t,e){t.addFieldInt32(2,e,0)},t.addDimension=function(t,e){t.addFieldInt32(3,e,0)},t.addNormalize=function(t,e){t.addFieldInt8(4,+e,0)},t.endFBVertexChannel=function(t){return t.endObject()},t.createFBVertexChannel=function(e,i,r,n,a,o){return t.startFBVertexChannel(e),t.addSemantic(e,i),t.addOffset(e,r),t.addFormat(e,n),t.addDimension(e,a),t.addNormalize(e,o),t.endFBVertexChannel(e)},t}(),hu=function(){function t(t,e,i,r,n){void 0===t&&(t=null),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=!1),this.semantic=t,this.offset=e,this.format=i,this.dimension=r,this.normalize=n}return t.prototype.pack=function(t){var e=null!==this.semantic?t.createString(this.semantic):0;return hs.createFBVertexChannel(t,e,this.offset,this.format,this.dimension,this.normalize)},t}(),hh=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.channels=function(t,e){var i=this.bb.__offset(this.bb_pos,6);return i?(e||new hs).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.channelsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new hl(this.vertexCount(),this.bb.createObjList(this.channels.bind(this),this.channelsLength()))},e.unpackTo=function(t){t.vertexCount=this.vertexCount(),t.channels=this.bb.createObjList(this.channels.bind(this),this.channelsLength())},t.getRootAsFBVertexData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexData=function(t){t.startObject(2)},t.addVertexCount=function(t,e){t.addFieldInt32(0,e,0)},t.addChannels=function(t,e){t.addFieldOffset(1,e,0)},t.createChannelsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startChannelsVector=function(t,e){t.startVector(4,e,4)},t.endFBVertexData=function(t){return t.endObject()},t.createFBVertexData=function(e,i,r){return t.startFBVertexData(e),t.addVertexCount(e,i),t.addChannels(e,r),t.endFBVertexData(e)},t}(),hl=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=[]),this.vertexCount=t,this.channels=e}return t.prototype.pack=function(t){var e=hh.createChannelsVector(t,t.createObjectOffsetList(this.channels));return hh.createFBVertexData(t,this.vertexCount,e)},t}(),hc=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.id=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.name=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.vertexData=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new hh).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},e.indexFormat=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexOffset=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):0},e.subMeshes=function(t,e){var i=this.bb.__offset(this.bb_pos,14);return i?(e||new ha).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.subMeshesLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.mode=function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):0},e.buffer=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null},e.binaryData=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.binaryDataLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.binaryDataArray=function(){var t=this.bb.__offset(this.bb_pos,20);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.boneNames=function(t,e){var i=this.bb.__offset(this.bb_pos,22);return i?this.bb.__string(this.bb.__vector(this.bb_pos+i)+4*t,e):null},e.boneNamesLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.rootBoneName=function(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null},e.inverseBindMatrices=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.inverseBindMatricesLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.inverseBindMatricesArray=function(){var t=this.bb.__offset(this.bb_pos,26);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new hf(this.id(),this.name(),null!==this.vertexData()?this.vertexData().unpack():null,this.indexFormat(),this.indexOffset(),this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),this.mode(),this.buffer(),this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),this.rootBoneName(),this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength()))},e.unpackTo=function(t){t.id=this.id(),t.name=this.name(),t.vertexData=null!==this.vertexData()?this.vertexData().unpack():null,t.indexFormat=this.indexFormat(),t.indexOffset=this.indexOffset(),t.subMeshes=this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),t.mode=this.mode(),t.buffer=this.buffer(),t.binaryData=this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),t.boneNames=this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),t.rootBoneName=this.rootBoneName(),t.inverseBindMatrices=this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength())},t.getRootAsFBGeometryData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBGeometryData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBGeometryData=function(t){t.startObject(12)},t.addId=function(t,e){t.addFieldOffset(0,e,0)},t.addName=function(t,e){t.addFieldOffset(1,e,0)},t.addVertexData=function(t,e){t.addFieldOffset(2,e,0)},t.addIndexFormat=function(t,e){t.addFieldInt32(3,e,0)},t.addIndexOffset=function(t,e){t.addFieldInt32(4,e,0)},t.addSubMeshes=function(t,e){t.addFieldOffset(5,e,0)},t.createSubMeshesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startSubMeshesVector=function(t,e){t.startVector(4,e,4)},t.addMode=function(t,e){t.addFieldInt32(6,e,0)},t.addBuffer=function(t,e){t.addFieldOffset(7,e,0)},t.addBinaryData=function(t,e){t.addFieldOffset(8,e,0)},t.createBinaryDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startBinaryDataVector=function(t,e){t.startVector(1,e,1)},t.addBoneNames=function(t,e){t.addFieldOffset(9,e,0)},t.createBoneNamesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startBoneNamesVector=function(t,e){t.startVector(4,e,4)},t.addRootBoneName=function(t,e){t.addFieldOffset(10,e,0)},t.addInverseBindMatrices=function(t,e){t.addFieldOffset(11,e,0)},t.createInverseBindMatricesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addFloat32(e[i]);return t.endVector()},t.startInverseBindMatricesVector=function(t,e){t.startVector(4,e,4)},t.endFBGeometryData=function(t){return t.endObject()},t}(),hf=function(){function t(t,e,i,r,n,a,o,s,u,h,l,c){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=[]),void 0===o&&(o=0),void 0===s&&(s=null),void 0===u&&(u=[]),void 0===h&&(h=[]),void 0===l&&(l=null),void 0===c&&(c=[]),this.id=t,this.name=e,this.vertexData=i,this.indexFormat=r,this.indexOffset=n,this.subMeshes=a,this.mode=o,this.buffer=s,this.binaryData=u,this.boneNames=h,this.rootBoneName=l,this.inverseBindMatrices=c}return t.prototype.pack=function(t){var e=null!==this.id?t.createString(this.id):0,i=null!==this.name?t.createString(this.name):0,r=null!==this.vertexData?this.vertexData.pack(t):0,n=hc.createSubMeshesVector(t,t.createObjectOffsetList(this.subMeshes)),a=null!==this.buffer?t.createString(this.buffer):0,o=hc.createBinaryDataVector(t,this.binaryData),s=hc.createBoneNamesVector(t,t.createObjectOffsetList(this.boneNames)),u=null!==this.rootBoneName?t.createString(this.rootBoneName):0,h=hc.createInverseBindMatricesVector(t,this.inverseBindMatrices);return hc.startFBGeometryData(t),hc.addId(t,e),hc.addName(t,i),hc.addVertexData(t,r),hc.addIndexFormat(t,this.indexFormat),hc.addIndexOffset(t,this.indexOffset),hc.addSubMeshes(t,n),hc.addMode(t,this.mode),hc.addBuffer(t,a),hc.addBinaryData(t,o),hc.addBoneNames(t,s),hc.addRootBoneName(t,u),hc.addInverseBindMatrices(t,h),hc.endFBGeometryData(t)},t}(),hd=function(){function t(){this.exportObjectDatas=[]}var e=t.prototype;return e.addData=function(t){this.exportObjectDatas.push(t)},e.serializeToBinary=function(){for(var t,e=new ht(1),i=new hn,r=[],n=iD(this.exportObjectDatas);!(t=n()).done;){var a=t.value,o=void 0;a.dataType===el.Geometry&&(o=new hi("Geometry",this.geometryDataToBinary(a))),o&&r.push(o)}return i.exportObjects=r,hr.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.deserializeFromBinary=function(t){for(var e=new u7(t),i=hr.getRootAsFBEffectsPackageData(e),r=0;r<i.exportObjectsLength();r++){var n=i.exportObjects(r);if(n){var a=n.dataArray(),o=n.dataType();if(a){var s=void 0;o===el.Geometry&&(s=this.binaryToGeometryData(a)),s&&this.exportObjectDatas.push(s)}}}},e.geometryDataToBinary=function(t){var e=new ht(1),i=new hf,r=t.indexFormat,n=t.indexOffset,a=t.mode,o=t.id,s=t.vertexData,u=t.boneNames,h=t.rootBoneName,l=t.inverseBindMatrices,c=t.binaryData;i.indexFormat=r,i.indexOffset=n,i.mode=a,i.id=o,i.boneNames=void 0===u?[]:u,i.rootBoneName=void 0===h?"":h,i.inverseBindMatrices=void 0===l?[]:l,i.binaryData=void 0===c?[]:c;var f=new hl;f.vertexCount=s.vertexCount,f.channels=[];for(var d,p=iD(s.channels);!(d=p()).done;){var m=d.value,v=new hu(m.semantic,m.offset,m.format,m.dimension,m.normalize);f.channels.push(v)}i.vertexData=f;for(var y,g=[],x=iD(t.subMeshes);!(y=x()).done;){var b=y.value,T=new ho(b.offset,b.indexCount,b.vertexCount);g.push(T)}return i.subMeshes=g,hr.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.binaryToGeometryData=function(t){var e,i,r,n,a=new u7(t),o=hc.getRootAsFBGeometryData(a),s={vertexCount:0,channels:[]},u=o.vertexData();if(u){s.vertexCount=u.vertexCount();for(var h=0;h<u.channelsLength();h++){var l,c=u.channels(h);if(c){var f={semantic:null!=(l=c.semantic())?l:"",offset:c.offset(),format:c.format(),dimension:c.dimension(),normalize:c.normalize()};s.channels.push(f)}}}for(var d=[],p=0;p<o.subMeshesLength();p++){var m=o.subMeshes(p);if(m){var v={offset:m.offset(),vertexCount:m.vertexCount(),indexCount:m.indexCount()};d.push(v)}}for(var y=[],g=0;g<o.boneNamesLength();g++){var x=o.boneNames(g);y.push(x)}var b=o.inverseBindMatricesArray();return{vertexData:s,indexFormat:o.indexFormat(),indexOffset:o.indexOffset(),subMeshes:d,mode:o.mode(),buffer:null!=(e=o.buffer())?e:"",boneNames:y,rootBoneName:null!=(i=o.rootBoneName())?i:"",inverseBindMatrices:b?Array.from(b):void 0,binaryData:null!=(r=o.binaryDataArray())?r:void 0,id:null!=(n=o.id())?n:"",dataType:el.Geometry}},t}(),hp=function(){function t(t){void 0===t&&(t=60),this.paused=!0,this.lastTime=0,this.dt=0,this.setFPS(t),this.tickers=[]}var e=t.prototype;return e.getFPS=function(){return this.targetFPS},e.setFPS=function(t){this.targetFPS=eK(t,1,120),this.interval=Math.floor(1e3/t)-2},e.getPaused=function(){return this.paused},e.start=function(){var t=this;if(this.paused=!1,this.dt=0,!this.intervalId){this.lastTime=performance.now();var e=requestAnimationFrame||function(t){return window.setTimeout(t,16.7)},i=function(){t.intervalId=e(i),t.paused||t.tick()};i()}},e.stop=function(){(cancelAnimationFrame||window.clearTimeout)(this.intervalId),this.intervalId=0,this.lastTime=0,this.paused=!0,this.dt=0,this.tickers=[]},e.pause=function(){this.paused=!0,this.dt=0},e.resume=function(){this.paused=!1,this.dt=0},e.tick=function(){if(!this.paused){var t=performance.now();if(this.dt=t-this.lastTime,this.dt>=this.interval){this.lastTime=t,this.resetTickers&&(this.tickers=this.tickers.filter(function(t){return t}),this.resetTickers=!1);for(var e=0,i=this.tickers.length;e<i;e++)(0,this.tickers[e])(this.dt)}}},e.add=function(t){if("function"!=typeof t)throw Error("The tick object must implement the tick method.");this.tickers.push(t)},rC(t,[{key:"deltaTime",get:function(){return this.dt}}]),t}(),hm=function(e){function i(t,i){var r,n,a,o,s,u;return(r=e.call(this)||this).name="NewEngine",r.speed=1,r.displayScale=1,r.offscreenMode=!1,r.renderErrors=new Set,r.compositions=[],r.assetManagers=[],r.env="",r.ticker=null,r._disposed=!1,r.textures=[],r.materials=[],r.geometries=[],r.meshes=[],r.renderPasses=[],r.canvas=t,r.env=null!=(n=null==i?void 0:i.env)?n:"",r.name=null!=(a=null==i?void 0:i.name)?a:r.name,r.pixelRatio=null!=(o=null==i?void 0:i.pixelRatio)?o:e8(),r.jsonSceneData={},r.objectInstance={},r.whiteTexture=nr(a9(r)),r.transparentTexture=nn(a9(r)),(null==i?void 0:i.manualRender)||(r.ticker=new hp(null==i?void 0:i.fps),r.runRenderLoop(r.render.bind(a9(r)))),r.eventSystem=new aK(a9(r),null!=(s=null==i?void 0:i.notifyTouch)&&s),r.eventSystem.enabled=null!=(u=null==i?void 0:i.interactive)&&u,r.eventSystem.bindListeners(r.canvas),r.assetLoader=new uh(a9(r)),r.assetService=new u4(a9(r)),r}iN(i,e);var r=i.prototype;return r.clearResources=function(){this.jsonSceneData={},this.objectInstance={}},r.addEffectsObjectData=function(t){this.jsonSceneData[t.id]=t},r.findEffectsObjectData=function(t){return this.jsonSceneData[t]},r.addInstance=function(t){this.objectInstance[t.getInstanceId()]=t},r.findObject=function(t){return ix(t)?this.objectInstance[t.id]?this.objectInstance[t.id]:this.assetLoader.loadGUID(t):t},r.removeInstance=function(t){delete this.objectInstance[t]},r.addPackageDatas=function(t){for(var e,i=t.jsonScene,r=t.textureOptions,n=i.items,a=i.materials,o=i.shaders,s=i.geometries,u=i.components,h=i.animations,l=i.bins,c=void 0===l?[]:l,f=i.miscs,d=i.compositions,p=iD(d);!(e=p()).done;){var m=e.value;this.addEffectsObjectData(m)}for(var v,y=iD(void 0===n?[]:n);!(v=y()).done;){var g=v.value;uK(g.renderLevel,t.renderLevel)||(g.components=[],g.type=tG.null),this.addEffectsObjectData(g)}for(var x,b=iD(void 0===a?[]:a);!(x=b()).done;){var T=x.value;this.addEffectsObjectData(T)}for(var _,E=iD(void 0===o?[]:o);!(_=E()).done;){var C=_.value;this.addEffectsObjectData(C)}for(var S,w=iD(void 0===s?[]:s);!(S=w()).done;){var A=S.value;this.addEffectsObjectData(A)}for(var M,I=iD(void 0===u?[]:u);!(M=I()).done;){var R=M.value;this.addEffectsObjectData(R)}for(var P,O=iD(void 0===h?[]:h);!(P=O()).done;){var N=P.value;this.addEffectsObjectData(N)}for(var V,L=iD(void 0===f?[]:f);!(V=L()).done;){var F=V.value;this.addEffectsObjectData(F)}for(var D=0;D<c.length;D++){var k=c[D],z=t.bins[D];if(k.dataType===el.BinaryAsset)k.buffer=z,k.id&&this.addEffectsObjectData(k);else{var B=new hd;B.deserializeFromBinary(new Uint8Array(z));for(var U,G=iD(B.exportObjectDatas);!(U=G()).done;){var j=U.value;this.addEffectsObjectData(j)}}}for(var W,X=iD(void 0===r?[]:r);!(W=X()).done;){var H=W.value;this.addEffectsObjectData(H)}},r.runRenderLoop=function(t){var e;null==(e=this.ticker)||e.add(t)},r.render=function(e){var i,r,n=this.renderErrors;n.size>0&&(this.emit("rendererror",n.values().next().value),null==(i=this.ticker)||i.pause()),e=Math.min(e,33)*this.speed;var a=this.compositions,o=!1;a.sort(function(t,e){return t.getIndex()-e.getIndex()});for(var s=0;s<a.length;s++){var u=a[s];if(u.textureOffloaded){o=!0,id.error("Composition "+u.name+" texture offloaded, skip render.");continue}u.update(e)}if(o)return this.emit("rendererror",Error("Play when texture offloaded.")),null==(r=this.ticker)?void 0:r.pause();this.renderer.setFramebuffer(null),this.renderer.clear({stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]});for(var h=0;h<a.length;h++)a[h].renderFrame.isDisposed||this.renderer.renderRenderFrame(a[h].renderFrame);this.renderer.renderTargetPool.flush()},r.resize=function(){var t,e,i,r,n=this.canvas.parentElement;if(n){var a=this.getTargetSize(n);t=a[0],e=a[1],i=a[2],r=a[3]}else t=i=this.canvas.width,e=r=this.canvas.height;var o=t/e;if(t&&e){var s=document.documentElement.clientWidth;i>2*s&&id.error("DPI overflowed, width "+i+" is more than 2x document width "+s+", see "+ak["DPI overflowed"]+".");var u=this.env?this.gpuCapability.detail.maxTextureSize:2048;(i>u||r>u)&&(id.error("Container size overflowed "+i+"x"+r+", see "+ak["Container size overflowed"]+"."),o>1?(i=Math.round(u),r=Math.round(u/o)):(r=Math.round(u),i=Math.round(u*o))),this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",id.info("Resize engine "+this.name+" ["+i+","+r+","+t+","+e+"]."),this.setSize(i,r)}},r.setSize=function(t,e){var i,r=this;this.renderer.resize(t,e),null==(i=this.compositions)||i.forEach(function(i){i.camera.aspect=t/e,i.camera.pixelHeight=r.renderer.getHeight(),i.camera.pixelWidth=r.renderer.getWidth()}),this.emit("resize",this)},r.getTargetSize=function(t){if(null==t)throw Error("Container is not an HTMLElement, see "+ak["Container is not an HTMLElement"]+".");var e,i,r=this.displayAspect,n=null==window.getComputedStyle?void 0:window.getComputedStyle.call(window,t),a=0,o=0;n?(a=parseInt(n.width,10),o=parseInt(n.height,10)):(a=t.clientWidth,o=t.clientHeight),r?a/o>r?e=(i=o*this.displayScale)*r:i=(e=a*this.displayScale)/r:(e=a,i=o);var s=this.pixelRatio,u=e,h=i;if(e=Math.round(e*s),i=Math.round(i*s),e<1||i<1){if(this.offscreenMode)e=i=u=h=1;else throw Error("Invalid container size "+e+"x"+i+", see "+ak["Invalid container size"]+".")}return[u,h,e,i]},r.addTexture=function(t){this.disposed||eW(this.textures,t)},r.removeTexture=function(t){this.disposed||eX(this.textures,t)},r.addMaterial=function(t){this.disposed||eW(this.materials,t)},r.removeMaterial=function(t){this.disposed||eX(this.materials,t)},r.addGeometry=function(t){this.disposed||eW(this.geometries,t)},r.removeGeometry=function(t){this.disposed||eX(this.geometries,t)},r.addMesh=function(t){this.disposed||eW(this.meshes,t)},r.removeMesh=function(t){this.disposed||eX(this.meshes,t)},r.addRenderPass=function(t){this.disposed||eW(this.renderPasses,t)},r.removeRenderPass=function(t){this.disposed||eX(this.renderPasses,t)},r.addComposition=function(t){this.disposed||eW(this.compositions,t)},r.removeComposition=function(t){this.disposed||eX(this.compositions,t)},r.getShaderLibrary=function(){return this.renderer.getShaderLibrary()},r.dispose=function(){if(!this.disposed){this._disposed=!0;var t,e,i,r=[];this.renderPasses.length>0&&r.push("Pass "+this.renderPasses.length),this.meshes.length>0&&r.push("Mesh "+this.meshes.length),this.geometries.length>0&&r.push("Geom "+this.geometries.length),this.textures.length>0&&r.push("Tex "+this.textures.length),r.length>0&&id.warn("Release GPU memory: "+r.join(", ")+"."),null==(t=this.ticker)||t.stop(),null==(e=this.eventSystem)||e.dispose(),null==(i=this.assetService)||i.dispose(),this.renderPasses.forEach(function(t){return t.dispose()}),this.meshes.forEach(function(t){return t.dispose()}),this.geometries.forEach(function(t){return t.dispose()}),this.materials.forEach(function(t){return t.dispose()}),this.textures.forEach(function(t){return t.dispose()}),this.assetManagers.forEach(function(t){return t.dispose()}),this.compositions.forEach(function(t){return t.dispose()}),this.textures=[],this.materials=[],this.geometries=[],this.meshes=[],this.renderPasses=[],this.compositions=[]}},rC(i,[{key:"disposed",get:function(){return this._disposed}}]),i}(sP),hv={format:rR.RGBA,type:rR.UNSIGNED_BYTE,minFilter:rR.LINEAR,magFilter:rR.LINEAR,wrapS:rR.CLAMP_TO_EDGE,wrapT:rR.CLAMP_TO_EDGE},hy=Symbol("dispose"),hg=function(){function e(t){this.textureCache={},this.textureRef={},this.engine=t}var i=e.prototype;return i.requestColorAttachmentTexture=function(e){var i=this,r=e.width,n=e.height,a=e.name,o={sourceType:t.TextureSourceType.framebuffer,data:{width:r,height:n},name:a},s=[a];Object.getOwnPropertyNames(hv).forEach(function(t){var i,r=null!=(i=e[t])?i:hv[t];o[t]=r,s.push(t,r)});var u=s.join(":"),h=this.textureCache[u];if(h)this.textureRef[u]++;else{var l=this.engine;ih(l),h=nt.create(l,o),this.textureCache[u]=h,this.textureRef[u]=1,h[hy]=h.dispose,h.dispose=function(){return i.removeTexture(u)}}return h},i.removeTexture=function(t){var e=this.textureRef[t];if(e<=1){e<0&&console.error("Ref count < 0.");var i=this.textureCache[t];i&&(i[hy](),i.dispose=i[hy]),delete this.textureCache[t],delete this.textureRef[t]}else this.textureRef[t]=e-1},i.dispose=function(){var t=this;Object.keys(this.textureCache).forEach(function(e){var i=t.textureCache[e];i[hy](),i.dispose=i[hy]}),this.textureCache={},this.textureRef={},this.engine=void 0},e}(),hx=function(){function t(){}return t.load=function(t,e,i){void 0===i&&(i={});var r=this;return eL(function(){var n,a,o,s,u,h,l,c,f,d,p,m,v;return ez(this,function(y){switch(y.label){case 0:return s=performance.now(),u=null==(a=e.gpuCapability)?void 0:null==(n=a.detail)?void 0:n.asyncShaderCompile,h=e.compositions.length,l=new u2(i),e.assetManagers.push(l),[4,l.loadScene(t,e.renderer)];case 1:return c=y.sent(),e.clearResources(),iM.loadResources(c,l.options,e),e.assetService.prepareAssets(c,c.assets),e.assetService.updateTextVariables(c,i.variables),e.assetService.initializeTexture(c),(f=r.createComposition(c,e,i)).setIndex(h),d=performance.now(),[4,new Promise(function(t){var i;null==(i=e.renderer.getShaderLibrary())||i.compileAllShaders(function(){return t(null)})})];case 2:return y.sent(),p=performance.now()-d,null==(o=e.ticker)||o.start(),m=f.name,v=performance.now()-s,f.statistic.compileTime=p,f.statistic.firstFrameTime=v,id.info("First frame ["+m+"]: "+v.toFixed(4)+"ms."),id.info("Shader "+(u?"async":"sync")+" compile ["+m+"]: "+p.toFixed(4)+"ms."),[2,f]}})})()},t.createComposition=function(t,e,i){void 0===i&&(i={});var r=e.renderer,n=new sF(i2({},i,{renderer:r,width:r.getWidth(),height:r.getHeight(),event:e.eventSystem}),t);return e.ticker&&i.renderLevel===tV.B&&e.ticker.setFPS(Math.min(e.ticker.getFPS(),30)),e.env!==aD&&e.assetService.createShaderVariant(),n},t}();iA("camera",aW),iA("text",uo),iA("sprite",a4),iA("particle",sH),iA("cal",sY),iA("interact",a$),id.info("Core version: 2.8.0-alpha.3.");var hb=((eI={})[rR.ONE]=eN.OneFactor,eI[rR.ZERO]=eN.ZeroFactor,eI[rR.SRC_COLOR]=eN.SrcColorFactor,eI[rR.SRC_ALPHA]=eN.SrcAlphaFactor,eI[rR.ONE_MINUS_SRC_COLOR]=eN.OneMinusSrcColorFactor,eI[rR.ONE_MINUS_SRC_ALPHA]=eN.OneMinusSrcAlphaFactor,eI[rR.DST_COLOR]=eN.DstColorFactor,eI[rR.DST_ALPHA]=eN.DstAlphaFactor,eI[rR.ONE_MINUS_DST_COLOR]=eN.OneMinusDstColorFactor,eI[rR.ONE_MINUS_DST_ALPHA]=eN.OneMinusDstAlphaFactor,eI),hT=((eR={})[rR.NEVER]=eN.NeverStencilFunc,eR[rR.EQUAL]=eN.EqualStencilFunc,eR[rR.LESS]=eN.LessStencilFunc,eR[rR.LEQUAL]=eN.LessEqualStencilFunc,eR[rR.ALWAYS]=eN.AlwaysStencilFunc,eR[rR.NOTEQUAL]=eN.NotEqualStencilFunc,eR[rR.GREATER]=eN.GreaterStencilFunc,eR[rR.GEQUAL]=eN.GreaterEqualStencilFunc,eR),h_=((eP={})[rR.KEEP]=eN.KeepStencilOp,eP[rR.ZERO]=eN.ZeroStencilOp,eP[rR.REPLACE]=eN.ReplaceStencilOp,eP[rR.INCR]=eN.IncrementStencilOp,eP[rR.DECR]=eN.DecrementStencilOp,eP[rR.INCR_WRAP]=eN.IncrementWrapStencilOp,eP[rR.DECR_WRAP]=eN.IncrementWrapStencilOp,eP[rR.INVERT]=eN.InvertStencilOp,eP),hE=((eO={})[rR.NEVER]=eN.NeverDepth,eO[rR.ALWAYS]=eN.AlwaysDepth,eO[rR.EQUAL]=eN.EqualDepth,eO[rR.LESS]=eN.LessDepth,eO[rR.LEQUAL]=eN.LessEqualDepth,eO[rR.GREATER]=eN.GreaterDepth,eO[rR.GEQUAL]=eN.GreaterEqualDepth,eO[rR.NOTEQUAL]=eN.NotEqualDepth,eO),hC=["uMaskTex","_MainTex","uColorOverLifetime","uColorOverTrail"],hS=function(e){function i(i,r){(n=e.call(this,i,r)||this).textures={},n.material=new eN.RawShaderMaterial,n.uniforms={},n.macrosDirty=!0;var n,a,o,s,u,h=null==r?void 0:r.shader,l=i.gpuCapability.level;return n.shader=new t.Shader(i),n.shader.shaderData=i2({},h,{id:i_(),dataType:el.Shader,vertex:null!=(a=null==h?void 0:h.vertex)?a:"",fragment:null!=(o=null==h?void 0:h.fragment)?o:""}),n.uniforms._MainTex=new eN.Uniform(null),n.uniforms.effects_ObjectToWorld=new eN.Uniform(new eN.Matrix4().identity()),n.uniforms.effects_MatrixInvV=new eN.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.uniforms.effects_MatrixVP=new eN.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-8,1]),n.uniforms.effects_MatrixV=new eN.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.material=new eN.RawShaderMaterial({vertexShader:nB.genFinalShaderCode({level:n.engine.gpuCapability.level,shaderType:t.ShaderType.vertex,shader:null!=(s=null==h?void 0:h.vertex)?s:"",macros:null==h?void 0:h.macros,removeVersion:!0}),fragmentShader:nB.genFinalShaderCode({level:n.engine.gpuCapability.level,shaderType:t.ShaderType.fragment,shader:null!=(u=null==h?void 0:h.fragment)?u:"",macros:null==h?void 0:h.macros,removeVersion:!0}),alphaToCoverage:!1,depthFunc:eN.LessDepth,polygonOffsetFactor:eN.ZeroFactor,polygonOffsetUnits:eN.ZeroFactor,polygonOffset:!1,uniforms:n.uniforms}),1===l?n.material.glslVersion=eN.GLSL1:n.material.glslVersion=eN.GLSL3,n}iN(i,e);var r=i.prototype;return r.onSetUniformValue=function(t,e){var i;hC.includes(t)&&(i=e.texture),this.material.uniforms[t]?this.material.uniforms[t].value=i||e:this.material.uniforms[t]=new eN.Uniform(i||e)},r.use=function(t,e){var i=this.engine,r=i.composition,n=i.threeCamera;if(n){var a=new eN.Matrix4().multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse);this.setMatrix("effects_MatrixVP",a)}else{var o=r.camera;this.setMatrix("effects_MatrixVP",o.getViewProjectionMatrix()),this.setMatrix("effects_MatrixV",o.getViewMatrix())}},r.onRemoveUniformValue=function(t){this.material.uniforms[t]&&(this.material.uniforms[t].value=null)},r.getTexture=function(t){return this.textures[t]},r.setTexture=function(t,e){this.setUniform(t,e.texture),this.textures[t]=e},r.getVector4Array=function(t){return this.uniforms[t].value},r.setVector4Array=function(t,e){for(var i,r=[],n=iD(e);!(i=n()).done;){var a=i.value;r=r.concat(a.toArray())}this.setUniform(t,r)},r.getMatrixArray=function(t){return this.uniforms[t].value},r.setMatrixArray=function(t,e){for(var i,r=[],n=iD(e);!(i=n()).done;){var a=i.value;r=r.concat(a.elements)}this.setUniform(t,r)},r.setMatrixNumberArray=function(t,e){this.setUniform(t,e)},r.getMatrix=function(t){return this.uniforms[t].value},r.setMatrix=function(t,e){this.setUniform(t,e)},r.setMatrix3=function(t,e){this.setUniform(t,e)},r.getVector2=function(t){return this.uniforms[t].value},r.setVector2=function(t,e){this.setUniform(t,e)},r.getVector3=function(t){return this.uniforms[t].value},r.setVector3=function(t,e){this.setUniform(t,e)},r.getVector4=function(t){return this.uniforms[t].value},r.setVector4=function(t,e){this.setUniform(t,e)},r.getColor=function(t){var e=this.uniforms[t].value;return new e1(e.x,e.y,e.z,e.w)},r.setColor=function(t,e){this.setUniform(t,new eN.Vector4(e.r,e.g,e.b,e.a))},r.getQuaternion=function(t){return this.uniforms[t].value},r.setQuaternion=function(t,e){this.setUniform(t,e)},r.getFloat=function(t){return this.uniforms[t].value},r.setFloat=function(t,e){this.setUniform(t,e)},r.getFloats=function(t){return this.uniforms[t].value},r.setFloats=function(t,e){this.setUniform(t,e)},r.getInt=function(t){return this.uniforms[t].value},r.setInt=function(t,e){this.setUniform(t,e)},r.hasUniform=function(t){return!!this.uniforms[t]},r.setUniform=function(t,e){var i=new eN.Uniform(e);this.uniforms[t]=this.material.uniforms[t]=i},r.enableMacro=function(t,e){this.isMacroEnabled(t)&&this.enabledMacros[t]===e||(this.enabledMacros[t]=null==e||e,this.macrosDirty=!0)},r.disableMacro=function(t){this.isMacroEnabled(t)&&(delete this.enabledMacros[t],this.macrosDirty=!0)},r.isMacroEnabled=function(t){return void 0!==this.enabledMacros[t]},r.clone=function(t){throw Error("Method not implemented.")},r.cloneUniforms=function(t){throw Error("Method not implemented.")},r.fromData=function(t){throw Error("Method not implemented.")},r.dispose=function(){this.destroyed||(this.material.dispose(),this.destroyed=!0,e.prototype.dispose.call(this))},rC(i,[{key:"blending",get:function(){return this.material.blending!==eN.NoBlending},set:function(t){this.material.blending=t?eN.CustomBlending:eN.NoBlending}},{key:"blendFunction",get:function(){var t=this.material,e=t.blendSrc,i=t.blendDst;return[e,i,t.blendSrcAlpha||e,t.blendDstAlpha||i]},set:function(t){if(t){var e=t[0],i=t[1],r=t[2],n=t[3];this.material.blendSrc=hb[e],this.material.blendDst=hb[i],this.material.blendSrcAlpha=hb[r],this.material.blendDstAlpha=hb[n]}}},{key:"blendEquation",get:function(){var t=this.material,e=t.blendEquation;return[e,t.blendEquationAlpha||e]},set:function(t){if(t){var e=t[0],i=t[1];this.material.blendEquation=e,this.material.blendEquationAlpha=i}}},{key:"depthTest",get:function(){return this.material.depthTest},set:function(t){this.material.depthTest=!!t}},{key:"depthMask",get:function(){return this.material.depthWrite},set:function(t){this.material.depthWrite=!!t}},{key:"depthFunc",get:function(){return this.material.depthFunc},set:function(t){void 0!==t&&(this.material.depthFunc=hE[t])}},{key:"polygonOffsetFill",get:function(){return this.material.polygonOffset},set:function(t){this.material.polygonOffset=!!t}},{key:"polygonOffset",get:function(){return[this.material.polygonOffsetFactor,this.material.polygonOffsetUnits]},set:function(t){if(t){var e=t[0],i=t[1];this.material.polygonOffsetFactor=e,this.material.polygonOffsetUnits=i}}},{key:"sampleAlphaToCoverage",get:function(){return this.material.alphaToCoverage},set:function(t){this.material.alphaToCoverage=!!t}},{key:"stencilTest",get:function(){return this.material.stencilWrite},set:function(t){this.material.stencilWrite=!!t}},{key:"stencilMask",get:function(){return[this.material.stencilWriteMask,this.material.stencilWriteMask]},set:function(t){t&&(this.material.stencilWriteMask=t[0])}},{key:"stencilRef",get:function(){return[this.material.stencilRef,this.material.stencilRef]},set:function(t){t&&(this.material.stencilRef=t[0])}},{key:"stencilFunc",get:function(){return[this.material.stencilFunc,this.material.stencilFunc]},set:function(t){t&&(this.material.stencilFunc=hT[t[0]])}},{key:"stencilOpFail",get:function(){return[this.material.stencilFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilFail=h_[t[0]])}},{key:"stencilOpZFail",get:function(){return[this.material.stencilZFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilZFail=h_[t[0]])}},{key:"stencilOpZPass",get:function(){return[this.material.stencilZPass,this.material.stencilZPass]},set:function(t){t&&(this.material.stencilZPass=h_[t[0]])}},{key:"culling",get:function(){return this.material.side!==eN.DoubleSide},set:function(t){this.material.side=t?eN.FrontSide:eN.DoubleSide}},{key:"cullFace",get:function(){return this.material.side},set:function(t){t===tF.FRONT?this.material.side=eN.FrontSide:t===tF.BACK&&(this.material.side=eN.BackSide)}},{key:"colorMask",get:function(){return this.material.colorWrite},set:function(t){this.material.colorWrite=t}}]),i}(nl);function hw(t,e){return e&&("object"===eD(e)||"function"==typeof e)?e:a9(t)}var hA=1,hM=function(t){function e(e,i){if((r=t.call(this,e)||this).attributes={},r.destroyed=!1,r.attributesName=[],!i)return hw(r);var r,n=i.drawStart,a=i.drawCount,o=i.indices,s=i.mode,u=i.name,h=void 0===u?"effectsGeometry:"+hA++:u;r.name=h,r.mode=null!=s?s:rR.TRIANGLES;var l=[],c={},f=new eN.BufferGeometry;return Object.keys(i.attributes).forEach(function(t){var e=i.attributes[t];if("dataSource"in e){var n=e.dataSource;if(n){void 0===c[n]&&r.setAttributeType(n,e,f,c,i.maxVertex);var a=e.size,o=e.offset,s=e.normalize,u=c[n],h=u.buffer,d=u.dataLength,p=new eN.InterleavedBufferAttribute(h,a,(null!=o?o:0)/d,s);f.setAttribute(t,p),c[t]={buffer:h,attribute:p,type:u.type,dataLength:d}}}else r.setAttributeType(t,e,f,c,i.maxVertex);l.push(t)}),o&&o.data&&f.setIndex(new eN.BufferAttribute(o.data,1)),r.geometry=f,r.attributes=c,r.attributesName=l,r.drawStart=void 0===n?0:n,r.drawCount=null!=a?a:0,r}iN(e,t);var i=e.prototype;return i.getAttributeData=function(t){if(void 0!=this.attributes[t])return this.attributes[t].buffer.array},i.setAttributeData=function(t,e){if(void 0!=this.attributes[t]){var i=this.attributes[t].buffer;if(e.length>i.array.length){var r=new eN.InterleavedBuffer(e,i.stride);i=this.attributes[t].attribute.data=r,this.attributes[t].buffer=r,this.geometry.setAttribute(t,this.attributes[t].attribute)}else i.set(e,0),i.updateRange.count=e.length,i.updateRange.offset=0;this.geometry.attributes[t].needsUpdate=!0}},i.setAttributeSubData=function(t,e,i){void 0!=this.attributes[t]&&(this.attributes[t].buffer.set(i,e),this.geometry.attributes[t].needsUpdate=!0)},i.getAttributeStride=function(t){var e=this.attributes[t];return e.buffer.stride*ny[e.type]},i.getAttributeNames=function(){return this.attributesName},i.getIndexData=function(){var t=this.geometry.getIndex();return null===t?void 0:t.array},i.setIndexData=function(t){t&&(this.geometry.setIndex(new eN.BufferAttribute(t,1)),this.geometry.index.needsUpdate=!0)},i.setIndexSubData=function(t,e){var i=this.geometry.getIndex();if(null!==i){var r=t+e.length;if(i.count<r){var n=new e.constructor(end);n.set(i.array),i.array=n}i.array.set(e,t),this.geometry.index.needsUpdate=!0}},i.setDrawStart=function(t){this.drawStart=t},i.getDrawStart=function(){return this.drawStart},i.setDrawCount=function(t){this.drawCount=t},i.getDrawCount=function(){return this.drawCount},i.getSkinProps=function(){return{}},i.dispose=function(){this.destroyed||(this.geometry.dispose(),this.destroyed=!0,t.prototype.dispose.call(this))},i.setAttributeType=function(t,e,i,r,n){var a=e.stride,o=e.size,s=e.offset,u=e.normalize,h=e.type,l=void 0===h?rR.FLOAT:h,c=e.data;if(l&&!c&&(c=nx(l)),c){var f=eF(c,Float32Array)?Float32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,d=(void 0===a?0:a)/f,p=(n=(null!=n?n:0)*d)||o*f;p&&0===c.length&&(c=eF(c,Float32Array)?new Float32Array(p):new Uint16Array(p));var m=new eN.InterleavedBuffer(c,d),v=new eN.InterleavedBufferAttribute(m,o,(null!=s?s:0)/f,u);i.setAttribute(t,v),r[t]={buffer:m,attribute:v,type:l,dataLength:f}}},rC(e,[{key:"drawCount",get:function(){return this.geometry.drawRange.count},set:function(t){this.geometry.drawRange.count=t}},{key:"drawStart",get:function(){return this.geometry.drawRange.start},set:function(t){this.geometry.drawRange.start=t}}]),e}(ng),hI=function(t){function e(e,i){if(!i)return hw(r);var r,n=i.material,a=i.geometry,o=i.priority;return(r=t.call(this,e,i)||this).geometry=a,r.material=n,a.mode===rR.LINES?r.mesh=new eN.LineSegments(a.geometry,n.material):r.mesh=new eN.Mesh(a.geometry,n.material),r.priority=void 0===o?0:o,r}iN(e,t);var i=e.prototype;return i.setVisible=function(t){this.mesh.visible=t},i.getVisible=function(){return this.mesh.visible},i.firstGeometry=function(){return this.geometry},i.setMaterial=function(t){this.material.dispose(),this.material=t,this.mesh.material=t.material},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.mesh)},i.restore=function(){},i.render=function(t){!this.isDestroyed&&this.getVisible()&&(this.material.setMatrix("effects_ObjectToWorld",this.worldMatrix),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.dispose=function(e){this.destroyed||(this.mesh.clear(),this.destroyed=!0),t.prototype.dispose.call(this)},rC(e,[{key:"priority",get:function(){return this.mesh.renderOrder},set:function(t){this.mesh&&(this.mesh.renderOrder=t)}}]),e}(nA),hR=function(e){function i(i,r,n){if(void 0===n&&(n={}),a=e.call(this,i)||this,r){var a,o=r.width,s=r.height;a.texture=a.createTextureByType(i2({},n,{sourceType:t.TextureSourceType.data,data:r})),a.width=void 0===o?1:o,a.height=void 0===s?1:s}else a.texture=a.createTextureByType(n);return a.texture.needsUpdate=!0,a.source={},a}iN(i,e);var r=i.prototype;return r.updateSource=function(t){this.texture.dispose(),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.assembleOptions=function(e){var r=e.target,n=void 0===r?rR.TEXTURE_2D:r;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=t.TextureSourceType.none),i2({},e,{target:n,format:eN.RGBAFormat,type:eN.UnsignedByteType,minFilter:i.toThreeJsTextureFilter(e.minFilter),magFilter:i.toThreeJsTextureFilter(e.magFilter),wrapS:i.toThreeJsTextureWrap(e.wrapS),wrapT:i.toThreeJsTextureWrap(e.wrapT)})},r.dispose=function(){this.texture.dispose(),e.prototype.dispose.call(this)},r.fromData=function(t){e.prototype.fromData.call(this,t),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.createTextureByType=function(e){var i=this.assembleOptions(e),r=i.flipY,n=i.type,a=i.wrapS,o=i.wrapT,s=i.minFilter,u=i.magFilter,h=i.sourceType,l=eN.UVMapping,c=i.format,f=void 0;if(this.sourceType=h,h===t.TextureSourceType.data){var d=e.data;f=new eN.DataTexture(d.data,d.width,d.height,c,n,l,a,o,u,s),this.width=d.width,this.height=d.height}else if(h===t.TextureSourceType.image){var p=e.image;f=new eN.Texture(p,l,a,o,u,s,c,n),this.width=p.width,this.height=p.height}else if(h===t.TextureSourceType.compressed){var m=0,v=0,y=e.mipmaps.map(function(t){var e=t.data,i=t.width,r=t.height;return m=m<i?i:m,v=v<r?r:v,{data:e,width:i,height:r,colorSpace:"srgb"}});c=eN.RGBA_ASTC_4x4_Format,f=new eN.CompressedTexture(y,m,v,c,n,l,a,o,u,s),this.width=m,this.height=v}else if(h===t.TextureSourceType.video)f=new eN.VideoTexture(e.video,l,a,o,u,s,c,n);else if(h===t.TextureSourceType.framebuffer){var g=e.data;if(g){var x,b,T=null!=(x=g.width)?x:0,_=null!=(b=g.height)?b:0;f=new eN.FramebufferTexture(T,_,c),this.width=T,this.height=_}}else h===t.TextureSourceType.none&&((f=new eN.DataTexture(new Uint8Array(4).fill(255),1,1)).wrapS=eN.MirroredRepeatWrapping,f.wrapT=eN.MirroredRepeatWrapping,this.width=this.height=1);if(this.source=e,f)return f.flipY=!!r,f;throw Error("Create a texture using an unknown data type.")},i.toThreeJsTextureFilter=function(t){return t===rR.LINEAR?eN.LinearFilter:eN.NearestFilter},i.toThreeJsTextureWrap=function(t){switch(t){case rR.MIRRORED_REPEAT:return eN.MirroredRepeatWrapping;case rR.REPEAT:return eN.RepeatWrapping;default:return eN.ClampToEdgeWrapping}},i}(nt),hP=function(e){function i(t,i){return e.call(this,t,i)}return iN(i,e),i.prototype.prepareRender=function(){var e=this.renderer;this.renderFrame._renderPasses[0].meshes.length=0;for(var i,r=iD(this.rootComposition.items);!(i=r()).done;)for(var n,a=i.value.getComponents(rA),o=iD(a);!(n=o()).done;){var s=n.value;s.isActiveAndEnabled&&s.render(e)}for(var u,h=iD(this.refContent);!(u=h()).done;)for(var l,c=u.value,f=iD(c.getComponent(t.CompositionComponent).items);!(l=f()).done;)for(var d,p=l.value.getComponents(rA),m=iD(p);!(d=m()).done;){var v=d.value;v.isActiveAndEnabled&&v.render(e)}},i}(sF);hP.shape={};var hO=function(t){function e(e){var i;return(i=t.call(this,e)||this).renderingData={currentFrame:{}},i}return iN(e,t),e}(nJ),hN=function(t){function e(e,i){var r;return(r=t.call(this,e.canvas,i)||this).renderer=new hO(a9(r)),r.gpuCapability=new nQ(e),r}return iN(e,t),e.prototype.setOptions=function(t){var e=t.threeCamera,i=t.threeGroup,r=t.composition;this.threeCamera=e,this.threeGroup=i,this.composition=r},e}(hm),hV=function(t){function e(e,i){(r=t.call(this)||this).compositions=[],r.env="",r.baseCompositionIndex=0;var r,n=i.width,a=i.height,o=i.camera;return r.engine=new hN(e),r.assetService=new u4(r.engine),r.width=n,r.height=a,r.camera=o,r}iN(e,t);var i=e.prototype;return i.loadScene=function(t,e){var i=this;return eL(function(){var r,n,a,o,s,u,h,l,c,f,d,p;return ez(this,function(m){switch(m.label){case 0:return ih(i.renderer,"Renderer is not exist, maybe the Player has been disabled or in gl 'debug-disable' mode."),r=performance.now(),n=[],a=[],s=null==(o=null==e?void 0:e.autoplay)||o,u=i.baseCompositionIndex,iv(t)?(h=n).push.apply(h,[].concat(t)):n.push(t),[4,Promise.all(n.map(eL(function(t,r){var n,o,h,l,c,f,d;return ez(this,function(p){switch(p.label){case 0:return o=(n=i.assetService.assembleSceneLoadOptions(t,i2({autoplay:s},e))).source,[4,(l=new u2(h=n.options)).loadScene(o,i.renderer)];case 1:return c=p.sent(),(f=i.engine).clearResources(),iM.loadResources(c,l.options,f),i.assetService.prepareAssets(c,l.getAssets()),i.assetService.updateTextVariables(c,l.options.variables),i.assetService.initializeTexture(c),d=i.createComposition(c,h),i.baseCompositionIndex+=1,d.setIndex(u+r),a[r]=d,[2]}})})))];case 1:for(m.sent(),l=0;l<a.length;l++)s?a[l].play():a[l].pause();for(c=a.map(function(t){return t.name}),f=performance.now()-r,d=iD(a);!(p=d()).done;)p.value.statistic.firstFrameTime=f;return id.info("First frame ["+c+"]: "+f.toFixed(4)+"ms."),[2,iv(t)?a:a[0]]}})})()},i.createComposition=function(t,e){var i=this;void 0===e&&(e={});var r=new hP(i2({},e,{width:this.width,height:this.height,renderer:this.renderer,onItemMessage:function(t){i.dispatchEvent({type:"message",message:t})}}),t);return r.on("end",function(){i.dispatchEvent({type:"end",composition:r})}),this.renderer.engine.setOptions({threeCamera:this.camera,threeGroup:this,composition:r}),this.compositions.push(r),r},i.pause=function(){this.dispatchEvent({type:"pause"}),this.compositions.forEach(function(t){t.pause()})},i.resume=function(){this.dispatchEvent({type:"resume"}),this.compositions.forEach(function(t){t.resume()})},i.update=function(t){this.compositions.forEach(function(e){e.update(t)})},rC(e,[{key:"renderer",get:function(){return this.engine.renderer}},{key:"currentComposition",get:function(){return this.compositions[0]}}]),e}(eN.Group);t.ThreeSpriteComponent=function(t){function e(){return t.apply(this,arguments)}iN(e,t);var i=e.prototype;return i.setVisible=function(t){this.threeMesh.visible=t},i.getVisible=function(){return this.threeMesh.visible},i.dispose=function(){this.isActiveAndEnabled||this.threeMesh.clear(),t.prototype.dispose.call(this)},i.fromData=function(e){t.prototype.fromData.call(this,e),this.threeMesh||(this.geometry.mode===rR.LINES?this.threeMesh=new eN.LineSegments(this.geometry.geometry,this.material.material):this.threeMesh=new eN.Mesh(this.geometry.geometry,this.material.material))},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.threeMesh)},i.render=function(t){this.isActiveAndEnabled&&(this.material.setVector2("_Size",this.transform.size),this.material.setMatrix("effects_ObjectToWorld",this.transform.getWorldMatrix()),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.onDestroy=function(){this.threeMesh.clear()},rC(e,[{key:"priority",get:function(){return this.threeMesh.renderOrder},set:function(t){this.threeMesh&&(this.threeMesh.renderOrder=t)}},{key:"enabled",get:function(){return this.threeMesh.visible},set:function(t){this.threeMesh.visible=t,t&&this.onEnable()}}]),e}(t.SpriteComponent),t.ThreeSpriteComponent=ek([iU(el.SpriteComponent)],t.ThreeSpriteComponent),t.ThreeTextComponent=function(t){function e(e,i){if((r=t.call(this,e,i)||this).isDirty=!0,r.canvas=ue.getCanvas(),ue.saveCanvas(r.canvas),r.context=r.canvas.getContext("2d",{willReadFrequently:!0}),!i)return hw(r);var r,n=i.options;return r.updateWithOptions(n),r.updateTexture(),r}iN(e,t);var i=e.prototype;return i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.options;this.updateWithOptions(i),this.updateTexture(),this.material.setColor("_Color",new e1(1,1,1,1))},i.updateWithOptions=function(t){},i.updateTexture=function(t){},e}(t.ThreeSpriteComponent),t.ThreeTextComponent=ek([iU(el.TextComponent)],t.ThreeTextComponent),iC(t.ThreeTextComponent,[un]),nt.create=function(t,e){return new hR(t,void 0,e)},nt.createWithData=function(t,e,i){return new hR(t,e,i)},nl.create=function(t,e){return new hS(t,e)},ng.create=function(t,e){return new hM(t,e)},nA.create=function(t,e){return new hI(t,e)};var hL="2.8.0-alpha.3";id.info("THREEJS plugin version: "+hL+"."),t.AbstractPlugin=iP,t.ActivationMixerPlayable=ss,t.ActivationPlayable=su,t.AndNode=ro,t.Animatable=i4,t.AnimationClipNode=i3,t.ApplyAdditiveNode=rn,t.Asset=us,t.AssetLoader=uh,t.AssetManager=u2,t.AssetService=u4,t.BYTES_TYPE_MAP=ny,t.Behaviour=rw,t.BezierCurve=az,t.BezierCurvePath=aw,t.BezierCurveQuat=aA,t.BlendNode=ra,t.BoolValueNode=i$,t.CONSTANT_MAP_BLEND=hb,t.CONSTANT_MAP_DEPTH=hE,t.CONSTANT_MAP_STENCIL_FUNC=hT,t.CONSTANT_MAP_STENCIL_OP=h_,t.COPY_FRAGMENT_SHADER="precision mediump float;\nvarying vec2 vTex;\n\n#ifdef DEPTH_TEXTURE\nuniform sampler2D uDepth;\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main(){\n #ifdef DEPTH_TEXTURE\n gl_FragDepthEXT = texture2D(uDepth,vTex).r;\n #endif\n}\n",t.COPY_MESH_SHADER_ID="effects-internal-copy-mesh",t.COPY_VERTEX_SHADER="\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.0))/2.;\n}",t.CalculateLoader=sY,t.Camera=oa,t.CameraVFXItemLoader=aW,t.ColorCurve=aj,t.ColorPlayable=sk,t.ColorPropertyMixerPlayable=sc,t.Component=rS,t.ComponentTimePlayable=sX,t.ComponentTimePlayableAsset=sW,t.ComponentTimeTrack=sU,t.Composition=sF,t.ConstBoolNode=rl,t.ConstFloatNode=rh,t.ConstraintTarget=rU,t.ControlParameterBoolNode=rf,t.ControlParameterFloatNode=rc,t.ControlParameterTriggerNode=rd,t.DEFAULT_FONTS=["serif","sans-serif","monospace","courier"],t.DEFAULT_FPS=60,t.Database=ul,t.Deferred=function(){var t=this;this.promise=new Promise(function(e,i){t.resolve=e,t.reject=i})},t.Downloader=rj,t.DrawObjectPass=nm,t.EFFECTS_COPY_MESH_NAME="effects-internal-copy",t.EVENT_TYPE_CLICK=aY,t.EVENT_TYPE_TOUCH_END=aQ,t.EVENT_TYPE_TOUCH_MOVE=aq,t.EVENT_TYPE_TOUCH_START=aZ,t.EffectComponentTimeTrack=sj,t.EffectsObject=iW,t.EffectsPackage=hd,t.Ellipse=s6,t.Engine=hm,t.EventEmitter=sP,t.EventSystem=aK,t.Float16ArrayWrapper=n2,t.FloatComparisonNode=ry,t.FloatComparisonNodeData=rv,t.FloatPropertyMixerPlayable=sf,t.FloatValueNode=iJ,t.Framebuffer=nc,t.GPUCapability=nQ,t.Geometry=ng,t.GlobalUniforms=nH,t.GradientValue=aE,t.GraphInstance=r_,t.GraphNode=iZ,t.GraphNodeData=iq,t.GraphicsPath=ut,t.HELP_LINK=ak,t.InteractLoader=a$,t.InteractMesh=a1,t.InvalidIndex=-1,t.LayerBlendNode=rp,t.LineSegments=aC,t.LinearValue=a_,t.MaskProcessor=rM,t.MaskableGraphic=n0,t.Material=nl,t.MaterialDataBlock=ns,t.Mesh=nA,t.MeshCollider=a3,t.NodeTransform=re,t.NotNode=ru,t.OrNode=rs,t.PLAYER_OPTIONS_ENV_EDITOR=aD,t.POST_PROCESS_SETTINGS="post_process_settings",t.ParticleBehaviourPlayable=o0,t.ParticleBehaviourPlayableAsset=o1,t.ParticleLoader=sH,t.ParticleMesh=o3,t.ParticleMixerPlayable=sd,t.ParticleSystemRenderer=o6,t.ParticleTrack=sM,t.PassTextureCache=hg,t.PathSegments=aS,t.Playable=a5,t.PlayableAsset=a8,t.PlayableOutput=a6,t.PluginSystem=iM,t.PointerEventData=aX,t.PolyStar=s8,t.Polygon=s4,t.Pose=ri,t.PoseNode=iQ,t.PropertyClipPlayable=sh,t.PropertyTrack=sA,t.RENDER_PREFER_LOOKUP_TEXTURE=oW,t.RUNTIME_ENV="runtime_env",t.RandomSetValue=ax,t.RandomValue=ab,t.RandomVectorValue=aT,t.RaycastResult=aH,t.RenderFrame=nW,t.RenderPass=np,t.RenderPassPriorityNormal=1e3,t.RenderPassPriorityPostprocess=3e3,t.RenderPassPriorityPrepare=0,t.RenderTargetHandle=nf,t.RenderTargetPool=nZ,t.Renderbuffer=nY,t.Renderer=nJ,t.RendererComponent=rA,t.RuntimeClip=sw,t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0="PRE_MAIN_COLOR_0",t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_MAIN_COLOR_SIZE_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_0="PRE_COLOR_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_COLOR_SIZE_0",t.SPRITE_VERTEX_STRIDE=6,t.SceneLoader=hx,t.SemanticMap=n$,t.SerializationHelper=uu,t.ShaderFactory=nB,t.ShaderVariant=nv,t.ShapePath=s7,t.SpriteColorMixerPlayable=sp,t.SpriteComponentTimeTrack=sG,t.SpriteLoader=a4,t.StateMachineNode=rg,t.StateNode=rx,t.StaticValue=ag,t.SubCompositionClipPlayable=sm,t.SubCompositionMixerPlayable=sv,t.TEMPLATE_USE_OFFSCREEN_CANVAS=oX,t.TEXTURE_UNIFORM_MAP=hC,t.TextComponentBase=un,t.TextLayout=ui,t.TextLoader=uo,t.TextStyle=ur,t.Texture=nt,t.TextureFactory=no,t.ThreeComposition=hP,t.ThreeDisplayObject=hV,t.ThreeEngine=hN,t.ThreeMaterial=hS,t.ThreeTexture=hR,t.Ticker=hp,t.TimelineClip=sS,t.TimelineInstance=sR,t.TrackMixerPlayable=so,t.Transform=or,t.TransformMixerPlayable=sy,t.TransformPlayable=sC,t.TransitionNode=rb,t.ValueGetter=ay,t.ValueNode=iK,t.Vector2Curve=aF,t.Vector2PropertyMixerPlayable=sb,t.Vector3Curve=aL,t.Vector3PropertyMixerPlayable=sx,t.Vector4Curve=aV,t.Vector4PropertyMixerPlayable=sg,t.addByOrder=is,t.addItem=eW,t.addItemWithOrder=function(t,e,i,r){if(void 0===r&&(r=!1),!t.includes(e)&&(t.push(e),1!==t.length)){var n=t.length-1;if(n){var a=t[n];if(r)for(;t[n-1][i]<a[i]&&(t[n]=t[n-1],0!=--n););else for(;t[n-1][i]>a[i]&&(t[n]=t[n-1],0!=--n););t[n]=a}}},t.applyMixins=iC,t.assertExist=ih,t.asserts=function(t,e){if(void 0===e&&(e="asserts failed"),!t)throw Error(e)},t.base64ToFile=iE,t.buildLine=sJ,t.calculateTranslation=n5,t.canUseBOM=e9,t.canvasPool=ue,t.closePointEps=1e-4,t.colorGradingFrag=nV,t.colorStopsFromGradient=e4,t.colorToArr=e2,t.combineImageTemplate=u$,t.createGLContext=function(t,e,i){var r;if(void 0===e&&(e="webgl"),"webgl2"!==e||(r=t.getContext("webgl2",i))||console.debug("WebGL2 context retrieval failed, falling back to WebGL context."),r&&"webgl"!==e||(r=t.getContext("webgl",i)),!r)throw Error("This browser does not support WebGL or the WebGL version is incorrect. Please check your WebGL version.");return r},t.createKeyFrameMeta=aP,t.createShape=ob,t.createValueGetter=aG,t.curveEps=1e-4,t.decimalEqual=ai,t.deserializeMipmapTexture=r5,t.earcut=oD,t.effectsClass=iU,t.effectsClassStore=iB,t.enlargeBuffer=eH,t.ensureFixedNumber=uf,t.ensureVec3=n6,t.gaussianDownHFrag=nL,t.gaussianDownVFrag=nF,t.gaussianUpFrag=nD,t.generateEmptyTypedArray=nx,t.generateGUID=i_,t.generateHalfFloatTexture=ne,t.generateTransparentTexture=nn,t.generateWhiteTexture=nr,t.getBackgroundImage=uJ,t.getClass=function(t){return iB[t]},t.getColorFromGradientStops=e3,t.getConfig=function(t){return oH[t]},t.getDefaultTextureFactory=function(){return ex||(ex=new no),ex},t.getGeometryByShape=oz,t.getGeometryTriangles=ok,t.getKeyFrameMetaByRawValue=aR,t.getMergedStore=iG,t.getNodeDataClass=function(t){return iH[t]},t.getParticleMeshShader=function(t,e,i){void 0===i&&(i="");var r,n,a,o=t.content,s=+((null==(r=o.renderer)?void 0:r.renderMode)||0),u=[["RENDER_MODE",s],["ENV_EDITOR",i===aD]],h=e.level,l=e.detail,c=aP(),f=aP(),d=l.maxVertexUniforms>0,p=(null!=(n=o.positionOverLifetime)?n:{}).speedOverLifetime,m=0,v=0;d&&u.push(["ENABLE_VERTEX_TEXTURE",!0]),p&&(u.push(["SPEED_OVER_LIFETIME",!0]),v|=2,aR(c,p));var y=o.textureSheetAnimation;y&&y.animate&&(u.push(["USE_SPRITE",!0]),v|=4);var g=o.colorOverLifetime;g&&g.color&&(u.push(["COLOR_OVER_LIFETIME",!0]),v|=16);var x=g&&g.opacity;x&&aR(c,x);var b=o.positionOverLifetime;if(["x","y","z"].forEach(function(t,e){var i=0,r="linear"+t.toUpperCase(),n="orbital"+t.toUpperCase();(null==b?void 0:b[r])&&(aR(c,b[r]),i=1,v|=1<<7+e),u.push(["LINEAR_VEL_"+t.toUpperCase(),i]);var o=0;(null==b?void 0:b[n])&&(aR(c,b[n]),o=1,v|=1<<10+e,a=!0),u.push(["ORB_VEL_"+t.toUpperCase(),o])}),(null==b?void 0:b.asMovement)&&(u.push(["AS_LINEAR_MOVEMENT",!0]),v|=32),a&&(null==b?void 0:b.asRotation)&&(u.push(["AS_ORBITAL_MOVEMENT",!0]),v|=64),o.sizeOverLifetime){var T=o.sizeOverLifetime;T.separateAxes?(aR(c,T.x),u.push(["SIZE_Y_BY_LIFE",1]),v|=16384,aR(c,T.y)):aR(c,T.size)}if(o.rotationOverLifetime){var _=o.rotationOverLifetime;_.z&&(aR(c,null==_?void 0:_.z),v|=32768,u.push(["ROT_Z_LIFETIME",1])),_.separateAxes&&(_.x&&(aR(c,_.x),v|=65536,u.push(["ROT_X_LIFETIME",1])),_.y&&(aR(c,_.y),v|=131072,u.push(["ROT_Y_LIFETIME",1]))),(null==_?void 0:_.asRotation)&&(u.push(["ROT_LIFETIME_AS_MOVEMENT",1]),v|=262144)}aR(c,null==b?void 0:b.gravityOverLifetime),(null==b?void 0:b.forceTarget)&&(u.push(["FINAL_TARGET",!0]),v|=524288,aR(c,b.forceCurve));var E=l.halfFloatTexture;E&&f.max&&(v|=1048576);var C=l.maxVertexUniforms,S=c.max+c.curves.length-32>C;oH[oW]&&(S=!0),2===h&&(c.max=-1,f.index>0&&(f.max=-1)),S&&E&&d&&(m=1);var w={fragment:nR,vertex:"#define LOOKUP_TEXTURE_CURVE "+m+"\n"+nP,shared:!0,cacheId:["-p:",s,v,c.index,c.max,f.index,f.max].join("+"),macros:u,name:"particle#"+t.name};return u.push(["VERT_CURVE_VALUE_COUNT",c.index],["FRAG_CURVE_VALUE_COUNT",f.index],["VERT_MAX_KEY_FRAME_COUNT",c.max],["FRAG_MAX_KEY_FRAME_COUNT",f.max]),{shader:w,vertex:c.index,fragment:f.index}},t.getPixelRatio=e8,t.getPluginUsageInfo=iR,t.getPreMultiAlpha=rV,t.getStandardComposition=uY,t.getStandardImage=uH,t.getStandardItem=uq,t.getStandardJSON=uW,t.getTextureSize=nX,t.glContext=rR,t.glType2VertexFormatType=function(t){switch(t){case WebGLRenderingContext.FLOAT:return ef.Float32;case WebGLRenderingContext.SHORT:return ef.Int16;case WebGLRenderingContext.BYTE:return ef.Int8;case WebGLRenderingContext.UNSIGNED_SHORT:return ef.UInt16;case WebGLRenderingContext.UNSIGNED_BYTE:return ef.UInt8;default:return ef.Float32}},t.gpuTimer=function(t){var e=t.getExtension("EXT_disjoint_timer_query_webgl2");if(e){var i=t.createQuery(),r=eL(function(){return ez(this,function(n){return[2,new Promise(function(n,a){if(i){var o=t.getQueryParameter(i,t.QUERY_RESULT_AVAILABLE),s=t.getParameter(e.GPU_DISJOINT_EXT);o&&!s&&n(t.getQueryParameter(i,t.QUERY_RESULT)/1e3/1e3),(o||s)&&(t.deleteQuery(i),i=null),null!==o&&i&&window.setTimeout(function(){r().then(n).catch},1)}})]})});if(!i)return;return{begin:function(){i&&t.beginQuery(e.TIME_ELAPSED_EXT,i)},end:function(){t.endQuery(e.TIME_ELAPSED_EXT)},getTime:r}}},t.imageDataFromColor=function(t){im(t)&&(t=e2(t));for(var e=t,i={width:1,height:1,data:new Uint8Array(4)},r=i.data,n=0;n<4;n++)r[n]=e[n];return i},t.imageDataFromGradient=io,t.initErrors=rI,t.initGLContext=rO,t.integrate="float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}",t.interpolateColor=e5,t.isAlipayMiniApp=ir,t.isAndroid=it,t.isArray=iv,t.isCanvas=ib,t.isFunction=iy,t.isIOS=e7,t.isIOSByUA=function(){var t=navigator.userAgent.toLowerCase().match(/cpu (iphone )?os (.*?) like mac os/);return t?parseInt(t[2],10):0},t.isMiniProgram=function(){return ir()||ia()},t.isObject=ig,t.isOpenHarmony=ie,t.isPlainObject=ix,t.isPowerOfTwo=function(t){return(t&t-1)==0&&0!==t},t.isSimulatorCellPhone=ii,t.isString=im,t.isUniformStruct=nu,t.isUniformStructArray=function(t){return t&&void 0!==t.length&&nu(t[0])},t.isValidFontFamily=il,t.isWebGL2=function(t){return"undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name},t.isWechatMiniApp=ia,t.itemFrag=nI,t.itemVert=nM,t.loadAVIFOptional=rZ,t.loadBinary=rJ,t.loadBlob=function(t){return r0.apply(this,arguments)},t.loadImage=rQ,t.loadMedia=r3,t.loadVideo=r1,t.loadWebPOptional=rH,t.logger=id,t.math=nS,t.modifyMaxKeyframeShader=function(t,e,i){var r,n=null==(r=t.cacheId)?void 0:r.split("+");if(n[3]=e,n[5]=i,t.cacheId=n.join("+"),t.macros)for(var a=0;a<t.macros.length;a++){var o=t.macros[a];if("VERT_CURVE_VALUE_COUNT"===o[0])o[1]=e;else if("FRAG_CURVE_VALUE_COUNT"===o[0]){o[1]=i;break}}},t.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},t.nodeDataClass=iY,t.noop=ip,t.normalizeColor=ug,t.numberToFix=ar,t.oldBezierKeyFramesToNew=aB,t.parsePercent=e6,t.particleFrag=nR,t.particleOriginTranslateMap=n7,t.particleUniformTypeMap=o2,t.particleVert=nP,t.passRenderLevel=uK,t.pluginLoaderMap=iS,t.randomInRange=iT,t.registerPlugin=iA,t.removeItem=eX,t.rotateVec2=oB,t.screenMeshVert=nN,t.serialize=function(t,e){return ij(t,e)},t.setBlendMode=rL,t.setConfig=function(t,e){return oH[t]=e},t.setDefaultTextureFactory=function(t){ex=t},t.setMaskMode=rD,t.setRayFromCamera=at,t.setSideMode=rF,t.setUniformValue=function(t,e,i){t[e]?t[e].value=i:t[e]=new eN.Uniform(i)},t.sortByOrder=function(t,e){void 0===e&&(e=2);var i=t.length;if(i<=1||1===e)return t;if(!(i<=30))return function t(e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=e.length-1),r>=n)return e;for(var a,o,s=e[r],u=r,h=n;u<h;){if(2===i){for(;e[h].priority>s.priority&&h>=u;)h--;for(;e[u].priority<=s.priority&&u<h;)u++}else{for(;e[h].priority<s.priority&&h>=u;)h--;for(;e[u].priority>=s.priority&&u<h;)u++}a=[e[h],e[u]],e[u]=a[0],e[h]=a[1]}return o=[e[u],e[r]],e[r]=o[0],e[u]=o[1],t(e,i,r,u-1),t(e,i,h+1,n),e}(t,e);for(var r=1;r<i;r++)iu(t,r,e);return t},t.spec=iL,t.textureLoaderRegistry=na,t.thresholdFrag=nk,t.throwDestroyedError=function(){throw Error("Destroyed item cannot be used again.")},t.trailVert=nO,t.translatePoint=function(t,e){for(var i=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],r=0;r<8;r+=2)i[r]+=t,i[r+1]+=e;return i},t.trianglesFromRect=ae,t.unregisterPlugin=function(t){delete iS[t];var e=iw.findIndex(function(e){return e.name===t});-1!==e&&iw.splice(e,1)},t.valIfUndefined=function(t,e){return null==t?e:t},t.value="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}",t.valueDefine="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n",t.vecFill=n8,t.vecMulCombine=n9,t.version=hL,t.vertexFormatType2GLType=function(t){switch(t){case ef.Float32:return WebGLRenderingContext.FLOAT;case ef.Int16:return WebGLRenderingContext.SHORT;case ef.Int8:return WebGLRenderingContext.BYTE;case ef.UInt16:return WebGLRenderingContext.UNSIGNED_SHORT;case ef.UInt8:return WebGLRenderingContext.UNSIGNED_BYTE;default:return WebGLRenderingContext.FLOAT}},Object.defineProperty(t,"__esModule",{value:!0})});
8
8
  //# sourceMappingURL=index.min.js.map