@vvfx/sdk 0.0.0-alpha.4

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.
@@ -0,0 +1,286 @@
1
+ "use strict";var vvfxSDK=(()=>{var t,e=Object.create,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,a=t=>{throw TypeError(t)},h=(t=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(t,{get:(t,e)=>("undefined"!=typeof require?require:t)[e]}):t)(function(t){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),u=(t,e)=>function(){return e||(0,t[n(t)[0]])((e={exports:{}}).exports,e),e.exports},l=(t,e,s,a)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let h of n(e))o.call(t,h)||h===s||i(t,h,{get:()=>e[h],enumerable:!(a=r(e,h))||a.enumerable});return t},c=(t,r,n)=>(n=null!=t?e(s(t)):{},l(!r&&t&&t.__esModule?n:i(n,"default",{value:t,enumerable:!0}),t)),f=(t,e,r)=>((t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),d=(t,e,i)=>e.has(t)||a("Cannot "+i),p=(t,e,i)=>(d(t,e,"read from private field"),i?i.call(t):e.get(t)),m=(t,e,i)=>e.has(t)?a("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),v=(t,e,i,r)=>(d(t,e,"write to private field"),r?r.call(t,i):e.set(t,i),i),y=u({"node_modules/.pnpm/eventemitter3@3.1.2/node_modules/eventemitter3/index.js"(t,e){var i=Object.prototype.hasOwnProperty,r="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,n,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new s(i,n||t,o),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new n:delete t._events[e]}function h(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),h.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},h.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n<s;n++)o[n]=i[n].fn;return o},h.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},h.prototype.emit=function(t,e,i,n,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,s),!0;case 6:return l.fn.call(l.context,e,i,n,s,o),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var f,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,i);break;case 4:l[u].fn.call(l[u].context,e,i,n);break;default:if(!h)for(f=1,h=new Array(c-1);f<c;f++)h[f-1]=arguments[f];l[u].fn.apply(l[u].context,h)}}return!0},h.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},h.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},h.prototype.removeListener=function(t,e,i,n){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||n&&!o.once||i&&o.context!==i||a(this,s);else{for(var h=0,u=[],l=o.length;h<l;h++)(o[h].fn!==e||n&&!o[h].once||i&&o[h].context!==i)&&u.push(o[h]);u.length?this._events[s]=1===u.length?u[0]:u:a(this,s)}return this},h.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=r,h.EventEmitter=h,void 0!==e&&(e.exports=h)}}),g=u({"node_modules/.pnpm/earcut@2.2.4/node_modules/earcut/src/earcut.js"(t,e){function i(t,e,i){i=i||2;var n,o,a,h,u,f,d,m=e&&e.length,v=m?e[0]*i:t.length,y=r(t,0,v,i,!0),g=[];if(!y||y.next===y.prev)return g;if(m&&(y=function(t,e,i,n){var s,o,a,h=[];for(s=0,o=e.length;s<o;s++)(a=r(t,e[s]*n,s<o-1?e[s+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),h.push(p(a));for(h.sort(l),s=0;s<h.length;s++)i=c(h[s],i);return i}(t,e,y,i)),t.length>80*i){n=a=t[0],o=h=t[1];for(var b=i;b<v;b+=i)(u=t[b])<n&&(n=u),(f=t[b+1])<o&&(o=f),u>a&&(a=u),f>h&&(h=f);d=0!==(d=Math.max(a-n,h-o))?32767/d:0}return s(y,g,i,n,o,d,0),g}function r(t,e,i,r,n){var s,o;if(n===O(t,e,i,r)>0)for(s=e;s<i;s+=r)o=T(s,t[s],t[s+1],o);else for(s=i-r;s>=e;s-=r)o=T(s,t[s],t[s+1],o);return o&&g(o,o.next)&&(S(o),o=o.next),o}function n(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!g(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(S(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,r,l,c,f){if(t){!f&&c&&function(t,e,i,r){var n=t;do{0===n.z&&(n.z=d(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,s,o,a,h,u=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,r=i,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(h=u;a>0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;i=r}s.nextZ=null,u*=2}while(o>1)}(n)}(t,r,l,c);for(var p,m,v=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?a(t,r,l,c):o(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),S(t),t=m.next,v=m.next;else if((t=m)===v){f?1===f?s(t=h(n(t),e,i),e,i,r,l,c,2):2===f&&u(t,e,i,r,l,c):s(n(t),e,i,r,l,c,1);break}}}function o(t){var e=t.prev,i=t,r=t.next;if(y(e,i,r)>=0)return!1;for(var n=e.x,s=i.x,o=r.x,a=e.y,h=i.y,u=r.y,l=n<s?n<o?n:o:s<o?s:o,c=a<h?a<u?a:u:h<u?h:u,f=n>s?n>o?n:o:s>o?s:o,d=a>h?a>u?a:u:h>u?h:u,p=r.next;p!==e;){if(p.x>=l&&p.x<=f&&p.y>=c&&p.y<=d&&m(n,a,s,h,o,u,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function a(t,e,i,r){var n=t.prev,s=t,o=t.next;if(y(n,s,o)>=0)return!1;for(var a=n.x,h=s.x,u=o.x,l=n.y,c=s.y,f=o.y,p=a<h?a<u?a:u:h<u?h:u,v=l<c?l<f?l:f:c<f?c:f,g=a>h?a>u?a:u:h>u?h:u,b=l>c?l>f?l:f:c>f?c:f,x=d(p,v,e,i,r),_=d(g,b,e,i,r),E=t.prevZ,w=t.nextZ;E&&E.z>=x&&w&&w.z<=_;){if(E.x>=p&&E.x<=g&&E.y>=v&&E.y<=b&&E!==n&&E!==o&&m(a,l,h,c,u,f,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;if(E=E.prevZ,w.x>=p&&w.x<=g&&w.y>=v&&w.y<=b&&w!==n&&w!==o&&m(a,l,h,c,u,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;E&&E.z>=x;){if(E.x>=p&&E.x<=g&&E.y>=v&&E.y<=b&&E!==n&&E!==o&&m(a,l,h,c,u,f,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;w&&w.z<=_;){if(w.x>=p&&w.x<=g&&w.y>=v&&w.y<=b&&w!==n&&w!==o&&m(a,l,h,c,u,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function h(t,e,i){var r=t;do{var s=r.prev,o=r.next.next;!g(s,o)&&b(s,r,r.next,o)&&E(s,o)&&E(o,s)&&(e.push(s.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),S(r),S(r.next),r=t=o),r=r.next}while(r!==t);return n(r)}function u(t,e,i,r,o,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&v(h,u)){var l=w(h,u);return h=n(h,h.next),l=n(l,l.next),s(h,e,i,r,o,a,0),void s(l,e,i,r,o,a,0)}u=u.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function c(t,e){var i=function(t,e){var i,r=e,n=t.x,s=t.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o&&(o=a,i=r.x<r.next.x?r:r.next,a===n))return i}r=r.next}while(r!==e);if(!i)return null;var h,u=i,l=i.x,c=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=l&&n!==r.x&&m(s<c?n:o,s,l,c,s<c?o:n,s,r.x,r.y)&&(h=Math.abs(s-r.y)/(n-r.x),E(r,t)&&(h<d||h===d&&(r.x>i.x||r.x===i.x&&f(i,r)))&&(i=r,d=h)),r=r.next}while(r!==u);return i}(t,e);if(!i)return e;var r=w(i,t);return n(r,r.next),n(i,i.next)}function f(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(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}function m(t,e,i,r,n,s,o,a){return(n-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(r-a)>=(i-o)*(e-a)&&(i-o)*(s-a)>=(n-o)*(r-a)}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.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&&b(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||g(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function g(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,i,r){var n=_(y(t,e,i)),s=_(y(t,e,r)),o=_(y(i,r,t)),a=_(y(i,r,e));return n!==s&&o!==a||(!(0!==n||!x(t,i,e))||(!(0!==s||!x(t,r,e))||(!(0!==o||!x(i,t,r))||!(0!==a||!x(i,e,r)))))}function x(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 _(t){return t>0?1:t<0?-1:0}function E(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function w(t,e){var i=new A(t.i,t.x,t.y),r=new A(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function T(t,e,i,r){var n=new A(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 S(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 A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(t,e,i,r){for(var n=0,s=e,o=i-r;s<i;s+=r)n+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return n}e.exports=i,e.exports.default=i,i.deviation=function(t,e,i,r){var n=e&&e.length,s=n?e[0]*i:t.length,o=Math.abs(O(t,0,s,i));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*i,l=a<h-1?e[a+1]*i:t.length;o-=Math.abs(O(t,u,l,i))}var c=0;for(a=0;a<r.length;a+=3){var f=r[a]*i,d=r[a+1]*i,p=r[a+2]*i;c+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},i.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,n=0;n<t.length;n++){for(var s=0;s<t[n].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[n][s][o]);n>0&&(r+=t[n-1].length,i.holes.push(r))}return i}}}),b=u({"node_modules/.pnpm/punycode@1.4.1/node_modules/punycode/punycode.js"(t,e){!function(i){var r="object"==typeof t&&t&&!t.nodeType&&t,n="object"==typeof e&&e&&!e.nodeType&&e,s="object"==typeof global&&global;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var o,a,h=2147483647,u=36,l=/^xn--/,c=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(t){throw new RangeError(d[t])}function y(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function g(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+y((t=t.replace(f,".")).split("."),e).join(".")}function b(t){for(var e,i,r=[],n=0,s=t.length;n<s;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<s?56320==(64512&(i=t.charCodeAt(n++)))?r.push(((1023&e)<<10)+(1023&i)+65536):(r.push(e),n--):r.push(e);return r}function x(t){return y(t,function(t){var e="";return t>65535&&(e+=m((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=m(t)}).join("")}function _(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u}function E(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var r=0;for(t=i?p(t/700):t>>1,t+=p(t/e);t>455;r+=u)t=p(t/35);return p(r+36*t/(t+38))}function T(t){var e,i,r,n,s,o,a,l,c,f,d=[],m=t.length,y=0,g=128,b=72;for((i=t.lastIndexOf("-"))<0&&(i=0),r=0;r<i;++r)t.charCodeAt(r)>=128&&v("not-basic"),d.push(t.charCodeAt(r));for(n=i>0?i+1:0;n<m;){for(s=y,o=1,a=u;n>=m&&v("invalid-input"),((l=_(t.charCodeAt(n++)))>=u||l>p((h-y)/o))&&v("overflow"),y+=l*o,!(l<(c=a<=b?1:a>=b+26?26:a-b));a+=u)o>p(h/(f=u-c))&&v("overflow"),o*=f;b=w(y-s,e=d.length+1,0==s),p(y/e)>h-g&&v("overflow"),g+=p(y/e),y%=e,d.splice(y++,0,g)}return x(d)}function S(t){var e,i,r,n,s,o,a,l,c,f,d,y,g,x,_,T=[];for(y=(t=b(t)).length,e=128,i=0,s=72,o=0;o<y;++o)(d=t[o])<128&&T.push(m(d));for(r=n=T.length,n&&T.push("-");r<y;){for(a=h,o=0;o<y;++o)(d=t[o])>=e&&d<a&&(a=d);for(a-e>p((h-i)/(g=r+1))&&v("overflow"),i+=(a-e)*g,e=a,o=0;o<y;++o)if((d=t[o])<e&&++i>h&&v("overflow"),d==e){for(l=i,c=u;!(l<(f=c<=s?1:c>=s+26?26:c-s));c+=u)_=l-f,x=u-f,T.push(m(E(f+_%x,0))),l=p(_/x);T.push(m(E(l,0))),s=w(i,g,r==n),i=0,++r}++i,++e}return T.join("")}if(o={version:"1.4.1",ucs2:{decode:b,encode:x},decode:T,encode:S,toASCII:function(t){return g(t,function(t){return c.test(t)?"xn--"+S(t):t})},toUnicode:function(t){return g(t,function(t){return l.test(t)?T(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return o});else if(r&&n)if(e.exports==r)n.exports=o;else for(a in o)o.hasOwnProperty(a)&&(r[a]=o[a]);else i.punycode=o}(t)}}),x=u({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(t,e){e.exports=TypeError}}),_=u({"(disabled):node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect"(){}}),E=u({"node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js"(t,e){var i="function"==typeof Map&&Map.prototype,r=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=i&&r&&"function"==typeof r.get?r.get:null,s=i&&Map.prototype.forEach,o="function"==typeof Set&&Set.prototype,a=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,h=o&&a&&"function"==typeof a.get?a.get:null,u=o&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,c="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,p=Object.prototype.toString,m=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,g=String.prototype.replace,b=String.prototype.toUpperCase,x=String.prototype.toLowerCase,E=RegExp.prototype.test,w=Array.prototype.concat,T=Array.prototype.join,S=Array.prototype.slice,A=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,R="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===R||"symbol")?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,D=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function F(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||E.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var r=t<0?-A(-t):A(t);if(r!==t){var n=String(r),s=y.call(e,n.length+1);return g.call(n,i,"$&_")+"."+g.call(g.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(e,i,"$&_")}var L=_(),k=L.custom,N=X(k)?k:null,B={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function z(t,e,i){var r=i.quoteStyle||e,n=B[r];return n+t+n}function V(t){return g.call(String(t),/"/g,"&quot;")}function G(t){return!P||!("object"==typeof t&&(P in t||void 0!==t[P]))}function j(t){return"[object Array]"===q(t)&&G(t)}function H(t){return"[object RegExp]"===q(t)&&G(t)}function X(t){if(R)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!I)return!1;try{return I.call(t),!0}catch(t){}return!1}e.exports=function t(e,i,r,o){var a=i||{};if(Y(a,"quoteStyle")&&!Y(B,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Y(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=!Y(a,"customInspect")||a.customInspect;if("boolean"!=typeof p&&"symbol"!==p)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Y(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Y(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=a.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return K(e,a);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var _=String(e);return b?F(e,_):_}if("bigint"==typeof e){var E=String(e)+"n";return b?F(e,E):E}var A=void 0===a.depth?5:a.depth;if(void 0===r&&(r=0),r>=A&&A>0&&"object"==typeof e)return j(e)?"[Array]":"[Object]";var C=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=T.call(Array(t.indent+1)," ")}return{base:i,prev:T.call(Array(e+1),i)}}(a,r);if(void 0===o)o=[];else if(Z(o,e)>=0)return"[Circular]";function k(e,i,n){if(i&&(o=S.call(o)).push(i),n){var s={depth:a.depth};return Y(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),t(e,s,r+1,o)}return t(e,a,r+1,o)}if("function"==typeof e&&!H(e)){var U=function(t){if(t.name)return t.name;var e=v.call(m.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),W=it(e,k);return"[Function"+(U?": "+U:" (anonymous)")+"]"+(W.length>0?" { "+T.call(W,", ")+" }":"")}if(X(e)){var Q=R?g.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(e);return"object"!=typeof e||R?Q:J(Q)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var rt="<"+x.call(String(e.nodeName)),nt=e.attributes||[],st=0;st<nt.length;st++)rt+=" "+nt[st].name+"="+z(V(nt[st].value),"double",a);return rt+=">",e.childNodes&&e.childNodes.length&&(rt+="..."),rt+="</"+x.call(String(e.nodeName))+">"}if(j(e)){if(0===e.length)return"[]";var ot=it(e,k);return C&&!function(t){for(var e=0;e<t.length;e++)if(Z(t[e],"\n")>=0)return!1;return!0}(ot)?"["+et(ot,C)+"]":"[ "+T.call(ot,", ")+" ]"}if(function(t){return"[object Error]"===q(t)&&G(t)}(e)){var at=it(e,k);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+T.call(at,", ")+" }":"{ ["+String(e)+"] "+T.call(w.call("[cause]: "+k(e.cause),at),", ")+" }"}if("object"==typeof e&&p){if(N&&"function"==typeof e[N]&&L)return L(e,{depth:A-r});if("symbol"!==p&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!n||!t||"object"!=typeof t)return!1;try{n.call(t);try{h.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ht=[];return s&&s.call(e,function(t,i){ht.push(k(i,e,!0)+" => "+k(t,e))}),tt("Map",n.call(e),ht,C)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t);try{n.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return u&&u.call(e,function(t){ut.push(k(t,e))}),tt("Set",h.call(e),ut,C)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t,l);try{c.call(t,c)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return $("WeakMap");if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t,c);try{l.call(t,l)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return $("WeakSet");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{return f.call(t),!0}catch(t){}return!1}(e))return $("WeakRef");if(function(t){return"[object Number]"===q(t)&&G(t)}(e))return J(k(Number(e)));if(function(t){if(!t||"object"!=typeof t||!O)return!1;try{return O.call(t),!0}catch(t){}return!1}(e))return J(k(O.call(e)));if(function(t){return"[object Boolean]"===q(t)&&G(t)}(e))return J(d.call(e));if(function(t){return"[object String]"===q(t)&&G(t)}(e))return J(k(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||"undefined"!=typeof global&&e===global)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===q(t)&&G(t)}(e)&&!H(e)){var lt=it(e,k),ct=D?D(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",dt=!ct&&P&&Object(e)===e&&P in e?y.call(q(e),8,-1):ft?"Object":"",pt=(ct||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(dt||ft?"["+T.call(w.call([],dt||[],ft||[]),": ")+"] ":"");return 0===lt.length?pt+"{}":C?pt+"{"+et(lt,C)+"}":pt+"{ "+T.call(lt,", ")+" }"}return String(e)};var W=Object.prototype.hasOwnProperty||function(t){return t in this};function Y(t,e){return W.call(t,e)}function q(t){return p.call(t)}function Z(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}function K(t,e){if(t.length>e.maxStringLength){var i=t.length-e.maxStringLength,r="... "+i+" more character"+(i>1?"s":"");return K(y.call(t,0,e.maxStringLength),e)+r}var n=U[e.quoteStyle||"single"];return n.lastIndex=0,z(g.call(g.call(t,n,"\\$1"),/[\x00-\x1f]/g,Q),"single",e)}function Q(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+b.call(e.toString(16))}function J(t){return"Object("+t+")"}function $(t){return t+" { ? }"}function tt(t,e,i,r){return t+" ("+e+") {"+(r?et(i,r):T.call(i,", "))+"}"}function et(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+T.call(t,","+i)+"\n"+e.prev}function it(t,e){var i=j(t),r=[];if(i){r.length=t.length;for(var n=0;n<t.length;n++)r[n]=Y(t,n)?e(t[n],t):""}var s,o="function"==typeof C?C(t):[];if(R){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var h in t)Y(t,h)&&(i&&String(Number(h))===h&&h<t.length||R&&s["$"+h]instanceof Symbol||(E.call(/[^\w$]/,h)?r.push(e(h,t)+": "+e(t[h],t)):r.push(h+": "+e(t[h],t))));if("function"==typeof C)for(var u=0;u<o.length;u++)M.call(t,o[u])&&r.push("["+e(o[u])+"]: "+e(t[o[u]],t));return r}}}),w=u({"node_modules/.pnpm/side-channel-list@1.0.0/node_modules/side-channel-list/index.js"(t,e){var i=E(),r=x(),n=function(t,e,i){for(var r,n=t;null!=(r=n.next);n=r)if(r.key===e)return n.next=r.next,i||(r.next=t.next,t.next=r),r};e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new r("Side channel does not contain "+i(t))},delete:function(e){var i=t&&t.next,r=function(t,e){if(t)return n(t,e,!0)}(t,e);return r&&i&&i===r&&(t=void 0),!!r},get:function(e){return function(t,e){if(t){var i=n(t,e);return i&&i.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!n(t,e)}(t,e)},set:function(e,i){t||(t={next:void 0}),function(t,e,i){var r=n(t,e);r?r.value=i:t.next={key:e,next:t.next,value:i}}(t,e,i)}};return e}}}),T=u({"node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(t,e){e.exports=Object}}),S=u({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(t,e){e.exports=Error}}),A=u({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(t,e){e.exports=EvalError}}),O=u({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(t,e){e.exports=RangeError}}),C=u({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(t,e){e.exports=ReferenceError}}),I=u({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(t,e){e.exports=SyntaxError}}),R=u({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(t,e){e.exports=URIError}}),P=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(t,e){e.exports=Math.abs}}),M=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(t,e){e.exports=Math.floor}}),D=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(t,e){e.exports=Math.max}}),F=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(t,e){e.exports=Math.min}}),L=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(t,e){e.exports=Math.pow}}),k=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(t,e){e.exports=Math.round}}),N=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(t,e){e.exports=Number.isNaN||function(t){return t!=t}}}),B=u({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(t,e){var i=N();e.exports=function(t){return i(t)||0===t?t:t<0?-1:1}}}),U=u({"node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(t,e){e.exports=Object.getOwnPropertyDescriptor}}),z=u({"node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(t,e){var i=U();if(i)try{i([],"length")}catch(t){i=null}e.exports=i}}),V=u({"node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(t,e){var i=Object.defineProperty||!1;if(i)try{i({},"a",{value:1})}catch(t){i=!1}e.exports=i}}),G=u({"node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(t,e){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var r in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(t,e);if(42!==s.value||!0!==s.enumerable)return!1}return!0}}}),j=u({"node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(t,e){var i="undefined"!=typeof Symbol&&Symbol,r=G();e.exports=function(){return"function"==typeof i&&("function"==typeof Symbol&&("symbol"==typeof i("foo")&&("symbol"==typeof Symbol("bar")&&r())))}}}),H=u({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(t,e){e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null}}),X=u({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(t,e){var i=T();e.exports=i.getPrototypeOf||null}}),W=u({"node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(t,e){var i=Object.prototype.toString,r=Math.max,n=function(t,e){for(var i=[],r=0;r<t.length;r+=1)i[r]=t[r];for(var n=0;n<e.length;n+=1)i[n+t.length]=e[n];return i};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var s,o=function(t,e){for(var i=[],r=e||0,n=0;r<t.length;r+=1,n+=1)i[n]=t[r];return i}(arguments,1),a=r(0,e.length-o.length),h=[],u=0;u<a;u++)h[u]="$"+u;if(s=Function("binder","return function ("+function(t,e){for(var i="",r=0;r<t.length;r+=1)i+=t[r],r+1<t.length&&(i+=e);return i}(h,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof s){var i=e.apply(this,n(o,arguments));return Object(i)===i?i:this}return e.apply(t,n(o,arguments))}),e.prototype){var l=function(){};l.prototype=e.prototype,s.prototype=new l,l.prototype=null}return s}}}),Y=u({"node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(t,e){var i=W();e.exports=Function.prototype.bind||i}}),q=u({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(t,e){e.exports=Function.prototype.call}}),Z=u({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(t,e){e.exports=Function.prototype.apply}}),K=u({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(t,e){e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply}}),Q=u({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(t,e){var i=Y(),r=Z(),n=q(),s=K();e.exports=s||i.call(n,r)}}),J=u({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(t,e){var i=Y(),r=x(),n=q(),s=Q();e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new r("a function is required");return s(i,n,t)}}}),$=u({"node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(t,e){var i,r=J(),n=z();try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var s=!!i&&n&&n(Object.prototype,"__proto__"),o=Object,a=o.getPrototypeOf;e.exports=s&&"function"==typeof s.get?r([s.get]):"function"==typeof a&&function(t){return a(null==t?t:o(t))}}}),tt=u({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(t,e){var i=H(),r=X(),n=$();e.exports=i?function(t){return i(t)}:r?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return r(t)}:n?function(t){return n(t)}:null}}),et=u({"node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(t,e){var i=Function.prototype.call,r=Object.prototype.hasOwnProperty,n=Y();e.exports=n.call(i,r)}}),it=u({"node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(t,e){var i,r,n=T(),s=S(),o=A(),a=O(),h=C(),u=I(),l=x(),c=R(),f=P(),d=M(),p=D(),m=F(),v=L(),y=k(),g=B(),b=Function,_=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(t){}},E=z(),w=V(),N=function(){throw new l},U=E?function(){try{return N}catch(t){try{return E(arguments,"callee").get}catch(t){return N}}}():N,G=j()(),W=tt(),K=X(),Q=H(),J=Z(),$=q(),it={},rt="undefined"!=typeof Uint8Array&&W?W(Uint8Array):i,nt={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":G&&W?W([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":it,"%AsyncGenerator%":it,"%AsyncGeneratorFunction%":it,"%AsyncIteratorPrototype%":it,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":it,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":G&&W?W(W([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&G&&W?W((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":a,"%ReferenceError%":h,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&G&&W?W((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":G&&W?W(""[Symbol.iterator]()):i,"%Symbol%":G?Symbol:i,"%SyntaxError%":u,"%ThrowTypeError%":U,"%TypedArray%":rt,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":$,"%Function.prototype.apply%":J,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":K,"%Math.abs%":f,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":v,"%Math.round%":y,"%Math.sign%":g,"%Reflect.getPrototypeOf%":Q};if(W)try{null.error}catch(t){r=W(W(t)),nt["%Error.prototype%"]=r}var st=function t(e){var i;if("%AsyncFunction%"===e)i=_("async function () {}");else if("%GeneratorFunction%"===e)i=_("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=_("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(i=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&W&&(i=W(n.prototype))}return nt[e]=i,i},ot={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},at=Y(),ht=et(),ut=at.call($,Array.prototype.concat),lt=at.call(J,Array.prototype.splice),ct=at.call($,String.prototype.replace),ft=at.call($,String.prototype.slice),dt=at.call($,RegExp.prototype.exec),pt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,mt=/\\(\\)?/g,vt=function(t,e){var i,r=t;if(ht(ot,r)&&(r="%"+(i=ot[r])[0]+"%"),ht(nt,r)){var n=nt[r];if(n===it&&(n=st(r)),void 0===n&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:n}}throw new u("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===dt(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=ft(t,0,1),i=ft(t,-1);if("%"===e&&"%"!==i)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var r=[];return ct(t,pt,function(t,e,i,n){r[r.length]=i?ct(n,mt,"$1"):e||t}),r}(t),r=i.length>0?i[0]:"",n=vt("%"+r+"%",e),s=n.name,o=n.value,a=!1,h=n.alias;h&&(r=h[0],lt(i,ut([0,1],h)));for(var c=1,f=!0;c<i.length;c+=1){var d=i[c],p=ft(d,0,1),m=ft(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===m||"'"===m||"`"===m)&&p!==m)throw new u("property names with quotes must have matching quotes");if("constructor"!==d&&f||(a=!0),ht(nt,s="%"+(r+="."+d)+"%"))o=nt[s];else if(null!=o){if(!(d in o)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(E&&c+1>=i.length){var v=E(o,d);o=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:o[d]}else f=ht(o,d),o=o[d];f&&!a&&(nt[s]=o)}}return o}}}),rt=u({"node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(t,e){var i=it(),r=J(),n=r([i("%String.prototype.indexOf%")]);e.exports=function(t,e){var s=i(t,!!e);return"function"==typeof s&&n(t,".prototype.")>-1?r([s]):s}}}),nt=u({"node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js"(t,e){var i=it(),r=rt(),n=E(),s=x(),o=i("%Map%",!0),a=r("Map.prototype.get",!0),h=r("Map.prototype.set",!0),u=r("Map.prototype.has",!0),l=r("Map.prototype.delete",!0),c=r("Map.prototype.size",!0);e.exports=!!o&&function(){var t,e={assert:function(t){if(!e.has(t))throw new s("Side channel does not contain "+n(t))},delete:function(e){if(t){var i=l(t,e);return 0===c(t)&&(t=void 0),i}return!1},get:function(e){if(t)return a(t,e)},has:function(e){return!!t&&u(t,e)},set:function(e,i){t||(t=new o),h(t,e,i)}};return e}}}),st=u({"node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js"(t,e){var i=it(),r=rt(),n=E(),s=nt(),o=x(),a=i("%WeakMap%",!0),h=r("WeakMap.prototype.get",!0),u=r("WeakMap.prototype.set",!0),l=r("WeakMap.prototype.has",!0),c=r("WeakMap.prototype.delete",!0);e.exports=a?function(){var t,e,i={assert:function(t){if(!i.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(i){if(a&&i&&("object"==typeof i||"function"==typeof i)){if(t)return c(t,i)}else if(s&&e)return e.delete(i);return!1},get:function(i){return a&&i&&("object"==typeof i||"function"==typeof i)&&t?h(t,i):e&&e.get(i)},has:function(i){return a&&i&&("object"==typeof i||"function"==typeof i)&&t?l(t,i):!!e&&e.has(i)},set:function(i,r){a&&i&&("object"==typeof i||"function"==typeof i)?(t||(t=new a),u(t,i,r)):s&&(e||(e=s()),e.set(i,r))}};return i}:s}}),ot=u({"node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js"(t,e){var i=x(),r=E(),n=w(),s=nt(),o=st()||s||n;e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new i("Side channel does not contain "+r(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,i){t||(t=o()),t.set(e,i)}};return e}}}),at=u({"node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/formats.js"(t,e){var i=String.prototype.replace,r=/%20/g,n="RFC1738",s="RFC3986";e.exports={default:s,formatters:{RFC1738:function(t){return i.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:n,RFC3986:s}}}),ht=u({"node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/utils.js"(t,e){var i=at(),r=Object.prototype.hasOwnProperty,n=Array.isArray,s=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),o=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},r=0;r<t.length;++r)void 0!==t[r]&&(i[r]=t[r]);return i},a=1024;e.exports={arrayToObject:o,assign:function(t,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],r=0;r<e.length;++r)for(var s=e[r],o=s.obj[s.prop],a=Object.keys(o),h=0;h<a.length;++h){var u=a[h],l=o[u];"object"==typeof l&&null!==l&&-1===i.indexOf(l)&&(e.push({obj:o,prop:u}),i.push(l))}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(n(i)){for(var r=[],s=0;s<i.length;++s)void 0!==i[s]&&r.push(i[s]);e.obj[e.prop]=r}}}(e),t},decode:function(t,e,i){var r=t.replace(/\+/g," ");if("iso-8859-1"===i)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(t){return r}},encode:function(t,e,r,n,o){if(0===t.length)return t;var h=t;if("symbol"==typeof t?h=Symbol.prototype.toString.call(t):"string"!=typeof t&&(h=String(t)),"iso-8859-1"===r)return escape(h).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var u="",l=0;l<h.length;l+=a){for(var c=h.length>=a?h.slice(l,l+a):h,f=[],d=0;d<c.length;++d){var p=c.charCodeAt(d);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||o===i.RFC1738&&(40===p||41===p)?f[f.length]=c.charAt(d):p<128?f[f.length]=s[p]:p<2048?f[f.length]=s[192|p>>6]+s[128|63&p]:p<55296||p>=57344?f[f.length]=s[224|p>>12]+s[128|p>>6&63]+s[128|63&p]:(d+=1,p=65536+((1023&p)<<10|1023&c.charCodeAt(d)),f[f.length]=s[240|p>>18]+s[128|p>>12&63]+s[128|p>>6&63]+s[128|63&p])}u+=f.join("")}return u},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(n(t)){for(var i=[],r=0;r<t.length;r+=1)i.push(e(t[r]));return i}return e(t)},merge:function t(e,i,s){if(!i)return e;if("object"!=typeof i&&"function"!=typeof i){if(n(e))e.push(i);else{if(!e||"object"!=typeof e)return[e,i];(s&&(s.plainObjects||s.allowPrototypes)||!r.call(Object.prototype,i))&&(e[i]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(i);var a=e;return n(e)&&!n(i)&&(a=o(e,s)),n(e)&&n(i)?(i.forEach(function(i,n){if(r.call(e,n)){var o=e[n];o&&"object"==typeof o&&i&&"object"==typeof i?e[n]=t(o,i,s):e.push(i)}else e[n]=i}),e):Object.keys(i).reduce(function(e,n){var o=i[n];return r.call(e,n)?e[n]=t(e[n],o,s):e[n]=o,e},a)}}}}),ut=u({"node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/stringify.js"(t,e){var i=ot(),r=ht(),n=at(),s=Object.prototype.hasOwnProperty,o={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},a=Array.isArray,h=Array.prototype.push,u=function(t,e){h.apply(t,a(e)?e:[e])},l=Date.prototype.toISOString,c=n.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:c,formatter:n.formatters[c],indices:!1,serializeDate:function(t){return l.call(t)},skipNulls:!1,strictNullHandling:!1},d={},p=function t(e,n,s,o,h,l,c,p,m,v,y,g,b,x,_,E,w,T){for(var S,A=e,O=T,C=0,I=!1;void 0!==(O=O.get(d))&&!I;){var R=O.get(e);if(C+=1,void 0!==R){if(R===C)throw new RangeError("Cyclic object value");I=!0}void 0===O.get(d)&&(C=0)}if("function"==typeof v?A=v(n,A):A instanceof Date?A=b(A):"comma"===s&&a(A)&&(A=r.maybeMap(A,function(t){return t instanceof Date?b(t):t})),null===A){if(l)return m&&!E?m(n,f.encoder,w,"key",x):n;A=""}if("string"==typeof(S=A)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||r.isBuffer(A))return m?[_(E?n:m(n,f.encoder,w,"key",x))+"="+_(m(A,f.encoder,w,"value",x))]:[_(n)+"="+_(String(A))];var P,M=[];if(void 0===A)return M;if("comma"===s&&a(A))E&&m&&(A=r.maybeMap(A,m)),P=[{value:A.length>0?A.join(",")||null:void 0}];else if(a(v))P=v;else{var D=Object.keys(A);P=y?D.sort(y):D}var F=p?String(n).replace(/\./g,"%2E"):String(n),L=o&&a(A)&&1===A.length?F+"[]":F;if(h&&a(A)&&0===A.length)return L+"[]";for(var k=0;k<P.length;++k){var N=P[k],B="object"==typeof N&&N&&void 0!==N.value?N.value:A[N];if(!c||null!==B){var U=g&&p?String(N).replace(/\./g,"%2E"):String(N),z=a(A)?"function"==typeof s?s(L,U):L:L+(g?"."+U:"["+U+"]");T.set(e,C);var V=i();V.set(d,T),u(M,t(B,z,s,o,h,l,c,p,"comma"===s&&E&&a(A)?null:m,v,y,g,b,x,_,E,w,V))}}return M};e.exports=function(t,e){var r,h=t,l=function(t){if(!t)return f;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||f.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=n.default;if(void 0!==t.format){if(!s.call(n.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var r,h=n.formatters[i],u=f.filter;if(("function"==typeof t.filter||a(t.filter))&&(u=t.filter),r=t.arrayFormat in o?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":f.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=void 0===t.allowDots?!0===t.encodeDotInKeys||f.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:f.addQueryPrefix,allowDots:l,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:r,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?f.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:f.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:f.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:f.encodeValuesOnly,filter:u,format:i,formatter:h,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:f.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:f.strictNullHandling}}(e);"function"==typeof l.filter?h=(0,l.filter)("",h):a(l.filter)&&(r=l.filter);var c=[];if("object"!=typeof h||null===h)return"";var d=o[l.arrayFormat],m="comma"===d&&l.commaRoundTrip;r||(r=Object.keys(h)),l.sort&&r.sort(l.sort);for(var v=i(),y=0;y<r.length;++y){var g=r[y],b=h[g];l.skipNulls&&null===b||u(c,p(b,g,d,m,l.allowEmptyArrays,l.strictNullHandling,l.skipNulls,l.encodeDotInKeys,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,v))}var x=c.join(l.delimiter),_=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),x.length>0?_+x:""}}}),lt=u({"node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/parse.js"(t,e){var i=ht(),r=Object.prototype.hasOwnProperty,n=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},a=function(t,e,i){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&i>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},h=function(t,e,n,s){if(t){var o=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,h=/(\[[^[\]]*])/g,u=n.depth>0&&/(\[[^[\]]*])/.exec(o),l=u?o.slice(0,u.index):o,c=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;c.push(l)}for(var f=0;n.depth>0&&null!==(u=h.exec(o))&&f<n.depth;){if(f+=1,!n.plainObjects&&r.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(u[1])}if(u){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");c.push("["+o.slice(u.index)+"]")}return function(t,e,r,n){var s=0;if(t.length>0&&"[]"===t[t.length-1]){var o=t.slice(0,-1).join("");s=Array.isArray(e)&&e[o]?e[o].length:0}for(var h=n?e:a(e,r,s),u=t.length-1;u>=0;--u){var l,c=t[u];if("[]"===c&&r.parseArrays)l=r.allowEmptyArrays&&(""===h||r.strictNullHandling&&null===h)?[]:i.combine([],h);else{l=r.plainObjects?{__proto__:null}:{};var f="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,d=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,p=parseInt(d,10);r.parseArrays||""!==d?!isNaN(p)&&c!==d&&String(p)===d&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(l=[])[p]=h:"__proto__"!==d&&(l[d]=h):l={0:h}}h=l}return h}(c,e,n,s)}};e.exports=function(t,e){var u=function(t){if(!t)return s;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?s.charset:t.charset,r=void 0===t.duplicates?s.duplicates:t.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||s.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:s.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:s.decoder,delimiter:"string"==typeof t.delimiter||i.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:s.depth,duplicates:r,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:s.strictDepth,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return u.plainObjects?{__proto__:null}:{};for(var l="string"==typeof t?function(t,e){var h={__proto__:null},u=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;u=u.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var l=e.parameterLimit===1/0?void 0:e.parameterLimit,c=u.split(e.delimiter,e.throwOnLimitExceeded?l+1:l);if(e.throwOnLimitExceeded&&c.length>l)throw new RangeError("Parameter limit exceeded. Only "+l+" parameter"+(1===l?"":"s")+" allowed.");var f,d=-1,p=e.charset;if(e.charsetSentinel)for(f=0;f<c.length;++f)0===c[f].indexOf("utf8=")&&("utf8=%E2%9C%93"===c[f]?p="utf-8":"utf8=%26%2310003%3B"===c[f]&&(p="iso-8859-1"),d=f,f=c.length);for(f=0;f<c.length;++f)if(f!==d){var m,v,y=c[f],g=y.indexOf("]="),b=-1===g?y.indexOf("="):g+1;-1===b?(m=e.decoder(y,s.decoder,p,"key"),v=e.strictNullHandling?null:""):(m=e.decoder(y.slice(0,b),s.decoder,p,"key"),v=i.maybeMap(a(y.slice(b+1),e,n(h[m])?h[m].length:0),function(t){return e.decoder(t,s.decoder,p,"value")})),v&&e.interpretNumericEntities&&"iso-8859-1"===p&&(v=o(String(v))),y.indexOf("[]=")>-1&&(v=n(v)?[v]:v);var x=r.call(h,m);x&&"combine"===e.duplicates?h[m]=i.combine(h[m],v):x&&"last"!==e.duplicates||(h[m]=v)}return h}(t,u):t,c=u.plainObjects?{__proto__:null}:{},f=Object.keys(l),d=0;d<f.length;++d){var p=f[d],m=h(p,l[p],u,"string"==typeof t);c=i.merge(c,m,u)}return!0===u.allowSparse?c:i.compact(c)}}}),ct=u({"node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/index.js"(t,e){var i=ut(),r=lt(),n=at();e.exports={formats:n,parse:r,stringify:i}}}),ft=u({"node_modules/.pnpm/url@0.11.4/node_modules/url/url.js"(t){var e=b();function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),a=["'"].concat(o),h=["%","/","?",";","#"].concat(a),u=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,c=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=ct();function v(t,e,r){if(t&&"object"==typeof t&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}i.prototype.parse=function(t,i,n){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),v=-1!==o&&o<t.indexOf("#")?"?":"#",y=t.split(v);y[0]=y[0].replace(/\\/g,"/");var g=t=y.join(v);if(g=g.trim(),!n&&1===t.split("#").length){var b=s.exec(g);if(b)return this.path=g,this.href=g,this.pathname=b[1],b[2]?(this.search=b[2],this.query=i?m.parse(this.search.substr(1)):this.search.substr(1)):i&&(this.search="",this.query={}),this}var x=r.exec(g);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,g=g.substr(x.length)}if(n||x||g.match(/^\/\/[^@/]+@[^@/]+/)){var E="//"===g.substr(0,2);!E||x&&d[x]||(g=g.substr(2),this.slashes=!0)}if(!d[x]&&(E||x&&!p[x])){for(var w,T,S=-1,A=0;A<u.length;A++){-1!==(O=g.indexOf(u[A]))&&(-1===S||O<S)&&(S=O)}-1!==(T=-1===S?g.lastIndexOf("@"):g.lastIndexOf("@",S))&&(w=g.slice(0,T),g=g.slice(T+1),this.auth=decodeURIComponent(w)),S=-1;for(A=0;A<h.length;A++){var O;-1!==(O=g.indexOf(h[A]))&&(-1===S||O<S)&&(S=O)}-1===S&&(S=g.length),this.host=g.slice(0,S),g=g.slice(S),this.parseHost(),this.hostname=this.hostname||"";var C="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!C)for(var I=this.hostname.split(/\./),R=(A=0,I.length);A<R;A++){var P=I[A];if(P&&!P.match(l)){for(var M="",D=0,F=P.length;D<F;D++)P.charCodeAt(D)>127?M+="x":M+=P[D];if(!M.match(l)){var L=I.slice(0,A),k=I.slice(A+1),N=P.match(c);N&&(L.push(N[1]),k.unshift(N[2])),k.length&&(g="/"+k.join(".")+g),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=e.toASCII(this.hostname));var B=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+B,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!f[_])for(A=0,R=a.length;A<R;A++){var z=a[A];if(-1!==g.indexOf(z)){var V=encodeURIComponent(z);V===z&&(V=escape(z)),g=g.split(z).join(V)}}var G=g.indexOf("#");-1!==G&&(this.hash=g.substr(G),g=g.slice(0,G));var j=g.indexOf("?");if(-1!==j?(this.search=g.substr(j),this.query=g.substr(j+1),i&&(this.query=m.parse(this.query)),g=g.slice(0,j)):i&&(this.search="",this.query={}),g&&(this.pathname=g),p[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var H=this.search||"";this.path=B+H}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",r=this.hash||"",n=!1,s="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(s=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var o=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||p[e])&&!1!==n?(n="//"+(n||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):n||(n=""),r&&"#"!==r.charAt(0)&&(r="#"+r),o&&"?"!==o.charAt(0)&&(o="?"+o),e+n+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(o=o.replace("#","%23"))+r},i.prototype.resolve=function(t){return this.resolveObject(v(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if("string"==typeof t){var e=new i;e.parse(t,!1,!0),t=e}for(var r=new i,n=Object.keys(this),s=0;s<n.length;s++){var o=n[s];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),h=0;h<a.length;h++){var u=a[h];"protocol"!==u&&(r[u]=t[u])}return p[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!p[t.protocol]){for(var l=Object.keys(t),c=0;c<l.length;c++){var f=l[c];r[f]=t[f]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||d[t.protocol])r.pathname=t.pathname;else{for(var m=(t.pathname||"").split("/");m.length&&!(t.host=m.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==m[0]&&m.unshift(""),m.length<2&&m.unshift(""),r.pathname=m.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var v=r.pathname||"",y=r.search||"";r.path=v+y}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),b=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=b||g||r.host&&t.pathname,_=x,E=r.pathname&&r.pathname.split("/")||[],w=(m=t.pathname&&t.pathname.split("/")||[],r.protocol&&!p[r.protocol]);if(w&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===m[0]?m[0]=t.host:m.unshift(t.host)),t.host=null),x=x&&(""===m[0]||""===E[0])),b)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=m;else if(m.length)E||(E=[]),E.pop(),E=E.concat(m),r.search=t.search,r.query=t.query;else if(null!=t.search){if(w)r.host=E.shift(),r.hostname=r.host,(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.hostname=C.shift(),r.host=r.hostname);return r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=E.slice(-1)[0],S=(r.host||t.host||E.length>1)&&("."===T||".."===T)||""===T,A=0,O=E.length;O>=0;O--)"."===(T=E[O])?E.splice(O,1):".."===T?(E.splice(O,1),A++):A&&(E.splice(O,1),A--);if(!x&&!_)for(;A--;A)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),S&&"/"!==E.join("/").substr(-1)&&E.push("");var C,I=""===E[0]||E[0]&&"/"===E[0].charAt(0);w&&(r.hostname=I?"":E.length?E.shift():"",r.host=r.hostname,(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.hostname=C.shift(),r.host=r.hostname));return(x=x||r.host&&E.length)&&!I&&E.unshift(""),E.length>0?r.pathname=E.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=n.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.parse=v,t.resolve=function(t,e){return v(t,!1,!0).resolve(e)},t.resolveObject=function(t,e){return t?v(t,!1,!0).resolveObject(e):e},t.format=function(t){return"string"==typeof t&&(t=v(t)),t instanceof i?t.format():i.prototype.format.call(t)},t.Url=i}}),dt=u({"node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js"(t,e){var i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var s,o,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),h=1;h<arguments.length;h++){for(var u in s=Object(arguments[h]))r.call(s,u)&&(a[u]=s[u]);if(i){o=i(s);for(var l=0;l<o.length;l++)n.call(s,o[l])&&(a[o[l]]=s[o[l]])}}return a}}}),pt=u({"node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js"(t,e){!function(i){"object"==typeof t&&void 0!==e?e.exports=i():"function"==typeof define&&define.amd?define([],i):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=i()}(function(){return function t(e,i,r){function n(o,a){if(!i[o]){if(!e[o]){var u="function"==typeof h&&h;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[o]={exports:{}};e[o][0].call(c.exports,function(t){return n(e[o][1][t]||t)},c,c.exports,t,e,i,r)}return i[o].exports}for(var s="function"==typeof h&&h,o=0;o<r.length;o++)n(r[o]);return n}({1:[function(t,e,i){var r=t("./utils"),n=t("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,n,o,a,h,u,l=[],c=0,f=t.length,d=f,p="string"!==r.getTypeOf(t);c<t.length;)d=f-c,n=p?(e=t[c++],i=c<f?t[c++]:0,c<f?t[c++]:0):(e=t.charCodeAt(c++),i=c<f?t.charCodeAt(c++):0,c<f?t.charCodeAt(c++):0),o=e>>2,a=(3&e)<<4|i>>4,h=1<d?(15&i)<<2|n>>6:64,u=2<d?63&n:64,l.push(s.charAt(o)+s.charAt(a)+s.charAt(h)+s.charAt(u));return l.join("")},i.decode=function(t){var e,i,r,o,a,h,u=0,l=0,c="data:";if(t.substr(0,5)===c)throw new Error("Invalid base64 input, it looks like a data url.");var f,d=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===s.charAt(64)&&d--,t.charAt(t.length-2)===s.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=n.uint8array?new Uint8Array(0|d):new Array(0|d);u<t.length;)e=s.indexOf(t.charAt(u++))<<2|(o=s.indexOf(t.charAt(u++)))>>4,i=(15&o)<<4|(a=s.indexOf(t.charAt(u++)))>>2,r=(3&a)<<6|(h=s.indexOf(t.charAt(u++))),f[l++]=e,64!==a&&(f[l++]=i),64!==h&&(f[l++]=r);return f}},{"./support":30,"./utils":32}],2:[function(t,e,i){var r=t("./external"),n=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,i,r,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=r,this.compressedContent=n}a.prototype={getContentWorker:function(){var t=new n(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new n(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,i){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){var r=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){var r=t("./utils"),n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==r.getTypeOf(t)?function(t,e,i){var r=n,s=0+i;t^=-1;for(var o=0;o<s;o++)t=t>>>8^r[255&(t^e[o])];return-1^t}(0|e,t,t.length):function(t,e,i){var r=n,s=0+i;t^=-1;for(var o=0;o<s;o++)t=t>>>8^r[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){var r;r="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:r}},{lie:37}],7:[function(t,e,i){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=r?"uint8array":"array";function h(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",s.inherits(h,o),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},h.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new h("Deflate",t)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){function r(t,e){var i,r="";for(i=0;i<e;i++)r+=String.fromCharCode(255&t),t>>>=8;return r}function n(t,e,i,n,o,l){var c,f,d=t.file,p=t.compression,m=l!==a.utf8encode,v=s.transformTo("string",l(d.name)),y=s.transformTo("string",a.utf8encode(d.name)),g=d.comment,b=s.transformTo("string",l(g)),x=s.transformTo("string",a.utf8encode(g)),_=y.length!==d.name.length,E=x.length!==g.length,w="",T="",S="",A=d.dir,O=d.date,C={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(C.crc32=t.crc32,C.compressedSize=t.compressedSize,C.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),m||!_&&!E||(I|=2048);var R,P,M,D=0,F=0;A&&(D|=16),"UNIX"===o?(F=798,D|=(R=d.unixPermissions,P=A,M=R,R||(M=P?16893:33204),(65535&M)<<16)):(F=20,D|=function(t){return 63&(t||0)}(d.dosPermissions)),c=O.getUTCHours(),c<<=6,c|=O.getUTCMinutes(),c<<=5,c|=O.getUTCSeconds()/2,f=O.getUTCFullYear()-1980,f<<=4,f|=O.getUTCMonth()+1,f<<=5,f|=O.getUTCDate(),_&&(T=r(1,1)+r(h(v),4)+y,w+="up"+r(T.length,2)+T),E&&(S=r(1,1)+r(h(b),4)+x,w+="uc"+r(S.length,2)+S);var L="";return L+="\n\0",L+=r(I,2),L+=p.magic,L+=r(c,2),L+=r(f,2),L+=r(C.crc32,4),L+=r(C.compressedSize,4),L+=r(C.uncompressedSize,4),L+=r(v.length,2),L+=r(w.length,2),{fileRecord:u.LOCAL_FILE_HEADER+L+v+w,dirRecord:u.CENTRAL_FILE_HEADER+r(F,2)+L+r(b.length,2)+"\0\0\0\0"+r(D,4)+r(n,4)+v+w+b}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),h=t("../crc32"),u=t("../signature");function l(t,e,i,r){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=r,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(l,o),l.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-r-1))/i:100}}))},l.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(t){this.accumulate=!1;var e,i=this.streamFiles&&!t.file.dir,s=n(t,i,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(s.dirRecord),i)this.push({data:(e=t,u.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:s.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i,n,o,a,h,l,c=this.bytesWritten-t,f=(i=this.dirRecords.length,n=c,o=t,a=this.zipComment,h=this.encodeFileName,l=s.transformTo("string",h(a)),u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(i,2)+r(i,2)+r(n,4)+r(o,4)+r(l.length,2)+l);this.push({data:f,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()}),t.on("error",function(t){e.error(t)}),this},l.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(t){var e=this._sources;if(!o.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},l.prototype.lock=function(){o.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){var r=t("../compressions"),n=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var s=new n(e.streamFiles,i,e.platform,e.encodeFileName),o=0;try{t.forEach(function(t,i){o++;var n=function(t,e){var i=t||e,n=r[i];if(!n)throw new Error(i+" is not a valid compression method !");return n}(i.options.compression,e.compression),a=i.options.compressionOptions||e.compressionOptions||{},h=i.dir,u=i.date;i._compressWorker(n,a).withStreamInfo("file",{name:t,dir:h,date:u,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(s)}),s.entriesCount=o}catch(t){s.error(t)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new r;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(r.prototype=t("./object")).loadAsync=t("./load"),r.support=t("./support"),r.defaults=t("./defaults"),r.version="3.10.1",r.loadAsync=function(t,e){return(new r).loadAsync(t,e)},r.external=t("./external"),e.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){var r=t("./utils"),n=t("./external"),s=t("./utf8"),o=t("./zipEntries"),a=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function u(t){return new n.Promise(function(e,i){var r=t.decompressed.getContentWorker().pipe(new a);r.on("error",function(t){i(t)}).on("end",function(){r.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}e.exports=function(t,e){var i=this;return e=r.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),h.isNode&&h.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var i=new o(e);return i.load(t),i}).then(function(t){var i=[n.Promise.resolve(t)],r=t.files;if(e.checkCRC32)for(var s=0;s<r.length;s++)i.push(u(r[s]));return n.Promise.all(i)}).then(function(t){for(var n=t.shift(),s=n.files,o=0;o<s.length;o++){var a=s[o],h=a.fileNameStr,u=r.resolve(a.fileNameStr);i.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:e.createFolders}),a.dir||(i.file(u).unsafeOriginalName=h)}return n.zipComment.length&&(i.comment=n.zipComment),i})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){var r=t("../utils"),n=t("../stream/GenericWorker");function s(t,e){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}r.inherits(s,n),s.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},s.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){var r=t("readable-stream").Readable;function n(t,e,i){r.call(this,e),this._helper=t;var n=this;t.on("data",function(t,e){n.push(t)||n._helper.pause(),i&&i(e)}).on("error",function(t){n.emit("error",t)}).on("end",function(){n.push(null)})}t("../utils").inherits(n,r),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,e,i){e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){function r(t,e,i){var r,n=s.getTypeOf(e),a=s.extend(i||{},h);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=m(t)),a.createFolders&&(r=p(t))&&v.call(this,r,!0);var c="string"===n&&!1===a.binary&&!1===a.base64;i&&void 0!==i.binary||(a.binary=!c),(e instanceof u&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",n="string");var y;y=e instanceof u||e instanceof o?e:f.isNode&&f.isStream(e)?new d(t,e):s.prepareContent(t,e,a.binary,a.optimizedBinaryString,a.base64);var g=new l(t,y,a);this.files[t]=g}var n=t("./utf8"),s=t("./utils"),o=t("./stream/GenericWorker"),a=t("./stream/StreamHelper"),h=t("./defaults"),u=t("./compressedObject"),l=t("./zipObject"),c=t("./generate"),f=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},v=function(t,e){return e=void 0!==e?e:h.createFolders,t=m(t),this.files[t]||r.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function y(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var g={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,r;for(e in this.files)r=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,r)},filter:function(t){var e=[];return this.forEach(function(i,r){t(i,r)&&e.push(r)}),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,r.call(this,t,e,i),this;if(y(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}var s=this.files[this.root+t];return s&&!s.dir?s:null},folder:function(t){if(!t)return this;if(y(t))return this.filter(function(e,i){return i.dir&&t.test(e)});var e=this.root+t,i=v.call(this,e),r=this.clone();return r.root=i.name,r},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter(function(e,i){return i.name.slice(0,t.length)===t}),r=0;r<i.length;r++)delete this.files[i[r].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=s.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");s.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var r=i.comment||this.comment||"";e=c.generateWorker(this,i,r)}catch(t){(e=new o("error")).error(t)}return new a(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=g},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){var r=t("./DataReader");function n(t){r.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(n,r),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2),n=t.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===e&&this.data[s+1]===i&&this.data[s+2]===r&&this.data[s+3]===n)return s-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2),n=t.charCodeAt(3),s=this.readData(4);return e===s[0]&&i===s[1]&&r===s[2]&&n===s[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){var r=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return r.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,i){var r=t("./Uint8ArrayReader");function n(t){r.call(this,t)}t("../utils").inherits(n,r),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){var r=t("./DataReader");function n(t){r.call(this,t)}t("../utils").inherits(n,r),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){var r=t("./ArrayReader");function n(t){r.call(this,t)}t("../utils").inherits(n,r),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){var r=t("../utils"),n=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(t){var e=r.getTypeOf(t);return r.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new a(t):n.uint8array?new h(r.transformTo("uint8array",t)):new s(r.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){var r=t("./GenericWorker"),n=t("../utils");function s(t){r.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(s,r),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){var r=t("./GenericWorker"),n=t("../crc32");function s(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,r),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){var r=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}r.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){var r=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=r.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}r.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){function r(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.end()}),t.on("error",function(t){e.error(t)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=r},{}],29:[function(t,e,i){var r=t("../utils"),n=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),h=t("../external"),u=null;if(a.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function l(t,e,i){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=i,r.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}l.prototype={accumulate:function(t){return function(t,e){return new h.Promise(function(i,n){var s=[],a=t._internalType,h=t._outputType,u=t._mimeType;t.on("data",function(t,i){s.push(t),e&&e(i)}).on("error",function(t){s=[],n(t)}).on("end",function(){try{var t=function(t,e,i){switch(t){case"blob":return r.newBlob(r.transformTo("arraybuffer",e),i);case"base64":return o.encode(e);default:return r.transformTo(t,e)}}(h,function(t,e){var i,r=0,n=null,s=0;for(i=0;i<e.length;i++)s+=e[i].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(s),i=0;i<e.length;i++)n.set(e[i],r),r+=e[i].length;return n;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(a,s),u);i(t)}catch(t){n(t)}s=[]}).resume()})}(this,t)},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,function(t){e.call(i,t.data,t.meta)}):this._worker.on(t,function(){r.delay(e,arguments,i)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(r.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=l},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,i.nodebuffer="undefined"!=typeof Buffer,i.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)i.blob=!1;else{var r=new ArrayBuffer(0);try{i.blob=0===new Blob([r],{type:"application/zip"}).size}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(r),i.blob=0===n.getBlob("application/zip").size}catch(t){i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch(t){i.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,i){for(var r=t("./utils"),n=t("./support"),s=t("./nodejsUtils"),o=t("./stream/GenericWorker"),a=new Array(256),h=0;h<256;h++)a[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function u(){o.call(this,"utf-8 decode"),this.leftOver=null}function l(){o.call(this,"utf-8 encode")}a[254]=a[254]=1,i.utf8encode=function(t){return n.nodebuffer?s.newBufferFrom(t,"utf-8"):function(t){var e,i,r,s,o,a=t.length,h=0;for(s=0;s<a;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),h+=i<128?1:i<2048?2:i<65536?3:4;for(e=n.uint8array?new Uint8Array(h):new Array(h),s=o=0;o<h;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),i<128?e[o++]=i:(i<2048?e[o++]=192|i>>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e}(t)},i.utf8decode=function(t){return n.nodebuffer?r.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,n,s,o=t.length,h=new Array(2*o);for(e=i=0;e<o;)if((n=t[e++])<128)h[i++]=n;else if(4<(s=a[n]))h[i++]=65533,e+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&e<o;)n=n<<6|63&t[e++],s--;1<s?h[i++]=65533:n<65536?h[i++]=n:(n-=65536,h[i++]=55296|n>>10&1023,h[i++]=56320|1023&n)}return h.length!==i&&(h.subarray?h=h.subarray(0,i):h.length=i),r.applyFromCharCode(h)}(t=r.transformTo(n.uint8array?"uint8array":"array",t))},r.inherits(u,o),u.prototype.processChunk=function(t){var e=r.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}(e),h=e;o!==e.length&&(n.uint8array?(h=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(h=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:i.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=u,r.inherits(l,o),l.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){var r=t("./support"),n=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function h(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}t("setimmediate"),i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(i){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(t),r.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(t,e,i){var r=[],n=0,s=t.length;if(s<=i)return String.fromCharCode.apply(null,t);for(;n<s;)"array"===e||"nodebuffer"===e?r.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+i,s)))):r.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+i,s)))),n+=i;return r.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(t){return!1}}()}};function l(t){var e=65536,r=i.getTypeOf(t),n=!0;if("uint8array"===r?n=u.applyCanBeUsed.uint8array:"nodebuffer"===r&&(n=u.applyCanBeUsed.nodebuffer),n)for(;1<e;)try{return u.stringifyByChunk(t,r,e)}catch(t){e=Math.floor(e/2)}return u.stringifyByChar(t)}function c(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=l;var f={};f.string={string:a,array:function(t){return h(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return h(t,new Uint8Array(t.length))},nodebuffer:function(t){return h(t,s.allocBuffer(t.length))}},f.array={string:l,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(t)}},f.arraybuffer={string:function(t){return l(new Uint8Array(t))},array:function(t){return c(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(new Uint8Array(t))}},f.uint8array={string:l,array:function(t){return c(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a,nodebuffer:function(t){return s.newBufferFrom(t)}},f.nodebuffer={string:l,array:function(t){return c(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return c(t,new Uint8Array(t.length))},nodebuffer:a},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var r=i.getTypeOf(e);return f[r][t](e)},i.resolve=function(t){for(var e=t.split("/"),i=[],r=0;r<e.length;r++){var n=e[r];"."===n||""===n&&0!==r&&r!==e.length-1||(".."===n?i.pop():i.push(n))}return i.join("/")},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":r.nodebuffer&&s.isBuffer(t)?"nodebuffer":r.uint8array&&t instanceof Uint8Array?"uint8array":r.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!r[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,r="";for(i=0;i<(t||"").length;i++)r+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return r},i.delay=function(t,e,i){setImmediate(function(){t.apply(i||null,e||[])})},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,s,a,u){return o.Promise.resolve(e).then(function(t){return r.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new o.Promise(function(e,i){var r=new FileReader;r.onload=function(t){e(t.target.result)},r.onerror=function(t){i(t.target.error)},r.readAsArrayBuffer(t)}):t}).then(function(e){var l,c=i.getTypeOf(e);return c?("arraybuffer"===c?e=i.transformTo("uint8array",e):"string"===c&&(u?e=n.decode(e):s&&!0!==a&&(e=h(l=e,r.uint8array?new Uint8Array(l.length):new Array(l.length)))),e):o.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,i){var r=t("./reader/readerFor"),n=t("./utils"),s=t("./signature"),o=t("./zipEntry"),a=t("./support");function h(t){this.files=[],this.loadOptions=t}h.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(e)+", expected "+n.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var r=this.reader.readString(4)===e;return this.reader.setIndex(i),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",i=n.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,r=this.zip64EndOfCentralSize-44;0<r;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(t=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var r=e-i;if(0<r)this.isSignature(e,s.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(t){this.reader=r(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){var r=t("./reader/readerFor"),n=t("./utils"),s=t("./compressedObject"),o=t("./crc32"),a=t("./utf8"),h=t("./compressions"),u=t("./support");function l(t,e){this.options=t,this.loadOptions=e}l.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in h)if(Object.prototype.hasOwnProperty.call(h,e)&&h[e].magic===t)return h[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=r(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,i,r,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<n;)e=t.readInt(2),i=t.readInt(2),r=t.readData(i),this.extraFields[e]={id:e,length:i,value:r};t.setIndex(n)},handleUTF8:function(){var t=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var s=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=r(t.value);return 1!==e.readInt(1)||o(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=r(t.value);return 1!==e.readInt(1)||o(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},e.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){function r(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var n=t("./stream/StreamHelper"),s=t("./stream/DataWorker"),o=t("./utf8"),a=t("./compressedObject"),h=t("./stream/GenericWorker");r.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var r="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!r&&(e=e.pipe(new o.Utf8EncodeWorker)),!s&&r&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new h("error")).error(t)}return new n(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof h?this._data:new s(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<u.length;c++)r.prototype[u[c]]=l;e.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,i){(function(t){var i,r,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var s=0,o=new n(l),a=t.document.createTextNode("");o.observe(a,{characterData:!0}),i=function(){a.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var h=new t.MessageChannel;h.port1.onmessage=l,i=function(){h.port2.postMessage(0)}}var u=[];function l(){var t,e;r=!0;for(var i=u.length;i;){for(e=u,u=[],t=-1;++t<i;)e[t]();i=u.length}r=!1}e.exports=function(t){1!==u.push(t)||r||i()}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){var r=t("immediate");function n(){}var s={},o=["REJECTED"],a=["FULFILLED"],h=["PENDING"];function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,t!==n&&d(this,t)}function l(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function c(t,e,i){r(function(){var r;try{r=e(i)}catch(e){return s.reject(t,e)}r===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,r)})}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var i=!1;function r(e){i||(i=!0,s.reject(t,e))}function n(e){i||(i=!0,s.resolve(t,e))}var o=p(function(){e(n,r)});"error"===o.status&&r(o.value)}function p(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}(e.exports=u).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(i){return e.resolve(t()).then(function(){return i})},function(i){return e.resolve(t()).then(function(){throw i})})},u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var i=new this.constructor(n);return this.state!==h?c(i,this.state===a?t:e,this.outcome):this.queue.push(new l(i,t,e)),i},l.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){s.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},s.resolve=function(t,e){var i=p(f,e);if("error"===i.status)return s.reject(t,i.value);var r=i.value;if(r)d(t,r);else{t.state=a,t.outcome=e;for(var n=-1,o=t.queue.length;++n<o;)t.queue[n].callFulfilled(e)}return t},s.reject=function(t,e){t.state=o,t.outcome=e;for(var i=-1,r=t.queue.length;++i<r;)t.queue[i].callRejected(e);return t},u.resolve=function(t){return t instanceof this?t:s.resolve(new this(n),t)},u.reject=function(t){var e=new this(n);return s.reject(e,t)},u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,r=!1;if(!i)return this.resolve([]);for(var o=new Array(i),a=0,h=-1,u=new this(n);++h<i;)l(t[h],h);return u;function l(t,n){e.resolve(t).then(function(t){o[n]=t,++a!==i||r||(r=!0,s.resolve(u,o))},function(t){r||(r=!0,s.reject(u,t))})}},u.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,i=!1;if(!e)return this.resolve([]);for(var r,o=-1,a=new this(n);++o<e;)r=t[o],this.resolve(r).then(function(t){i||(i=!0,s.resolve(a,t))},function(t){i||(i=!0,s.reject(a,t))});return a}},{immediate:36}],38:[function(t,e,i){var r={};(0,t("./lib/utils/common").assign)(r,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){var r=t("./zlib/deflate"),n=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/messages"),a=t("./zlib/zstream"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==i)throw new Error(o[i]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var l;if(l="string"==typeof e.dictionary?s.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(i=r.deflateSetDictionary(this.strm,l)))throw new Error(o[i]);this._dict_set=!0}}function l(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}u.prototype.push=function(t,e){var i,o,a=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=s.string2buf(t):"[object ArrayBuffer]"===h.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new n.Buf8(u),a.next_out=0,a.avail_out=u),1!==(i=r.deflate(a,o))&&0!==i)return this.onEnd(i),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(s.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==i);return 4===o?(i=r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==o||(this.onEnd(0),!(a.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=u,i.deflate=l,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){var r=t("./zlib/inflate"),n=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/constants"),a=t("./zlib/messages"),h=t("./zlib/zstream"),u=t("./zlib/gzheader"),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&!(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,e.windowBits);if(i!==o.Z_OK)throw new Error(a[i]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function f(t,e){var i=new c(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}c.prototype.push=function(t,e){var i,a,h,u,c,f,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,v=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?d.input=s.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new n.Buf8(p),d.next_out=0,d.avail_out=p),(i=r.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&m&&(f="string"==typeof m?s.string2buf(m):"[object ArrayBuffer]"===l.call(m)?new Uint8Array(m):m,i=r.inflateSetDictionary(this.strm,f)),i===o.Z_BUF_ERROR&&!0===v&&(i=o.Z_OK,v=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&i!==o.Z_STREAM_END&&(0!==d.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(h=s.utf8border(d.output,d.next_out),u=d.next_out-h,c=s.buf2string(d.output,h),d.next_out=u,d.avail_out=p-u,u&&n.arraySet(d.output,d.output,h,u,0),this.onData(c)):this.onData(n.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(v=!0)}while((0<d.avail_in||0===d.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(d.avail_out=0))},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=c,i.inflate=f,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},i.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,r,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+r),n);else for(var s=0;s<r;s++)t[n+s]=e[i+s]},flattenChunks:function(t){var e,i,r,n,s,o;for(e=r=0,i=t.length;e<i;e++)r+=t[e].length;for(o=new Uint8Array(r),e=n=0,i=t.length;e<i;e++)s=t[e],o.set(s,n),n+=s.length;return o}},s={arraySet:function(t,e,i,r,n){for(var s=0;s<r;s++)t[n+s]=e[i+s]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,s))},i.setTyped(r)},{}],42:[function(t,e,i){var r=t("./common"),n=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new r.Buf8(256),a=0;a<256;a++)o[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function h(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var i="",o=0;o<e;o++)i+=String.fromCharCode(t[o]);return i}o[254]=o[254]=1,i.string2buf=function(t){var e,i,n,s,o,a=t.length,h=0;for(s=0;s<a;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),h+=i<128?1:i<2048?2:i<65536?3:4;for(e=new r.Buf8(h),s=o=0;o<h;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),i<128?e[o++]=i:(i<2048?e[o++]=192|i>>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e},i.buf2binstring=function(t){return h(t,t.length)},i.binstring2buf=function(t){for(var e=new r.Buf8(t.length),i=0,n=e.length;i<n;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,r,n,s,a=e||t.length,u=new Array(2*a);for(i=r=0;i<a;)if((n=t[i++])<128)u[r++]=n;else if(4<(s=o[n]))u[r++]=65533,i+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&i<a;)n=n<<6|63&t[i++],s--;1<s?u[r++]=65533:n<65536?u[r++]=n:(n-=65536,u[r++]=55296|n>>10&1023,u[r++]=56320|1023&n)}return h(u,r)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){e.exports=function(t,e,i,r){for(var n=65535&t,s=t>>>16&65535,o=0;0!==i;){for(i-=o=2e3<i?2e3:i;s=s+(n=n+e[r++]|0)|0,--o;);n%=65521,s%=65521}return n|s<<16}},{}],44:[function(t,e,i){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){var r=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,n){var s=r,o=n+i;t^=-1;for(var a=n;a<o;a++)t=t>>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,i){var r,n=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),h=t("./messages"),u=-2,l=258,c=262,f=113;function d(t,e){return t.msg=h[e],e}function p(t){return(t<<1)-(4<t?9:0)}function m(t){for(var e=t.length;0<=--e;)t[e]=0}function v(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function y(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,v(t.strm)}function g(t,e){t.pending_buf[t.pending++]=e}function b(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function x(t,e){var i,r,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-c?t.strstart-(t.w_size-c):0,u=t.window,f=t.w_mask,d=t.prev,p=t.strstart+l,m=u[s+o-1],v=u[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(i=e)+o]===v&&u[i+o-1]===m&&u[i]===u[s]&&u[++i]===u[s+1]){s+=2,i++;do{}while(u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&s<p);if(r=l-(p-s),s=p-l,o<r){if(t.match_start=e,a<=(o=r))break;m=u[s+o-1],v=u[s+o]}}}while((e=d[e&f])>h&&0!=--n);return o<=t.lookahead?o:t.lookahead}function _(t){var e,i,r,s,h,u,l,f,d,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-c)){for(n.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=i=t.hash_size;r=t.head[--e],t.head[e]=m<=r?r-m:0,--i;);for(e=i=m;r=t.prev[--e],t.prev[e]=m<=r?r-m:0,--i;);s+=m}if(0===t.strm.avail_in)break;if(u=t.strm,l=t.window,f=t.strstart+t.lookahead,p=void 0,(d=s)<(p=u.avail_in)&&(p=d),i=0===p?0:(u.avail_in-=p,n.arraySet(l,u.input,u.next_in,p,f),1===u.state.wrap?u.adler=o(u.adler,l,p,f):2===u.state.wrap&&(u.adler=a(u.adler,l,p,f)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<c&&0!==t.strm.avail_in)}function E(t,e){for(var i,r;;){if(t.lookahead<c){if(_(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-c&&(t.match_length=x(t,i)),t.match_length>=3)if(r=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function w(t,e){for(var i,r,n;;){if(t.lookahead<c){if(_(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-c&&(t.match_length=x(t,i),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-3,r=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=s._tr_tally(t,0,t.window[t.strstart-1]))&&y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=s._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function T(t,e,i,r,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=n}function S(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function A(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:f,t.adler=2===e.wrap?0:1,e.last_flush=0,s._tr_init(e),0):d(t,u)}function O(t){var e,i=A(t);return 0===i&&((e=t.state).window_size=2*e.w_size,m(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i}function C(t,e,i,r,s,o){if(!t)return u;var a=1;if(-1===e&&(e=6),r<0?(a=0,r=-r):15<r&&(a=2,r-=16),s<1||9<s||8!==i||r<8||15<r||e<0||9<e||o<0||4<o)return d(t,u);8===r&&(r=9);var h=new S;return(t.state=h).strm=t,h.wrap=a,h.gzhead=null,h.w_bits=r,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=s+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new n.Buf8(2*h.w_size),h.head=new n.Buf16(h.hash_size),h.prev=new n.Buf16(h.w_size),h.lit_bufsize=1<<s+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new n.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=o,h.method=i,O(t)}r=[new T(0,0,0,0,function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+i;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-c&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(y(t,!1),t.strm.avail_out),1)}),new T(4,4,8,4,E),new T(4,5,16,8,E),new T(4,6,32,32,E),new T(4,4,16,16,w),new T(8,16,32,32,w),new T(8,16,128,128,w),new T(8,32,128,256,w),new T(32,128,258,1024,w),new T(32,258,258,4096,w)],i.deflateInit=function(t,e){return C(t,e,8,15,8,0)},i.deflateInit2=C,i.deflateReset=O,i.deflateResetKeep=A,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,0):u},i.deflate=function(t,e){var i,n,o,h;if(!t||!t.state||5<e||e<0)return t?d(t,u):u;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&4!==e)return d(t,0===t.avail_out?-5:u);if(n.strm=t,i=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,g(n,31),g(n,139),g(n,8),n.gzhead?(g(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),g(n,255&n.gzhead.time),g(n,n.gzhead.time>>8&255),g(n,n.gzhead.time>>16&255),g(n,n.gzhead.time>>24&255),g(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),g(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(g(n,255&n.gzhead.extra.length),g(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(g(n,0),g(n,0),g(n,0),g(n,0),g(n,0),g(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),g(n,3),n.status=f);else{var c=8+(n.w_bits-8<<4)<<8;c|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(c|=32),c+=31-c%31,n.status=f,b(n,c),0!==n.strstart&&(b(n,t.adler>>>16),b(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending!==n.pending_buf_size));)g(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,g(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===h&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,g(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===h&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&v(t),n.pending+2<=n.pending_buf_size&&(g(n,255&t.adler),g(n,t.adler>>8&255),t.adler=0,n.status=f)):n.status=f),0!==n.pending){if(v(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(i)&&4!==e)return d(t,-5);if(666===n.status&&0!==t.avail_in)return d(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&666!==n.status){var x=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var i,r,n,o,a=t.window;;){if(t.lookahead<=l){if(_(t),t.lookahead<=l&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(r=a[n=t.strstart-1])===a[++n]&&r===a[++n]&&r===a[++n]){o=t.strstart+l;do{}while(r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&n<o);t.match_length=l-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(n,e):r[n.level].func(n,e);if(3!==x&&4!==x||(n.status=666),1===x||3===x)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===x&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(m(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),v(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(g(n,255&t.adler),g(n,t.adler>>8&255),g(n,t.adler>>16&255),g(n,t.adler>>24&255),g(n,255&t.total_in),g(n,t.total_in>>8&255),g(n,t.total_in>>16&255),g(n,t.total_in>>24&255)):(b(n,t.adler>>>16),b(n,65535&t.adler)),v(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?0:1)},i.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==f&&666!==e?d(t,u):(t.state=null,e===f?d(t,-3):0):u},i.deflateSetDictionary=function(t,e){var i,r,s,a,h,l,c,f,d=e.length;if(!t||!t.state)return u;if(2===(a=(i=t.state).wrap)||1===a&&42!==i.status||i.lookahead)return u;for(1===a&&(t.adler=o(t.adler,e,d,0)),i.wrap=0,d>=i.w_size&&(0===a&&(m(i.head),i.strstart=0,i.block_start=0,i.insert=0),f=new n.Buf8(i.w_size),n.arraySet(f,e,d-i.w_size,i.w_size,0),e=f,d=i.w_size),h=t.avail_in,l=t.next_in,c=t.input,t.avail_in=d,t.next_in=0,t.input=e,_(i);i.lookahead>=3;){for(r=i.strstart,s=i.lookahead-2;i.ins_h=(i.ins_h<<i.hash_shift^i.window[r+3-1])&i.hash_mask,i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++,--s;);i.strstart=r,i.lookahead=2,_(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=l,t.input=c,t.avail_in=h,i.wrap=a,0},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,i){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,i){e.exports=function(t,e){var i,r,n,s,o,a,h,u,l,c,f,d,p,m,v,y,g,b,x,_,E,w,T,S,A;i=t.state,r=t.next_in,S=t.input,n=r+(t.avail_in-5),s=t.next_out,A=t.output,o=s-(e-t.avail_out),a=s+(t.avail_out-257),h=i.dmax,u=i.wsize,l=i.whave,c=i.wnext,f=i.window,d=i.hold,p=i.bits,m=i.lencode,v=i.distcode,y=(1<<i.lenbits)-1,g=(1<<i.distbits)-1;t:do{p<15&&(d+=S[r++]<<p,p+=8,d+=S[r++]<<p,p+=8),b=m[d&y];e:for(;;){if(d>>>=x=b>>>24,p-=x,0==(x=b>>>16&255))A[s++]=65535&b;else{if(!(16&x)){if(!(64&x)){b=m[(65535&b)+(d&(1<<x)-1)];continue e}if(32&x){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}_=65535&b,(x&=15)&&(p<x&&(d+=S[r++]<<p,p+=8),_+=d&(1<<x)-1,d>>>=x,p-=x),p<15&&(d+=S[r++]<<p,p+=8,d+=S[r++]<<p,p+=8),b=v[d&g];i:for(;;){if(d>>>=x=b>>>24,p-=x,!(16&(x=b>>>16&255))){if(!(64&x)){b=v[(65535&b)+(d&(1<<x)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(E=65535&b,p<(x&=15)&&(d+=S[r++]<<p,(p+=8)<x&&(d+=S[r++]<<p,p+=8)),h<(E+=d&(1<<x)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(d>>>=x,p-=x,(x=s-o)<E){if(l<(x=E-x)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(T=f,(w=0)===c){if(w+=u-x,x<_){for(_-=x;A[s++]=f[w++],--x;);w=s-E,T=A}}else if(c<x){if(w+=u+c-x,(x-=c)<_){for(_-=x;A[s++]=f[w++],--x;);if(w=0,c<_){for(_-=x=c;A[s++]=f[w++],--x;);w=s-E,T=A}}}else if(w+=c-x,x<_){for(_-=x;A[s++]=f[w++],--x;);w=s-E,T=A}for(;2<_;)A[s++]=T[w++],A[s++]=T[w++],A[s++]=T[w++],_-=3;_&&(A[s++]=T[w++],1<_&&(A[s++]=T[w++]))}else{for(w=s-E;A[s++]=A[w++],A[s++]=A[w++],A[s++]=A[w++],2<(_-=3););_&&(A[s++]=A[w++],1<_&&(A[s++]=A[w++]))}break}}break}}while(r<n&&s<a);r-=_=p>>3,d&=(1<<(p-=_<<3))-1,t.next_in=r,t.next_out=s,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=s<a?a-s+257:257-(s-a),i.hold=d,i.bits=p}},{}],49:[function(t,e,i){var r=t("../utils/common"),n=t("./adler32"),s=t("./crc32"),o=t("./inffast"),a=t("./inftrees"),h=-2;function u(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):h}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,c(t)):h}function d(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?h:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,f(t))):h}function p(t,e){var i,r;return t?(r=new l,(t.state=r).window=null,0!==(i=d(t,e))&&(t.state=null),i):h}var m,v,y=!0;function g(t){if(y){var e;for(m=new r.Buf32(512),v=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,v,0,t.work,{bits:5}),y=!1}t.lencode=m,t.lenbits=9,t.distcode=v,t.distbits=5}function b(t,e,i,n){var s,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),n>=o.wsize?(r.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n<(s=o.wsize-o.wnext)&&(s=n),r.arraySet(o.window,e,i-n,s,o.wnext),(n-=s)?(r.arraySet(o.window,e,i-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}i.inflateReset=f,i.inflateReset2=d,i.inflateResetKeep=c,i.inflateInit=function(t){return p(t,15)},i.inflateInit2=p,i.inflate=function(t,e){var i,l,c,f,d,p,m,v,y,x,_,E,w,T,S,A,O,C,I,R,P,M,D,F,L=0,k=new r.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;12===(i=t.state).mode&&(i.mode=13),d=t.next_out,c=t.output,m=t.avail_out,f=t.next_in,l=t.input,p=t.avail_in,v=i.hold,y=i.bits,x=p,_=m,M=0;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;y<16;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(2&i.wrap&&35615===v){k[i.check=0]=255&v,k[1]=v>>>8&255,i.check=s(i.check,k,2,0),y=v=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&v)){t.msg="unknown compression method",i.mode=30;break}if(y-=4,P=8+(15&(v>>>=4)),0===i.wbits)i.wbits=P;else if(P>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<P,t.adler=i.check=1,i.mode=512&v?10:12,y=v=0;break;case 2:for(;y<16;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(i.flags=v,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=v>>8&1),512&i.flags&&(k[0]=255&v,k[1]=v>>>8&255,i.check=s(i.check,k,2,0)),y=v=0,i.mode=3;case 3:for(;y<32;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}i.head&&(i.head.time=v),512&i.flags&&(k[0]=255&v,k[1]=v>>>8&255,k[2]=v>>>16&255,k[3]=v>>>24&255,i.check=s(i.check,k,4,0)),y=v=0,i.mode=4;case 4:for(;y<16;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}i.head&&(i.head.xflags=255&v,i.head.os=v>>8),512&i.flags&&(k[0]=255&v,k[1]=v>>>8&255,i.check=s(i.check,k,2,0)),y=v=0,i.mode=5;case 5:if(1024&i.flags){for(;y<16;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}i.length=v,i.head&&(i.head.extra_len=v),512&i.flags&&(k[0]=255&v,k[1]=v>>>8&255,i.check=s(i.check,k,2,0)),y=v=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(p<(E=i.length)&&(E=p),E&&(i.head&&(P=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),r.arraySet(i.head.extra,l,f,E,P)),512&i.flags&&(i.check=s(i.check,l,E,f)),p-=E,f+=E,i.length-=E),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===p)break t;for(E=0;P=l[f+E++],i.head&&P&&i.length<65536&&(i.head.name+=String.fromCharCode(P)),P&&E<p;);if(512&i.flags&&(i.check=s(i.check,l,E,f)),p-=E,f+=E,P)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===p)break t;for(E=0;P=l[f+E++],i.head&&P&&i.length<65536&&(i.head.comment+=String.fromCharCode(P)),P&&E<p;);if(512&i.flags&&(i.check=s(i.check,l,E,f)),p-=E,f+=E,P)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;y<16;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(v!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}y=v=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;y<32;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}t.adler=i.check=u(v),y=v=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,i.hold=v,i.bits=y,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){v>>>=7&y,y-=7&y,i.mode=27;break}for(;y<3;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}switch(i.last=1&v,y-=1,3&(v>>>=1)){case 0:i.mode=14;break;case 1:if(g(i),i.mode=20,6!==e)break;v>>>=2,y-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&v,y=v=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(E=i.length){if(p<E&&(E=p),m<E&&(E=m),0===E)break t;r.arraySet(c,l,f,E,d),p-=E,f+=E,m-=E,d+=E,i.length-=E;break}i.mode=12;break;case 17:for(;y<14;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(i.nlen=257+(31&v),v>>>=5,y-=5,i.ndist=1+(31&v),v>>>=5,y-=5,i.ncode=4+(15&v),v>>>=4,y-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;y<3;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}i.lens[N[i.have++]]=7&v,v>>>=3,y-=3}for(;i.have<19;)i.lens[N[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,D={bits:i.lenbits},M=a(0,i.lens,0,19,i.lencode,0,i.work,D),i.lenbits=D.bits,M){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;A=(L=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,O=65535&L,!((S=L>>>24)<=y);){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(O<16)v>>>=S,y-=S,i.lens[i.have++]=O;else{if(16===O){for(F=S+2;y<F;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(v>>>=S,y-=S,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}P=i.lens[i.have-1],E=3+(3&v),v>>>=2,y-=2}else if(17===O){for(F=S+3;y<F;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}y-=S,P=0,E=3+(7&(v>>>=S)),v>>>=3,y-=3}else{for(F=S+7;y<F;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}y-=S,P=0,E=11+(127&(v>>>=S)),v>>>=7,y-=7}if(i.have+E>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;E--;)i.lens[i.have++]=P}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,D={bits:i.lenbits},M=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,D),i.lenbits=D.bits,M){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,D={bits:i.distbits},M=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,D),i.distbits=D.bits,M){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=p&&258<=m){t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,i.hold=v,i.bits=y,o(t,_),d=t.next_out,c=t.output,m=t.avail_out,f=t.next_in,l=t.input,p=t.avail_in,v=i.hold,y=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;A=(L=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,O=65535&L,!((S=L>>>24)<=y);){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(A&&!(240&A)){for(C=S,I=A,R=O;A=(L=i.lencode[R+((v&(1<<C+I)-1)>>C)])>>>16&255,O=65535&L,!(C+(S=L>>>24)<=y);){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}v>>>=C,y-=C,i.back+=C}if(v>>>=S,y-=S,i.back+=S,i.length=O,0===A){i.mode=26;break}if(32&A){i.back=-1,i.mode=12;break}if(64&A){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&A,i.mode=22;case 22:if(i.extra){for(F=i.extra;y<F;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}i.length+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;A=(L=i.distcode[v&(1<<i.distbits)-1])>>>16&255,O=65535&L,!((S=L>>>24)<=y);){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(!(240&A)){for(C=S,I=A,R=O;A=(L=i.distcode[R+((v&(1<<C+I)-1)>>C)])>>>16&255,O=65535&L,!(C+(S=L>>>24)<=y);){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}v>>>=C,y-=C,i.back+=C}if(v>>>=S,y-=S,i.back+=S,64&A){t.msg="invalid distance code",i.mode=30;break}i.offset=O,i.extra=15&A,i.mode=24;case 24:if(i.extra){for(F=i.extra;y<F;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}i.offset+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===m)break t;if(E=_-m,i.offset>E){if((E=i.offset-E)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}w=E>i.wnext?(E-=i.wnext,i.wsize-E):i.wnext-E,E>i.length&&(E=i.length),T=i.window}else T=c,w=d-i.offset,E=i.length;for(m<E&&(E=m),m-=E,i.length-=E;c[d++]=T[w++],--E;);0===i.length&&(i.mode=21);break;case 26:if(0===m)break t;c[d++]=i.length,m--,i.mode=21;break;case 27:if(i.wrap){for(;y<32;){if(0===p)break t;p--,v|=l[f++]<<y,y+=8}if(_-=m,t.total_out+=_,i.total+=_,_&&(t.adler=i.check=i.flags?s(i.check,c,_,d-_):n(i.check,c,_,d-_)),_=m,(i.flags?v:u(v))!==i.check){t.msg="incorrect data check",i.mode=30;break}y=v=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;y<32;){if(0===p)break t;p--,v+=l[f++]<<y,y+=8}if(v!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}y=v=0}i.mode=29;case 29:M=1;break t;case 30:M=-3;break t;case 31:return-4;default:return h}return t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,i.hold=v,i.bits=y,(i.wsize||_!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&b(t,t.output,t.next_out,_-t.avail_out)?(i.mode=31,-4):(x-=t.avail_in,_-=t.avail_out,t.total_in+=x,t.total_out+=_,i.total+=_,i.wrap&&_&&(t.adler=i.check=i.flags?s(i.check,c,_,t.next_out-_):n(i.check,c,_,t.next_out-_)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==x&&0===_||4===e)&&0===M&&(M=-5),M)},i.inflateEnd=function(t){if(!t||!t.state)return h;var e=t.state;return e.window&&(e.window=null),t.state=null,0},i.inflateGetHeader=function(t,e){var i;return t&&t.state&&2&(i=t.state).wrap?((i.head=e).done=!1,0):h},i.inflateSetDictionary=function(t,e){var i,r=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?h:11===i.mode&&n(1,e,r,0)!==i.check?-3:b(t,e,r,r)?(i.mode=31,-4):(i.havedict=1,0):h},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){var r=t("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,h,u,l,c,f){var d,p,m,v,y,g,b,x,_,E=f.bits,w=0,T=0,S=0,A=0,O=0,C=0,I=0,R=0,P=0,M=0,D=null,F=0,L=new r.Buf16(16),k=new r.Buf16(16),N=null,B=0;for(w=0;w<=15;w++)L[w]=0;for(T=0;T<h;T++)L[e[i+T]]++;for(O=E,A=15;1<=A&&0===L[A];A--);if(A<O&&(O=A),0===A)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(S=1;S<A&&0===L[S];S++);for(O<S&&(O=S),w=R=1;w<=15;w++)if(R<<=1,(R-=L[w])<0)return-1;if(0<R&&(0===t||1!==A))return-1;for(k[1]=0,w=1;w<15;w++)k[w+1]=k[w]+L[w];for(T=0;T<h;T++)0!==e[i+T]&&(c[k[e[i+T]]++]=T);if(g=0===t?(D=N=c,19):1===t?(D=n,F-=257,N=s,B-=257,256):(D=o,N=a,-1),w=S,y=l,I=T=M=0,m=-1,v=(P=1<<(C=O))-1,1===t&&852<P||2===t&&592<P)return 1;for(;;){for(b=w-I,_=c[T]<g?(x=0,c[T]):c[T]>g?(x=N[B+c[T]],D[F+c[T]]):(x=96,0),d=1<<w-I,S=p=1<<C;u[y+(M>>I)+(p-=d)]=b<<24|x<<16|_,0!==p;);for(d=1<<w-1;M&d;)d>>=1;if(0!==d?(M&=d-1,M+=d):M=0,T++,0==--L[w]){if(w===A)break;w=e[i+c[T]]}if(O<w&&(M&v)!==m){for(0===I&&(I=O),y+=S,R=1<<(C=w-I);C+I<A&&!((R-=L[C+I])<=0);)C++,R<<=1;if(P+=1<<C,1===t&&852<P||2===t&&592<P)return 1;u[m=M&v]=O<<24|C<<16|y-l}}return 0!==M&&(u[y+M]=w-I<<24|64<<16),f.bits=O,0}},{"../utils/common":41}],51:[function(t,e,i){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){var r=t("../utils/common");function n(t){for(var e=t.length;0<=--e;)t[e]=0}var s=256,o=286,a=30,h=15,u=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);n(d);var p=new Array(60);n(p);var m=new Array(512);n(m);var v=new Array(256);n(v);var y=new Array(29);n(y);var g,b,x,_=new Array(a);function E(t,e,i,r,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=t&&t.length}function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function T(t){return t<256?m[t]:m[256+(t>>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function A(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,S(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function O(t,e,i){A(t,i[2*e],i[2*e+1])}function C(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function I(t,e,i){var r,n,s=new Array(16),o=0;for(r=1;r<=h;r++)s[r]=o=o+i[r-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=C(s[a]++,a))}}function R(t){var e;for(e=0;e<o;e++)t.dyn_ltree[2*e]=0;for(e=0;e<a;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function P(t){8<t.bi_valid?S(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function M(t,e,i,r){var n=2*e,s=2*i;return t[n]<t[s]||t[n]===t[s]&&r[e]<=r[i]}function D(t,e,i){for(var r=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&M(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!M(e,r,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=r}function F(t,e,i){var r,n,o,a,h=0;if(0!==t.last_lit)for(;r=t.pending_buf[t.d_buf+2*h]<<8|t.pending_buf[t.d_buf+2*h+1],n=t.pending_buf[t.l_buf+h],h++,0===r?O(t,n,e):(O(t,(o=v[n])+s+1,e),0!==(a=u[o])&&A(t,n-=y[o],a),O(t,o=T(--r),i),0!==(a=l[o])&&A(t,r-=_[o],a)),h<t.last_lit;);O(t,256,e)}function L(t,e){var i,r,n,s=e.dyn_tree,o=e.stat_desc.static_tree,a=e.stat_desc.has_stree,u=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<u;i++)0!==s[2*i]?(t.heap[++t.heap_len]=l=i,t.depth[i]=0):s[2*i+1]=0;for(;t.heap_len<2;)s[2*(n=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[n]=0,t.opt_len--,a&&(t.static_len-=o[2*n+1]);for(e.max_code=l,i=t.heap_len>>1;1<=i;i--)D(t,s,i);for(n=u;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],D(t,s,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,s[2*n]=s[2*i]+s[2*r],t.depth[n]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,s[2*i+1]=s[2*r+1]=n,t.heap[1]=n++,D(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,n,s,o,a,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,v=0;for(s=0;s<=h;s++)t.bl_count[s]=0;for(u[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)m<(s=u[2*u[2*(r=t.heap[i])+1]+1]+1)&&(s=m,v++),u[2*r+1]=s,l<r||(t.bl_count[s]++,o=0,p<=r&&(o=d[r-p]),a=u[2*r],t.opt_len+=a*(s+o),f&&(t.static_len+=a*(c[2*r+1]+o)));if(0!==v){do{for(s=m-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[m]--,v-=2}while(0<v);for(s=m;0!==s;s--)for(r=t.bl_count[s];0!==r;)l<(n=t.heap[--i])||(u[2*n+1]!==s&&(t.opt_len+=(s-u[2*n+1])*u[2*n],u[2*n+1]=s),r--)}}(t,e),I(s,l,t.bl_count)}function k(t,e,i){var r,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)n=o,o=e[2*(r+1)+1],++a<h&&n===o||(a<u?t.bl_tree[2*n]+=a:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=n,u=(a=0)===o?(h=138,3):n===o?(h=6,3):(h=7,4))}function N(t,e,i){var r,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),r=0;r<=i;r++)if(n=o,o=e[2*(r+1)+1],!(++a<h&&n===o)){if(a<u)for(;O(t,n,t.bl_tree),0!=--a;);else 0!==n?(n!==s&&(O(t,n,t.bl_tree),a--),O(t,16,t.bl_tree),A(t,a-3,2)):a<=10?(O(t,17,t.bl_tree),A(t,a-3,3)):(O(t,18,t.bl_tree),A(t,a-11,7));s=n,u=(a=0)===o?(h=138,3):n===o?(h=6,3):(h=7,4)}}n(_);var B=!1;function U(t,e,i,n){var s,o,a;A(t,0+(n?1:0),3),o=e,a=i,P(s=t),S(s,a),S(s,~a),r.arraySet(s.pending_buf,s.window,o,a,s.pending),s.pending+=a}i._tr_init=function(t){B||(function(){var t,e,i,r,n,s=new Array(16);for(r=i=0;r<28;r++)for(y[r]=i,t=0;t<1<<u[r];t++)v[i++]=r;for(v[i-1]=r,r=n=0;r<16;r++)for(_[r]=n,t=0;t<1<<l[r];t++)m[n++]=r;for(n>>=7;r<a;r++)for(_[r]=n<<7,t=0;t<1<<l[r]-7;t++)m[256+n++]=r;for(e=0;e<=h;e++)s[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,s[8]++;for(;t<=255;)d[2*t+1]=9,t++,s[9]++;for(;t<=279;)d[2*t+1]=7,t++,s[7]++;for(;t<=287;)d[2*t+1]=8,t++,s[8]++;for(I(d,287,s),t=0;t<a;t++)p[2*t+1]=5,p[2*t]=C(t,5);g=new E(d,u,257,o,h),b=new E(p,l,0,a,h),x=new E(new Array(0),c,0,19,7)}(),B=!0),t.l_desc=new w(t.dyn_ltree,g),t.d_desc=new w(t.dyn_dtree,b),t.bl_desc=new w(t.bl_tree,x),t.bi_buf=0,t.bi_valid=0,R(t)},i._tr_stored_block=U,i._tr_flush_block=function(t,e,i,r){var n,o,a=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<s;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),L(t,t.l_desc),L(t,t.d_desc),a=function(t){var e;for(k(t,t.dyn_ltree,t.l_desc.max_code),k(t,t.dyn_dtree,t.d_desc.max_code),L(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*f[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=i+5,i+4<=n&&-1!==e?U(t,e,i,r):4===t.strategy||o===n?(A(t,2+(r?1:0),3),F(t,d,p)):(A(t,4+(r?1:0),3),function(t,e,i,r){var n;for(A(t,e-257,5),A(t,i-1,5),A(t,r-4,4),n=0;n<r;n++)A(t,t.bl_tree[2*f[n]+1],3);N(t,t.dyn_ltree,e-1),N(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),F(t,t.dyn_ltree,t.dyn_dtree)),R(t),r&&P(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(v[i]+s+1)]++,t.dyn_dtree[2*T(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){var e;A(t,2,3),O(t,256,d),16===(e=t).bi_valid?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,i){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t){if(!t.setImmediate){var e,i,r,n,s=1,o={},a=!1,h=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,e="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick(function(){c(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(n="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",f,!1):t.attachEvent("onmessage",f),function(e){t.postMessage(n+e,"*")}):t.MessageChannel?((r=new MessageChannel).port1.onmessage=function(t){c(t.data)},function(t){r.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,function(t){var e=h.createElement("script");e.onreadystatechange=function(){c(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(c,0,t)},u.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var i=new Array(arguments.length-1),r=0;r<i.length;r++)i[r]=arguments[r+1];var n={callback:t,args:i};return o[s]=n,e(s),s++},u.clearImmediate=l}function l(t){delete o[t]}function c(t){if(a)setTimeout(c,0,t);else{var e=o[t];if(e){a=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(undefined,i)}}(e)}finally{l(t),a=!1}}}}function f(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(n)&&c(+e.data.slice(n.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)})}}),mt={};function vt(t,e,i,r,n,s,o){try{var a=t[s](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(r,n)}function yt(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var s=t.apply(e,i);function o(t){vt(s,r,n,o,a,"next",t)}function a(t){vt(s,r,n,o,a,"throw",t)}o(void 0)})}}function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}function bt(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 gt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gt(t,e):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 new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function xt(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):xt(t,e)}function _t(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function Et(t,e,i,r){var n,s=arguments.length,o=s<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 a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function wt(t,e){var i,r,n,s={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=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(h){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}}((t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})})(mt,{ExportStatusMap:()=>Z_,SDK:()=>K_,spec:()=>qi});var Tt=new Uint8Array(16);function St(){if(!t&&!(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(Tt)}var At,Ot=[];for(At=0;At<256;++At)Ot.push((At+256).toString(16).slice(1));var Ct,It,Rt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pt(t,e,i){if(Rt.randomUUID&&!e&&!t)return Rt.randomUUID();var r=(t=t||{}).random||(t.rng||St)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){i=i||0;for(var n=0;n<16;++n)e[i+n]=r[n];return e}return function(t,e){return void 0===e&&(e=0),Ot[t[e+0]]+Ot[t[e+1]]+Ot[t[e+2]]+Ot[t[e+3]]+"-"+Ot[t[e+4]]+Ot[t[e+5]]+"-"+Ot[t[e+6]]+Ot[t[e+7]]+"-"+Ot[t[e+8]]+Ot[t[e+9]]+"-"+Ot[t[e+10]]+Ot[t[e+11]]+Ot[t[e+12]]+Ot[t[e+13]]+Ot[t[e+14]]+Ot[t[e+15]]}(r)}function Mt(t,e){return t.includes(e)||t.push(e),t}function Dt(t,e){var i=t.indexOf(e);return i>-1&&t.splice(i,1),t}function Ft(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 s=new ArrayBuffer(t.BYTES_PER_ELEMENT*n),o=new t.constructor(s);return o.set(t),o}return t}function Lt(t,e){var i=[0,0,0,0];if($t(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 xt(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:t[3]]);if(e)for(var s=0;s<4;s++)i[s]/=255;return i}function kt(t){var e=[];if(xt(t,Array)?t.forEach(function(t){var i=t[0],r=t[1],n=t[2],s=t[3],o=t[4];e.push({stop:Bt(i),color:[r,n,s,o]})}):Object.keys(t).forEach(function(i){var r=Lt(t[i]);e.push({stop:Bt(i),color:r})}),(e=e.sort(function(t,e){return t.stop-e.stop})).length){0!==e[0].stop&&e.unshift({stop:0,color:e[0].color.slice()});var i=e[e.length-1];1!==i.stop&&e.push({stop:1,color:i.color.slice()})}return e}function Nt(t,e,i,r){var n=[],s=1-i;if(r)for(var o=0;o<4;o++)n[o]=t[o]*s+e[o]*i;else{for(var a=0;a<3;a++)n[a]=Math.round(Math.sqrt(t[a]*t[a]*s+e[a]*e[a]*i));n[3]=Math.round(t[3]*s+e[3]*i)}return n}function Bt(t){var e=/^(-)?([\d+.]+)%$/.exec(t);return e?+e[2]/100*(e[1]?-1:1):+t}function Ut(){return/\b[Aa]ndroid\b/.test(navigator.userAgent)}function zt(){return Ut()||/\bOpenHarmony\b/.test(navigator.userAgent)||/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)}function Vt(t){var e=128,i={width:e,height:1,data:new Uint8Array(512)},r=i.data,n=kt(t);if(n.length){r.set(n[0].color,0);for(var s=1;s<127;s++){for(var o=s/e,a=void 0,h=void 0,u=0;u<n.length&&(a=n[u],h=n[u+1],!(a.stop<=o&&h.stop>o));u++);var l=Nt(a.color,h.color,(o-a.stop)/(h.stop-a.stop));r.set(l,4*s)}r.set(n[n.length-1].color,508)}return i}function Gt(t,e){void 0===e&&(e=2);var i=t.length;if(i<=1||1===e)return t;if(i<=30){for(var r=1;r<i;r++)jt(t,r,e);return t}return Ht(t,e)}function jt(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 Ht(t,e,i,r){if(void 0===i&&(i=0),void 0===r&&(r=t.length-1),i>=r)return t;for(var n,s=t[i],o=i,a=r;o<a;){if(2===e){for(;t[a].priority>s.priority&&a>=o;)a--;for(;t[o].priority<=s.priority&&o<a;)o++}else{for(;t[a].priority<s.priority&&a>=o;)a--;for(;t[o].priority>=s.priority&&o<a;)o++}var h;h=[t[a],t[o]],t[o]=h[0],t[a]=h[1]}return n=[t[o],t[i]],t[i]=n[0],t[o]=n[1],Ht(t,e,i,o-1),Ht(t,e,a+1,r),t}function Xt(t,e){if(void 0===e&&(e="item doesn't exist"),null==t)throw new Error(e)}function Wt(t){return/^[^\d.][\w-]*$/.test(t)}(It=Ct||(Ct={}))[It.none=1]="none",It[It.ascending=2]="ascending",It[It.descending=3]="descending";var Yt;function qt(t){return["%c[Galacean Effects]","color: #AA0100",""+t]}var Zt,Kt,Qt={error:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];var n;(n=console).error.apply(n,[].concat(qt(t),[i])),null==Yt||Yt("error",t,i)},info:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];var n;(n=console).debug.apply(n,[].concat(qt(t))),null==Yt||Yt("info",t,i)},warn:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];var n;(n=console).warn.apply(n,[].concat(qt(t))),null==Yt||Yt("warn",t,i)},register:function(t){t&&ee(t)&&(Yt=t)}};function Jt(){}function $t(t){return"string"==typeof t}(Kt=Zt||(Zt={}))[Kt.destroy=0]="destroy",Kt[Kt.keep=1]="keep",Kt[Kt.force=0]="force";var te=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function ee(t){return"[object Function]"===Object.prototype.toString.call(t)}function ie(t){return"[object Object]"===Object.prototype.toString.call(t)}function re(t){var e;return"object"==typeof t&&null!==t&&"CANVAS"===(null==(e=t.tagName)?void 0:e.toUpperCase())}function ne(t,e){return t+Math.random()*(e-t)}function se(){throw new Error("Destroyed item cannot be used again.")}function oe(){return Pt().replace(/-/g,"")}function ae(t,e,i){void 0===e&&(e="base64File"),void 0===i&&(i="");for(var r=t.split(",")[1]||t,n=atob(r),s=[],o=0;o<n.length;o+=512){for(var a=n.slice(o,o+512),h=new Array(a.length),u=0;u<a.length;u++)h[u]=a.charCodeAt(u);var l=new Uint8Array(h);s.push(l)}var c=new Blob(s,{type:i});return new File([c],e,{type:i})}var he={},ue=[],le={};function ce(t,e,i){le[t]&&Qt.error("Duplicate registration for plugin "+t+"."),le[t]=i,he[t]=e,Mt(ue,t)}var fe=function(){function t(t){var e={},i=[];ue.forEach(function(t){var r=he[t];i.includes(r)||(i.push(r),e[t]=r)});for(var r,n=bt(t);!(r=n()).done;){var s=r.value;if(!he[s])throw new Error("The plugin '"+s+"' not found."+pe(s))}this.plugins=Object.keys(e).map(function(t){var e=new(0,he[t]);return e.name=t,e}).sort(function(t,e){return t.order-e.order})}var e=t.prototype;return e.initializeComposition=function(t,e){this.plugins.forEach(function(i){return i.onCompositionConstructed(t,e)})},e.destroyComposition=function(t){this.plugins.forEach(function(e){return e.onCompositionDestroyed(t)})},e.resetComposition=function(t,e){this.plugins.forEach(function(i){return i.onCompositionReset(t,e)})},e.processRawJSON=function(t,e){var i=this;return yt(function(){return wt(this,function(r){return[2,i.callStatic("processRawJSON",t,e)]})})()},e.processAssets=function(t,e){var i=this;return yt(function(){return wt(this,function(r){return[2,i.callStatic("processAssets",t,e)]})})()},e.precompile=function(t,e){for(var i,r=bt(this.plugins);!(i=r()).done;){i.value.precompile(t,e)}},e.loadResources=function(t,e){var i=this;return yt(function(){return wt(this,function(r){return[2,i.callStatic("prepareResource",t,e)]})})()},e.callStatic=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];var n=this;return yt(function(){var e,r,s,o,a,h,u;return wt(this,function(l){for(e=[],r=n.plugins,s=0;s<r.length;s++)o=r[s],a=he[o.name],t in a&&e.push(Promise.resolve(null==(u=a[t])?void 0:(h=u).call.apply(h,[].concat([a],i))));return[2,Promise.all(e)]})})()},t}(),de={"alipay-downgrade":"@galacean/effects-plugin-alipay-downgrade",downgrade:"@galacean/effects-plugin-downgrade","editor-gizmo":"@galacean/effects-plugin-editor-gizmo",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 pe(t){var e=de[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 me,ve,ye,ge,be,xe,_e,Ee,we,Te,Se,Ae,Oe,Ce,Ie,Re,Pe,Me,De,Fe,Le,ke,Ne,Be,Ue,ze,Ve,Ge,je=function(){function t(){this.order=100,this.name=""}var e=t.prototype;return e.precompile=function(t,e){},e.onCompositionConstructed=function(t,e){},e.onCompositionItemLifeBegin=function(t,e){},e.onCompositionItemLifeEnd=function(t,e){},e.onCompositionItemRemoved=function(t,e){},e.onCompositionReset=function(t,e){},e.onCompositionWillReset=function(t,e){},e.onCompositionDestroyed=function(t){},e.onCompositionUpdate=function(t,e){},e.prepareRenderFrame=function(t,e){return!1},e.postProcessFrame=function(t,e){},t}();function He(t,e){return(He=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xe(t,e){if("function"!=typeof e&&null!==e)throw new 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&&He(t,e)}(ve=me||(me={}))["1_0"]="1.0",ve["1_1"]="1.1",ve["1_2"]="1.2",ve["1_3"]="1.3",ve["1_5"]="1.5",ve["1_8"]="1.8",ve["2_0"]="2.0",ve["2_1"]="2.1",ve["2_2"]="2.2",ve["2_3"]="2.3",ve["2_4"]="2.4",ve["3_0"]="3.0",ve["3_1"]="3.1",ve["3_2"]="3.2",ve["3_3"]="3.3",ve.LATEST="3.3",(ge=ye||(ye={})).S="S",ge.APlus="A+",ge.A="A",ge.BPlus="B+",ge.B="B",(xe=be||(be={}))[xe.ALPHA=0]="ALPHA",xe[xe.ADD=1]="ADD",xe[xe.MULTIPLY=2]="MULTIPLY",xe[xe.BRIGHTNESS=3]="BRIGHTNESS",xe[xe.SUBTRACTION=4]="SUBTRACTION",xe[xe.STRONG_LIGHT=5]="STRONG_LIGHT",xe[xe.WEAK_LIGHT=6]="WEAK_LIGHT",xe[xe.SUPERPOSITION=7]="SUPERPOSITION",(Ee=_e||(_e={}))[Ee.DOUBLE=1032]="DOUBLE",Ee[Ee.FRONT=1028]="FRONT",Ee[Ee.BACK=1029]="BACK",(Te=we||(we={}))[Te.OBSCURED=2]="OBSCURED",Te[Te.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",(Ae=Se||(Se={}))[Ae.NONE=0]="NONE",Ae[Ae.SPHERE=1]="SPHERE",Ae[Ae.CONE=2]="CONE",Ae[Ae.HEMISPHERE=3]="HEMISPHERE",Ae[Ae.CIRCLE=4]="CIRCLE",Ae[Ae.DONUT=5]="DONUT",Ae[Ae.RECTANGLE=6]="RECTANGLE",Ae[Ae.RECTANGLE_EDGE=7]="RECTANGLE_EDGE",Ae[Ae.EDGE=8]="EDGE",Ae[Ae.TEXTURE=9]="TEXTURE",(Ce=Oe||(Oe={}))[Ce.GYROSCOPE=0]="GYROSCOPE",Ce[Ce.SPINE=1]="SPINE",(Re=Ie||(Ie={}))[Re.CLICK=0]="CLICK",Re[Re.MESSAGE=1]="MESSAGE",Re[Re.DRAG=2]="DRAG",(Me=Pe||(Pe={}))[Me.NONE=0]="NONE",Me[Me.NOTIFY=1]="NOTIFY",Me[Me.RESUME_PLAYER=2]="RESUME_PLAYER",Me[Me.REMOVE=3]="REMOVE",Me[Me.PAUSE=4]="PAUSE",(Fe=De||(De={})).base="0",Fe.sprite="1",Fe.particle="2",Fe.null="3",Fe.interact="4",Fe.plugin="5",Fe.camera="6",Fe.composition="7",Fe.spine="spine",Fe.mesh="mesh",Fe.tree="tree",Fe.text="text",Fe.light="light",Fe.skybox="skybox",Fe.effect="effect",Fe.shape="shape",Fe.postProcessVolume="postProcessVolume",Fe.node="node",Fe.video="video",Fe.audio="audio",Fe.richtext="richtext",(ke=Le||(Le={}))[ke.BILLBOARD=0]="BILLBOARD",ke[ke.MESH=1]="MESH",ke[ke.VERTICAL_BILLBOARD=2]="VERTICAL_BILLBOARD",ke[ke.HORIZONTAL_BILLBOARD=3]="HORIZONTAL_BILLBOARD",(Be=Ne||(Ne={}))[Be.PARTICLE_ORIGIN_CENTER=0]="PARTICLE_ORIGIN_CENTER",Be[Be.PARTICLE_ORIGIN_LEFT_TOP=1]="PARTICLE_ORIGIN_LEFT_TOP",Be[Be.PARTICLE_ORIGIN_LEFT_CENTER=2]="PARTICLE_ORIGIN_LEFT_CENTER",Be[Be.PARTICLE_ORIGIN_LEFT_BOTTOM=3]="PARTICLE_ORIGIN_LEFT_BOTTOM",Be[Be.PARTICLE_ORIGIN_CENTER_TOP=4]="PARTICLE_ORIGIN_CENTER_TOP",Be[Be.PARTICLE_ORIGIN_CENTER_BOTTOM=5]="PARTICLE_ORIGIN_CENTER_BOTTOM",Be[Be.PARTICLE_ORIGIN_RIGHT_TOP=6]="PARTICLE_ORIGIN_RIGHT_TOP",Be[Be.PARTICLE_ORIGIN_RIGHT_CENTER=7]="PARTICLE_ORIGIN_RIGHT_CENTER",Be[Be.PARTICLE_ORIGIN_RIGHT_BOTTOM=8]="PARTICLE_ORIGIN_RIGHT_BOTTOM",(ze=Ue||(Ue={})).Opaque="Opaque",ze.Transparent="Transparent",(Ge=Ve||(Ve={})).Both="Both",Ge.Back="Back",Ge.Front="Front";var We,Ye,qe,Ze,Ke,Qe,Je,$e,ti,ei,ii,ri,ni,si,oi,ai,hi,ui,li,ci,fi,di,pi,mi,vi,yi,gi,bi,xi,_i,Ei,wi,Ti,Si;(Ye=We||(We={}))[Ye.portrait=1]="portrait",Ye[Ye.landscape=0]="landscape",(Ze=qe||(qe={}))[Ze.CONSTANT=0]="CONSTANT",Ze[Ze.CONSTANT_VEC2=1]="CONSTANT_VEC2",Ze[Ze.CONSTANT_VEC3=2]="CONSTANT_VEC3",Ze[Ze.CONSTANT_VEC4=3]="CONSTANT_VEC4",Ze[Ze.RANDOM=4]="RANDOM",Ze[Ze.LINE=5]="LINE",Ze[Ze.CURVE=6]="CURVE",Ze[Ze.BEZIER_PATH=7]="BEZIER_PATH",Ze[Ze.RGBA_COLOR=8]="RGBA_COLOR",Ze[Ze.GRADIENT_COLOR=9]="GRADIENT_COLOR",Ze[Ze.SHAPE_POINTS=10]="SHAPE_POINTS",Ze[Ze.SHAPE_SPLITS=11]="SHAPE_SPLITS",Ze[Ze.LINEAR_PATH=12]="LINEAR_PATH",Ze[Ze.COLORS=13]="COLORS",Ze[Ze.BINARY=20]="BINARY",Ze[Ze.BEZIER_CURVE=21]="BEZIER_CURVE",Ze[Ze.BEZIER_CURVE_PATH=22]="BEZIER_CURVE_PATH",Ze[Ze.BEZIER_CURVE_QUAT=23]="BEZIER_CURVE_QUAT",Ze[Ze.COLOR_CURVE=24]="COLOR_CURVE",Ze[Ze.VECTOR4_CURVE=25]="VECTOR4_CURVE",Ze[Ze.VECTOR2_CURVE=26]="VECTOR2_CURVE",(Qe=Ke||(Ke={}))[Qe.AUTO=0]="AUTO",Qe[Qe.EASE=1]="EASE",Qe[Qe.EASE_IN=2]="EASE_IN",Qe[Qe.EASE_OUT=3]="EASE_OUT",Qe[Qe.LINE=4]="LINE",Qe[Qe.HOLD=5]="HOLD",Qe[Qe.LINE_OUT=6]="LINE_OUT",($e=Je||(Je={}))[$e.destroy=0]="destroy",$e[$e.restart=5]="restart",$e[$e.forward=2]="forward",$e[$e.freeze=4]="freeze",(ei=ti||(ti={}))[ei.none=0]="none",ei[ei.removeParticle=1]="removeParticle",(ri=ii||(ii={}))[ri.RANDOM=0]="RANDOM",ri[ri.UNIDIRECTIONAL_CYCLE=1]="UNIDIRECTIONAL_CYCLE",ri[ri.BIDIRECTIONAL_CYCLE=2]="BIDIRECTIONAL_CYCLE",ri[ri.UNIFORM_BURST=3]="UNIFORM_BURST",(si=ni||(ni={})).point="point",si.spot="spot",si.directional="directional",si.ambient="ambient",(ai=oi||(oi={}))[ai.box=2]="box",ai[ai.sphere=3]="sphere",(ui=hi||(hi={})).orthographic="orthographic",ui.perspective="perspective",(ci=li||(li={})).unlit="unlit",ci.pbr="pbr",ci.hair="hair",(di=fi||(fi={}))[di.opaque=100]="opaque",di[di.masked=101]="masked",di[di.translucent=102]="translucent",di[di.additive=103]="additive",(mi=pi||(pi={})).none="none",mi.uv="uv",mi.normal="normal",mi.basecolor="basecolor",mi.alpha="alpha",mi.metallic="metallic",mi.roughness="roughness",mi.ao="ao",mi.emissive="emissive",mi.diffuse="diffuse",(yi=vi||(vi={}))[yi.display=0]="display",yi[yi.clip=1]="clip",yi[yi.ellipsis=2]="ellipsis",(bi=gi||(gi={}))[bi.top=0]="top",bi[bi.middle=1]="middle",bi[bi.bottom=2]="bottom",(_i=xi||(xi={}))[_i.left=0]="left",_i[_i.middle=1]="middle",_i[_i.right=2]="right",(wi=Ei||(Ei={})).normal="normal",wi.bold="bold",wi.lighter="lighter",(Si=Ti||(Ti={})).normal="normal",Si.italic="italic",Si.oblique="oblique";var Ai,Oi,Ci,Ii,Ri,Pi,Mi,Di,Fi,Li,ki,Ni,Bi,Ui,zi,Vi,Gi,ji,Hi,Xi,Wi={WhiteTexture:"whitetexture00000000000000000000",TransparentTexture:"transparenttexture00000000000000000000",PBRShader:"pbr00000000000000000000000000000",UnlitShader:"unlit000000000000000000000000000"};(Oi=Ai||(Ai={}))[Oi.Custom=0]="Custom",Oi[Oi.Rectangle=1]="Rectangle",Oi[Oi.Ellipse=2]="Ellipse",Oi[Oi.Polygon=3]="Polygon",Oi[Oi.Star=4]="Star",(Ii=Ci||(Ci={}))[Ii.Butt=0]="Butt",Ii[Ii.Round=1]="Round",Ii[Ii.Square=2]="Square",(Pi=Ri||(Ri={}))[Pi.Round=0]="Round",Pi[Pi.Bevel=1]="Bevel",Pi[Pi.Miter=2]="Miter",(Di=Mi||(Mi={})).video="video",Di.image="image",(Li=Fi||(Fi={})).video="video",Li.audio="audio",(Ni=ki||(ki={})).VFXItemData="VFXItemData",Ni.Material="Material",Ni.Shader="Shader",Ni.Geometry="Geometry",Ni.Texture="Texture",Ni.Image="Image",Ni.AnimationClip="AnimationClip",Ni.BinaryAsset="BinaryAsset",Ni.TrackAsset="TrackAsset",Ni.TimelineAsset="TimelineAsset",Ni.ObjectBindingTrack="ObjectBindingTrack",Ni.TransformTrack="TransformTrack",Ni.SpriteColorTrack="SpriteColorTrack",Ni.ActivationTrack="ActivationTrack",Ni.SubCompositionTrack="SubCompositionTrack",Ni.FloatPropertyTrack="FloatPropertyTrack",Ni.ColorPropertyTrack="ColorPropertyTrack",Ni.Vector2PropertyTrack="Vector2PropertyTrack",Ni.Vector4PropertyTrack="Vector4PropertyTrack",Ni.TransformPlayableAsset="TransformPlayableAsset",Ni.SpriteColorPlayableAsset="SpriteColorPlayableAsset",Ni.ActivationPlayableAsset="ActivationPlayableAsset",Ni.SubCompositionPlayableAsset="SubCompositionPlayableAsset",Ni.FloatPropertyPlayableAsset="FloatPropertyPlayableAsset",Ni.ColorPropertyPlayableAsset="ColorPropertyPlayableAsset",Ni.Vector2PropertyPlayableAsset="Vector2PropertyPlayableAsset",Ni.Vector4PropertyPlayableAsset="Vector4PropertyPlayableAsset",Ni.MeshComponent="MeshComponent",Ni.SkyboxComponent="SkyboxComponent",Ni.LightComponent="LightComponent",Ni.CameraComponent="CameraComponent",Ni.ModelPluginComponent="ModelPluginComponent",Ni.TreeComponent="TreeComponent",Ni.AnimationComponent="AnimationComponent",Ni.SpineComponent="SpineComponent",Ni.VideoComponent="VideoComponent",Ni.AudioComponent="AudioComponent",Ni.RichTextComponent="RichTextComponent",Ni.OrientationComponent="OrientationComponent",Ni.ShapeComponent="ShapeComponent",Ni.SpriteComponent="SpriteComponent",Ni.ParticleSystem="ParticleSystem",Ni.InteractComponent="InteractComponent",Ni.CameraController="CameraController",Ni.PostProcessVolume="PostProcessVolume",Ni.EffectComponent="EffectComponent",Ni.TextComponent="TextComponent",Ni.TimelineClip="TimelineClip",(Ui=Bi||(Bi={}))[Ui.POINTS=0]="POINTS",Ui[Ui.LINES=1]="LINES",Ui[Ui.LINE_LOOP=2]="LINE_LOOP",Ui[Ui.LINE_STRIP=3]="LINE_STRIP",Ui[Ui.TRIANGLES=4]="TRIANGLES",Ui[Ui.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Ui[Ui.TRIANGLE_FAN=6]="TRIANGLE_FAN",(Vi=zi||(zi={}))[Vi.Float16=0]="Float16",Vi[Vi.Float32=1]="Float32",Vi[Vi.Int8=2]="Int8",Vi[Vi.Int16=3]="Int16",Vi[Vi.Int32=4]="Int32",Vi[Vi.UInt8=5]="UInt8",Vi[Vi.UInt16=6]="UInt16",Vi[Vi.UInt32=7]="UInt32",(ji=Gi||(Gi={}))[ji.None=-1]="None",ji[ji.UInt8=0]="UInt8",ji[ji.UInt16=1]="UInt16",ji[ji.UInt32=2]="UInt32",(Xi=Hi||(Hi={})).Position="POSITION",Xi.Uv="TEXCOORD0",Xi.Uv2="TEXCOORD1",Xi.Normal="NORMAL",Xi.Tangent="TANGENT",Xi.Color="COLOR",Xi.Joints="JOINTS",Xi.Weights="WEIGHTS",Xi.PositionBS0="POSITION_BS0",Xi.PositionBS1="POSITION_BS1",Xi.PositionBS2="POSITION_BS2",Xi.PositionBS3="POSITION_BS3",Xi.PositionBS4="POSITION_BS4",Xi.PositionBS5="POSITION_BS5",Xi.PositionBS6="POSITION_BS6",Xi.PositionBS7="POSITION_BS7",Xi.NormalBS0="NORMAL_BS0",Xi.NormalBS1="NORMAL_BS1",Xi.NormalBS2="NORMAL_BS2",Xi.NormalBS3="NORMAL_BS3",Xi.TangentBS0="TANGENT_BS0",Xi.TangentBS1="TANGENT_BS1",Xi.TangentBS2="TANGENT_BS2",Xi.TangentBS3="TANGENT_BS3";var Yi=me.LATEST,qi=Object.freeze({__proto__:null,LATEST_VERSION:Yi,get RenderLevel(){return ye},get BlendingMode(){return be},get SideMode(){return _e},get ObscuredMode(){return we},get ParticleEmitterShapeType(){return Se},get PluginType(){return Oe},get InteractType(){return Ie},get InteractBehavior(){return Pe},get ItemType(){return De},get RenderMode(){return Le},get ParticleOrigin(){return Ne},get RenderType(){return Ue},get RenderFace(){return Ve},get CameraClipMode(){return We},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 qe},get BezierKeyframeType(){return Ke},get JSONSceneVersion(){return me},get EndBehavior(){return Je},get ParticleInteractionBehavior(){return ti},get ShapeArcMode(){return ii},get LightType(){return ni},get ModelBoundingType(){return oi},get CameraType(){return hi},get MaterialType(){return li},get MaterialBlending(){return fi},get RenderMode3D(){return pi},get TextOverflow(){return vi},get TextBaseline(){return gi},get TextAlignment(){return xi},get TextWeight(){return Ei},get FontStyle(){return Ti},BuiltinObjectGUID:Wi,get ShapePrimitiveType(){return Ai},get LineCap(){return Ci},get LineJoin(){return Ri},get BackgroundType(){return Mi},get MultimediaType(){return Fi},get DataType(){return ki},get GeometryType(){return Bi},get VertexFormatType(){return zi},get IndexFormatType(){return Gi},get VertexBufferSemantic(){return Hi}});function Zi(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 Ki(t,e,i){return e&&Zi(t.prototype,e),i&&Zi(t,i),t}var Qi=new Map,Ji=new Map,$i={};function tr(t){return function(e,i){$i[t]&&console.warn("Class "+t+" is already registered."),$i[t]=e}}function er(t,e){return function(t,e){return function(i,r){var n=function(t){var e=t.constructor;Qi.get(e)||Qi.set(e,{});return Qi.get(e)}(i);n&&(n[r]||(n[r]={type:t,sourceName:e}))}}(t,e)}function ir(t){var e=t.constructor;if(Ji.get(e))return Ji.get(e);var i={};Ji.set(e,i);for(var r=t,n=e;n;){var s=Qi.get(n);for(var o in s)i[o]=s[o];var a=Object.getPrototypeOf(r);if((n=Object.getPrototypeOf(a).constructor)===Object)break;r=a}return i}var rr=function(){function t(t){this.engine=t,this.guid=oe(),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){},e.dispose=function(){},t.is=function(e){return xt(e,t)&&"guid"in e},t}(),nr=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).isAwakeCalled=!1,e.isStartCalled=!1,e.isEnableCalled=!1,e._enabled=!0,e}Xe(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.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&&Dt(this.item.components,this)},i.start=function(){this.isStartCalled||(this.isStartCalled=!0,this.onStart())},Ki(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}(rr);Et([er()],nr.prototype,"item",void 0),Et([er()],nr.prototype,"_enabled",void 0);var sr=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).materials=[],e._priority=0,e}Xe(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)},Ki(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}(nr);Et([er()],sr.prototype,"materials",void 0),Et([er()],sr.prototype,"_priority",void 0);var or=2*Math.PI,ar=Math.PI/180,hr=180/Math.PI,ur=1e-6;function lr(t,e){return Math.abs(t-e)<ur||t===1/0&&e===1/0||t===-1/0&&e===-1/0}var cr=function(t,e,i){return(1-i)*t+i*e};function fr(t,e,i){var r=isNaN(e)?-1/0:e,n=isNaN(i)?1/0:i,s=Math.min(r,n),o=Math.max(r,n);return Math.min(Math.max(t,s),o)}var dr=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):xt(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):xt(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):xt(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):xt(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=ur,e=this.x,i=this.y;return Math.abs(e)<=t&&Math.abs(i)<=t},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}();dr.ONE=new dr(1,1),dr.ZERO=new dr(0,0);var pr=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):xt(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):xt(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):xt(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):xt(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,s=e.x,o=e.y,a=e.z;return this.x=r*a-n*o,this.y=n*s-i*a,this.z=i*o-r*s,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=ur,e=this,i=e.x,r=e.y,n=e.z;return Math.abs(i)<=t&&Math.abs(r)<=t&&Math.abs(n)<=t},e.toArray=function(){return[this.x,this.y,this.z]},e.toVector2=function(){return new dr(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}();pr.X=new pr(1,0,0),pr.Y=new pr(0,1,0),pr.Z=new pr(0,0,1),pr.ONE=new pr(1,1,1),pr.ZERO=new pr(0,0,0);var mr=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,s;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!=(s=t[e+3])?s: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):xt(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):xt(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):xt(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):xt(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=ur,e=this,i=e.x,r=e.y,n=e.z,s=e.w;return Math.abs(i)<=t&&Math.abs(r)<=t&&Math.abs(n)<=t&&Math.abs(s)<=t},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector3=function(){return new pr(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}();mr.ONE=new mr(1,1,1,1),mr.ZERO=new mr(0,0,0,0);var vr=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).meshCollider=new Ya,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}Xe(e,t);var i=e.prototype;return i.render=function(t){t.renderingData.currentFrame.globalUniforms&&t.setGlobalMatrix("effects_ObjectToWorld",this.transform.getWorldMatrix());for(var e=0;e<this.materials.length;e++)t.drawGeometry(this.geometry,this.materials[e],e)},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},e}(sr);Et([er()],vr.prototype,"geometry",void 0);var yr=function(t){function e(e){var i;return(i=t.call(this,e)||this).name="EffectComponent",i}Xe(e,t);var i=e.prototype;return i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.onUpdate=function(t){var e,i=this.item.time,r=null!=(e=this.material.getVector4("_Time"))?e:new mr;this.material.setVector4("_Time",r.set(i/20,i,2*i,3*i))},i.fromData=function(e){t.prototype.fromData.call(this,e),this.material=this.materials[0]},e}(vr);yr=Et([tr(ki.EffectComponent)],yr);var gr=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 Xe(e,t),e.prototype.onStart=function(){var t=this.item.composition;t&&(t.renderFrame.globalVolume=this)},e}(nr);Et([er()],gr.prototype,"bloom",void 0),Et([er()],gr.prototype,"vignette",void 0),Et([er()],gr.prototype,"tonemapping",void 0),Et([er()],gr.prototype,"colorAdjustments",void 0),gr=Et([tr(ki.PostProcessVolume)],gr);var br=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,s;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!=(s=t[e+3])?s:0,this},e.setFromHSV=function(t,e,i,r){void 0===r&&(r=1);var n=i*e,s=t/60,o=n*(1-Math.abs(s%2-1)),a=0,h=0,u=0;s>=0&&s<=1?(a=n,h=o):s>=1&&s<=2?(a=o,h=n):s>=2&&s<=3?(h=n,u=o):s>=3&&s<=4?(h=o,u=n):s>=4&&s<=5?(a=o,u=n):s>=5&&s<=6&&(a=n,u=o);var l=i-n;return this.set(a+l,h+l,u+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):xt(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):xt(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):xt(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):xt(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 mr(this.r,this.g,this.b,this.a)},e.toHSV=function(){var e=this,i=e.r,r=e.g,n=e.b,s=e.a,o=Math.max(i,r,n),a=Math.min(i,r,n),h=o-a,u=0,l=0;return 0!==o&&(l=h/o),o!=a&&(o==i?(u=(r-n)/h,r<n&&(u+=6)):o==r?u=(n-i)/h+2:o==n&&(u=(i-r)/h+4),u*=60),new t(u,l,o,s)},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)),s=t.ToHex(Math.round(255*this.a));return e?"#"+i+r+n+s:"#"+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}();br.BLACK=new br(0,0,0,1),br.BLUE=new br(0,0,1,1),br.CLEAR=new br(0,0,0,0),br.CYAN=new br(0,1,1,1),br.GRAY=new br(.5,.5,.5,1),br.GREEN=new br(0,1,0,1),br.MAGENTA=new br(1,0,1,1),br.RED=new br(1,0,0,1),br.WHITE=new br(1,1,1,1),br.YELLOW=new br(1,.92,.016,1);var xr=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),s=t.tempVec0;return s.copyFrom(e).normalize(),this.x=s.x*n,this.y=s.y*n,this.z=s.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],s=e[1],o=e[5],a=e[9],h=e[2],u=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=(u-a)*f,this.y=(n-h)*f,this.z=(s-r)*f}else if(i>o&&i>l){var d=2*Math.sqrt(1+i-o-l);this.w=(u-a)/d,this.x=.25*d,this.y=(r+s)/d,this.z=(n+h)/d,this.negate()}else if(o>l){var p=2*Math.sqrt(1+o-i-l);this.w=(n-h)/p,this.x=(r+s)/p,this.y=.25*p,this.z=(a+u)/p,this.negate()}else{var m=2*Math.sqrt(1+l-i-o);this.w=(s-r)/m,this.x=(n+h)/m,this.y=(a+u)/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.w=i):(this.x=0,this.y=-t.z,this.z=t.y,this.w=i)):(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(fr(this.dot(t),-1,1)))},e.rotateTowards=function(t,e){var i=this.angleTo(t);if(0===i)return this;var r=Math.min(1,e/i);return this.slerp(t,r),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,s=t.w,o=e.x,a=e.y,h=e.z,u=e.w;return this.x=i*u+s*o+r*h-n*a,this.y=r*u+s*a+n*o-i*h,this.z=n*u+s*h+i*a-r*o,this.w=s*u-i*o-r*a-n*h,this},e.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copyFrom(t);var i=this,r=i.x,n=i.y,s=i.z,o=i.w,a=o*t.w+r*t.x+n*t.y+s*t.z;if(a<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,a=-a):this.copyFrom(t),a>=1)return this.w=o,this.x=r,this.y=n,this.z=s,this;var h=1-a*a;if(h<=Number.EPSILON){var u=1-e;return this.w=u*o+e*this.w,this.x=u*r+e*this.x,this.y=u*n+e*this.y,this.z=u*s+e*this.z,this.normalize(),this}var l=Math.sqrt(h),c=Math.atan2(l,a),f=Math.sin((1-e)*c)/l,d=Math.sin(e*c)/l;return this.w=o*f+this.w*d,this.x=r*f+this.x*d,this.y=n*f+this.y*d,this.z=s*f+this.z*d,this},e.slerpQuaternions=function(t,e,i){this.copyFrom(t).slerp(e,i)},e.rotateVector3=function(t,e){var i=this,r=i.x,n=i.y,s=i.z,o=i.w,a=t.x,h=t.y,u=t.z,l=o*a+n*u-s*h,c=o*h+s*a-r*u,f=o*u+r*h-n*a,d=-r*a-n*h-s*u,p=null!=e?e:t;return p.x=l*o+d*-r+c*-s-f*-n,p.y=c*o+d*-n+f*-r-l*-s,p.z=f*o+d*-s+l*-n-c*-r,p},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(pr.ZERO,this,pr.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}();xr.tempVec0=new pr;var _r=function(){function t(t,e,i,r,n,s,o,a,h,u,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===s&&(s=1),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),void 0===u&&(u=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,s,o,a,h,u,l,c,f,d,p,m]}var e=t.prototype;return e.set=function(t,e,i,r,n,s,o,a,h,u,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]=s,v[6]=o,v[7]=a,v[8]=h,v[9]=u,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,s,o,a,h,u,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]=s,v[9]=o,v[13]=a,v[2]=h,v[6]=u,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),s=Math.sin(i),o=1-n,a=r.x,h=r.y,u=r.z,l=o*a,c=o*h;return this.set(l*a+n,l*h+s*u,l*u-s*h,0,l*h-s*u,c*h+n,c*u+s*a,0,l*u+s*h,c*u-s*a,o*u*u+n,0,0,0,0,1)},e.setFromEuler=function(t){return t.toMatrix4(this),this},e.setFromQuaternion=function(t){return this.compose(pr.ZERO,t,pr.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,s=t.tempVec1,o=t.tempVec2;o.subtractVectors(e,i),o.normalize(),n.crossVectors(r,o),n.normalize(),s.crossVectors(o,n);var a=this.elements;return a[0]=n.x,a[1]=s.x,a[2]=o.x,a[3]=0,a[4]=n.y,a[5]=s.y,a[6]=o.y,a[7]=0,a[8]=n.z,a[9]=s.z,a[10]=o.z,a[11]=0,a[12]=-n.dot(e),a[13]=-s.dot(e),a[14]=-o.dot(e),a[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){for(var e=0;e<16;e++)this.elements[e]*=t;return this}return this.multiplyMatrices(this,t)},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,s=i[0],o=i[4],a=i[8],h=i[12],u=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],b=i[11],x=i[15],_=r[0],E=r[4],w=r[8],T=r[12],S=r[1],A=r[5],O=r[9],C=r[13],I=r[2],R=r[6],P=r[10],M=r[14],D=r[3],F=r[7],L=r[11],k=r[15];return n[0]=s*_+o*S+a*I+h*D,n[4]=s*E+o*A+a*R+h*F,n[8]=s*w+o*O+a*P+h*L,n[12]=s*T+o*C+a*M+h*k,n[1]=u*_+l*S+c*I+f*D,n[5]=u*E+l*A+c*R+f*F,n[9]=u*w+l*O+c*P+f*L,n[13]=u*T+l*C+c*M+f*k,n[2]=d*_+p*S+m*I+v*D,n[6]=d*E+p*A+m*R+v*F,n[10]=d*w+p*O+m*P+v*L,n[14]=d*T+p*C+m*M+v*k,n[3]=y*_+g*S+b*I+x*D,n[7]=y*E+g*A+b*R+x*F,n[11]=y*w+g*O+b*P+x*L,n[15]=y*T+g*C+b*M+x*k,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],s=t[1],o=t[5],a=t[9],h=t[13],u=t[2],l=t[6],c=t[10],f=t[14];return t[3]*(+n*a*l-r*h*l-n*o*c+i*h*c+r*o*f-i*a*f)+t[7]*(+e*a*f-e*h*c+n*s*c-r*s*f+r*h*u-n*a*u)+t[11]*(+e*h*l-e*o*f-n*s*l+i*s*f+n*o*u-i*h*u)+t[15]*(-r*o*u-e*a*l+e*o*c+r*s*l-i*s*c+i*a*u)},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],s=t[4],o=t[5],a=t[6],h=t[7],u=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*h-p*c*h+p*a*f-o*m*f-l*a*v+o*c*v,g=d*c*h-u*m*h-d*a*f+s*m*f+u*a*v-s*c*v,b=u*p*h-d*l*h+d*o*f-s*p*f-u*o*v+s*l*v,x=d*l*a-u*p*a-d*o*c+s*p*c+u*o*m-s*l*m,_=e*y+i*g+r*b+n*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var E=1/_;return t[0]=y*E,t[1]=(p*c*n-l*m*n-p*r*f+i*m*f+l*r*v-i*c*v)*E,t[2]=(o*m*n-p*a*n+p*r*h-i*m*h-o*r*v+i*a*v)*E,t[3]=(l*a*n-o*c*n-l*r*h+i*c*h+o*r*f-i*a*f)*E,t[4]=g*E,t[5]=(u*m*n-d*c*n+d*r*f-e*m*f-u*r*v+e*c*v)*E,t[6]=(d*a*n-s*m*n-d*r*h+e*m*h+s*r*v-e*a*v)*E,t[7]=(s*c*n-u*a*n+u*r*h-e*c*h-s*r*f+e*a*f)*E,t[8]=b*E,t[9]=(d*l*n-u*p*n-d*i*f+e*p*f+u*i*v-e*l*v)*E,t[10]=(s*p*n-d*o*n+d*i*h-e*p*h-s*i*v+e*o*v)*E,t[11]=(u*o*n-s*l*n-u*i*h+e*l*h+s*i*f-e*o*f)*E,t[12]=x*E,t[13]=(u*p*r-d*l*r+d*i*c-e*p*c-u*i*m+e*l*m)*E,t[14]=(d*o*r-s*p*r-d*i*a+e*p*a+s*i*m-e*o*m)*E,t[15]=(s*l*r-u*o*r+u*i*a-e*l*a-s*i*c+e*o*c)*E,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=pr.ZERO);var n=this.elements,s=e.x,o=e.y,a=e.z,h=e.w,u=-r.x,l=-r.y,c=-r.z,f=s+s,d=o+o,p=a+a,m=s*f,v=s*d,y=s*p,g=o*d,b=o*p,x=a*p,_=h*f,E=h*d,w=h*p,T=i.x,S=i.y,A=i.z;return n[0]=(1-(g+x))*T,n[1]=(v+w)*T,n[2]=(y-E)*T,n[3]=0,n[4]=(v-w)*S,n[5]=(1-(m+x))*S,n[6]=(b+_)*S,n[7]=0,n[8]=(y+E)*A,n[9]=(b-_)*A,n[10]=(1-(m+g))*A,n[11]=0,n[12]=u*n[0]+l*n[4]+c*n[8]-u+t.x,n[13]=u*n[1]+l*n[5]+c*n[9]-l+t.y,n[14]=u*n[2]+l*n[6]+c*n[10]-c+t.z,this},e.decompose=function(e,i,r){var n=t.tempVec0,s=this.elements,o=n.set(s[0],s[1],s[2]).length(),a=n.set(s[4],s[5],s[6]).length(),h=n.set(s[8],s[9],s[10]).length();this.determinant()<0&&(o=-o),e.x=s[12],e.y=s[13],e.z=s[14];var u=t.tempMat0;u.copyFrom(this);var l=1/o,c=1/a,f=1/h;return u.elements[0]*=l,u.elements[1]*=l,u.elements[2]*=l,u.elements[4]*=c,u.elements[5]*=c,u.elements[6]*=c,u.elements[8]*=f,u.elements[9]*=f,u.elements[10]*=f,i.setFromRotationMatrix(u),r.x=o,r.y=a,r.z=h,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 pr,e=new xr,i=new pr;return this.decompose(t,e,i),{translation:t,rotation:e,scale:i}},e.orthographic=function(t,e,i,r,n,s){var o=1/(e-t),a=1/(i-r),h=1/(s-n),u=-(e+t)*o,l=-(i+r)*a,c=-(s+n)*h;o*=2,a*=2,h*=-2;var f=this.elements;return f[0]=o,f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[5]=a,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[10]=h,f[11]=0,f[12]=u,f[13]=l,f[14]=c,f[15]=1,this},e.perspective=function(t,e,i,r,n){var s=1/Math.tan(.5*t),o=1/(i-r),a=this.elements;return a[0]=n?s:s/e,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=n?s*e:s,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=(r+i)*o,a[11]=-1,a[12]=0,a[13]=0,a[14]=2*r*i*o,a[15]=0,null!==r&&r!==1/0||(a[10]=-1,a[14]=-2*i),this},e.projectPoint=function(t,e){var i=t.x,r=t.y,n=t.z,s=this.elements,o=null!=e?e:t;o.x=s[0]*i+s[4]*r+s[8]*n+s[12],o.y=s[1]*i+s[5]*r+s[9]*n+s[13],o.z=s[2]*i+s[6]*r+s[10]*n+s[14];var a=s[3]*i+s[7]*r+s[11]*n+s[15];return o.multiply(1/a)},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,s=this.elements,o=null!=e?e:t;return o.x=s[0]*i+s[4]*r+s[8]*n+s[12],o.y=s[1]*i+s[5]*r+s[9]*n+s[13],o.z=s[2]*i+s[6]*r+s[10]*n+s[14],o},e.transformNormal=function(t,e){var i=t.x,r=t.y,n=t.z,s=this.elements,o=null!=e?e:t;return o.x=s[0]*i+s[4]*r+s[8]*n,o.y=s[1]*i+s[5]*r+s[9]*n,o.z=s[2]*i+s[6]*r+s[10]*n,o.normalize()},e.transformVector4=function(t,e){var i=t.x,r=t.y,n=t.z,s=t.w,o=this.elements,a=null!=e?e:t;return a.x=o[0]*i+o[4]*r+o[8]*n+o[12]*s,a.y=o[1]*i+o[5]*r+o[9]*n+o[13]*s,a.z=o[2]*i+o[6]*r+o[10]*n+o[14]*s,a.w=o[3]*i+o[7]*r+o[11]*n+o[15]*s,a},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<16;r++)if(!lr(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,s){return(new t).perspective(e,i,r,n,s)},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,s,o,a,h,u,l,c,f,d,p,m,v){return new t(e,s,u,d,i,o,l,p,r,a,c,m,n,h,f,v)},t}();_r.IDENTITY=new _r(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),_r.ZERO=new _r(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),_r.tempVec0=new pr,_r.tempVec1=new pr,_r.tempVec2=new pr,_r.tempMat0=new _r;var Er,wr,Tr,Sr,Ar,Or,Cr,Ir,Rr=[],Pr={};function Mr(t){return"undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name}function Dr(t){for(var e in t)/^[A-Z_]/.test(e)&&(Pr[e]=t[e])}function Fr(t){switch(t){case zi.Float32:return WebGLRenderingContext.FLOAT;case zi.Int16:return WebGLRenderingContext.SHORT;case zi.Int8:return WebGLRenderingContext.BYTE;case zi.UInt16:return WebGLRenderingContext.UNSIGNED_SHORT;case zi.UInt8:return WebGLRenderingContext.UNSIGNED_BYTE;default:return WebGLRenderingContext.FLOAT}}function Lr(t){switch(t){case be.ALPHA:case be.ADD:case be.SUBTRACTION:case be.STRONG_LIGHT:case be.WEAK_LIGHT:return 1;case be.SUPERPOSITION:return 2;case be.BRIGHTNESS:return 3;case be.MULTIPLY:return 0;default:return 1}}function kr(t,e){switch(e){case void 0:case be.ALPHA:t.blendFunction=[Pr.ONE,Pr.ONE_MINUS_SRC_ALPHA,Pr.ONE,Pr.ONE_MINUS_SRC_ALPHA];break;case be.ADD:t.blendFunction=[Pr.ONE,Pr.ONE,Pr.ONE,Pr.ONE];break;case be.SUBTRACTION:t.blendFunction=[Pr.ONE,Pr.ONE,Pr.ZERO,Pr.ONE],t.blendEquation=[Pr.FUNC_REVERSE_SUBTRACT,Pr.FUNC_REVERSE_SUBTRACT];break;case be.SUPERPOSITION:t.blendFunction=[Pr.ONE,Pr.ONE,Pr.ONE,Pr.ONE];break;case be.MULTIPLY:t.blendFunction=[Pr.DST_COLOR,Pr.ONE_MINUS_SRC_ALPHA,Pr.DST_COLOR,Pr.ONE_MINUS_SRC_ALPHA];break;case be.BRIGHTNESS:t.blendFunction=[Pr.ONE,Pr.ONE_MINUS_SRC_ALPHA,Pr.ONE,Pr.ONE_MINUS_SRC_ALPHA];break;case be.STRONG_LIGHT:t.blendFunction=[Pr.DST_COLOR,Pr.DST_ALPHA,Pr.ZERO,Pr.ONE];break;case be.WEAK_LIGHT:t.blendFunction=[Pr.DST_COLOR,Pr.ZERO,Pr.ZERO,Pr.ONE];break;default:console.warn("BlendMode "+e+" not in specification, please set blend params separately.")}}function Nr(t,e){e===_e.DOUBLE?t.culling=!1:(t.culling=!0,t.frontFace=Pr.CW,t.cullFace=e===_e.BACK?Pr.BACK:Pr.FRONT)}function Br(t,e){switch(e){case void 0:t.stencilTest=!1;break;case Tr.MASK:t.stencilTest=!0,t.stencilFunc=[Pr.ALWAYS,Pr.ALWAYS],t.stencilOpZPass=[Pr.REPLACE,Pr.REPLACE];break;case Tr.OBSCURED:t.stencilTest=!0,t.stencilFunc=[Pr.EQUAL,Pr.EQUAL];break;case Tr.REVERSE_OBSCURED:t.stencilTest=!0,t.stencilFunc=[Pr.NOTEQUAL,Pr.NOTEQUAL];break;case Tr.NONE:t.stencilTest=!1;break;default:console.warn("MaskMode "+e+" not in specification, please set stencil params seperately.")}}function Ur(){return Ur=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},Ur.apply(this,arguments)}Rr.length||function(){"function"==typeof WebGL2RenderingContext?Dr(WebGL2RenderingContext):"undefined"!=typeof WebGLRenderingContext?(Dr(WebGLRenderingContext),Dr(WebGLRenderingContext.prototype)):Rr.push("iOS16 lockdown mode, WebGL Constants not in global");Rr.length||"HALF_FLOAT"in Pr||(Pr.HALF_FLOAT=5131)}(),(wr=Er||(Er={}))[wr.vertex=0]="vertex",wr[wr.fragment=1]="fragment",(Sr=Tr||(Tr={}))[Sr.NONE=0]="NONE",Sr[Sr.MASK=1]="MASK",Sr[Sr.OBSCURED=2]="OBSCURED",Sr[Sr.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",(Or=Ar||(Ar={}))[Or.whatever=0]="whatever",Or[Or.clear=2]="clear",(Ir=Cr||(Cr={}))[Ir.none=0]="none",Ir[Ir.data=1]="data",Ir[Ir.image=2]="image",Ir[Ir.compressed=3]="compressed",Ir[Ir.video=4]="video",Ir[Ir.canvas=5]="canvas",Ir[Ir.framebuffer=6]="framebuffer",Ir[Ir.mipmaps=7]="mipmaps";var zr=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.download=function(t,e,i,r){var n=this;if(void 0===e&&(e="json"),!this.start(t,i,r)){var s=new XMLHttpRequest,o=function(){n.finish(t,s.status,s.response)};s.responseType=e,s.addEventListener("load",function(){200==s.status?n.finish(t,200,s.response):o()}),s.addEventListener("error",o),s.open("GET",t,!0),s.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(t,e,i){var r=this.callbacks[t];delete this.callbacks[t];for(var n=200==e?[i]:[e,i],s=n.length-1,o=r.length;s<o;s+=2)r[s].apply(null,n)},t}(),Vr=!1,Gr=!1;function jr(t,e){return Hr.apply(this,arguments)}function Hr(){return(Hr=yt(function(t,e){return wt(this,function(i){switch(i.label){case 0:return!Vr&&e?[3,2]:[4,Yr(t)];case 1:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,Yr(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),Vr=!0,[4,Yr(t)];case 5:return[2,{image:i.sent(),url:t}];case 6:return[2]}})})).apply(this,arguments)}function Xr(t,e){return Wr.apply(this,arguments)}function Wr(){return(Wr=yt(function(t,e){return wt(this,function(i){switch(i.label){case 0:return!Gr&&e?[3,2]:[4,Yr(t)];case 1:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,Yr(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),Gr=!0,[4,Yr(t)];case 5:return[2,{image:i.sent(),url:t}];case 6:return[2]}})})).apply(this,arguments)}function Yr(t){return qr.apply(this,arguments)}function qr(){return(qr=yt(function(t){var e,i;return wt(this,function(r){if(e="",xt(t,HTMLImageElement)){if(t.complete)return[2,t];e=t.src}else xt(t,Blob)?(e=URL.createObjectURL(t),i=!0):"string"==typeof t&&(e=t);if(!e)throw new 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 Zr(t){return Kr.apply(this,arguments)}function Kr(){return(Kr=yt(function(t){return wt(this,function(e){return[2,new Promise(function(e,i){(new zr).downloadBinary(t,e,function(e,r){i("Couldn't load bins "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function Qr(t){return Jr.apply(this,arguments)}function Jr(){return(Jr=yt(function(t){var e;return wt(this,function(i){return e=document.createElement("video"),"string"==typeof t?e.src=t:e.srcObject=t,e.crossOrigin="anonymous",e.muted=!0,Ut()&&e.setAttribute("renderer","standard"),e.setAttribute("playsinline","playsinline"),[2,new Promise(function(t,i){var r=e.play();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 $r(t,e){return tn.apply(this,arguments)}function tn(){return(tn=yt(function(t,e){return wt(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:return[2,i.sent()];case 3:return i.sent(),[4,e(t[1])];case 4:return[2,i.sent()];case 5:return[2,e(t)]}})})).apply(this,arguments)}function en(t,e,i){return rn.apply(this,arguments)}function rn(){return(rn=yt(function(t,e,i,r){var n,s,o,a,h,u,l,c,f;return wt(this,function(d){switch(d.label){case 0:return void 0===r&&(r=[]),34067!==t.target?[3,2]:(n=t.mipmaps,s=t.target,o=n.map(function(t){return Promise.all(t.map(function(t){return t.id?i[t.id]:nn(t,e)}))}),[4,Promise.all(o)]);case 1:return a=d.sent(),[2,Ur({keepImageSource:!1},t,{mipmaps:a,sourceFrom:{target:s,type:Cr.mipmaps}})];case 2:return h=t.mipmaps,u=t.target,l=h.map(function(t){return nn(t,e)}),[4,Promise.all(l)];case 3:return c=d.sent(),f=r[h[0][1][0]].url,[2,Ur({keepImageSource:!1},t,{mipmaps:c,sourceType:Cr.mipmaps,sourceFrom:{target:u,bin:f,type:Cr.mipmaps,mipmaps:h.map(function(t){return[t[1][1],t[1][2]]})}})];case 4:return[2]}})})).apply(this,arguments)}function nn(t,e){return sn.apply(this,arguments)}function sn(){return(sn=yt(function(t,e){var i,r,n,s,o;return wt(this,function(a){if(i=t[1],r=i[0],n=i[1],s=i[2],!(o=e[r]))throw new Error("Invalid bin pointer: "+JSON.stringify(t)+".");return[2,Yr(new Blob([new Uint8Array(o,n,s)]))]})})).apply(this,arguments)}var on=1,an=function(t){function e(e){var i;return(i=t.call(this,e)||this).destroyed=!1,i.id="Tex"+on++,i}Xe(e,t);var i=e.prototype;return i.getWidth=function(){return this.width||0},i.getHeight=function(){return this.height||0},i.uploadCurrentVideoFrame=function(){},i.offloadData=function(){},i.reloadData=function(){},i.initialize=function(){},i.assembleOptions=function(t){var e=t.target,i=void 0===e?Pr.TEXTURE_2D:e,r=t.format,n=void 0===r?Pr.RGBA:r;return t.sourceType||(t.sourceType="image"in t?Cr.image:"data"in t?Cr.data:"video"in t?Cr.video:0),Ur({minFilter:Pr.NEAREST,magFilter:Pr.NEAREST,wrapS:Pr.CLAMP_TO_EDGE,wrapT:Pr.CLAMP_TO_EDGE,target:i,format:Pr.RGBA,internalFormat:n,type:Pr.UNSIGNED_BYTE},t)},e.fromImage=function(t,i,r){return yt(function(){var n,s;return wt(this,function(o){switch(o.label){case 0:return[4,Yr(t)];case 1:return n=o.sent(),(s=e.create(i,Ur({sourceType:Cr.image,image:n,target:Pr.TEXTURE_2D,id:oe(),flipY:!0},r))).initialize(),[2,s]}})})()},e.fromVideo=function(t,i,r){return yt(function(){var n,s;return wt(this,function(o){switch(o.label){case 0:return[4,Qr(t)];case 1:return n=o.sent(),(s=e.create(i,Ur({sourceType:Cr.video,video:n,id:oe(),flipY:!0},r))).initialize(),[2,s]}})})()},Ki(e,[{key:"isDestroyed",get:function(){return this.destroyed}}]),e}(rr);function hn(t,e,i,r){var n,s,o=e.length/i/r;return s=n=4===o||0===o?Pr.RGBA:3===o?Pr.RGB:2===o?Pr.LUMINANCE_ALPHA:Pr.LUMINANCE,an.createWithData(t,{data:e,width:i,height:r},{type:Pr.HALF_FLOAT,format:n,internalFormat:s,wrapS:Pr.CLAMP_TO_EDGE,wrapT:Pr.CLAMP_TO_EDGE})}var un={type:Pr.UNSIGNED_BYTE,format:Pr.RGBA,internalFormat:Pr.RGBA,wrapS:Pr.MIRRORED_REPEAT,wrapT:Pr.MIRRORED_REPEAT,minFilter:Pr.NEAREST,magFilter:Pr.NEAREST};function ln(t){return an.create(t,Ur({id:Wi.WhiteTexture,data:{width:1,height:1,data:new Uint8Array([255,255,255,255])},sourceType:Cr.data},un))}function cn(t){return an.create(t,Ur({id:Wi.TransparentTexture,data:{width:1,height:1,data:new Uint8Array([0,0,0,0])},sourceType:Cr.data},un))}var fn=function(){function t(t,e,i){void 0===i&&(i=0),this.arrayBuffer=t,this.baseOffset=i;var r=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171!==r[0]||75!==r[1]||84!==r[2]||88!==r[3]||32!==r[4]||49!==r[5]||49!==r[6]||187!==r[7]||13!==r[8]||10!==r[9]||26!==r[10]||10!==r[11])throw new Error("Texture missing KTX identifier.");var n=Uint32Array.BYTES_PER_ELEMENT,s=new DataView(this.arrayBuffer,this.baseOffset+12,13*n),o=67305985===s.getUint32(0,!0);this.glType=s.getUint32(1*n,o),this.glTypeSize=s.getUint32(2*n,o),this.glFormat=s.getUint32(3*n,o),this.glInternalFormat=s.getUint32(4*n,o),this.glBaseInternalFormat=s.getUint32(5*n,o),this.pixelWidth=s.getUint32(6*n,o),this.pixelHeight=s.getUint32(7*n,o),this.pixelDepth=s.getUint32(8*n,o),this.numberOfArrayElements=s.getUint32(9*n,o),this.numberOfFaces=s.getUint32(10*n,o),this.numberOfMipmapLevels=s.getUint32(11*n,o),this.bytesOfKeyValueData=s.getUint32(12*n,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=0:this.loadType=2:Qt.warn("Number of faces expected "+e+", but found "+this.numberOfFaces+"."):Qt.warn("Texture arrays not currently supported."):Qt.warn("Only 2D textures currently supported.")}return t.prototype.mipmaps=function(t){for(var e=[],i=64+this.bytesOfKeyValueData,r=this.pixelWidth,n=this.pixelHeight,s=t?this.numberOfMipmapLevels:1,o=0;o<s;o++){for(var a=new Int32Array(this.arrayBuffer,this.baseOffset+i,1)[0],h=0;h<this.numberOfFaces;h++){var u=new Uint8Array(this.arrayBuffer,this.baseOffset+i+4,a);e.push({data:u,width:r,height:n}),i+=a+4,i+=3-(a+3)%4}r=Math.max(1,.5*r),n=Math.max(1,.5*n)}return e},t}();function dn(t){var e=new fn(t,1),i=e.numberOfMipmapLevels,r=e.pixelWidth,n=e.pixelHeight,s=e.glType,o=e.numberOfFaces,a=e.glInternalFormat,h=e.glFormat,u=i>=Math.floor(Math.log2(Math.max(r,n))+1);return{sourceType:Cr.compressed,type:s,target:6===o?Pr.TEXTURE_CUBE_MAP:Pr.TEXTURE_2D,internalFormat:a,format:h,mipmaps:e.mipmaps(u)}}var pn,mn,vn,yn=function(){function t(){this.reloadPending={}}var e=t.prototype;return e.reload=function(t){var e=this;return yt(function(){var i,r;return wt(this,function(n){switch(n.label){case 0:return i=t.id,e.reloadPending[i]?[2]:t.sourceFrom?(e.reloadPending[i]=!0,[4,e.loadSource(t.sourceFrom)]):[3,2];case 1:return r=n.sent(),t.updateSource(r),e.reloadPending[i]=!1,[3,3];case 2:throw new Error("No source from.");case 3:return[2]}})})()},e.canOffloadTexture=function(t){if(t){var e=t.type;if(e===Cr.compressed||e===Cr.image){var i=t.target,r=t.map,n=t.url;return i===Pr.TEXTURE_CUBE_MAP?"object"==typeof r&&!!r:$t(n)&&n.length>0}if(e===Cr.mipmaps){var s=t.bin,o=t.mipmaps,a=t.target,h=t.maps,u=t.urls;return s?o.length>0:a===Pr.TEXTURE_CUBE_MAP?h.every(function(t){return"object"==typeof t&&t}):u.every(function(t){return $t(t)&&t.length>0})}}return!1},e.loadSource=function(t,e){var i=this;return yt(function(){var r,n,s,o,a,h,u,l,c,f,d,p,m,v,y,g,b;return wt(this,function(x){switch(x.label){case 0:return r=t.type,n=t.target,s=t.map,o=t.url,a=t.bin,h=t.mipmaps,u=t.urls,l=t.maps,n!==Pr.TEXTURE_CUBE_MAP||r===Cr.mipmaps?[3,2]:[4,i.loadCubeMap(s)];case 1:return c=x.sent(),[2,Ur({},e,{cube:c,target:Pr.TEXTURE_CUBE_MAP,sourceType:Cr.image,sourceFrom:{type:Cr.image,map:Ur({},s),target:Pr.TEXTURE_CUBE_MAP}})];case 2:return r!==Cr.image?[3,4]:[4,Yr(o)];case 3:return f=x.sent(),[2,Ur({},e,{image:f,sourceType:Cr.image,sourceFrom:{type:r,url:o,target:Pr.TEXTURE_2D}})];case 4:return r!==Cr.video?[3,6]:[4,Qr(o)];case 5:return d=x.sent(),[2,Ur({},e,{video:d,sourceType:Cr.video})];case 6:return r!==Cr.compressed?[3,8]:[4,Zr(o)];case 7:return[2,Ur({},dn(x.sent()),e,{sourceFrom:{url:o,type:Cr.compressed}})];case 8:return r!==Cr.mipmaps?[3,17]:a?[4,Zr(a)]:[3,13];case 9:return p=x.sent(),m=null!=n?n:Pr.TEXTURE_2D,v=m===Pr.TEXTURE_2D?h.slice():h.map(function(t){return t.slice()}),n!==Pr.TEXTURE_CUBE_MAP?[3,11]:[4,Promise.all(h.map(function(t){return i.loadMipmapImages(t,p)}))];case 10:return y=x.sent(),[3,12];case 11:y=i.loadMipmapImages(h,p),x.label=12;case 12:return[2,Ur({},e,{mipmaps:y,target:m,sourceType:Cr.mipmaps,sourceFrom:{bin:a,mipmaps:v,target:m,type:Cr.mipmaps}})];case 13:return n!==Pr.TEXTURE_2D&&n?[3,15]:[4,Promise.all(u.map(function(t){return Yr(t)}))];case 14:return g=x.sent(),[2,Ur({},e,{mipmaps:g,target:Pr.TEXTURE_2D,sourceType:Cr.mipmaps,sourceFrom:{type:r,urls:u.slice(),target:Pr.TEXTURE_2D}})];case 15:return n!==Pr.TEXTURE_CUBE_MAP?[3,17]:[4,Promise.all(l.map(function(t){return i.loadCubeMap(t)}))];case 16:return b=x.sent(),[2,Ur({},e,{mipmaps:b,target:Pr.TEXTURE_CUBE_MAP,sourceType:Cr.mipmaps,sourceFrom:{type:r,maps:l.map(function(t){return Ur({},t)}),target:Pr.TEXTURE_CUBE_MAP}})];case 17:throw new Error("Invalid resource type: "+r+".")}})})()},e.loadMipmapImages=function(t,e){return yt(function(){return wt(this,function(i){return[2,Promise.all(t.map(function(t){return Yr(new Blob([new Uint8Array(e,t[0],t[1])]))}))]})})()},e.loadCubeMap=function(t){return yt(function(){return wt(this,function(e){return[2,Promise.all(t.map(function(t){return Yr(t)}))]})})()},t}();function gn(){return pn||(pn=new yn),pn}(vn=mn||(mn={}))[vn.normal=0]="normal",vn[vn.transformFeedback=1]="transformFeedback";var bn,xn,_n,En,wn=1,Tn=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,s=void 0===n?"Material"+wn++:n,o=i.renderType,a=void 0===o?0:o,h=i.shader,u=i.uniformSemantics;r.name=s,r.renderType=a,r.shaderSource=h,r.props=i,r.uniformSemantics=Ur({},u)}else r.name="Material"+wn++,r.renderType=0;return r}Xe(e,t);var i=e.prototype;return i.initialize=function(){},i.createShaderVariant=function(){},i.use=function(t,e){},Ki(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}(rr),Sn=function(){function t(t){this.engine=t,this.alphaMaskEnabled=!1,this.maskMode=Tr.NONE,this.maskable=null,this.stencilClearAction={stencilAction:Ar.clear}}var e=t.prototype;return e.getRefValue=function(){return 1},e.getMaskMode=function(t){var e=t.isMask,i=void 0!==e&&e,r=t.inverted,n=void 0!==r&&r,s=t.reference,o=t.alphaMaskEnabled,a=void 0!==o&&o;return this.alphaMaskEnabled=a,i?this.maskMode=Tr.MASK:(this.maskMode=n?Tr.REVERSE_OBSCURED:Tr.OBSCURED,s&&(this.maskable=this.engine.findObject(s))),this.maskMode},e.drawStencilMask=function(t){this.maskable&&(t.clear(this.stencilClearAction),this.maskable.drawStencilMask(t))},t}();(xn=bn||(bn={}))[xn.noShader=0]="noShader",xn[xn.success=1]="success",xn[xn.fail=2]="fail",xn[xn.compiling=3]="compiling",(En=_n||(_n={})).GLSL1="100",En.GLSL3="300 es";var An=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).source=i,r}return Xe(e,t),e}(rr),On=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.createVariant=function(t){var e=[];if(t)for(var i,r=bt(Object.keys(t));!(i=r()).done;){var n=i.value;e.push([n,t[n]])}var s=this.engine.getShaderLibrary().createShader(this.shaderData,e);return s.shader=this,s},i.fromData=function(e){t.prototype.fromData.call(this,e),this.shaderData=e},e}(rr);On=Et([tr(ki.Shader)],On);var Cn="effects-internal-copy";function In(t,e){return{name:Cn,vertex:"\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}",fragment:"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",glslVersion:2===t?_n.GLSL3:_n.GLSL1,macros:[["DEPTH_TEXTURE",!!e]],cacheId:"effects-internal-copy-mesh"+ +e}}var Rn,Pn,Mn,Dn={format:Pr.RGBA,type:Pr.UNSIGNED_BYTE,minFilter:Pr.LINEAR,magFilter:Pr.LINEAR,wrapS:Pr.CLAMP_TO_EDGE,wrapT:Pr.CLAMP_TO_EDGE},Fn=Symbol("dispose"),Ln=function(){function t(t){this.textureCache={},this.textureRef={},this.engine=t}var e=t.prototype;return e.requestColorAttachmentTexture=function(t){var e=this,i=t.width,r=t.height,n=t.name,s={sourceType:Cr.framebuffer,data:{width:i,height:r},name:n},o=[n];Object.getOwnPropertyNames(Dn).forEach(function(e){var i,r=null!=(i=t[e])?i:Dn[e];s[e]=r,o.push(e,r)});var a=o.join(":"),h=this.textureCache[a];if(h)this.textureRef[a]++;else{var u=this.engine;Xt(u),h=an.create(u,s),this.textureCache[a]=h,this.textureRef[a]=1,h[Fn]=h.dispose,h.dispose=function(){return e.removeTexture(a)}}return h},e.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[Fn](),i.dispose=i[Fn]),delete this.textureCache[t],delete this.textureRef[t]}else this.textureRef[t]=e-1},e.dispose=function(){var t=this;Object.keys(this.textureCache).forEach(function(e){var i=t.textureCache[e];i[Fn](),i.dispose=i[Fn]}),this.textureCache={},this.textureRef={},this.engine=void 0},t}(),kn=function(){function t(t){void 0===t&&(t={}),this.semantics=Ur({},t)}var e=t.prototype;return e.toObject=function(){return Ur({},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 ee(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}(),Nn=((Rn={})[Pr.FLOAT]=Float32Array.BYTES_PER_ELEMENT,Rn[Pr.INT]=Int32Array.BYTES_PER_ELEMENT,Rn[Pr.SHORT]=Int16Array.BYTES_PER_ELEMENT,Rn[Pr.BYTE]=Int8Array.BYTES_PER_ELEMENT,Rn),Bn=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).name="",e.subMeshes=[],e}Xe(e,t);var i=e.prototype;return i.initialize=function(){},i.flush=function(){},e}(rr);(Mn=Pn||(Pn={}))[Mn.XYZ=0]="XYZ",Mn[Mn.XZY=1]="XZY",Mn[Mn.YXZ=2]="YXZ",Mn[Mn.YZX=3]="YZX",Mn[Mn.ZXY=4]="ZXY",Mn[Mn.ZYX=5]="ZYX";var Un=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],s=i[8],o=i[1],a=i[5],h=i[9],u=i[2],l=i[6],c=i[10];switch(e){case Pn.XYZ:this.y=Math.asin(fr(s,-1,1)),Math.abs(s)<.9999999?(this.x=Math.atan2(-h,c),this.z=Math.atan2(-n,r)):(this.x=Math.atan2(l,a),this.z=0);break;case Pn.YXZ:this.x=Math.asin(-fr(h,-1,1)),Math.abs(h)<.9999999?(this.y=Math.atan2(s,c),this.z=Math.atan2(o,a)):(this.y=Math.atan2(-u,r),this.z=0);break;case Pn.ZXY:this.x=Math.asin(fr(l,-1,1)),Math.abs(l)<.9999999?(this.y=Math.atan2(-u,c),this.z=Math.atan2(-n,a)):(this.y=0,this.z=Math.atan2(o,r));break;case Pn.ZYX:this.y=Math.asin(-fr(u,-1,1)),Math.abs(u)<.9999999?(this.x=Math.atan2(l,c),this.z=Math.atan2(o,r)):(this.x=0,this.z=Math.atan2(-n,a));break;case Pn.YZX:this.z=Math.asin(fr(o,-1,1)),Math.abs(o)<.9999999?(this.x=Math.atan2(-h,a),this.y=Math.atan2(-u,r)):(this.x=0,this.y=Math.atan2(s,c));break;case Pn.XZY:this.z=Math.asin(-fr(n,-1,1)),Math.abs(n)<.9999999?(this.x=Math.atan2(l,a),this.y=Math.atan2(s,r)):(this.x=Math.atan2(-h,c),this.y=0);break;default:console.error("setFromRotationMatrix: unknown order: "+e)}return this.x*=hr,this.y*=hr,this.z*=hr,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,s,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!=(s=t[e+2])?s: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):(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):(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 xr;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,i=e.x,r=e.y,n=e.z,s=e.order,o=Math.cos(i*ar*.5),a=Math.cos(r*ar*.5),h=Math.cos(n*ar*.5),u=Math.sin(i*ar*.5),l=Math.sin(r*ar*.5),c=Math.sin(n*ar*.5);switch(s){case Pn.XYZ:t.set(u*a*h+o*l*c,o*l*h-u*a*c,o*a*c+u*l*h,o*a*h-u*l*c);break;case Pn.YXZ:t.set(u*a*h+o*l*c,o*l*h-u*a*c,o*a*c-u*l*h,o*a*h+u*l*c);break;case Pn.ZXY:t.set(u*a*h-o*l*c,o*l*h+u*a*c,o*a*c+u*l*h,o*a*h-u*l*c);break;case Pn.ZYX:t.set(u*a*h-o*l*c,o*l*h+u*a*c,o*a*c-u*l*h,o*a*h+u*l*c);break;case Pn.YZX:t.set(u*a*h+o*l*c,o*l*h+u*a*c,o*a*c-u*l*h,o*a*h-u*l*c);break;case Pn.XZY:t.set(u*a*h-o*l*c,o*l*h-u*a*c,o*a*c+u*l*h,o*a*h+u*l*c);break;default:console.error("unknown euler order: "+s)}return t},e.toMatrix4=function(t){var e=t.elements,i=this,r=i.x,n=i.y,s=i.z,o=i.order,a=Math.cos(r*ar),h=Math.sin(r*ar),u=Math.cos(n*ar),l=Math.sin(n*ar),c=Math.cos(s*ar),f=Math.sin(s*ar);if(o===Pn.XYZ){var d=a*c,p=a*f,m=h*c,v=h*f;e[0]=u*c,e[4]=-u*f,e[8]=l,e[1]=p+m*l,e[5]=d-v*l,e[9]=-h*u,e[2]=v-d*l,e[6]=m+p*l,e[10]=a*u}else if(o===Pn.YXZ){var y=u*c,g=u*f,b=l*c,x=l*f;e[0]=y+x*h,e[4]=b*h-g,e[8]=a*l,e[1]=a*f,e[5]=a*c,e[9]=-h,e[2]=g*h-b,e[6]=x+y*h,e[10]=a*u}else if(o===Pn.ZXY){var _=u*c,E=u*f,w=l*c,T=l*f;e[0]=_-T*h,e[4]=-a*f,e[8]=w+E*h,e[1]=E+w*h,e[5]=a*c,e[9]=T-_*h,e[2]=-a*l,e[6]=h,e[10]=a*u}else if(o===Pn.ZYX){var S=a*c,A=a*f,O=h*c,C=h*f;e[0]=u*c,e[4]=O*l-A,e[8]=S*l+C,e[1]=u*f,e[5]=C*l+S,e[9]=A*l-O,e[2]=-l,e[6]=h*u,e[10]=a*u}else if(o===Pn.YZX){var I=a*u,R=a*l,P=h*u,M=h*l;e[0]=u*c,e[4]=M-I*f,e[8]=P*f+R,e[1]=f,e[5]=a*c,e[9]=-h*c,e[2]=-l*c,e[6]=R*f+P,e[10]=I-M*f}else if(o===Pn.XZY){var D=a*u,F=a*l,L=h*u,k=h*l;e[0]=u*c,e[4]=-f,e[8]=l*c,e[1]=D*f+k,e[5]=a*c,e[9]=F*f-L,e[2]=L*f-F,e[6]=h*c,e[10]=k*f+D}else console.error("toMatrix4: Invalid order "+o);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}();Un.DEFAULT_ORDER=Pn.ZYX,Un.tempQuat0=new xr,Un.tempMat0=new _r;var zn=function(){function t(t,e,i,r,n,s,o,a,h){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===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=1),this.elements=[t,e,i,r,n,s,o,a,h]}var e=t.prototype;return e.set=function(t,e,i,r,n,s,o,a,h){var u=this.elements;return u[0]=t,u[3]=r,u[6]=o,u[1]=e,u[4]=n,u[7]=a,u[2]=i,u[5]=s,u[8]=h,this},e.setFromRowMajorData=function(t,e,i,r,n,s,o,a,h){var u=this.elements;return u[0]=t,u[3]=e,u[6]=i,u[1]=r,u[4]=n,u[7]=s,u[2]=o,u[5]=a,u[8]=h,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,s=e+e,o=i+i,a=r+r,h=e*s,u=e*o,l=e*a,c=i*o,f=i*a,d=r*a,p=n*s,m=n*o,v=n*a,y=this.elements;return y[0]=1-(c+d),y[1]=u+v,y[2]=l-m,y[3]=u-v,y[4]=1-(h+d),y[5]=f+p,y[6]=l+m,y[7]=f-p,y[8]=1-(h+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],s=r[3],o=r[6],a=r[1],h=r[4],u=r[7];return r[0]=e*n+i*a,r[3]=e*s+i*h,r[6]=e*o+i*u,r[1]=-i*n+e*a,r[4]=-i*s+e*h,r[7]=-i*o+e*u,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){for(var e=0;e<9;e++)this.elements[e]*=t;return this}return this.multiplyMatrices(this,t)},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,s=i[0],o=i[3],a=i[6],h=i[1],u=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],b=r[7],x=r[2],_=r[5],E=r[8];return n[0]=s*p+o*y+a*x,n[3]=s*m+o*g+a*_,n[6]=s*v+o*b+a*E,n[1]=h*p+u*y+l*x,n[4]=h*m+u*g+l*_,n[7]=h*v+u*b+l*E,n[2]=c*p+f*y+d*x,n[5]=c*m+f*g+d*_,n[8]=c*v+f*b+d*E,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],s=t[4],o=t[7],a=t[2],h=t[5],u=t[8];return e*(s*u-h*o)+n*(h*r-i*u)+a*(i*o-s*r)},e.invert=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],s=t[4],o=t[7],a=t[2],h=t[5],u=t[8],l=u*s-h*o,c=h*r-u*i,f=o*i-s*r,d=e*l+n*c+a*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]=(a*o-u*n)*p,t[2]=(h*n-a*s)*p,t[3]=c*p,t[4]=(u*e-a*r)*p,t[5]=(a*i-h*e)*p,t[6]=f*p,t[7]=(n*r-o*e)*p,t[8]=(s*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,s=this.elements,o=null!=e?e:t;return o.x=s[0]*i+s[3]*r+s[6]*n,o.y=s[1]*i+s[4]*r+s[7]*n,o.z=s[2]*i+s[5]*r+s[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(!lr(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,s,o,a,h,u){return new t(e,n,a,i,s,h,r,o,u)},t}(),Vn=function(){function t(t,e){void 0===t&&(t=pr.ZERO),void 0===e&&(e=pr.X),this.origin=new pr,this.direction=new pr,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 pr;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,s,o,a,h=this.origin,u=h.x,l=h.y,c=h.z,f=this.direction,d=f.x,p=f.y,m=f.z,v=t.min,y=v.x,g=v.y,b=v.z,x=t.max,_=x.x,E=x.y,w=x.z,T=1/d,S=1/p,A=1/m;if(T>=0?(i=(y-u)*T,r=(_-u)*T):(i=(_-u)*T,r=(y-u)*T),S>=0?(n=(g-l)*S,s=(E-l)*S):(n=(E-l)*S,s=(g-l)*S),!(i>s||n>r||((n>i||i!=i)&&(i=n),(s<r||r!=r)&&(r=s),(n>i||i!=i)&&(i=n),(s<r||r!=r)&&(r=s),A>=0?(o=(b-c)*A,a=(w-c)*A):(o=(w-c)*A,a=(b-c)*A),i>a||o>r||((o>i||i!=i)&&(i=o),(a<r||r!=r)&&(r=a),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 pr).copyFrom(this.origin):void 0;var s=-(this.origin.dot(i)+r)/n;return s>=0?this.at(s,e):void 0},e.intersectSphere=function(e,i){var r=e.center,n=t.tempVec0.subtractVectors(r,this.origin),s=n.dot(this.direction),o=n.dot(n)-s*s,a=e.radius*e.radius;if(!(o>a)){var h=Math.sqrt(a-o),u=s-h,l=s+h;if(!(l<0))return u>=0?this.at(u,i):this.at(l,i)}},e.intersectTriangle=function(e,i,r){var n,s=e.p0,o=e.p1,a=e.p2,h=t.tempVec0.subtractVectors(o,s),u=t.tempVec1.subtractVectors(a,s),l=t.tempVec2.subtractVectors(this.origin,s),c=t.tempVec3.crossVectors(h,u),f=this.direction.dot(c);if(f>0){if(r)return;n=1}else{if(!(f<0))return;n=-1,f=-f}u.crossVectors(l,u);var d=n*this.direction.dot(u);if(!(d<0)){h.cross(l);var p=n*this.direction.dot(h);if(!(p<0||d+p>f)){var m=-n*l.dot(c);if(!(m<0))return this.at(m/f,i)}}},t}();Vn.tempVec0=new pr,Vn.tempVec1=new pr,Vn.tempVec2=new pr,Vn.tempVec3=new pr;var Gn,jn,Hn,Xn,Wn=function(){function t(t,e){void 0===t&&(t=new pr(1/0,1/0,1/0)),void 0===e&&(e=new pr(-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,s=-1/0,o=-1/0,a=0,h=t.length;a<h;a+=3){var u=t[a],l=t[a+1],c=t[a+2];u<e&&(e=u),l<i&&(i=l),c<r&&(r=c),u>n&&(n=u),l>s&&(s=l),c>o&&(o=c)}return this.min.set(e,i,r),this.max.set(n,s,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 pr),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 pr),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,s=0,o=n.length;s<o;s++)this.expandByObject(n[s]);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 pr),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 pr;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 pr),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 pr),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 pr),this.isEmpty())return[];var i=[];return i[0]=new pr(this.min.x,this.min.y,this.min.z),i[1]=new pr(this.min.x,this.min.y,this.max.z),i[2]=new pr(this.min.x,this.max.y,this.min.z),i[3]=new pr(this.min.x,this.max.y,this.max.z),i[4]=new pr(this.max.x,this.min.y,this.min.z),i[5]=new pr(this.max.x,this.min.y,this.max.z),i[6]=new pr(this.max.x,this.max.y,this.min.z),i[7]=new pr(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 pr;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}(),Yn=function(){function t(t,e){void 0===t&&(t=pr.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 s=(new Wn).setFromPoints(t);s.getCenter(i),this.radius=s.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 pr),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 Wn),this.isEmpty()?(t.makeEmpty(),t):(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],s=Math.sqrt(Math.max(i,r,n));return this.center.applyMatrix(t),this.radius=this.radius*s,this},e.translate=function(t){return this.center.add(t),this},e.expandByPoint=function(t){var e=(new pr).subtractVectors(t,this.center),i=e.lengthSquared();if(i>this.radius*this.radius){var r=Math.sqrt(i),n=.5*(r-this.radius);this.center.add(e.multiply(n/r)),this.radius+=n}return this},e.union=function(t){var e=new pr,i=new pr;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 pr).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}(),qn=Object.freeze({__proto__:null,get EulerOrder(){return Pn},Euler:Un,Quaternion:xr,Vector2:dr,Vector3:pr,Vector4:mr,Matrix3:zn,Matrix4:_r,Ray:Vn,PI2:or,DEG2RAD:ar,RAD2DEG:hr,NumberEpsilon:ur,isZero:function(t){return isNaN(t)||Math.abs(t)<ur},isEqual:lr,damp:function(t,e,i,r){return cr(t,e,1-Math.exp(-i*r))},lerp:cr,degToRad:function(t){return t*ar},radToDeg:function(t){return t*hr},clamp:fr,Color:br,Box3:Wn,Sphere:Yn}),Zn=1,Kn=function(t){function e(e,i){var r;if((r=t.call(this,e)||this).destroyed=!1,r.visible=!0,i){var n=i.material,s=i.geometry,o=i.name,a=void 0===o?"<unnamed>":o,h=i.priority,u=void 0===h?0:h,l=i.worldMatrix,c=void 0===l?_r.fromIdentity():l;r.id="Mesh"+Zn++,r.name=a,r.geometry=s,r.material=n,r.priority=u,r.worldMatrix=c}else r.id="Mesh"+Zn++,r.name="<unnamed>",r.worldMatrix=_r.fromIdentity(),r._priority=0;return r}Xe(e,t);var i=e.prototype;return i.setVisible=function(t){this.visible=t},i.getVisible=function(){return this.visible},i.render=function(t){this.isDestroyed||this.getVisible()&&(t.renderingData.currentFrame.globalUniforms&&t.setGlobalMatrix("effects_ObjectToWorld",this.worldMatrix),t.drawGeometry(this.geometry,this.material))},i.firstGeometry=function(){return this.geometry},i.setMaterial=function(t,e){e!==Zt.keep&&this.material.dispose(e),this.material=t},i.restore=function(){},i.dispose=function(t){if(!this.destroyed){(null==t?void 0:t.geometries)!==Zt.keep&&this.geometry.dispose();var e=null==t?void 0:t.material;e!==Zt.keep&&this.material.dispose(e),this.destroyed=!0,void 0!==this.engine&&(this.engine.removeMesh(this),this.engine=void 0)}},Ki(e,[{key:"isDestroyed",get:function(){return this.destroyed}}]),e}(sr);(jn=Gn||(Gn={}))[jn.none=0]="none",jn[jn.color=1]="color",jn[jn.stencil_8_opaque=2]="stencil_8_opaque",jn[jn.depth_16_opaque=3]="depth_16_opaque",jn[jn.depth_stencil_opaque=4]="depth_stencil_opaque",jn[jn.depth_16_texture=5]="depth_16_texture",jn[jn.depth_24_stencil_8_texture=6]="depth_24_stencil_8_texture",(Xn=Hn||(Hn={}))[Xn.store=0]="store",Xn[Xn.clear=2]="clear";var Qn,Jn,$n=function(){function t(t,e){if(this.destroyed=!1,e){var i=e.texture,r=e.size;if(xt(i,an))this.texture=i,this.externalTexture=!0;else if(i){var n=i.wrapT,s=i.wrapS,o=i.minFilter,a=i.magFilter,h=i.internalFormat,u=i.format,l=void 0===u?Pr.RGBA:u,c=i.type,f=void 0===c?Pr.UNSIGNED_BYTE:c;this.externalTexture=!1,this.textureOptions={size:r,format:l,type:f,internalFormat:h||l,wrapT:n,wrapS:s,minFilter:o,magFilter:a,name:e.name},this.texture=an.create(t,Ur({},this.textureOptions,{sourceType:Cr.framebuffer,data:{width:r[0],height:r[1]}}))}}}return t.prototype.dispose=function(){this.destroyed||(this.texture.dispose(),this.destroyed=!0)},Ki(t,[{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}}]),t}();(Jn=Qn||(Qn={}))[Jn.force=0]="force",Jn[Jn.keep=1]="keep",Jn[Jn.keepExternal=2]="keepExternal",Jn[Jn.destroy=0]="destroy";var ts=1,es=function(){function t(t,e){this.attachments=[],this.destroyed=!1,this.initialized=!1;var i=e.name,r=void 0===i?"RenderPass_"+ts++:i,n=e.clearAction,s=e.semantics,o=e.depthStencilAttachment,a=e.storeAction,h=e.priority,u=void 0===h?0:h,l=e.meshOrder,c=void 0===l?Ct.ascending:l,f=e.meshes,d=void 0===f?[]:f,p=e.delegate,m=void 0===p?{}:p;this.name=r,this.renderer=t,this.priority=u,this.meshOrder=c,this.meshes=Gt(d.slice(),this.meshOrder),this.depthStencilType=(null==o?void 0:o.storageType)||0,this.clearAction=Ur({},n),this.storeAction=Ur({colorAction:0,depthAction:0,stencilAction:0},a),this.semantics=new kn(s),this.options=e,this.delegate=m,this.setViewportOptions(e)}var e=t.prototype;return e.addMesh=function(t){var e,i,r;e=this.meshes,i=t,void 0===(r=this.meshOrder)&&(r=2),e.includes(i)||(e.push(i),1===e.length||1!==r&&jt(e,e.length-1,r))},e.removeMesh=function(t){Dt(this.meshes,t)},e.setMeshes=function(t){var e;return this.meshes.length=0,(e=this.meshes).splice.apply(e,[].concat([0,0],t)),Gt(this.meshes,this.meshOrder),this.meshes},e.getInitAttachments=function(){return this.attachments.length>0?this.attachments:this.options.attachments},e.configure=function(t){if(this.framebuffer)t.setFramebuffer(this.framebuffer);else{var e=this.getViewport(),i=e[0],r=e[1],n=e[2],s=e[3];t.setViewport(i,r,n,s)}},e.execute=function(t){t.clear(this.clearAction),t.renderMeshes(this.meshes),t.clear(this.storeAction)},e.frameCleanup=function(t){},e.resetColorAttachments=function(t){var e=this;if(t.length||this.resetAttachments({attachments:[]}),this.attachments.length){var i=t.map(function(t){return t.updateSource({sourceType:Cr.framebuffer}),new $n(e.renderer.engine,{texture:t})});this.attachments.forEach(function(t){return!t.externalTexture&&t.dispose()}),this.attachments=i,this.framebuffer&&(this.framebuffer.bind(),this.framebuffer.resetColorTextures(t.map(function(t){return t})))}else this.resetAttachments({attachments:t.map(function(t){return{texture:t}})})},e.resetAttachments=function(t){this.options=t,this.setViewportOptions(t),this.renderer&&this._resetAttachments()},e.setViewportOptions=function(t){if(t.viewport){if(this.isCustomViewport=!0,this.viewportScale=1,this.customViewport=t.viewport.slice(0,4),this.framebuffer){var e=this.customViewport;this.framebuffer.isCustomViewport=!1,this.framebuffer.resize(e[0],e[1],e[2],e[3])}}else this.isCustomViewport=!1,this.viewportScale=t.viewportScale||1,this.framebuffer&&(this.framebuffer.isCustomViewport=!0,this.framebuffer.viewportScale=this.viewportScale)},e._resetAttachments=function(){var t,e,i=this,r=this.renderer,n=this.options;this.attachments.length&&(this.attachments.forEach(function(t){return!t.externalTexture&&t.dispose()}),this.attachments.length=0,null==(e=this.framebuffer)||e.dispose({depthStencilAttachment:2}),this.framebuffer=null);var s=this.viewportScale,o=this.isCustomViewport?this.customViewport:[0,0,r.getWidth()*s,r.getHeight()*s],a=[o[2],o[3]],h=this.name;if(null==(t=n.attachments)?void 0:t.length){var u=n.attachments.map(function(t,e){var r;return new $n(i.renderer.engine,Ur({size:a,name:(null==(r=t.texture)?void 0:r.name)||h+"##color_"+e},t))});this.attachments=u;var l=Os.create({storeAction:this.storeAction,name:h,viewport:o,viewportScale:this.viewportScale,isCustomViewport:this.isCustomViewport,attachments:u.map(function(t){return t.texture}),depthStencilAttachment:n.depthStencilAttachment||{storageType:0}},r);l.bind(),l.unbind(),this.framebuffer=l}else this.attachments.length=0},e.getViewport=function(){var t,e=(null==(t=this.framebuffer)?void 0:t.viewport)||this.customViewport;if(e)return e;var i=this.renderer,r=this.viewportScale;return i?[0,0,i.getWidth()*r,i.getHeight()*r]:[0,0,0,0]},e.getDepthAttachment=function(){var t=this.framebuffer;if(t){var e=t.getDepthTexture(),i=e?this.getDepthTexture(e,t.externalStorage):void 0;return{storageType:t.depthStencilStorageType,storage:t.depthStorage,texture:i}}},e.getStencilAttachment=function(){var t=this.framebuffer;if(t){var e=t.getStencilTexture(),i=e?this.getDepthTexture(e,t.externalStorage):void 0;return{storageType:t.depthStencilStorageType,storage:t.stencilStorage,texture:i}}},e.getDepthTexture=function(t,e){if(!this.depthTexture){var i,r=null==(i=this.options.depthStencilAttachment)?void 0:i.texture,n=t===r?r:t;return e||(this.depthTexture=n),n}return this.depthTexture},e.getStencilTexture=function(t,e){if(!this.stencilTexture){var i,r=null==(i=this.options.depthStencilAttachment)?void 0:i.texture,n=t===r?r:t;return e||(this.stencilTexture=n),n}return this.stencilTexture},e.initialize=function(t){return this.initialized||(this._resetAttachments(),this.initialized=!0),this},e.dispose=function(t){if(!this.destroyed){var e=(null==t?void 0:t.meshes)||void 0;e!==Zt.keep&&this.meshes.forEach(function(t){t.dispose(e)}),this.meshes.length=0;var i=(null==t?void 0:t.colorAttachment)?t.colorAttachment:0;this.attachments.forEach(function(t){t.externalTexture&&2===i||1===i||t.dispose()}),this.attachments.length=0,(null==t?void 0:t.semantics)!==Zt.keep&&this.semantics.dispose(),this.destroyed=!0;var r,n,s=(null==t?void 0:t.depthStencilAttachment)?t.depthStencilAttachment:0,o=this.framebuffer;if(o)if(o.dispose({depthStencilAttachment:s}),!(o.externalStorage&&2===s||1===s))null==(r=this.stencilTexture)||r.dispose(),null==(n=this.depthTexture)||n.dispose();this.options=this.renderer=null,this.initialize=se}},Ki(t,[{key:"isDestroyed",get:function(){return this.destroyed}},{key:"viewport",get:function(){return this.getViewport()}},{key:"stencilAttachment",get:function(){return this.getStencilAttachment()}},{key:"depthAttachment",get:function(){return this.getDepthAttachment()}}]),t}(),is="#version 100\nprecision mediump float;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;}\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\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",rs="precision highp float;attribute vec2 aPos;varying vec2 uv;void main(){gl_Position=vec4(aPos,0.,1.0);uv=(aPos+vec2(1.0))/2.;}",ns={},ss=function(){function t(){}return t.registerInclude=function(t,e){ns[t]&&Qt.warn('The "'+t+'" shader include already exist.'),ns[t]=e},t.unRegisterInclude=function(t){delete ns[t]},t.unRegisterAllIncludes=function(){Object.keys(ns).forEach(function(e){t.unRegisterInclude(e)})},t.genFinalShaderCode=function(e){var i=e.level,r=e.shaderType,n=e.shader,s=e.macros,o=e.removeVersion,a=t.genMacroString(i,s),h=t.genShaderVersion(i),u=t.parseIncludes(n),l=t.isVersion300(u);return u=t.removeWebGLVersion(u),2!==i||l||(u=t.convertTo300(u,r===Er.fragment)),o?a+u:h+a+u},t.convertTo300=function(e,i){if(e=(e=(e=e.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(e=(e=(e=e.replace(/\btexture(2D|Cube)LodEXT\b/g,"textureLod")).replace(/\btexture(2D|Cube)GradEXT\b/g,"textureGrad")).replace(/\bgl_FragDepthEXT\b/g,"gl_FragDepth"),!t.has300Output(e))if(/\bgl_FragData\[.+?\]/g.test(e)){var r=(e=e.replace(/\bgl_FragColor\b/g,"gl_FragData[0]")).match(/\bgl_FragData\[.+?\]/g);r&&(e=t.replaceMRTShader(e,r))}else e=(e=e.replace(/void\s+?main\s*\(/g,"out vec4 glFragColor;\nvoid main(")).replace(/\bgl_FragColor\b/g,"glFragColor")}else e=e.replace(/\battribute\b/g,"in");return e},t.parseIncludes=function(t,e){var i;for(void 0===e&&(e=/#include <(.+)>/gm);null!==(i=e.exec(t));){var r=i[1],n=ns[r];if(void 0===n)throw new Error("Can't find include shader name "+r);t=t.replace(i[0],n)}return t},t.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":""},t.genShaderVersion=function(t){return 1===t?"#version 100\n":"#version 300 es\n"},t.isVersion300=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return(e?e[0]:"").includes("300")},t.removeWebGLVersion=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return e?t.replace(e[0],""):t},t.has300Output=function(t){return/\bout\s+(?:\w+\s+)?(?:vec4)\s+(?:\w+)\s*;/.test(t)},t.replaceMRTShader=function(t,e){for(var i=new Set,r="",n=0;n<e.length;n++){var s=e[n].match(/\bgl_FragData\[(.+?)\]/);s&&i.add(s[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)},t}(),os=function(t){function e(e,i){var r,n=(r=t.call(this,e,i)||this).renderer.engine,s=Bn.create(n,{mode:Pr.TRIANGLE_STRIP,attributes:{aPos:{type:Pr.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),o=Tn.create(n,{shader:{vertex:rs,fragment:"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);}",glslVersion:_n.GLSL1}});return o.blending=!1,o.depthTest=!1,o.culling=!1,r.screenMesh=Kn.create(n,{geometry:s,material:o,priority:0}),r.priority=5e3,r}Xe(e,t);var i=e.prototype;return i.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture=this.mainTexture,t.setFramebuffer(this.framebuffer)},i.execute=function(t){var e,i,r;t.clear({colorAction:Hn.clear,depthAction:Hn.clear,stencilAction:Hn.clear}),this.screenMesh.material.setTexture("_MainTex",this.mainTexture);var n=null!=(r=null==(i=t.renderingData.currentFrame.globalVolume)||null==(e=i.bloom)?void 0:e.threshold)?r:1;this.screenMesh.material.setFloat("_Threshold",n),t.renderMeshes([this.screenMesh])},e}(es),as=function(t){function e(e,i,r){var n;(n=t.call(this,e,r)||this).type=i;var s=n.renderer.engine,o="PostProcess",a=Bn.create(s,{name:o,mode:Pr.TRIANGLE_STRIP,attributes:{aPos:{type:Pr.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),h={vertex:rs,fragment:"H"==i?"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);}":"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);}",glslVersion:_n.GLSL1},u=Tn.create(s,{name:o,shader:h});return u.blending=!1,u.depthTest=!1,u.culling=!1,n.screenMesh=Kn.create(s,{name:o,geometry:a,material:u,priority:0}),n.priority=5e3,n}Xe(e,t);var i=e.prototype;return i.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],t.setFramebuffer(this.framebuffer)},i.execute=function(t){t.clear({colorAction:Hn.clear,depthAction:Hn.clear,stencilAction:Hn.clear}),this.screenMesh.material.setTexture("_MainTex",this.mainTexture),this.screenMesh.material.setVector2("_TextureSize",ds(this.mainTexture)),t.renderMeshes([this.screenMesh]),"V"===this.type&&(this.gaussianResult.texture=t.getFramebuffer().getColorTextures()[0])},e}(es),hs=function(t){function e(e,i){var r,n="PostProcess",s=(r=t.call(this,e,i)||this).renderer.engine,o=Bn.create(s,{name:n,mode:Pr.TRIANGLE_STRIP,attributes:{aPos:{type:Pr.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),a={vertex:rs,fragment:"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);}"},h=Tn.create(s,{name:n,shader:a});return h.blending=!1,h.depthTest=!1,h.culling=!1,r.screenMesh=Kn.create(s,{name:n,geometry:o,material:h,priority:0}),r.priority=5e3,r}Xe(e,t);var i=e.prototype;return i.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],t.setFramebuffer(this.framebuffer)},i.execute=function(t){t.clear({colorAction:Hn.clear,depthAction:Hn.clear,stencilAction:Hn.clear}),this.screenMesh.material.setTexture("_MainTex",this.mainTexture),this.screenMesh.material.setTexture("_GaussianDownTex",this.gaussianDownSampleResult.texture),this.screenMesh.material.setVector2("_GaussianDownTextureSize",ds(this.gaussianDownSampleResult.texture)),t.renderMeshes([this.screenMesh])},e}(es),us=function(t){function e(e,i){var r,n="PostProcess",s=(r=t.call(this,e,{})||this).renderer.engine;r.sceneTextureHandle=i||new $n(s);var o=Bn.create(s,{name:n,mode:Pr.TRIANGLE_STRIP,attributes:{aPos:{type:Pr.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),a=Tn.create(s,{name:n,shader:{vertex:rs,fragment:"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);}",glslVersion:_n.GLSL1}});return a.blending=!1,a.depthTest=!1,a.culling=!1,r.screenMesh=Kn.create(s,{name:n,geometry:o,material:a,priority:0}),r.priority=5e3,r}Xe(e,t);var i=e.prototype;return i.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture||(this.sceneTextureHandle.texture=this.mainTexture),t.setFramebuffer(null)},i.execute=function(t){t.clear({colorAction:Hn.clear,depthAction:Hn.clear,stencilAction:Hn.clear});var e=t.renderingData.currentFrame.globalVolume,i=Ur({threshold:0,intensity:0,active:!1},null==e?void 0:e.bloom),r=Ur({intensity:0,smoothness:0,roundness:0,active:!1},null==e?void 0:e.vignette),n=Ur({brightness:0,saturation:0,contrast:0,active:!1},null==e?void 0:e.colorAdjustments),s=Ur({active:!1},null==e?void 0:e.tonemapping);this.screenMesh.material.setTexture("_SceneTex",this.sceneTextureHandle.texture),this.screenMesh.material.setFloat("_Brightness",Math.pow(2,n.brightness)),this.screenMesh.material.setFloat("_Saturation",.01*n.saturation+1),this.screenMesh.material.setFloat("_Contrast",.01*n.contrast+1),this.screenMesh.material.setInt("_UseBloom",Number(i.active)),i.active&&(this.screenMesh.material.setTexture("_GaussianTex",this.mainTexture),this.screenMesh.material.setFloat("_BloomIntensity",i.intensity)),r.intensity>0&&(this.screenMesh.material.setFloat("_VignetteIntensity",r.intensity),this.screenMesh.material.setFloat("_VignetteSmoothness",r.smoothness),this.screenMesh.material.setFloat("_VignetteRoundness",r.roundness),this.screenMesh.material.setVector2("_VignetteCenter",new dr(.5,.5)),this.screenMesh.material.setVector3("_VignetteColor",new pr(0,0,0))),this.screenMesh.material.setInt("_UseToneMapping",Number(s.active)),t.renderMeshes([this.screenMesh])},e}(es),ls="_effects_default_",cs=1,fs=function(){function t(t){var e;this.renderQueue=[],this.destroyed=!1,this.renderPassInfoMap=new WeakMap;var i=t.camera,r=t.keepColorBuffer,n=t.renderer,s=t.editorTransform,o=void 0===s?[1,1,0,0]:s,a=t.globalVolume,h=t.postProcessingEnabled,u=void 0!==h&&h,l=t.clearAction,c=void 0===l?{colorAction:Ar.whatever,stencilAction:Ar.clear,depthAction:Ar.whatever}:l,f=n.engine;a&&(this.globalVolume=a),this.globalUniforms=new _s;var d,p=[],m={};if(this.renderer=n,u){if(!this.renderer.engine.gpuCapability.detail.halfFloatTexture)throw new Error("Half float texture is not supported.");var v=Pr.HALF_FLOAT;p=[{texture:{format:Pr.RGBA,type:v,magFilter:Pr.LINEAR,minFilter:Pr.LINEAR}}],d={storageType:Gn.depth_stencil_opaque},m={colorAction:Ar.clear,stencilAction:Ar.clear,depthAction:Ar.clear}}this.drawObjectPass=new es(n,{name:ls,priority:1e3,meshOrder:Ct.ascending,depthStencilAttachment:d,attachments:p,clearAction:m});var y=[this.drawObjectPass];if(this.setRenderPasses(y),u){var g=new $n(f),b=[0,0,this.renderer.getWidth()/2,this.renderer.getHeight()/2],x=new Array(7),_=Pr.HALF_FLOAT,E=new os(n,{name:"BloomThresholdPass",attachments:[{texture:{format:Pr.RGBA,type:_,minFilter:Pr.LINEAR,magFilter:Pr.LINEAR}}]});E.sceneTextureHandle=g,this.addRenderPass(E);for(var w=0;w<7;w++){x[w]=new $n(f);var T=new as(n,"H",{name:"GaussianDownPassH"+w,viewport:b,attachments:[{texture:{format:Pr.RGBA,type:_,minFilter:Pr.LINEAR,magFilter:Pr.LINEAR}}]}),S=new as(n,"V",{name:"GaussianDownPassV"+w,viewport:b,attachments:[{texture:{format:Pr.RGBA,type:_,minFilter:Pr.LINEAR,magFilter:Pr.LINEAR}}]});S.gaussianResult=x[w],this.addRenderPass(T),this.addRenderPass(S),b[2]/=2,b[3]/=2}b[2]*=4,b[3]*=4;for(var A=0;A<6;A++){var O=new hs(n,{name:"GaussianUpPass"+A,viewport:b,attachments:[{texture:{format:Pr.RGBA,type:_,minFilter:Pr.LINEAR,magFilter:Pr.LINEAR}}]});O.gaussianDownSampleResult=x[5-A],this.addRenderPass(O),b[2]*=2,b[3]*=2}var C=new us(n,g);this.addRenderPass(C)}this.semantics=new kn(t.semantics),this.clearAction=c,this.name="RenderFrame"+cs++;var I=y[0];this.emptyTexture=ln(f),this.transparentTexture=cn(f),this.camera=i,this.keepColorBuffer=r,this.renderPassInfoMap.set(I,{listStart:0,listEnd:0,renderPass:I,intermedia:!1}),this.editorTransform=mr.fromArray(o),t.clearAction||this.resetClearActions(),this.passTextureCache=new Ln(f);var R=f.gpuCapability,P=R.detail,M=In(R.level,P.readableDepthStencilTextures&&P.writableFragDepth);null==(e=this.renderer.getShaderLibrary())||e.addShader(M)}var e=t.prototype;return e.addMeshToDefaultRenderPass=function(t){this.drawObjectPass.addMesh(t)},e.removeMeshFromDefaultRenderPass=function(t){this.drawObjectPass.removeMesh(t)},e.dispose=function(t){(null==t?void 0:t.semantics)!==Zt.keep&&this.semantics.dispose();var e,i,r=(null==t?void 0:t.passes)?t.passes:void 0;(r!==Zt.keep&&this._renderPasses.forEach(function(t){t.dispose(r)}),this.passTextureCache.dispose(),this._renderPasses.length=0,this.emptyTexture.dispose(),this.transparentTexture.dispose(),this.resource)&&(this.resource.color_a.dispose(),this.resource.color_b.dispose(),null==(i=this.resource.depthStencil)||null==(e=i.texture)||e.dispose(),this.resource.finalCopyRP.dispose(),this.resource.resRP.dispose(),this.resource=null);this.destroyed=!0},e.resetRenderPassDefaultAttachment=function(t,e){for(var i,r=this.resource,n=r.color_a,s=r.color_b,o=e;o<t.length;o++){var a,h,u=t[o],l=null==(a=u.attachments[0])?void 0:a.texture;if(l&&i===l){var c=l===n?s:n;u.resetColorAttachments([c])}(l=null==(h=u.attachments[0])?void 0:h.texture)&&(i=l)}},e.findMeshRenderPassIndex=function(t){var e=-1;return this.renderPasses.every(function(i,r){return!i.name.startsWith(ls)||!i.meshes.includes(t)||(e=r,!1)}),e},e.addToRenderPass=function(t,e){var i=this.renderPassInfoMap.get(t),r=e.priority;i&&(0===t.meshes.length?i.listStart=i.listEnd=r:r<i.listStart?i.listStart=r:r>i.listEnd&&(i.listEnd=r),t.addMesh(e))},e.getRPAttachments=function(t,e){if(1===(null==t?void 0:t.length)){var i,r=t[0],n=r.texture,s=r.persistent,o=n.format,a=null!=(i=null==e?void 0:e.getInitAttachments())?i:[];if(o===Pr.RGBA&&!s){var h=this.resource.color_a;return 0===a.length?[{texture:h}]:[{texture:a[0].texture===h?this.resource.color_b:h}]}}return t},e.resetClearActions=function(){var t=this.renderPasses.length>1?Ar.clear:Ar.whatever;this.clearAction.stencilAction=t,this.clearAction.depthAction=t,this.clearAction.colorAction=t,this.keepColorBuffer&&(this.clearAction.colorAction=Ar.whatever)},e.setRenderPasses=function(t){var e=this;void 0!==this.renderer&&t.forEach(function(t){return t.initialize(e.renderer)}),this._renderPasses=t.slice()},e.addRenderPass=function(t){void 0!==this.renderer&&t.initialize(this.renderer),this._renderPasses.push(t)},e.createResource=function(){var t=this.renderer.engine;if(!this.resource){var e,i=t.gpuCapability,r=i.detail,n=i.level,s=this.renderer.getWidth(),o=this.renderer.getHeight(),a=2===n?Pr.LINEAR:Pr.NEAREST,h=an.create(t,{sourceType:Cr.framebuffer,format:Pr.RGBA,name:"frame_a",minFilter:a,magFilter:a}),u=an.create(t,{sourceType:Cr.framebuffer,format:Pr.RGBA,data:{width:s,height:o},minFilter:a,magFilter:a,name:"frame_b"}),l=r.readableDepthStencilTextures&&r.writableFragDepth?Gn.depth_24_stencil_8_texture:Gn.depth_stencil_opaque,c=new es(this.renderer,{depthStencilAttachment:{storageType:l},attachments:[{texture:h}]}).initialize(this.renderer),f=new xs(this.renderer,{name:"effects-final-copy",priority:1600,clearAction:{depthAction:Ar.clear,stencilAction:Ar.clear,colorAction:Ar.clear},meshOrder:Ct.ascending,meshes:[this.createCopyMesh({blend:!0,depthTexture:null==(e=c.getDepthAttachment())?void 0:e.texture})]});this.resource={color_a:c.attachments[0].texture,color_b:u,finalCopyRP:f,depthStencil:c.depthAttachment,resRP:c}}},e.createCopyMesh=function(t){var e,i=Cn,r=this.renderer.engine,n=Bn.create(r,{name:i,mode:Pr.TRIANGLE_STRIP,attributes:{aPos:{type:Pr.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),s=In(r.gpuCapability.level,!!(null==t?void 0:t.depthTexture));null==(e=this.renderer.getShaderLibrary())||e.addShader(s);var o=Tn.create(r,{uniformValues:{uDepth:null==t?void 0:t.depthTexture},name:i,shader:s});return o.blending=!1,o.depthTest=!1,o.culling=!1,(null==t?void 0:t.blend)&&(o.blending=!0,o.blendFunction=[Pr.SRC_ALPHA,Pr.ONE_MINUS_SRC_ALPHA,Pr.SRC_ALPHA,Pr.ONE_MINUS_SRC_ALPHA]),Kn.create(r,{name:i,geometry:n,material:o,priority:0})},e.removeRenderPass=function(t){Dt(this._renderPasses,t)},Ki(t,[{key:"renderPasses",get:function(){return this._renderPasses.slice()}},{key:"isDestroyed",get:function(){return this.destroyed}}]),t}();function ds(t){return t?new dr(t.getWidth(),t.getHeight()):new dr}var ps,ms,vs,ys,gs,bs,xs=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.configure=function(t){var e=t.getFramebuffer();e&&(this.prePassTexture=e.getColorTextures()[0]),t.setFramebuffer(null)},i.execute=function(t){t.clear(this.clearAction),this.meshes[0].material.setTexture("uFilterSource",this.prePassTexture),this.meshes[0].material.setVector2("uFilterSourceSize",ds(this.prePassTexture)),t.renderMeshes(this.meshes),this.storeAction&&t.clear(this.storeAction)},e}(es),_s=function(){this.floats={},this.ints={},this.vector3s={},this.vector4s={},this.matrices={},this.samplers=[],this.uniforms=[]},Es=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 Ki(t,[{key:"isDestroyed",get:function(){return this.destroyed}}]),t}(),ws="function"==typeof WebGL2RenderingContext,Ts=function(){function t(t){this.setupCapability(t)}var e=t.prototype;return e.setupCapability=function(t){var e,i=ws&&xt(t,WebGL2RenderingContext)?2:1,r=2===i,n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),s=t.getExtension("WEBGL_depth_texture"),o=!!t.getExtension("OES_texture_half_float_linear"),a=!!t.getExtension("OES_texture_float_linear");this.level=i,this.type=r?"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"),s&&(this.UNSIGNED_INT_24_8=s.UNSIGNED_INT_24_8_WEBGL),r&&!o&&(o=Ss(t,t.HALF_FLOAT)),r&&!a&&(a=Ss(t,t.FLOAT)),this.internalFormatDepth16=r?t.DEPTH_COMPONENT16:t.DEPTH_COMPONENT,this.internalFormatDepth24_stencil8=r?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL;var h=r||t.getExtension("OES_texture_float")?t.FLOAT:0,u=r?WebGL2RenderingContext.HALF_FLOAT:(null==(e=t.getExtension("OES_texture_half_float"))?void 0:e.HALF_FLOAT_OES)||0,l={floatTexture:h,halfFloatTexture:u,maxSample:r?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:r?!!t.getExtension("EXT_color_buffer_float"):h>0&&!!t.getExtension("WEBGL_color_buffer_float"),halfFloatColorAttachment:r?!!t.getExtension("EXT_color_buffer_float"):u>0&&!!t.getExtension("EXT_color_buffer_half_float"),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxShaderTexCount:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),compressedTexture:As(t),halfFloatLinear:o,floatLinear:a,maxTextureAnisotropy:n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,shaderTextureLod:r||!!t.getExtension("EXT_shader_texture_lod"),instanceDraw:r||!!t.getExtension("ANGLE_instanced_arrays"),drawBuffers:r||!!this.drawBufferExtension,asyncShaderCompile:!!this.glAsyncCompileExt,intIndexElementBuffer:!!t.getExtension("OES_element_index_uint"),standardDerivatives:r||!!t.getExtension("OES_standard_derivatives"),readableDepthStencilTextures:r||!!s,writableFragDepth:r||!!t.getExtension("EXT_frag_depth")};this.detail=l,n&&(this.textureMaxAnisotropyExt=n.TEXTURE_MAX_ANISOTROPY_EXT)},e.framebufferTexture2D=function(t,e,i,r,n){var s=this.drawBufferExtension;if(1===this.level&&!s&&i>0)throw new Error("Draw multiple color buffers not available.");var o=s?s["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){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)}else if(e.length>1)throw new Error("Draw buffers not available.")},e.setTextureAnisotropic=function(t,e,i){var r=this.detail.maxTextureAnisotropy;r&&t.texParameterf(e,this.textureMaxAnisotropyExt,Math.min(r,i||4))},t}();function Ss(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}function As(t){return t.getExtension("WEBGL_compressed_texture_astc")?2:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")?1:0}(ms=ps||(ps={}))[ms.NONE=0]="NONE",ms[ms.PVRTC=1]="PVRTC",ms[ms.ASTC=2]="ASTC",(ys=vs||(vs={}))[ys.Nearest=0]="Nearest",ys[ys.Linear=1]="Linear",(bs=gs||(gs={}))[bs.RGBA32=0]="RGBA32",bs[bs.RGBAHalf=1]="RGBAHalf";var Os=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){},Ki(t,[{key:"stencilStorage",get:function(){}},{key:"depthStorage",get:function(){}}]),t}(),Cs=function(){function 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 null},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.addLostHandler=function(t){},e.addRestoreHandler=function(t){},e.lost=function(t){},e.restore=function(){},e.getShaderLibrary=function(){},e.renderRenderFrame=function(t){},e.renderMeshes=function(t){},e.drawGeometry=function(t,e,i){},e.getTemporaryRT=function(t,e,i,r,n,s){return null},e.dispose=function(t){},t}(),Is=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=Rs(this.arc,this.arcMode,t)*ar,i=Math.cos(e)*this.radius,r=Math.sin(e)*this.radius,n=new pr(i,r,0),s=Math.tan(this.angle*ar),o=n.clone().multiply(s);return o.z+=1,{position:n.multiply(ne(0,1)),direction:o.normalize()}},t}();function Rs(t,e,i){if(e===ii.RANDOM)t=ne(0,t);else if(e===ii.UNIDIRECTIONAL_CYCLE){var r=i.index%(i.total+1);t=t/i.total*r}else if(e===ii.BIDIRECTIONAL_CYCLE){var n=i.index/(i.total+1),s=n-Math.floor(n);t*=Math.floor(n)%2?1-s:s}else e===ii.UNIFORM_BURST&&(t=t*i.burstIndex/i.burstCount);return t}var Ps,Ms=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=Rs(this.arc,this.arcMode,t)*ar,i=new pr(Math.cos(e),Math.sin(e),0),r=this.radius;return{direction:i,position:i.clone().multiply(r)}},t}(),Ds=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2}return t.prototype.generate=function(t){var e=ne(-this._d,this._d),i=ne(-this._h,this._h);return{direction:new pr(0,0,1),position:new pr(e,i,0)}},t}(),Fs=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=Rs(this.arc,this.arcMode,t)*ar,i=new pr(Math.cos(e),Math.sin(e),0),r=this._d,n=this._h,s=Math.atan2(n,r),o=Math.tan(e),a=new pr;return e<s?a.set(r,r*o,0):e>=s&&e<Math.PI-s?a.set(n/o,n,0):e<Math.PI+s?a.set(-r,-r*o,0):e<2*Math.PI-s?a.set(-n/o,-n,0):a.set(r,r*o,0),{direction:i,position:a}},t}(),Ls=function(){function t(t){this._d=t.width||1,this.arcMode=t.arcMode}return t.prototype.generate=function(t){var e=this.arcMode===ii.UNIFORM_BURST?t.burstIndex%t.burstCount/(t.burstCount-1):ne(0,1);return{direction:new pr(0,1,0),position:new pr(this._d*(e-.5),0,0)}},t}(),ks=new _r,Ns=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=ne(0,2*Math.PI),n=Rs(this.arc,this.arcMode,t)*ar,s=ks.setFromRotationZ(n),o=new pr(Math.cos(r),Math.sin(r),0),a=new pr(i+Math.cos(r)*e,0,Math.sin(r)*e);return{direction:s.transformNormal(o),position:s.transformPoint(a)}},t}(),Bs=new _r,Us=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 ne(-90,90)},e.generate=function(t){var e=Rs(this.arc,this.arcMode,t)*ar,i=this.getHorizontalAngle()*ar,r=this.radius,n=new pr(Math.cos(i),0,Math.sin(i)),s=Bs.setFromRotationZ(e).transformNormal(n);return{position:s.clone().multiply(r),direction:s}},t}(),zs=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.getHorizontalAngle=function(){return ne(0,90)},e}(Us),Vs=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=fr(t.random||0,0,1)}return t.prototype.generate=function(t){var e=this.anchors,i=e.length/2-1,r=Math.floor(Rs(i,this.arcMode,t)),n=(e[2*r]+this.block[0]*this.random*Math.random())%1-.5,s=(e[2*r+1]+this.block[1]*this.random*Math.random())%1-.5,o=new pr(n,s,0);return{position:new pr(n*this.width,s*this.height,0),direction:o.normalize()}},t}(),Gs=function(){function t(){}return t.prototype.generate=function(){return{position:new pr,direction:new pr}},t}(),js=((Ps={})[Se.NONE]=Gs,Ps[Se.CONE]=Is,Ps[Se.SPHERE]=Us,Ps[Se.HEMISPHERE]=zs,Ps[Se.CIRCLE]=Ms,Ps[Se.DONUT]=Ns,Ps[Se.RECTANGLE]=Ds,Ps[Se.EDGE]=Ls,Ps[Se.RECTANGLE_EDGE]=Fs,Ps[Se.TEXTURE]=Vs,Ps);function Hs(t,e,i,r,n){var s,o;if(n===function(t,e,i,r){for(var n=0,s=e,o=i-r;s<i;s+=r)n+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return n}(t,e,i,r)>0)for(s=e;s<i;s+=r)o=ho(s,t[s],t[s+1],o);else for(s=i-r;s>=e;s-=r)o=ho(s,t[s],t[s+1],o);return o&&io(o,o.next)&&(uo(o),o=o.next),o}function Xs(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!io(r,r.next)&&0!==eo(r.prev,r,r.next))r=r.next;else{if(uo(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function Ws(t){var e=t.prev,i=t,r=t.next;if(eo(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if($s(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&eo(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Ys(t,e,i,r){var n=t.prev,s=t,o=t.next;if(eo(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,h=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,u=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,l=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,c=Qs(a,h,e,i,r),f=Qs(u,l,e,i,r),d=t.prevZ,p=t.nextZ;d&&d.z>=c&&p&&p.z<=f;){if(d!==t.prev&&d!==t.next&&$s(n.x,n.y,s.x,s.y,o.x,o.y,d.x,d.y)&&eo(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&$s(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&eo(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&$s(n.x,n.y,s.x,s.y,o.x,o.y,d.x,d.y)&&eo(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&$s(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&eo(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function qs(t,e){return t.x-e.x}function Zs(t,e){if(e=function(t,e){var i,r=e,n=t.x,s=t.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!i)return null;if(n===o)return i;var h,u=i,l=i.x,c=i.y,f=1/0;r=i;do{n>=r.x&&r.x>=l&&n!==r.x&&$s(s<c?n:o,s,l,c,s<c?o:n,s,r.x,r.y)&&(h=Math.abs(s-r.y)/(n-r.x),oo(r,t)&&(h<f||h===f&&(r.x>i.x||r.x===i.x&&Ks(i,r)))&&(i=r,f=h)),r=r.next}while(r!==u);return i}(t,e),e){var i=ao(e,t);Xs(e,e.next),Xs(i,i.next)}}function Ks(t,e){return eo(t.prev,t,e.prev)<0&&eo(e.next,t,t.next)<0}function Qs(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Js(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}function $s(t,e,i,r,n,s,o,a){return(n-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(r-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function to(t,e){return t.next.i!==e.i&&t.prev.i!==e.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&&ro(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(oo(t,e)&&oo(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(eo(t.prev,t,e.prev)||eo(t,e.prev,e))||io(t,e)&&eo(t.prev,t,t.next)>0&&eo(e.prev,e,e.next)>0)}function eo(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function io(t,e){return t.x===e.x&&t.y===e.y}function ro(t,e,i,r){var n=so(eo(t,e,i)),s=so(eo(t,e,r)),o=so(eo(i,r,t)),a=so(eo(i,r,e));return n!==s&&o!==a||(!(0!==n||!no(t,i,e))||(!(0!==s||!no(t,r,e))||(!(0!==o||!no(i,t,r))||!(0!==a||!no(i,e,r)))))}function no(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 so(t){return t>0?1:t<0?-1:0}function oo(t,e){return eo(t.prev,t,t.next)<0?eo(t,e,t.next)>=0&&eo(t,t.prev,e)>=0:eo(t,e,t.prev)<0||eo(t,t.next,e)<0}function ao(t,e){var i=new lo(t.i,t.x,t.y),r=new lo(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function ho(t,e,i,r){var n=new lo(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 uo(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 lo(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 co=0;function fo(t,e,i,r){i=i||2,co=r||0;var n,s,o,a,h,u,l,c=e&&e.length,f=c?e[0]*i:t.length,d=Hs(t,0,f,i,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(t,e,i,r){var n,s,o,a=[];for(n=0,s=e.length;n<s;n++)(o=Hs(t,e[n]*r,n<s-1?e[n+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),a.push(Js(o));for(a.sort(qs),n=0;n<a.length;n++)Zs(a[n],i),i=Xs(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],s=a=t[1];for(var m=i;m<f;m+=i)(h=t[m])<n&&(n=h),(u=t[m+1])<s&&(s=u),h>o&&(o=h),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-s))?1/l:0}return po(d,p,i,n,s,l),p}function po(t,e,i,r,n,s,o){if(t){!o&&s&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=Qs(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,s,o,a,h,u=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,r=i,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(h=u;a>0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;i=r}s.nextZ=null,u*=2}while(o>1)}(n)}(t,r,n,s);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,s?Ys(t,r,n,s):Ws(t))e.push(a.i/i+co),e.push(t.i/i+co),e.push(h.i/i+co),uo(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?po(t=mo(Xs(t),e,i),e,i,r,n,s,2):2===o&&vo(t,e,i,r,n,s):po(Xs(t),e,i,r,n,s,1);break}}}function mo(t,e,i){var r=t;do{var n=r.prev,s=r.next.next;!io(n,s)&&ro(n,r,r.next,s)&&oo(n,s)&&oo(s,n)&&(e.push(n.i/i+co),e.push(r.i/i+co),e.push(s.i/i+co),uo(r),uo(r.next),r=t=s),r=r.next}while(r!==t);return Xs(r)}function vo(t,e,i,r,n,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&to(o,a)){var h=ao(o,a);return o=Xs(o,o.next),h=Xs(h,h.next),po(o,e,i,r,n,s),void po(h,e,i,r,n,s)}a=a.next}o=o.next}while(o!==t)}var yo="editor",go="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS",bo="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b";function xo(t,e){for(var i=t.s,r=t.p,n=i[1],s=r[1],o=0,a=0;a<n.length;a++){o+=n[a].length-1}var h,u=new Float32Array(6*o),l=e.indexBase,c=void 0===l?0:l,f=e.uvTransform,d=0,p=0,m=0,v=1,y=1;f&&(p=f[0],m=f[1],h=f[4],v=h?f[3]:f[2],y=h?f[2]:f[3]);for(var g=[0,0],b=0===h?0:-Math.PI/2,x=0;x<n.length;x++)for(var _=n[x],E=s[x],w=s[x+1]||s[0],T=_,S=[0,0],A=0;A<T.length-1;A++){wo(S,T[A],E,w,E[4],E[5],w[2],w[3]),C(S[0],S[1])}var O=fo(Array.from(u),null,6,c);return{aPoint:u,index:new Uint16Array(O)};function C(t,e){u[d++]=t/2,u[d++]=e/2,f?(g[0]=t,g[1]=e,Eo(g,g,b),u[d++]=p+(g[0]+1)/2*v,u[d++]=m+(g[1]+1)/2*y):(u[d++]=(t+1)/2,u[d++]=(e+1)/2),d+=2}}function _o(t,e){for(var i=[],r=function(t){var e=[];return"gs"in t?t.gs.forEach(function(t){e.push({p:[qe.SHAPE_POINTS,t.p],s:[qe.SHAPE_SPLITS,t.s]})}):"g"in t?e.push({p:[qe.SHAPE_POINTS,t.g.p],s:[qe.SHAPE_SPLITS,t.g.s]}):e.push(t),e}(t),n=0,s=0,o=0,a=0;a<r.length;a++){var h=xo(r[a],{indexBase:n,uvTransform:e});n+=h.aPoint.length/5,i.push(h),s+=h.aPoint.length,o+=h.index.length}if(1===i.length)return i[0];for(var u=new Float32Array(s),l=new Uint16Array(o),c=0,f=0,d=0;c<i[c];c++){var p=i[c];u.set(p.aPoint,f),f+=p.aPoint.length,l.set(p.index,d),d+=p.index.length}return{aPoint:u,index:l}}function Eo(t,e,i){var r=Math.cos(i),n=Math.sin(i),s=e[0],o=e[1];return t[0]=r*s+n*o,t[1]=-n*s+r*o,t}function wo(t,e,i,r,n,s,o,a){var h=1-e,u=h*h*h,l=3*e*h*h,c=3*e*e*h,f=e*e*e;return t[0]=u*i[0]+l*n+c*o+f*r[0],t[1]=u*i[1]+l*s+c*a+f*r[1],t}var To=[[0,0,1,1,0]],So=function(t){function e(e){var i;(i=t.call(this,e)||this).visible=!0,i.splits=To,i.meshCollider=new Ya,i._color=new br(1,1,1,1),i.getHitTestParams=function(t){var e=_r.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,s=i.meshCollider.getBoundingBoxData();if(s)return{behavior:(null==(n=i.interaction)?void 0:n.behavior)||0,type:s.type,triangles:s.area,backfaceCulling:i.renderer.side===_e.FRONT}}},i.renderer={renderMode:Le.MESH,blending:be.ALPHA,texture:i.engine.emptyTexture,occlusion:!1,transparentOcclusion:!1,side:_e.DOUBLE,mask:0},i.defaultGeometry=Bn.create(i.engine,{attributes:{aPos:{type:Pr.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:Pr.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:Pr.TRIANGLES,drawCount:6}),i.geometry=i.defaultGeometry;var r=Tn.create(i.engine,{shader:{fragment:"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;}",vertex:"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;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvoid 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);}\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}",shared:!0}});return i.material=r,i.material.setColor("_Color",new br(1,1,1,1)),i.maskManager=new Sn(e),i}Xe(e,t);var i=e.prototype;return i.setVisible=function(t){this.visible=t},i.getVisible=function(){return this.visible},i.setColor=function(t){xt(t,br)?this._color.copyFrom(t):this._color.setFromArray(t),this.material.setColor("_Color",this._color)},i.setTexture=function(t){var e=this;return yt(function(){var i;return wt(this,function(r){switch(r.label){case 0:return"string"!=typeof t?[3,2]:[4,an.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]}})})()},i.render=function(t){this.getVisible()&&(this.maskManager.drawStencilMask(t),this.draw(t))},i.drawStencilMask=function(t){if(this.isActiveAndEnabled){var e=this.material.colorMask;this.material.colorMask=!1,this.draw(t),this.material.colorMask=e}},i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.meshCollider.setGeometry(this.geometry,t),this.meshCollider.getBoundingBox()},i.getItemGeometryData=function(t){var e=this.splits,i=this.textureSheetAnimation,r=this.defaultGeometry;if(t.shape){for(var n=t.shape,s=n.index,o=void 0===s?[]:s,a=n.aPoint,h=void 0===a?[]:a,u=new Float32Array(h),l=[],c=[],f=0;f<u.length;f+=6)u[f]*=1,u[f+1]*=1,c.push(h[f+2],h[f+3]),l.push(u[f],u[f+1],0);return r.setAttributeData("aPos",new Float32Array(l)),{index:o,aUV:c}}var d=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],p=[],m=[],v=[];if(1===e.length){var y=i?[0,0,1,1,e[0][4]]:e[0],g=y[4]?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],b=y[0],x=y[1],_=y[4]?y[3]:y[2],E=y[4]?y[2]:y[3];p.push(g[0]*_+b,g[1]*E+x,g[2]*_+b,g[3]*E+x,g[4]*_+b,g[5]*E+x,g[6]*_+b,g[7]*E+x),v.push(d[0],d[1],0,d[2],d[3],0,d[4],d[5],0,d[6],d[7],0),m.push(0,1,2,2,1,3)}else for(var w=0;w<2;w++)for(var T=0;T<2;T++){var S=4*(2*T+w),A=i?[0,0,1,1,e[0][4]]:e[2*T+w],O=A[4]?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],C=((w+w+1)/2-1)/2,I=((T+T+1)/2-1)/2,R=A[0],P=A[1],M=A[4]?A[3]:A[2],D=A[4]?A[2]:A[3],F=[d[0]/2+C,d[1]/2+I,d[2]/2+C,d[3]/2+I,d[4]/2+C,d[5]/2+I,d[6]/2+C,d[7]/2+I];p.push(O[0]*M+R,O[1]*D+P,O[2]*M+R,O[3]*D+P,O[4]*M+R,O[5]*D+P,O[6]*M+R,O[7]*D+P),v.push(1*F[0],1*F[1],0,1*F[2],1*F[3],0,1*F[4],1*F[5],0,1*F[6],1*F[7],0),m.push(S,1+S,2+S,2+S,1+S,3+S)}return r.setAttributeData("aPos",new Float32Array(v)),{index:m,aUV:p}},i.configureDefaultGeometry=function(t){var e=this.getItemGeometryData(t),i=e.index,r=e.aUV,n=this.defaultGeometry;return n.setIndexData(new Uint16Array(i)),n.setAttributeData("aUV",new Float32Array(r)),n.setDrawCount(i.length),n},i.configureMaterial=function(t){var e=t.side,i=t.occlusion,r=t.blending,n=t.mask,s=t.texture,o=this.maskManager.maskMode,a=this.material;a.blending=!0,a.depthTest=!0,a.depthMask=i,a.stencilRef=void 0!==n?[n,n]:void 0,kr(a,r),Br(a,o),Nr(a,e),a.shader.shaderData.properties='_MainTex("_MainTex",2D) = "white" {}',a.setVector4("_TexOffset",new mr(0,0,1,1)),a.setTexture("_MainTex",s);var h=Lr(r),u=new mr;return u.x=t.occlusion?+t.transparentOcclusion:1,u.y=h,u.z=t.renderMode,u.w=o,a.setVector4("_TexParams",u),0===u.x||this.maskManager.alphaMaskEnabled?a.enableMacro("ALPHA_CLIP"):a.disableMacro("ALPHA_CLIP"),a},i.draw=function(t){t.renderingData.currentFrame.globalUniforms&&t.setGlobalMatrix("effects_ObjectToWorld",this.transform.getWorldMatrix());for(var e=0;e<this.materials.length;e++){var i=this.materials[e];i.setVector2("_Size",this.transform.size),this.renderer.renderMode!==Le.BILLBOARD&&this.renderer.renderMode!==Le.VERTICAL_BILLBOARD&&this.renderer.renderMode!==Le.HORIZONTAL_BILLBOARD||i.setVector3("_Scale",this.transform.scale),t.drawGeometry(this.geometry,i,e)}},i.fromData=function(e){t.prototype.fromData.call(this,e);var i,r=e,n=null!=(i=r.renderer)?i:{},s=r.splits,o=r.textureSheetAnimation,a=r.mask;a&&this.maskManager.getMaskMode(a);var h,u,l,c=n.shape,f=s&&!o?s[0]:void 0,d=void 0;if(null==c||"aPoint"in c&&"index"in c||(d=_o(c,f)),this.splits=s||To,this.textureSheetAnimation=o,this.renderer={renderMode:null!=(h=n.renderMode)?h:Le.MESH,blending:null!=(u=n.blending)?u:be.ALPHA,texture:n.texture?this.engine.findObject(n.texture):this.engine.emptyTexture,occlusion:!!n.occlusion,transparentOcclusion:!!n.transparentOcclusion||this.maskManager.maskMode===Tr.MASK,side:null!=(l=n.side)?l:_e.DOUBLE,mask:this.maskManager.getRefValue(),shape:d},this.configureMaterial(this.renderer),r.geometry){var p=this.engine.findObject(r.geometry),m=r.splits&&!r.textureSheetAnimation?r.splits[0]:To[0],v=m[0],y=m[1],g=Boolean(m[4]),b=g?m[3]:m[2],x=g?m[2]:m[3],_=g?-Math.PI/2:0,E=p.getAttributeData("aUV"),w=p.getAttributeData("aPos"),T=p.getIndexData(),S=[0,0];if(E&&w&&T){for(var A=E.length/2,O=0;O<A;O++){var C=3*O,I=2*O,R=w[C],P=w[C+1];S[0]=R,S[1]=P,Eo(S,S,_),E[I]=(S[0]+.5)*b+v,E[I+1]=(S[1]+.5)*x+y}this.geometry.setAttributeData("aPos",w.slice()),this.geometry.setAttributeData("aUV",E.slice()),this.geometry.setIndexData(T.slice()),this.geometry.setDrawCount(T.length)}this.geometry.subMeshes.length=0;for(var M,D=bt(p.subMeshes);!(M=D()).done;){var F=M.value;this.geometry.subMeshes.push({offset:F.offset,indexCount:F.indexCount,vertexCount:F.vertexCount})}}else this.geometry=this.defaultGeometry,this.configureDefaultGeometry(this.renderer)},Ki(e,[{key:"color",get:function(){return this._color},set:function(t){this._color=t,this.material.setColor("_Color",this._color)}}]),e}(sr),Ao=function(t){function e(e){var i;(i=t.call(this,e)||this).hasStroke=!1,i.hasFill=!1,i.shapeDirty=!0,i.graphicsPath=new yl,i.vert="\nprecision highp float;\n\nattribute vec3 aPos;//x y\n\nuniform mat4 effects_MatrixVP;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_ObjectToWorld;\n\nvoid main() {\n vec4 pos = vec4(aPos.xyz, 1.0);\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * pos;\n}\n",i.frag="\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n color.rgb *= color.a;\n gl_FragColor = color;\n}\n",i.geometry.subMeshes.push({offset:0,indexCount:0,vertexCount:0},{offset:0,indexCount:0,vertexCount:0});var r={shader:{vertex:i.vert,fragment:i.frag,glslVersion:_n.GLSL1}},n=Tn.create(e,r),s=Tn.create(e,r);return n.color=new br(1,1,1,1),n.depthMask=!1,n.depthTest=!0,n.blending=!0,i.material=n,s.color=new br(.25,.25,.25,1),s.depthMask=!1,s.depthTest=!0,s.blending=!0,i.materials[1]=s,i.strokeAttributes={width:1,alignment:.5,cap:Ci.Butt,join:Ri.Miter,miterLimit:10,color:new br(1,1,1,1)},i.fillAttribute={color:new br(1,1,1,1)},i.shapeAttribute={type:Ai.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},i}Xe(e,t);var i=e.prototype;return i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.onUpdate=function(t){this.material.color=this.fillAttribute.color,this.materials[1].color=this.strokeAttributes.color,this.shapeDirty&&(this.buildPath(this.shapeAttribute),this.buildGeometryFromPath(this.graphicsPath.shapePath),this.shapeDirty=!1)},i.buildGeometryFromPath=function(t){var e=t.shapePrimitives,i=[],r=[];if(this.hasFill)for(var n,s=bt(e);!(n=s()).done;){var o=n.value.shape,a=[],h=r.length,u=i.length/2;o.build(a),o.triangulate(a,i,u,r,h)}var l=r.length;if(this.hasStroke)for(var c,f=bt(e);!(c=f()).done;){var d=c.value.shape,p=[],m=i.length/2,v=this.strokeAttributes,y=!0;this.shapeAttribute.type===Ai.Custom&&(y=d.closePath),d.build(p),tl(p,v,!1,y,i,2,m,r)}var g=r.length-l,b=i.length/2,x=this.geometry.getAttributeData("aPos"),_=this.geometry.getAttributeData("aUV"),E=this.geometry.getIndexData();(!x||x.length<3*b)&&(x=new Float32Array(3*b)),(!_||_.length<2*b)&&(_=new Float32Array(2*b)),(!E||E.length<r.length)&&(E=new Uint16Array(r.length));for(var w=0;w<b;w++){var T=3*w,S=2*w,A=2*w;x[T]=i[S],x[T+1]=i[S+1],x[T+2]=0,_[A]=x[T],_[A+1]=x[T+1]}E.set(r),this.geometry.setAttributeData("aPos",x),this.geometry.setAttributeData("aUV",_),this.geometry.setIndexData(E),this.geometry.setDrawCount(r.length);var O=this.geometry.subMeshes[0],C=this.geometry.subMeshes[1];O.indexCount=l,C.offset=2*l,C.indexCount=g},i.buildPath=function(t){switch(this.graphicsPath.clear(),t.type){case Ai.Custom:for(var e,i=this.shapeAttribute,r=i.points,n=i.easingIns,s=i.easingOuts,o=bt(i.shapes);!(e=o()).done;){var a=e.value,h=a.indexes,u=r[h[0].point];this.graphicsPath.moveTo(u.x,u.y);for(var l=1;l<h.length;l++){var c=h[l],f=h[l-1],d=r[c.point],p=r[f.point],m=s[f.easingOut],v=n[c.easingIn];this.graphicsPath.bezierCurveTo(m.x+p.x,m.y+p.y,v.x+d.x,v.y+d.y,d.x,d.y,1)}if(a.close){var y=h[0],g=h[h.length-1],b=r[y.point],x=r[g.point],_=s[g.easingOut],E=n[y.easingIn];this.graphicsPath.bezierCurveTo(_.x+x.x,_.y+x.y,E.x+b.x,E.y+b.y,b.x,b.y,1),this.graphicsPath.closePath()}}break;case Ai.Ellipse:var w=t;this.graphicsPath.ellipse(0,0,w.xRadius,w.yRadius);break;case Ai.Rectangle:var T=t;this.graphicsPath.rect(-T.width/2,-T.height/2,T.width,T.height,T.roundness);break;case Ai.Star:var S=t;this.graphicsPath.polyStar(S.pointCount,S.outerRadius,S.innerRadius,S.outerRoundness,S.innerRoundness,cl.Star);break;case Ai.Polygon:var A=t;this.graphicsPath.polyStar(A.pointCount,A.radius,A.radius,A.roundness,A.roundness,cl.Polygon)}},i.fromData=function(e){t.prototype.fromData.call(this,e),this.shapeDirty=!0;var i=e.stroke;i&&(this.hasStroke=!0,this.strokeAttributes.width=i.width,this.strokeAttributes.color.copyFrom(i.color),this.strokeAttributes.cap=i.cap,this.strokeAttributes.join=i.join);var r=e.fill;switch(r&&(this.hasFill=!0,this.fillAttribute.color.copyFrom(r.color)),e.type){case Ai.Custom:for(var n,s=e,o={type:Ai.Custom,points:[],easingIns:[],easingOuts:[],shapes:[],fill:s.fill},a=bt(s.points);!(n=a()).done;){var h=n.value;o.points.push(new dr(h.x,h.y))}for(var u,l=bt(s.easingIns);!(u=l()).done;){var c=u.value;o.easingIns.push(new dr(c.x,c.y))}for(var f,d=bt(s.easingOuts);!(f=d()).done;){var p=f.value;o.easingOuts.push(new dr(p.x,p.y))}o.shapes=s.shapes,this.shapeAttribute=o;break;case Ai.Ellipse:var m=e,v={type:Ai.Ellipse,xRadius:m.xRadius,yRadius:m.yRadius,fill:m.fill};this.shapeAttribute=v;break;case Ai.Rectangle:var y=e,g={type:Ai.Rectangle,width:y.width,height:y.height,roundness:y.roundness,fill:y.fill};this.shapeAttribute=g;break;case Ai.Star:var b=e,x={type:Ai.Star,pointCount:b.pointCount,innerRadius:b.innerRadius,outerRadius:b.outerRadius,innerRoundness:b.innerRoundness,outerRoundness:b.outerRoundness,fill:b.fill};this.shapeAttribute=x;break;case Ai.Polygon:var _=e,E={type:Ai.Polygon,pointCount:_.pointCount,radius:_.radius,roundness:_.roundness,fill:_.fill};this.shapeAttribute=E}e.mask&&this.maskManager.getMaskMode(e.mask);var w=this.maskManager.getRefValue();this.material.stencilRef=void 0!==w?[w,w]:void 0,Br(this.material,this.maskManager.maskMode)},Ki(e,[{key:"shape",get:function(){return this.shapeDirty=!0,this.shapeAttribute}}]),e}(So);Ao=Et([tr("ShapeComponent")],Ao);var Oo,Co,Io=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).loop=!1,e.amountOfMotion=1,e.animationLength=2,e.mode=1,e.startPositionX=0,e.startPositionY=0,e.startPositionZ=0,e.endPositionX=0,e.endPositionY=0,e.endPositionZ=0,e.amplitudeX=0,e.amplitudeY=0,e.amplitudeZ=0,e.phaseX=0,e.phaseY=0,e.phaseZ=0,e}Xe(e,t);var i=e.prototype;return i.onStart=function(){this.effectComponent=this.item.getComponent(yr)},i.onUpdate=function(t){this.updateFake3D()},i.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 s=t;this.loop&&(s>.5&&(s=1-s),s*=2),e=this.startPositionX*(1-s)+s*this.endPositionX,i=this.startPositionY*(1-s)+s*this.endPositionY,r=this.startPositionZ*(1-s)+s*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)}},e}(nr);Et([er()],Io.prototype,"loop",void 0),Et([er()],Io.prototype,"amountOfMotion",void 0),Et([er()],Io.prototype,"animationLength",void 0),Et([er()],Io.prototype,"mode",void 0),Et([er()],Io.prototype,"startPositionX",void 0),Et([er()],Io.prototype,"startPositionY",void 0),Et([er()],Io.prototype,"startPositionZ",void 0),Et([er()],Io.prototype,"endPositionX",void 0),Et([er()],Io.prototype,"endPositionY",void 0),Et([er()],Io.prototype,"endPositionZ",void 0),Et([er()],Io.prototype,"amplitudeX",void 0),Et([er()],Io.prototype,"amplitudeY",void 0),Et([er()],Io.prototype,"amplitudeZ",void 0),Et([er()],Io.prototype,"phaseX",void 0),Et([er()],Io.prototype,"phaseY",void 0),Et([er()],Io.prototype,"phaseZ",void 0),Io=Et([tr("Fake3DComponent")],Io),(Co=Oo||(Oo={}))[Co.Circular=0]="Circular",Co[Co.Linear=1]="Linear";var Ro=function(t){function e(e,i){var r;return r=t.call(this,e)||this,i&&r.fromData(i),r}Xe(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}(nr);Ro=Et([tr(ki.CameraController)],Ro);var Po,Mo,Do=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(je);(Mo=Po||(Po={}))[Mo.triangle=1]="triangle",Mo[Mo.box=2]="box",Mo[Mo.sphere=3]="sphere",Mo[Mo.custom=4]="custom";var Fo="click",Lo=function(){function t(t,e){void 0===e&&(e=!1),this.target=t,this.allowPropagation=e,this.enabled=!0,this.handlers={},this.nativeHandlers={}}var e=t.prototype;return e.bindListeners=function(){var t,e,i,r,n,s=this;n=function(t){return t};var o,a="mousedown",h="mousemove",u="mouseup",l=function(t,e,i,n,o){void 0===n&&(n=0),void 0===o&&(o=0);var a=0,h=0,u=performance.now();if(!s.target)return Qt.warn("Trigger TouchEvent after EventSystem is disposed."),{x:e,y:i,vx:0,vy:h,dx:n,dy:o,ts:u,width:0,height:0,origin:t};var l=s.target,c=l.width,f=l.height;if(r){var d=u-r.ts;a=(n-r.dx)/d||0,h=(o-r.dy)/d||0,r={dx:n,dy:o,ts:u}}return{x:e,y:i,vx:a,vy:h,dx:n,dy:o,ts:u,width:c,height:f,origin:t}};zt()&&(n=function(t){var e=t.touches,i=t.changedTouches;return e[0]||i[0]},a="touchstart",h="touchmove",u="touchend"),this.nativeHandlers=((o={})[a]=function(o){if(s.enabled){var a=n(o),h=ko(a);t=h.x,e=h.y,r=i={clientX:a.clientX,clientY:a.clientY,ts:performance.now(),x:t,y:e},s.dispatchEvent("touchstart",l(o,t,e))}},o[h]=function(r){if(i&&s.enabled){var o=ko(n(r));t=o.x,e=o.y,s.dispatchEvent("touchmove",l(r,t,e,t-i.x,e-i.y))}},o[u]=function(r){if(i&&s.enabled){!s.allowPropagation&&r.cancelable&&(r.preventDefault(),r.stopPropagation());var o=n(r),a=ko(o),h=Math.abs(i.clientX-o.clientX)+Math.abs(i.clientY-o.clientY);t=a.x,e=a.y,h<4&&s.dispatchEvent(Fo,l(r,t,e)),s.dispatchEvent("touchend",l(r,t,e,t-i.x,e-i.y))}i=0},o),Object.keys(this.nativeHandlers).forEach(function(t){var e;null==(e=s.target)||e.addEventListener(String(t),s.nativeHandlers[t])})},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]=[]),Mt(i,e),function(){Dt(i,e)}},e.removeEventListener=function(t,e){var i=this.handlers[t];i&&Dt(i,e)},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={},this.target=null)},t}();function ko(t){var e=t.target,i=t.clientX,r=t.clientY,n=e.getBoundingClientRect(),s=n.left,o=n.top;return{x:(i-s)/n.width*2-1,y:1-(r-o)/n.height*2}}var No,Bo,Uo,zo=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(je),Vo=(No=new Float32Array(1),Bo=new Int32Array(No.buffer),function(t){No[0]=t;var e=Bo[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?i|=((r|=2048)>>114-n)+(r>>113-n&1):(i|=n-112<<10|r>>1,i+=1&r)}),Go=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]=Vo(t[i])}return t.prototype.set=function(t,e){for(var i=0;i<t.length;i++)this.data[i+e]=Vo(t[i])},t}(),jo=new Un,Ho=new _r;function Xo(t,e,i,r,n,s,o){var a=t,h=r/n,u=r,l=e.speedOverLifetime;l&&(u=l.getIntegrateValue(0,r,n));var c=e.gravityModifier?e.gravityModifier.getIntegrateByTime(0,r):0;a.copyFrom(s),a.addScaledVector(o,u),a.addScaledVector(i,c);var f=e.linearVelOverLifetime||{},d=e.orbitalVelOverLifetime||{};if(d.enabled){var p=new pr;d.center&&p.setFromArray(d.center);var m=a.clone().subtract(p),v=d.asRotation,y=["x","y","z"].map(function(t){var e=d[t];return e?v?e.getValue(h):e.getIntegrateValue(0,r,n):0});jo.setFromArray(y).negate(),Ho.setFromEuler(jo);var g=Ho.transformPoint(m);a.addVectors(p,g)}if(f.enabled){var b=f.asMovement,x=f.x,_=f.y,E=f.z;if(x){var w=b?x.getValue(h):x.getIntegrateValue(0,r,n);a.x=a.x+w}if(_){var T=b?_.getValue(h):_.getIntegrateValue(0,r,n);a.y=a.y+T}if(E){var S=b?E.getValue(h):E.getIntegrateValue(0,r,n);a.z=a.z+S}}return a}function Wo(t){return Array.isArray(t)?[t[0],t[1],t[2]]:[0,0,0]}(Uo={})[Ne.PARTICLE_ORIGIN_CENTER]=[0,0],Uo[Ne.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],Uo[Ne.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],Uo[Ne.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],Uo[Ne.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],Uo[Ne.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],Uo[Ne.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],Uo[Ne.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],Uo[Ne.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5];function Yo(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function qo(t,e,i){return void 0===i&&(i=1e-6),Math.abs(t-e)<i}function Zo(t,e){void 0===e&&(e=2);var i=Math.pow(10,e);return Math.floor(t*i)/i}var Ko={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,s=e[r],o=e[n];return new dr(s,o)},getPointIndexInCurve:function(t,e){var i=t[0],r=t[2],n=i===Ke.LINE||i===Ke.EASE_OUT?0:i===Ke.EASE_IN||i===Ke.EASE||i===Ke.HOLD&&r===Ke.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!==Ke.HOLD||!this.isKeyframeTypeLeftSideEase(i))||this.isKeyframeTypeLeftSideEase(e)},isRightSideEase:function(t){var e=t[0];t[1];var i=t[2];return!(e!==Ke.HOLD||!this.isKeyframeTypeRightSideEase(i))||this.isKeyframeTypeRightSideEase(e)},isKeyframeTypeLeftSideEase:function(t){return[Ke.EASE,Ke.EASE_IN,Ke.AUTO].includes(t)},isKeyframeTypeRightSideEase:function(t){return[Ke.EASE,Ke.EASE_OUT,Ke.AUTO].includes(t)},isHoldInKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===Ke.HOLD&&[Ke.HOLD,Ke.LINE_OUT,Ke.EASE_OUT].includes(i)},isHoldOutKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===Ke.HOLD&&[Ke.HOLD,Ke.LINE,Ke.EASE_IN].includes(i)}},Qo=function(t,e){this.points=t,this.totalLength=e},Jo={},$o={},ta=.1;function ea(t,e){return 1-3*e+3*t}function ia(t,e){return 3*e-6*t}function ra(t){return 3*t}function na(t,e,i){return((ea(e,i)*t+ia(e,i))*t+ra(e))*t}function sa(t,e,i){return 3*ea(e,i)*t*t+2*ia(e,i)*t+ra(e)}var oa=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=Zo(e.x-t.x,3)+"_"+Zo(e.y-t.y,3)+"_"+Zo(e.z-t.z,3)+"&"+Zo(i.x-t.x,3)+"_"+Zo(i.y-t.y,3)+"_"+Zo(i.z-t.z,3)+"&"+Zo(r.x-t.x,3)+"_"+Zo(r.y-t.y,3)+"_"+Zo(r.z-t.z,3);if($o[n])return{data:$o[n],interval:t};for(var s=[],o=null,a=0,h=0,u=0;u<300;u+=1){var l=new pr,c=u/299;h=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&&(h+=Math.pow(l.x-o.x,2),h+=Math.pow(l.y-o.y,2),h+=Math.pow(l.z-o.z,2)),o=l,a+=h=Math.sqrt(h),s[u]={partialLength:h,point:l}}var f=new Qo(s,a);return $o[n]=f,{data:f,interval:new pr(t.x,t.y,t.z)}}(t,e,i,r),s=n.data,o=n.interval;this.lengthData=s,this.interval=o,this.totalLength=s.totalLength}return t.prototype.getPointInPercent=function(t){var e=this.lengthData;if(0===t)return e.points[0].point.clone().add(this.interval);if(qo(1-t,0))return e.points[299].point.clone().add(this.interval);if(qo(e.totalLength,0))return this.p1.clone();var i=new pr,r=Zo(e.totalLength*t,4),n=this.catching.lastAddedLength,s=this.catching.lastPoint;if(qo(n,r))return e.points[s].point.clone().add(this.interval);var o=!0,a=1;for(r<n&&(a=-1);o;){if(r>=n){if(299===s){i.x=e.points[s].point.x,i.y=e.points[s].point.y,i.z=e.points[s].point.z;break}if(r<n+e.points[s+1].partialLength){var h=(r-n)/e.points[s+1].partialLength;i.x=e.points[s].point.x+(e.points[s+1].point.x-e.points[s].point.x)*h,i.y=e.points[s].point.y+(e.points[s+1].point.y-e.points[s].point.y)*h,i.z=e.points[s].point.z+(e.points[s+1].point.z-e.points[s].point.z)*h;break}}a>0&&s<299?(s+=a,n+=Zo(e.points[s].partialLength,5)):a<0&&s>0?(n-=Zo(e.points[s].partialLength,5),s+=a):o=!1}return this.catching.lastPoint=s,this.catching.lastAddedLength=n,i.add(this.interval),i},t}(),aa=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.temp=new xr,this.totalLength=0}return t.prototype.getPointInPercent=function(t){return 0===t?this.temp.copyFrom(this.p1):qo(1-t,0)?this.temp.copyFrom(this.p2):(ca.slerpFlat(this.temp,this.p1,this.p2,t),this.temp)},t}(),ha=function(){function t(t,e,i,r){this.precomputed=!1,this.control1=new dr,this.control2=new dr,this.weighted=!1,this.isConstant=!1,this.mSampleValues=new 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(),na(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 s=1-n,o=s*s,a=n*n;return t*(o*s)+e*o*n*3+i*s*a*3+r*(a*n)},e.calcSampleValues=function(){for(var t=0;t<11;++t)this.mSampleValues[t]=na(t*ta,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+=ta;var n=i+(t-e[--r])/(e[r+1]-e[r])*ta,s=sa(n,this.control1.x,this.control2.x);return s>=.001?function(t,e,i,r){for(var n=0;n<4;++n){var s=sa(e,i,r);if(0===s)return e;e-=(na(e,i,r)-t)/s}return e}(t,n,this.control1.x,this.control2.x):0===s?n:function(t,e,i,r,n){var s,o,a=0;do{(s=na(o=e+(i-e)/2,r,n)-t)>0?i=o:e=o}while(Math.abs(s)>1e-7&&++a<10);return o}(t,i,i+ta,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 ua(t,e){var i=la(t,e,!0),r=i.p0,n=i.p1,s=i.p2,o=i.p3;Xt(s),Xt(o);var a,h,u=o.x-r.x,l=o.y-r.y,c=Zo((n.x-r.x)/u,5),f=Zo((s.x-r.x)/u,5);qo(l,0)?a=h=NaN:(a=Zo((n.y-r.y)/l,5),h=Zo((s.y-r.y)/l,5)),c<0&&(console.error("Invalid bezier points, x1 < 0",r,n,s,o),c=0),f<0&&(console.error("Invalid bezier points, x2 < 0",r,n,s,o),f=0),c>1&&(console.error("Invalid bezier points, x1 >= 1",r,n,s,o),c=1),f>1&&(console.error("Invalid bezier points, x2 >= 1",r,n,s,o),f=1);var d,p=("bez_"+c+"_"+a+"_"+f+"_"+h).replace(/\./g,"p");return Jo[p]?d=Jo[p]:(d=qo(l,0)?new ha:new ha(c,a,f,h),Jo[p]=d),{points:[r,n,s,o],timeInterval:u,valueInterval:l,curve:d}}function la(t,e,i){var r=t[1],n=Ko.isHoldOutKeyframe(t),s=Ko.isHoldInKeyframe(e),o=!s&&Ko.isRightSideEase(t),a=!n&&Ko.isLeftSideEase(e);if(o&&!a&&!s){var h=new dr(r[r.length-4],r[r.length-3]),u=new dr(r[r.length-2],r[r.length-1]),l=Ko.getPointInCurve(e),c=new dr(l.x,l.y);return{type:"ease",p0:h,p1:u,p2:new dr(c.x-(c.x-h.x)/10,c.y),p3:c}}if(!o&&a&&!n){var f=e[1],d=Ko.getPointInCurve(t),p=new dr(d.x,d.y),m=new dr(f[0],f[1]),v=new dr(f[2],f[3]);return{type:"ease",p0:p,p1:new dr(p.x+(v.x-p.x)/10,p.y),p2:m,p3:v}}if(o&&a){var y=e[1];return{type:"ease",p0:new dr(r[r.length-4],r[r.length-3]),p1:new dr(r[r.length-2],r[r.length-1]),p2:new dr(y[0],y[1]),p3:new dr(y[2],y[3])}}var g=Ko.getPointInCurve(t),b=Ko.getPointInCurve(e);return n?b.y=g.y:s&&(g.y=b.y),i?{type:"ease",p0:g,p1:new dr((b.x-g.x)/3+g.x,(b.y-g.y)/3+g.y),p2:new dr((b.x-g.x)/3*2+g.x,(b.y-g.y)/3*2+g.y),p3:b,isHold:n||s,leftHoldLine:n,rightHoldLine:s}:{type:"line",p0:g,p1:b,isHold:n||s,leftHoldLine:n,rightHoldLine:s}}var ca=function(){function t(){}return t.slerpFlat=function(t,e,i,r){var n=e.x,s=e.y,o=e.z,a=e.w,h=i.x,u=i.y,l=i.z,c=i.w;if(0===r)return t.x=n,t.y=s,t.z=o,void(t.w=a);if(1===r)return t.x=h,t.y=u,t.z=l,void(t.w=c);if(a!==c||n!==h||s!==u||o!==l){var f=1-r,d=n*h+s*u+o*l+a*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+h*g,s=s*f+u*g,o=o*f+l*g,a=a*f+c*g,f===1-r){var b=1/Math.sqrt(n*n+s*s+o*o+a*a);n*=b,s*=b,o*=b,a*=b}}t.x=n,t.y=s,t.z=o,t.w=a},t}(),fa="not_implement",da=function(){function t(t){this.onCreate(t)}var e=t.prototype;return e.onCreate=function(t){throw new Error(fa)},e.getIntegrateValue=function(t,e,i){throw new Error(fa)},e.getIntegrateByTime=function(t,e){throw new Error(fa)},e.getValue=function(t){throw new Error(fa)},e.getMaxTime=function(){throw new Error(fa)},e.toUniform=function(t){throw new Error(fa)},e.map=function(t){throw new Error(fa)},e.scaleXCoord=function(t){return this},e.toData=function(){throw new Error(fa)},t.getAllData=function(t,e){for(var i=new(e?Go:Float32Array)(4*t.index),r=0,n=0,s=t.curves;r<s.length;r++){var o=s[r].toData();i.set(o,n),n+=o.length}return e?i.data:i},t}(),pa=function(t){function e(){return t.apply(this,arguments)}Xe(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}(da),ma=function(t){function e(){return t.apply(this,arguments)}Xe(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}(da),va=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t,e){var i=null!=e?e:Math.random();return this.min+i*(this.max-this.min)},i.getIntegrateValue=function(t,e,i){var r=null!=i?i:1;return(this.min+r*(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}(da),ya=function(t){function e(){return t.apply(this,arguments)}Xe(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 s=Math.random();r[n]=e[n]*(1-s)+i[n]*s}return r},i.map=function(t){return this.min=this.min.map(t),this.max=this.max.map(t),this},e}(da),ga=function(t){function e(){return t.apply(this,arguments)}Xe(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,s=this.xCoord*i;return((r+e/s*(n-r)+r)*e-(r+t/s*(n-r)+r)*t)/2},i.getIntegrateByTime=function(t,e){return Sa(e,0,this.xCoord,this.min,this.max)-Sa(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}(da),ba=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.onCreate=function(t){this.stops=kt(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],s=e[r+1];if(n.stop<=t&&s.stop>t){var o=(t-n.stop)/(s.stop-n.stop);return Nt(n.color,s.color,o,!0)}}return e[i].color.slice()},e}(da),xa=function(t){function e(){return t.apply(this,arguments)}Xe(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],s=e[r+1],o=n[0],a=s[0];if(t>=o&&t<=a){var h=(t-o)/(a-o),u=n[1];return u+h*(s[1]-u)}}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,s=e?Sa:Ta,o=0;o<n;o++){var a=i[o],h=i[o+1],u=a[0],l=h[0];if(t>u&&t<=l)return r+s(t,u,l,a[1],h[1]);r+=s(l,u,l,a[1],h[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=this.keys,r=Math.ceil(i.length/2);return t.lineSegCount+=r,t.curves.push(this),t.index+=r,t.max=Math.max(t.max,r),new Float32Array([3,e,r,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}(da),_a=function(t){function e(){return t.apply(this,arguments)}Xe(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],s=e[r+1];if(n[0]<=t&&s[0]>=t){var o=s[1]-n[1],a=void 0;if(0===o)a=(t-n[0])/(s[0]-n[0]);else a=(Aa(t,n,s)-n[1])/o;return this.calculateVec(r,a)}}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],s=0;s<i.length;s++)n[s]=i[s]*(1-e)+r[s]*e;return n},e}(da),Ea=function(t){function e(){return t.apply(this,arguments)}Xe(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 s=e[n],o=e[n+1],a=new pr(i[n][0],i[n][1],i[n][2]),h=new pr(i[n+1][0],i[n+1][1],i[n+1][2]),u=new pr(r[2*n][0],r[2*n][1],r[2*n][2]),l=new pr(r[2*n+1][0],r[2*n+1][1],r[2*n+1][2]),c=ua(s,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new oa(a,h,u,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=Zo(t,5),i=0,r=new pr,n=this.keyTimeData;if(!n.length)return r;var s=this.curveSegments[n[0]].timeStart,o=this.curveSegments[n[n.length-1]].timeEnd;if(e<=s)return r=this.curveSegments[n[0]].pathCurve.getPointInPercent(0);if(e>=o)return r=this.curveSegments[n[n.length-1]].pathCurve.getPointInPercent(1);for(var a=0;a<n.length;a++){var h=this.curveSegments[n[a]].timeStart,u=this.curveSegments[n[a]].timeEnd;if(e>=Number(h)&&e<Number(u)){var l=this.curveSegments[n[a]].pathCurve;i=this.getPercValue(n[a],e),r=l.getPointInPercent(i)}}return r},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,s=Zo((e-r.x)/n,4);return fr(i.easingCurve.getValue(s),0,1)},i.getMaxTime=function(){var t=this.keyTimeData;return this.curveSegments[t[t.length-1]].timeEnd},e}(da),wa=function(t){function e(){return t.apply(this,arguments)}Xe(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 s=e[n],o=e[n+1],a=xr.fromArray(i[n]),h=xr.fromArray(i[n+1]),u=xr.fromArray(r[2*n]),l=xr.fromArray(r[2*n+1]),c=ua(s,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new aa(a,h,u,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=Zo(t,5),r=Object.keys(this.curveSegments),n=Number(r[0].split("&")[0]),s=Number(r[r.length-1].split("&")[1]);if(i<=n)return this.curveSegments[r[0]].pathCurve.getPointInPercent(0);if(i>=s)return this.curveSegments[r[r.length-1]].pathCurve.getPointInPercent(1);for(var o=0;o<r.length;o++){var a=r[o].split("&"),h=a[0],u=a[1];if(i>=Number(h)&&i<Number(u)){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,s=Zo((e-r.x)/n,4);return fr(i.easingCurve.getValue(s),0,1)},i.getMaxTime=function(){var t=Object.keys(this.curveSegments);return Number(t[t.length-1].split("&")[1])},e}(da);function Ta(t,e,i,r,n){var s=t-e;return(r+r+(n-r)*s/(i-e))*s/2}function Sa(t,e,i,r,n){var s=t*t,o=e*e;return(2*(s*t)*(r-n)+3*s*(e*n-i*r)-o*e*(2*r+n)+3*o*i*r)/(6*(e-i))}function Aa(t,e,i){var r=i[0]-e[0],n=e[3]*r,s=i[2]*r,o=(t-e[0])/r,a=o*o,h=a*o,u=h-2*a+o,l=h-a,c=-2*h+3*a;return(2*h-3*a+1)*e[1]+u*n+l*s+c*i[1]}function Oa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Oa=function(){return!!t})()}function Ca(t,e,i){return(Ca=Oa()?Reflect.construct:function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&He(n,i.prototype),n}).apply(null,arguments)}var Ia,Ra,Pa,Ma,Da=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).value=new mr,e}Xe(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=Ua(t[0]),this.yCurve=Ua(t[1]),this.zCurve=Ua(t[2]),this.wCurve=Ua(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},e}(da),Fa=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).value=new dr,e}Xe(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=Ua(t[0]),this.yCurve=Ua(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},e}(da);(Ra=Ia||(Ia={}))[Ra.Cubic=0]="Cubic",Ra[Ra.Linear=1]="Linear",Ra[Ra.Constant=2]="Constant",(Ma=Pa||(Pa={}))[Ma.None=0]="None",Ma[Ma.In=1]="In",Ma[Ma.Out=2]="Out",Ma[Ma.Both=3]="Both";var La,ka=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.onCreate=function(t){this.keyFrames=t;var e=this.keyFrames;this.curveMap={},this.keys=[],this.curveInfos=[];for(var i=0;i<e.length-1;i++){var r=Na(e[i],e[i+1]),n=r.points,s=r.curve,o=r.timeInterval,a=r.valueInterval,h=n[0],u=n[n.length-1];this.keys.push([].concat(h.toArray(),n[1].toArray())),this.keys.push([].concat(u.toArray(),n[2].toArray()));var l={points:n,timeInterval:o,valueInterval:a,curve:s,timeStart:Number(h.x),timeEnd:Number(u.x)};this.curveMap[h.x+"&"+u.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,s=this.keyFrames[r+1].time;if(t>=n&&t<s){var o=this.curveInfos[r],a=o.points[0],h=o.timeInterval,u=o.valueInterval,l=(t-a.x)/h,c=o.curve.getValue(l);e=a.y+u*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,s=Object.keys(this.curveMap);if(r<=this.curveMap[s[0]].timeStart)return 0;for(var o=0;o<s.length;o++){var a=this.curveMap[s[o]].timeStart,h=this.curveMap[s[o]].timeEnd;if(r>=Number(h)&&(n+=i*this.getCurveIntegrateValue(s[o],Number(h))),r>=Number(a)&&r<Number(h)){n+=i*this.getCurveIntegrateValue(s[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,s=i.valueInterval,o=0,a=(e-r.x)/20,h=0;h<=20;h++){var u=h*a/n,l=r.y+s*i.curve.getValue(u);o+=0===h||20===h?l:h%2==1?4*l:2*l}return o*=a/3},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}(da);function Na(t,e){var i=new dr(t.time,t.value),r=new dr,n=new dr,s=new dr,o=2===t.weightedMode||3===t.weightedMode||1===e.weightedMode||3===e.weightedMode,a=2===t.tangentMode,h=(o?t.outWeight:1)*(e.time-t.time)/3;r.x=t.time+h,r.y=t.value+h*(a?0:t.outSlope);var u=(o?e.inWeight:1)*(e.time-t.time)/3;n.x=e.time-u,n.y=e.value-u*(a?0:e.inSlope),s.x=e.time,s.y=a?t.value:e.value,Xt(n),Xt(s);var l,c,f=s.x-i.x,d=s.y-i.y,p=Zo((r.x-i.x)/f,5),m=Zo((n.x-i.x)/f,5);qo(d,0)?l=c=NaN:(l=Zo((r.y-i.y)/d,5),c=Zo((n.y-i.y)/d,5)),p<0&&(console.error("Invalid bezier points, x1 < 0",i,r,n,s),p=0),m<0&&(console.error("Invalid bezier points, x2 < 0",i,r,n,s),m=0),p>1&&(console.error("Invalid bezier points, x1 >= 1",i,r,n,s),p=1),m>1&&(console.error("Invalid bezier points, x2 >= 1",i,r,n,s),m=1);var v,y=("bez_"+p+"_"+l+"_"+m+"_"+c).replace(/\./g,"p");return Jo[y]?v=Jo[y]:(v=qo(d,0)?new ha:o?new ha(p,l,m,c):new ha(l,c),Jo[y]=v),{points:[i,r,n,s],timeInterval:f,valueInterval:d,curve:v}}var Ba=((La={})[qe.RANDOM]=function(t){return xt(t[0],Array)?new ya(t):new va(t)},La[qe.CONSTANT]=function(t){return new pa(t)},La[qe.CONSTANT_VEC2]=function(t){return new pa(t)},La[qe.CONSTANT_VEC3]=function(t){return new pa(t)},La[qe.CONSTANT_VEC4]=function(t){return new pa(t)},La[qe.RGBA_COLOR]=function(t){return new pa(t)},La[qe.COLORS]=function(t){return new ma(t.map(function(t){return Lt(t,!1)}))},La[qe.LINE]=function(t){return 2===t.length&&0===t[0][0]&&1===t[1][0]?new ga([t[0][1],t[1][1]]):new xa(t)},La[qe.GRADIENT_COLOR]=function(t){return new ba(t)},La[qe.LINEAR_PATH]=function(t){return new _a(t)},La[qe.BEZIER_CURVE]=function(t){return 1===t.length?new pa(t[0][1][1]):new ka(function(t){for(var e=t,i=[],r=[],n={x:0,y:0},s=0;s<e.length-1;s++){var o=e[s],a=e[s+1],h=la(o,a,!0),u=h.p0,l=h.p1,c=h.p2,f=h.p3;Xt(c),Xt(f);var d={leftControl:n,value:u,rightControl:l,tangentMode:0};if(o[0]===Ke.HOLD&&(d.tangentMode=2),r.push(d),n=c,s===e.length-2){var p=la(a,a,!0);Xt(p.p3),r.push({leftControl:c,value:p.p3,rightControl:{x:0,y:0},tangentMode:a[0]===Ke.HOLD?2:0})}}for(var m=function(t,e){return(e.y-t.y)/(e.x-t.x+ur)},v=0;v<r.length;v++){var y=r[v].leftControl,g=r[v].value,b=r[v].rightControl,x=m(g,b),_=m(y,g),E={time:g.x,value:g.y,inSlope:_,outSlope:x,inWeight:0,outWeight:0,tangentMode:r[v].tangentMode,weightedMode:3};i.push(E),v>0&&(E.inWeight=(g.x-y.x)/((g.x-r[v-1].value.x)/3)),v+1<r.length&&(E.outWeight=(b.x-g.x)/((r[v+1].value.x-g.x)/3))}return i}(t))},La[qe.BEZIER_CURVE_PATH]=function(t){return 1===t[0].length?new pa(Ca(pr,[].concat(t[1][0]))):new Ea(t)},La[qe.BEZIER_CURVE_QUAT]=function(t){return 1===t[0].length?new pa(Ca(xr,[].concat(t[1][0]))):new wa(t)},La[qe.COLOR_CURVE]=function(t){return new za(t)},La[qe.VECTOR4_CURVE]=function(t){return new Da(t)},La[qe.VECTOR2_CURVE]=function(t){return new Fa(t)},La);function Ua(t){if(!t||!isNaN(+t))return new pa(t||0);if(xt(t,da))return t;if(ee(Ba[t[0]]))return Ba[t[0]](t[1]);throw new Error("ValueType: "+t[0]+" is not supported, see "+bo+".")}var za=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).value=new br,e}Xe(e,t);var i=e.prototype;return i.onCreate=function(t){this.rCurve=Ua(t[0]),this.gCurve=Ua(t[1]),this.bCurve=Ua(t[2]),this.aCurve=Ua(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},e}(da),Va=1,Ga=function(){function t(t,e,i,r){this.transform=i,this.engine=r,this.color=t.options.previewColor;var n=this.createMaterial(e),s=this.createGeometry();this.mesh=this.createMesh(s,n),this.updateMesh()}var e=t.prototype;return e.updateMesh=function(){var t=this.mesh.material,e=t.getVector2("uSize").clone(),i=t.getVector4("uPos").clone(),r=new pr,n=new xr,s=this.transform.scale.clone();this.transform.assignWorldTRS(r,n,s),e.x=s.x,e.y=s.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)},e.createMaterial=function(t){var e,i=[["ENV_EDITOR",(null==(e=this.engine.renderer)?void 0:e.env)===yo]],r=Ua(this.color).getValue(0),n={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#ifdef ENV_EDITOR\n uniform vec4 uEditorTransform;\n#endif\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 #ifdef ENV_EDITOR\n gl_Position = vec4(gl_Position.xy * uEditorTransform.xy + uEditorTransform.zw * gl_Position.w, gl_Position.zw);\n #endif\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:_n.GLSL1,cacheId:t.cachePrefix+"_effects_interact",macros:i},uniformSemantics:{effects_MatrixVP:"VIEWPROJECTION",effects_MatrixInvV:"VIEWINVERSE",effects_ObjectToWorld:"MODEL",uEditorTransform:"EDITOR_TRANSFORM"}},s=Tn.create(this.engine,n);return s.blending=!0,s.depthTest=!1,s.setVector4("uPos",new mr(0,0,0,0)),s.setVector2("uSize",new dr(1,1)),s.setVector4("uColor",new mr(r[0]/255,r[1]/255,r[2]/255,r[3])),s.setQuaternion("uQuat",new xr(0,0,0,0)),s},e.createGeometry=function(){var t=new Uint8Array([0,1,1,2,2,3,3,0]);return Bn.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:Pr.LINES,maxVertex:4})},e.createMesh=function(t,e){return Kn.create(this.engine,{name:"Interact_preview"+Va++,priority:0,worldMatrix:_r.fromIdentity(),geometry:t,material:e})},t}(),ja=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).downgrade=.95,e.dragRatio=[1,1],e.dragRange={dxRange:[0,0],dyRange:[0,0]},e.duringPlay=!1,e._interactive=!0,e.lastTime=-1,e.getHitTestParams=function(t){if(e.clickable){var i=e.item.props.content.options.behavior,r=e.getBoundingBox();return r?{type:r.type,triangles:r.area,behavior:i}:void 0}},e}Xe(e,t);var i=e.prototype;return i.getDragRangeX=function(){return this.dragRange.dxRange},i.setDragRangeX=function(t,e){this.dragRange.dxRange=[t,e]},i.getDragRangeY=function(){return this.dragRange.dyRange},i.setDragRangeY=function(t,e){this.dragRange.dyRange=[t,e]},i.onStart=function(){var t=this.item.props.content.options,e=this.item.engine.renderer.env,i=this.item.composition,r=this.interactData.options,n=r.type,s=r.showPreview;if(n===Ie.CLICK&&(this.clickable=!0,s&&e===yo)){var o=null==i?void 0:i.getRendererOptions();void 0!==o&&(this.previewContent=new Ga(this.item.props.content,o,this.transform,this.engine))}t.type===Ie.DRAG&&(e!==yo||t.enableInEditor)&&(null==i?void 0:i.event)&&this.beginDragTarget(t,i.event),this.previewContent&&(this.previewContent.mesh.item=this.item,this.materials=this.previewContent.mesh.materials),this.item.getHitTestParams=this.getHitTestParams},i.onDisable=function(){t.prototype.onDisable.call(this),this.item&&this.item.composition&&(this.duringPlay&&!this.item.transform.getValid()&&(this.item.composition.removeInteractiveItem(this.item,this.item.props.content.options.type),this.duringPlay=!1),this.clickable=!1,this.endDragTarget())},i.onEnable=function(){t.prototype.onEnable.call(this);var e=this.interactData.options.type,i=this.item.engine.renderer.env;if(e===Ie.CLICK)this.clickable=!0;else if(e===Ie.DRAG){var r,n=this.interactData.options,s=n.enableInEditor;if(i!==yo||s)(null==(r=this.item.composition)?void 0:r.event)&&this.beginDragTarget(n,this.item.composition.event)}},i.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){var n,s=this.item.props.content.options;null==(n=this.item.composition)||n.addInteractiveItem(this.item,s.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,Ha(this.bouncingArg)?(this.dragEvent=null,this.bouncingArg=null):this.handleDragMove(this.dragEvent,this.bouncingArg))},i.render=function(t){this.previewContent&&this.previewContent.mesh.render(t)},i.onDestroy=function(){var t;null==(t=this.previewContent)||t.mesh.dispose()},i.endDragTarget=function(){},i.handleDragMove=function(t,e){if((null==t?void 0:t.cameraParam)&&this.canInteract()&&this.item.composition){var i,r,n=t.cameraParam,s=n.position,o=n.fov,a=e.dy,h=e.dx*e.width/e.height,u=s[2],l=Math.tan(o*Math.PI/180/2)*Math.abs(u),c=a*l,f=h*l,d=this.dragRange,p=d.dxRange,m=d.dyRange,v=s[0]-this.dragRatio[0]*f,y=s[1]-this.dragRatio[1]*c,g=p[0],b=p[1],x=m[0],_=m[1];if(v=fr(v,g,b),y=fr(y,x,_),v!==g&&v!==b&&g!==b)null==(i=e.origin)||i.preventDefault();if(y!==x&&y!==_&&x!==_)null==(r=e.origin)||r.preventDefault();this.item.composition.camera.position=new pr(v,y,u)}},i.beginDragTarget=function(t,i){var r=this;if("camera"===t.target){var n,s={touchstart:function(t){var e;if(r.canInteract()){r.dragEvent=null,r.bouncingArg=null;var i=null==(e=r.item.composition)?void 0:e.camera;n={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){r.handleDragMove(n,t),r.bouncingArg=t},touchend:function(t){if(r.canInteract()){var e=r.bouncingArg;if(!Ha(e,3)&&e){e.vx*=5,e.vy*=5,r.dragEvent=Ur({},n)}n=null}}};Object.keys(s).forEach(function(t){i.addEventListener(t,s[t])}),s.touchmove({dx:0,dy:0,width:1,height:1}),this.item.getComponent(e).endDragTarget=function(){Object.keys(s).forEach(function(t){i.removeEventListener(t,s[t])})}}},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix(),e=function(t,e,i){var r=t.x,n=t.y,s=t.z,o=new pr(r-e,n+i,s),a=new pr(r-e,n-i,s),h=new pr(r+e,n-i,s),u=new pr(r+e,n+i,s);return[{p0:o,p1:a,p2:h},{p0:o.clone(),p1:h.clone(),p2:u}]}(pr.ZERO,.5*this.transform.size.x,.5*this.transform.size.y);return e.forEach(function(e){t.transformPoint(e.p0),t.transformPoint(e.p1),t.transformPoint(e.p2)}),{type:Po.triangle,area:e}},i.fromData=function(e){if(t.prototype.fromData.call(this,e),this.interactData=e,e.options.type===Ie.DRAG){var i=e.options;i.dxRange&&(this.dragRange.dxRange=i.dxRange),i.dyRange&&(this.dragRange.dyRange=i.dyRange)}},i.canInteract=function(){var t;return Boolean(null==(t=this.item.composition)?void 0:t.interactive)&&this._interactive},Ki(e,[{key:"interactive",get:function(){return this._interactive},set:function(t){this._interactive=t,t||(this.bouncingArg=null)}}]),e}(sr);function Ha(t,e){var i=1e-5*(e||1);return t&&Math.abs(t.vx||0)<i&&Math.abs(t.vy||0)<i}ja=Et([tr(ki.InteractComponent)],ja);var Xa,Wa,Ya=function(){function t(){this.triangles=[],this.worldMatrix=new _r,this.assemblyTriangles=function(t,e,i,r,n){for(var s=i;s<r;s+=3){var o=3*e[s],a=3*e[s+1],h=3*e[s+2],u={x:t[o],y:t[o+1],z:t[o+2]},l={x:t[a],y:t[a+1],z:t[a+2]},c={x:t[h],y:t[h+1],z:t[h+2]};n.push({p0:u,p1:l,p2:c})}}}var e=t.prototype;return e.getBoundingBoxData=function(){return this.applyWorldMatrix(this.boundingBoxData.area),this.boundingBoxData},e.getBoundingBox=function(){for(var t,e=-Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,n=Number.MAX_VALUE,s=bt(this.boundingBoxData.area);!(t=s()).done;){var o=t.value;e=Math.max(o.p0.x,o.p1.x,o.p2.x,e),i=Math.max(o.p0.y,o.p1.y,o.p2.y,i),r=Math.min(o.p0.x,o.p1.x,o.p2.x,r),n=Math.min(o.p0.y,o.p1.y,o.p2.y,n)}var a=[],h=new pr(r,i,0),u=new pr(e,i,0),l=new pr(e,n,0),c=new pr(r,n,0);return a.push({p0:h,p1:u,p2:l}),a.push({p0:h,p1:l,p2:c}),this.applyWorldMatrix(a),{type:Po.triangle,area:a}},e.setGeometry=function(t,e){this.triangles=this.geometryToTriangles(t);for(var i,r=[],n=bt(this.triangles);!(i=n()).done;){var s=i.value;r.push({p0:s.p0,p1:s.p1,p2:s.p2})}e&&this.worldMatrix.copyFrom(e),this.boundingBoxData={type:Po.triangle,area:r}},e.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,s=bt(t.subMeshes);!(n=s()).done;){var o=n.value;if(void 0!==o.indexCount){var a=e.BYTES_PER_ELEMENT,h=o.offset/a,u=h+o.indexCount;this.assemblyTriangles(i,e,h,u,r)}}return r},e.applyWorldMatrix=function(t){var e=this;return t.forEach(function(t){t.p0=e.worldMatrix.transformPoint(t.p0,new pr),t.p1=e.worldMatrix.transformPoint(t.p1,new pr),t.p2=e.worldMatrix.transformPoint(t.p2,new pr)}),t},t}(),qa=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).name="sprite",e}return Xe(e,t),e}(je),Za=function(){function t(){this.playableOutputs=[],this.playables=[]}var e=t.prototype;return e.evaluate=function(t){for(var e,i=bt(this.playableOutputs);!(e=i()).done;){e.value.context.deltaTime=t}for(var r,n=bt(this.playableOutputs);!(r=n()).done;){var s=r.value;this.prepareFrameWithRoot(s)}for(var o,a=bt(this.playableOutputs);!(o=a()).done;){var h=o.value;this.processFrameWithRoot(h)}},e.addOutput=function(t){this.playableOutputs.push(t)},e.addPlayable=function(t){this.playables.push(t)},e.processFrameWithRoot=function(t){t.sourcePlayable.processFrame(t.context),t.processFrame()},e.prepareFrameWithRoot=function(t){t.prepareFrame(),t.sourcePlayable.prepareFrame(t.context)},e.updatePlayableTime=function(t,e){0===t.getPlayState()&&t.setTime(t.getTime()+e)},t}(),Ka=function(){function t(t,e){this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1,this.duration=0,this.destroyed=!1,this.playState=0,this.time=0,t.addPlayable(this)}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(){if(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}(),Qa=function(){function t(){this.context={deltaTime:0,output:this}}var e=t.prototype;return e.setSourcePlayable=function(t){this.sourcePlayable=t},e.setUserData=function(t){this.userData=t},e.getUserData=function(){return this.userData},e.prepareFrame=function(){},e.processFrame=function(){},t}(),Ja=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(rr);function $a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(Wa=Xa||(Xa={}))[Wa.Playing=0]="Playing",Wa[Wa.Paused=1]="Paused";var th=new xr,eh=1,ih=function(){function t(t,e){void 0===t&&(t={}),this.taggedProperties={},this.position=new pr(0,0,0),this.quat=new xr(0,0,0,1),this.rotation=new Un(0,0,0),this.scale=new pr(1,1,1),this.anchor=new pr(0,0,0),this.size=new dr(1,1),this.children=[],this.worldMatrix=_r.fromIdentity(),this.localMatrix=_r.fromIdentity(),this.valid=!0,this.dirtyFlags={localData:!1,localMatrix:!1,worldMatrix:!1,parentMatrix:!1},this.worldTRSCache={position:new pr(0,0,0),quat:new xr(0,0,0,1),scale:new pr(1,1,1)},this.name="transform_"+eh++,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,s=t.size,o=t.quat,a=t.name,h=t.anchor;if(a&&(this.name=a),i&&(xt(i,pr)?this.setPosition(i.x,i.y,i.z):this.setPosition(i[0],i[1],i[2])),o)xt(o,xr)?this.setQuaternion(o.x,o.y,o.z,o.w):this.setQuaternion(o[0],o[1],o[2],o[3]);else if(r){var u=e?-1:1;xt(r,Un)?this.setRotation(r.x*u,r.y*u,r.z*u):this.setRotation(r[0]*u,r[1]*u,r[2]*u)}n&&(xt(n,pr)?this.setScale(n.x,n.y,n.z):this.setScale(n[0],n[1],n[2])),s&&this.setSize(s.x,s.y),h&&(xt(h,dr)?this.setAnchor(h.x,h.y):this.setAnchor(h[0],h[1]))},e.addChild=function(t){Mt(this.children,t)},e.removeChild=function(t){Dt(this.children,t)},e.getRotation=function(){return t.getRotation(this.quat,new Un)},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;this.dirtyFlags.worldMatrix&&(this.getWorldMatrix().decompose(t.position,t.quat,t.scale),this.dirtyFlags.worldMatrix=!1);return this.worldTRSCache.scale.clone()},e.getWorldPosition=function(){return this.updateTRSCache(),this.worldTRSCache.position.clone()},e.getWorldRotation=function(){return this.updateTRSCache(),t.getRotation(this.worldTRSCache.quat,new Un)},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={position:(new pr).copyFrom(t.position),rotation:new Un(t.eulerHint.x,t.eulerHint.y,t.eulerHint.z),scale:(new pr).copyFrom(t.scale)};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=th.copyFrom(t);return i.conjugate(),e.setFromQuaternion(i)},Ki(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}(),rh=new pr(1,1,1),nh=function(){function t(t,e){void 0===e&&(e={}),this.name=t,this.transform=new ih,this.viewportMatrix=_r.fromIdentity(),this.viewMatrix=_r.fromIdentity(),this.projectionMatrix=_r.fromIdentity(),this.viewProjectionMatrix=_r.fromIdentity(),this.inverseViewMatrix=_r.fromIdentity(),this.dirty=!0;var i=e.near,r=void 0===i?.1:i,n=e.far,s=void 0===n?20:n,o=e.fov,a=void 0===o?60:o,h=e.aspect,u=void 0===h?1:h,l=e.clipMode,c=void 0===l?We.portrait:l,f=e.position,d=void 0===f?[0,0,8]:f,p=e.rotation,m=void 0===p?[0,0,0]:p,v=new Un(m[0],m[1],m[2]),y=(new xr).setFromEuler(v);this.options={near:r,far:s,fov:a,aspect:u,clipMode:c},this.transform.setPosition(d[0],d[1],d[2]),this.transform.setQuaternion(y.x,y.y,y.z,y.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 pr(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 s=i.projectPoint(e).z,o=r.projectPoint(new pr(1,1,s)),a=o.x,h=o.y,u=r.projectPoint(new pr(-1,-1,s)),l=u.x,c=u.y;return new pr((a-l)/2,(h-c)/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 Ur({},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,s=t.aspect,o=t.position,a=t.rotation;this.near=e,this.far=i,this.fov=r,this.clipMode=n,this.aspect=s,this.position=o,this.rotation=a,this.updateMatrix()},e.updateMatrix=function(){if(this.dirty){var t,e=this.options,i=e.fov,r=e.aspect,n=e.near,s=e.far,o=e.clipMode;this.projectionMatrix.perspective(i*ar,r,n,s,o===We.portrait),this.projectionMatrix.premultiply(this.viewportMatrix),this.inverseViewMatrix.compose(this.position,this.getQuat(),rh),this.inverseViewMatrix.premultiply(null!=(t=this.transform.getParentMatrix())?t:_r.IDENTITY),this.viewMatrix.copyFrom(this.inverseViewMatrix).invert(),this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix,this.viewMatrix),this.inverseViewProjectionMatrix=null,this.dirty=!1}},Ki(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}(),sh=function(){function t(t){var e=t.time,i=t.interval,r=t.count,n=t.cycles,s=t.probability;this.time=+e||0,this.interval=+i||1,this.count=xt(r,da)?r:Ua(r),this.cycles=+n||1/0,this.probability=isNaN(s)?1:+s,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}(),oh=function(t){this.content=t},ah=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 oh(t);if(this.length++,1===this.length)return this.first=this.last=e;for(var i=this.first;i;){if(!(this.sort(i.content,e.content)<=0))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 oh(t);if(this.length++,1===this.length)return this.last=this.first=e;for(var i=this.last;i;){if(!(this.sort(e.content,i.content)<=0))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,s=t.next;n.next=s,s&&(s.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}(),hh={};var uh=new pr,lh=new pr,ch=function(){function t(t,e){this.pointStart=[];var i,r=e.colorOverLifetime,n=e.colorOverTrail,s=e.maxTrailCount,o=e.opacityOverLifetime,a=void 0===o?Ua(1):o,h=e.widthOverTrail,u=e.name,l=e.occlusion,c=e.blending,f=e.maskMode,d=e.mask,p=e.textureMap,m=void 0===p?[0,0,1,1]:p,v=e.texture,y=e.transparentOcclusion,g=e.minimumVertexDistance,b=e.lifetime,x=e.matrix,_=t.gpuCapability,E=_.detail,w=_.level,T=Math.max(e.pointCountPerTrail,2),S={curves:[],index:0,max:0,lineSegCount:0,curveCount:0},A=E.maxVertexTextures>0,O=(null!=(i=t.renderer)?i:{}).env,C={},I=[["ENABLE_VERTEX_TEXTURE",A],["LOOKUP_TEXTURE_CURVE",0],["ENV_EDITOR",O===yo]],R=s>64,P=0;r&&(I.push(["COLOR_OVER_LIFETIME",!0]),P|=1,C.uColorOverLifetime=an.createWithData(t,Vt(r))),n&&(I.push(["COLOR_OVER_TRAIL",!0]),P|=4,C.uColorOverTrail=an.createWithData(t,Vt(n))),R?(I.push(["ATTR_TRAIL_START",1]),P|=8):C.uTrailStart=new Float32Array(s),C.uOpacityOverLifetimeValue=a.toUniform(S);var M=h.toUniform(S);I.push(["VERT_CURVE_VALUE_COUNT",S.index],["VERT_MAX_KEY_FRAME_COUNT",S.max]),C.uVCurveValues=da.getAllData(S);var D={shader:{vertex:"#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;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvoid 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;\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}",fragment:is,macros:I,glslVersion:1===w?_n.GLSL1:_n.GLSL3,shared:!0,name:"trail#"+u,cacheId:"-t:+"+P+"+"+S.index+"+"+S.max},uniformSemantics:{effects_MatrixVP:"VIEWPROJECTION",effects_MatrixInvV:"VIEWINVERSE",effects_ObjectToWorld:"MODEL",uEditorTransform:"EDITOR_TRANSFORM"}},F=T*s*2,L=(T-1)*s,k=Float32Array.BYTES_PER_ELEMENT,N=12*k,B={attributes:{aColor:{size:4,stride:N,data:new Float32Array(12*F)},aSeed:{size:1,stride:N,offset:4*k,dataSource:"aColor"},aInfo:{size:3,stride:N,offset:5*k,dataSource:"aColor"},aPos:{size:4,stride:N,offset:8*k,dataSource:"aColor"},aTime:{size:1,data:new Float32Array(F)},aDir:{size:3,data:new Float32Array(3*F)}},indices:{data:new Uint16Array(6*F)},drawCount:6*L,name:"trail#"+u,bufferUsage:Pr.DYNAMIC_DRAW};if(R)B.attributes.aTrailStart={size:1,data:new Float32Array(F)};else{var U=new Float32Array(F);B.attributes.aTrailStartIndex={size:1,data:U};for(var z=0;z<s;z++)for(var V=2*T,G=z*V,j=0;j<V;j++)U[G+j]=z}var H=Lr(c),X=Tn.create(t,D);X.blending=!0,X.depthMask=l,X.depthTest=!0,X.stencilRef=d?[d,d]:void 0,Br(X,f),kr(X,c);var W=this.mesh=Kn.create(t,{name:"MTrail_"+u,material:X,geometry:Bn.create(t,B)}),Y=null!=v?v:an.createWithData(t);Object.keys(C).map(function(t){var e=C[t];if(xt(e,an))X.setTexture(t,e);else if("uTrailStart"===t)X.setFloats("uTrailStart",e);else if("uVCurveValues"===t){for(var i=[],r=0;r<e.length;r+=4){var n=new mr(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}X.setVector4Array(t,i)}else X.setVector4(t,mr.fromArray(e))}),X.setFloat("uTime",0),X.setVector4("uWidthOverTrail",mr.fromArray(M)),X.setVector2("uTexOffset",new dr(0,0)),X.setVector4("uTextureMap",mr.fromArray(m)),X.setVector4("uParams",new mr(0,T-1,0,0)),X.setTexture("uMaskTex",Y),X.setVector4("uColorParams",new mr(v?1:0,+H,0,+(l&&!y))),this.maxTrailCount=s,this.pointCountPerTrail=T,this.checkVertexDistance=g>0,this.minimumVertexDistance=Math.pow(g||.001,2),this.useAttributeTrailStart=R,this.lifetime=b,x&&(this.mesh.worldMatrix=x),this.geometry=W.firstGeometry(),this.trailCursors=new Uint16Array(s)}var e=t.prototype;return e.addPoint=function(t,e,i){i=i||{};var r=this.trailCursors[t],n=this.pointCountPerTrail,s=this.geometry,o=n-1,a=r%n,h=(r-1)%n,u=(r-2)%n,l=this.getTrailPosition(t,h,uh);if(!(l&&this.checkVertexDistance&&(null==l?void 0:l.distanceSquared(e))<this.minimumVertexDistance)){var c=t*n+a,f=mh(l,e),d=i.time||this.time,p=[Math.random(),i.lifetime||this.lifetime,r],m=i.size||1,v=6*c,y=new Float32Array(6);y.set(f,0),y.set(f,3),s.setAttributeSubData("aDir",v,y),s.setAttributeSubData("aTime",2*c,new Float32Array([d,d]));var g=i.color||[1,1,1,1],b=new Float32Array(24),x=e.toArray();if(b.set(g,0),b.set(p,4),b[7]=0,b.set(x,8),b[11]=.5*m,b.set(g,12),b.set(p,16),b[19]=1,b.set(x,20),b[23]=-.5*m,s.setAttributeSubData("aColor",24*c,b),h>=0){var _=this.getTrailPosition(t,u,lh),E=new Float32Array(mh(_,l,e)),w=6*(t*n+h);s.setAttributeSubData("aDir",w,E),s.setAttributeSubData("aDir",w+3,E);var T=t*n*2,S=new Uint16Array([2*h+T,2*h+1+T,2*a+T,2*a+T,2*h+1+T,2*a+1+T]),A=6*(t*o+(r-1)%o);s.setIndexSubData(A,S)}r=++this.trailCursors[t];var O=this.mesh.material,C=O.getVector4("uParams"),I=p[2];if(this.useAttributeTrailStart){for(var R=2*n,P=new Float32Array(R),M=0;M<R;M++)P[M]=I;s.setAttributeSubData("aTrailStart",t*P.length,P)}else{var D=O.getFloats("uTrailStart");null!=D&&(D[t]=I,O.setFloats("uTrailStart",D))}C&&(C.y=Math.max(C.y,r-1)-Math.max(0,r-n),O.setVector4("uParams",C))}},e.getTrailPosition=function(t,e,i){var r=this.pointCountPerTrail;if(e>=0&&e<r){var n=24*(t*r+e)+8,s=this.geometry.getAttributeData("aColor");return Xt(s),i.x=s[n],i.y=s[1+n],i.z=s[2+n],i}},e.clearAllTrails=function(){var t=this.geometry.getIndexData();Xt(t),this.trailCursors=new Uint16Array(this.trailCursors.length),this.geometry.setIndexData(new Uint16Array(t.length))},e.minusTime=function(t){var e=this.geometry.getAttributeData("aTime");Xt(e);for(var i=0;i<e.length;i++)e[i]-=t;this.geometry.setAttributeData("aTime",e),this.time-=t},e.clearTrail=function(t){if(0!==this.trailCursors[t]){var e=6*(this.pointCountPerTrail-1),i=this.geometry.getIndexData();Xt(i),i.set(new Uint16Array(e),t*e),this.geometry.setIndexData(i),this.trailCursors[t]=0}},e.getPointStartPos=function(t){return this.pointStart[t]},e.setPointStartPos=function(t,e){this.pointStart[t]=e},e.onUpdate=function(t){},Ki(t,[{key:"time",get:function(){return this.mesh.material.getFloat("uTime")||0},set:function(t){this.mesh.material.setFloat("uTime",null!=t?t:0)}}]),t}(),fh=new pr,dh=new pr,ph=new pr;function mh(t,e,i){var r=fh;return t||i?(t?i?(dh.subtractVectors(e,t).normalize(),dh.subtractVectors(i,e),ph.copyFrom(dh).normalize(),r.addVectors(dh,ph)):r.subtractVectors(e,t):r.subtractVectors(i,e),r.normalize().toArray()):[0,0,0]}var vh=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).lastTime=0,e}Xe(e,t);var i=e.prototype;return i.start=function(t){var e=t.output.getUserData();!this.particleSystem&&xt(e,Ru)&&(this.particleSystem=e.getComponent(wh),this.particleSystem&&(this.particleSystem.name=e.name,this.particleSystem.startEmit(),this.particleSystem.initEmitterTransform()))},i.processFrame=function(t){this.time>=0&&this.start(t);var e=this.particleSystem;if(e){var i=t.deltaTime;this.time>=0&&this.time<e.item.duration&&e.isEnded()&&e.reset(),Math.abs(this.time-this.lastTime)<.001&&(i=0),e.update(i)}this.lastTime=this.time},e}(Ka),yh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createPlayable=function(t){return new vh(t)},e}(Ja),gh={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"},bh=function(){function t(t,e){var i;this.particleCount=0,this.cachedRotationVector3=new pr,this.cachedRotationMatrix=new zn,this.cachedLinearMove=new pr,this.tempMatrix3=new zn,this.VERT_MAX_KEY_FRAME_COUNT=0;var r,n,s=(null!=(i=t.renderer)?i:{}).env,o=e.speedOverLifetime,a=e.colorOverLifetime,h=e.linearVelOverLifetime,u=e.orbitalVelOverLifetime,l=e.sizeOverLifetime,c=e.rotationOverLifetime,f=e.sprite,d=e.gravityModifier,p=e.maxCount,m=e.textureFlip,v=e.useSprite,y=e.name,g=e.gravity,b=e.forceTarget,x=e.side,_=e.occlusion,E=e.anchor,w=e.blending,T=e.maskMode,S=e.mask,A=e.transparentOcclusion,O=e.meshSlots,C=e.renderMode,I=void 0===C?0:C,R=e.diffuse,P=void 0===R?an.createWithData(t):R,M=t.gpuCapability.detail,D=M.halfFloatTexture,F=M.maxVertexUniforms,L=[["RENDER_MODE",+I],["ENV_EDITOR",s===yo]],k=t.gpuCapability.level,N={curves:[],index:0,max:0,lineSegCount:0,curveCount:0},B={curves:[],index:0,max:0,lineSegCount:0,curveCount:0},U=F>0,z={},V=0,G=0;(this.useSprite=v,U&&L.push(["ENABLE_VERTEX_TEXTURE",!0]),o&&(L.push(["SPEED_OVER_LIFETIME",!0]),G|=2,z.uSpeedLifetimeValue=o.toUniform(N)),(null==f?void 0:f.animate)&&(L.push(["USE_SPRITE",!0]),G|=4,z.uFSprite=z.uSprite=new Float32Array([f.col,f.row,f.total,f.blend?1:0]),this.useSprite=!0),(null==a?void 0:a.color)&&(L.push(["COLOR_OVER_LIFETIME",!0]),G|=16,z.uColorOverLifetime=xt(a.color,an)?a.color:an.createWithData(t,Vt(a.color))),(null==a?void 0:a.opacity)?z.uOpacityOverLifetimeValue=a.opacity.toUniform(N):z.uOpacityOverLifetimeValue=Ua(1).toUniform(N),["x","y","z"].forEach(function(t,e){var i=0,n=0;(null==h?void 0:h[t])&&(z["uLinear"+t.toUpperCase()+"ByLifetimeValue"]=h[t].toUniform(N),i=1,G|=1<<7+e,h.enabled=!0),L.push(["LINEAR_VEL_"+t.toUpperCase(),i]),(null==u?void 0:u[t])&&(z["uOrb"+t.toUpperCase()+"ByLifetimeValue"]=u[t].toUniform(N),n=1,G|=1<<10+e,r=!0,u.enabled=!0),L.push(["ORB_VEL_"+t.toUpperCase(),n])}),(null==h?void 0:h.asMovement)&&(L.push(["AS_LINEAR_MOVEMENT",!0]),G|=32),r&&((null==u?void 0:u.asRotation)&&(L.push(["AS_ORBITAL_MOVEMENT",!0]),G|=64),z.uOrbCenter=new Float32Array((null==u?void 0:u.center)||[0,0,0])),z.uSizeByLifetimeValue=null==l?void 0:l.x.toUniform(N),null==l?void 0:l.separateAxes)&&(L.push(["SIZE_Y_BY_LIFE",1]),G|=16384,z.uSizeYByLifetimeValue=null==l||null==(n=l.y)?void 0:n.toUniform(N));(null==c?void 0:c.z)&&(z.uRZByLifeTimeValue=c.z.toUniform(N),G|=32768,L.push(["ROT_Z_LIFETIME",1])),(null==c?void 0:c.x)&&(z.uRXByLifeTimeValue=c.x.toUniform(N),G|=65536,L.push(["ROT_X_LIFETIME",1])),(null==c?void 0:c.y)&&(z.uRYByLifeTimeValue=c.y.toUniform(N),G|=1<<17,L.push(["ROT_Y_LIFETIME",1])),(null==c?void 0:c.asRotation)&&(L.push(["ROT_LIFETIME_AS_MOVEMENT",1]),G|=1<<18),z.uGravityModifierValue=d.toUniform(N),b&&(L.push(["FINAL_TARGET",!0]),G|=1<<19,z.uFinalTarget=new Float32Array(b.target||[0,0,0]),z.uForceCurve=b.curve.toUniform(N)),D&&B.max?(G|=1<<20,z.uFCurveValueTexture=hn(t,da.getAllData(B,!0),B.index,1)):z.uFCurveValues=da.getAllData(B);var j=N.max+N.curves.length-32>F;if(2===k&&(N.max=-1,N.index=O?O[0]:_h(N.index),B.index>0&&(B.max=-1,B.index=O?O[1]:_h(B.index))),j&&D&&U){var H=hn(t,da.getAllData(N,!0),N.index,1);z.uVCurveValueTexture=H,V=1}else z.uVCurveValues=da.getAllData(N);var X=["-p:",I,G,N.index,N.max,B.index,B.max].join("+");L.push(["VERT_CURVE_VALUE_COUNT",N.index],["FRAG_CURVE_VALUE_COUNT",B.index],["VERT_MAX_KEY_FRAME_COUNT",N.max],["FRAG_MAX_KEY_FRAME_COUNT",B.max]),this.VERT_MAX_KEY_FRAME_COUNT=N.max;var W={shader:{fragment:is,vertex:"#define LOOKUP_TEXTURE_CURVE "+V+"\n#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;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvec3 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;\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}}",glslVersion:1===k?_n.GLSL1:_n.GLSL3,shared:!0,cacheId:X,macros:L,name:"particle#"+y},uniformSemantics:{effects_MatrixV:"VIEW",effects_MatrixVP:"VIEWPROJECTION",uEditorTransform:"EDITOR_TRANSFORM",effects_ObjectToWorld:"MODEL"}},Y=Lr(w);z.uTexOffset=new Float32Array(P?[1/P.getWidth(),1/P.getHeight()]:[0,0]),z.uMaskTex=P,z.uColorParams=new Float32Array([P?1:0,+Y,0,+(!!_&&!A)]),z.uParams=[0,0,0,0],z.uAcceleration=[(null==g?void 0:g[0])||0,(null==g?void 0:g[1])||0,(null==g?void 0:g[2])||0,0];var q=Tn.create(t,W);q.blending=!0,q.depthTest=!0,q.depthMask=!!_,q.stencilRef=S?[S,S]:void 0,Br(q,T),kr(q,w),Nr(q,x),Object.keys(z).map(function(t){var e=z[t];if(xt(e,an))q.setTexture(t,e);else{var i=[];switch(gh[t]){case"vec4":q.setVector4(t,mr.fromArray(e));break;case"vec3":q.setVector3(t,pr.fromArray(e));break;case"vec2":q.setVector2(t,dr.fromArray(e));break;case"vec4Array":for(var r=0;r<e.length;r+=4){var n=new mr(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}q.setVector4Array(t,i),i.length=0;break;default:console.warn("Uniform "+t+"'s type not in typeMap.")}}}),q.setVector3("emissionColor",new pr(0,0,0)),q.setFloat("emissionIntensity",0);var Z=Bn.create(t,function(t,e,i){var r=Float32Array.BYTES_PER_ELEMENT,n=12*r,s={aPos:{size:3,offset:0,stride:n,data:new Float32Array(0)},aVel:{size:3,offset:3*r,stride:n,dataSource:"aPos"},aDirX:{size:3,offset:6*r,stride:n,dataSource:"aPos"},aDirY:{size:3,offset:9*r,stride:n,dataSource:"aPos"},aRot:{size:3,offset:0,stride:8*r,data:new Float32Array(0)},aSeed:{size:1,offset:3*r,stride:8*r,dataSource:"aRot"},aColor:{size:4,offset:4*r,stride:8*r,dataSource:"aRot"},aOffset:{size:4,stride:4*r,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*r,data:new Float32Array(0)},aRotation1:{size:3,offset:3*r,stride:9*r,dataSource:"aRotation0"},aRotation2:{size:3,offset:6*r,stride:9*r,dataSource:"aRotation0"}};e&&(s.aSprite={size:3,stride:3*r,data:new Float32Array(0)});return{attributes:s,indices:{data:new Uint16Array(0)},name:i,maxVertex:t}}(4*p,this.useSprite,"particle#"+y)),K=Kn.create(t,{name:"MParticle_"+y,material:q,geometry:Z});this.anchor=E,this.mesh=K,this.geometry=K.firstGeometry(),this.forceTarget=b,this.sizeOverLifetime=l,this.speedOverLifetime=o,this.linearVelOverLifetime=h,this.orbitalVelOverLifetime=u,this.orbitalVelOverLifetime=u,this.gravityModifier=d,this.rotationOverLifetime=c,this.maxCount=p,this.textureOffsets=m?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],this.time=0}var e=t.prototype;return e.getPointColor=function(t){var e=this.geometry.getAttributeData("aRot"),i=32*t+4;return Xt(e),[e[i],e[i+1],e[i+2],e[i+3]]},e.clearPoints=function(){this.resetGeometryData(this.geometry),this.particleCount=0,this.geometry.setDrawCount(0),this.maxParticleBufferCount=0},e.resetGeometryData=function(t){for(var e=t.getAttributeNames(),i=t.getIndexData(),r=0;r<e.length;r++){var n=e[r],s=t.getAttributeData(n);s&&t.setAttributeData(n,new s.constructor(0))}t.setIndexData(new i.constructor(0))},e.onUpdate=function(t){var e=this.geometry.getAttributeData("aPos"),i=Math.ceil(e.length/12);this.applyTranslation(i,t),this.applyRotation(i,t),this.applyLinearMove(i,t)},e.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},e.removePoint=function(t){t<this.particleCount&&this.geometry.setAttributeSubData("aOffset",16*t,new Float32Array(16))},e.setPoint=function(t,e){var i=this.maxCount;if(t<i){var r=t+1,n=4*r,s=this.geometry,o=r>this.maxParticleBufferCount,a=1;this.particleCount>300?a=(this.particleCount+100)/this.particleCount:this.particleCount>100?a=1.4:this.particleCount>0&&(a=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)},u=this.useSprite;u&&(h.aSprite=new Float32Array(12));var l=new pr,c=new xr,f=new pr(1,1,1);e.transform.assignWorldTRS(l,c,f);var d,p=ih.getRotation(c,new Un),m=l.toArray(),v=p.toArray(),y=this.textureOffsets,g=[0,0,e.delay,e.lifetime],b=[0,0,1,1],x=e.vel,_=e.color,E=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],w=Math.random();u&&(d=e.sprite);for(var T=0;T<4;T++){var S=2*T,A=3*T,O=4*T,C=12*T,I=8*T;h.aPos.set(m,C),x.fill(h.aPos,C+3),h.aRot.set(v,I),h.aRot[I+3]=w,h.aRot.set(_,I+4),u&&h.aSprite.set(d,A);var R=e.uv||b;if(R){var P=u?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,O);for(var M=T+T,D=(E[M]-this.anchor.x)*f.x,F=(E[M+1]-this.anchor.y)*f.y,L=0;L<3;L++)h.aPos[C+6+L]=e.dirX.getElement(L)*D,h.aPos[C+9+L]=e.dirY.getElement(L)*F}var k=new Uint16Array([0,1,2,2,1,3].map(function(e){return e+4*t}));if(o){var N=Ft(s.getIndexData(),6*r,6*i,a);N.set(k,6*t),s.setIndexData(N),this.maxParticleBufferCount=N.length/6}else s.setIndexSubData(6*t,k);Object.keys(h).forEach(function(e){var r=h[e],u=s.getAttributeStride(e)/Float32Array.BYTES_PER_ELEMENT;if(o){var l=s.getAttributeData(e);Xt(l);var c=Ft(l,n*u,4*i*u,a);c.set(r,r.length*t),s.setAttributeData(e,c)}else s.setAttributeSubData(e,r.length*t,r)}),this.particleCount=Math.max(r,this.particleCount),s.setDrawCount(6*this.particleCount)}},e.applyTranslation=function(t,e){var i=this.time,r=this.geometry.getAttributeData("aTranslation"),n=this.geometry.getAttributeData("aVel"),s=this.geometry.getAttributeData("aOffset");r.length<3*t&&(r=this.expandArray(r,3*t));for(var o=0,a=0,h=0,u=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],a=n[f+1],h=n[f+2];var d=i-s[4*c+2],p=s[4*c+3];if(u&&l){var m=this.gravityModifier.getIntegrateValue(0,d,p),v=u.x*m,y=u.y*m,g=u.z*m;if(this.speedOverLifetime){var b=this.speedOverLifetime.getValue(d/p);o=o*b+v,a=a*b+y,h=h*b+g}else o+=v,a+=y,h+=g}var x=3*c;if(s[4*c+2]<i){var _=o*(e/1e3),E=a*(e/1e3),w=h*(e/1e3);r[x]+=_,r[x+1]+=E,r[x+2]+=w,r[x+3]+=_,r[x+4]+=E,r[x+5]+=w,r[x+6]+=_,r[x+7]+=E,r[x+8]+=w,r[x+9]+=_,r[x+10]+=E,r[x+11]+=w}}this.geometry.setAttributeData("aTranslation",r)},e.applyRotation=function(t,e){var i=this.geometry.getAttributeData("aRotation0"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aRot"),s=this.geometry.getAttributeData("aSeed"),o=this.time,a=this.cachedRotationMatrix;i.length<9*t&&(i=this.expandArray(i,9*t));for(var h=0;h<t;h+=4){var u=fr((o-r[4*h+2])/r[4*h+3],0,1),l=8*h,c=this.cachedRotationVector3.set(n[l],n[l+1],n[l+2]),f=s[8*h+3],d=c;this.rotationOverLifetime?(this.rotationOverLifetime.x&&(xt(this.rotationOverLifetime.x,va)?d.x+=this.rotationOverLifetime.x.getValue(u,f):d.x+=this.rotationOverLifetime.x.getValue(u)),this.rotationOverLifetime.y&&(xt(this.rotationOverLifetime.y,va)?d.y+=this.rotationOverLifetime.y.getValue(u,f):d.y+=this.rotationOverLifetime.y.getValue(u)),this.rotationOverLifetime.z&&(xt(this.rotationOverLifetime.z,va)?d.z+=this.rotationOverLifetime.z.getValue(u,f):d.z+=this.rotationOverLifetime.z.getValue(u))):a.setZero(),0===d.dot(d)&&a.identity();var p=Math.PI/180,m=d.x*p,v=d.y*p,y=d.z*p,g=Math.sin(m),b=Math.sin(v),x=Math.sin(y),_=Math.cos(m),E=Math.cos(v),w=Math.cos(y);a.set(w,-x,0,x,w,0,0,0,1),a.multiply(this.tempMatrix3.set(E,0,b,0,1,0,-b,0,E)),a.multiply(this.tempMatrix3.set(1,0,0,0,_,-g,0,g,_));var T=9*h,S=a.elements;i.set(S,T),h+4<=t&&(i.set(S,T+9),i.set(S,T+18),i.set(S,T+27))}this.geometry.setAttributeData("aRotation0",i)},e.applyLinearMove=function(t,e){var i=this.geometry.getAttributeData("aLinearMove"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aSeed"),s=this.time;i.length<3*t&&(i=this.expandArray(i,3*t));var o=this.cachedLinearMove;if(this.linearVelOverLifetime&&this.linearVelOverLifetime.enabled)for(var a=0;a<t;a+=4){var h=s-r[4*a+2],u=r[4*a+3],l=h/u,c=n[8*a+3];o.setZero(),this.linearVelOverLifetime.asMovement?(this.linearVelOverLifetime.x&&(xt(this.linearVelOverLifetime.x,va)?o.x=this.linearVelOverLifetime.x.getValue(l,c):o.x=this.linearVelOverLifetime.x.getValue(l)),this.linearVelOverLifetime.y&&(xt(this.linearVelOverLifetime.y,va)?o.y=this.linearVelOverLifetime.y.getValue(l,c):o.y=this.linearVelOverLifetime.y.getValue(l)),this.linearVelOverLifetime.z&&(xt(this.linearVelOverLifetime.z,va)?o.z=this.linearVelOverLifetime.z.getValue(l,c):o.z=this.linearVelOverLifetime.z.getValue(l))):(this.linearVelOverLifetime.x&&(xt(this.linearVelOverLifetime.x,va)?o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,h,c):o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,h,u)),this.linearVelOverLifetime.y&&(xt(this.linearVelOverLifetime.y,va)?o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,h,c):o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,h,u)),this.linearVelOverLifetime.z&&(xt(this.linearVelOverLifetime.z,va)?o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,h,c):o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,h,u)));var f=3*a;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)},e.expandArray=function(t,e){var i=new Float32Array(e);return i.set(t),i},t}(),xh=[10,32,64,160];function _h(t){for(var e=0;e<xh.length;e++){var i=xh[e];if(i>t)return i}return t||xh[0]}var Eh=function(t){function e(e,i,r){var n;(n=t.call(this,e)||this).name="ParticleSystemRenderer",i&&(n.particleMesh=new bh(e,i)),r&&(n.trailMesh=new ch(e,r));var s=[n.particleMesh.mesh];return n.materials.push(n.particleMesh.mesh.material),n.trailMesh&&(s.push(n.trailMesh.mesh),n.materials.push(n.trailMesh.mesh.material)),n.meshes=s,n}Xe(e,t);var i=e.prototype;return i.onStart=function(){this._priority=this.item.renderOrder,this.particleMesh.gravityModifier.scaleXCoord(this.item.duration);for(var t,e=bt(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 mr;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=bt(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}(sr),wh=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).destroyed=!1,r.getHitTestParams=function(t){var e=r.interaction;if(t||e)return{type:Po.custom,collect:function(t){return r.raycast({radius:(null==e?void 0:e.radius)||.4,multiple:!!(null==e?void 0:e.multiple),removeParticle:(null==e?void 0:e.behavior)===ti.removeParticle,ray:t})}}},r.maskManager=new Sn(e),i&&r.fromData(i),r}Xe(e,t);var i=e.prototype;return i.isFrozen=function(){return this.frozen},i.isEnded=function(){return this.ended},i.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]===qe.CONSTANT_VEC3?e.add(r[1]):t=Ua(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 s=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(s)}},i.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 s=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(s)}},i.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 s=r.first;r.removeNode(s),i=n[1]=s.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())},i.setVisible=function(t){this.renderer.setVisible(t)},i.setOpacity=function(t){var e,i=this.renderer.particleMesh.mesh.material,r=this.renderer.particleMesh.mesh.geometry,n=(null==(e=i.getVector4("uOpacityOverLifetimeValue"))?void 0:e.toArray())||[1,1,1,1];i.setVector4("uOpacityOverLifetimeValue",new mr(n[0],n[1],n[2],t));for(var s=r.getAttributeData("aColor")||[],o=0;o<s.length;o+=32)s[8*o+7]=t},i.setColor=function(t,e,i,r){var n,s=this.renderer.particleMesh.mesh.material,o=this.renderer.particleMesh.mesh.geometry,a=(null==(n=s.getVector4("uOpacityOverLifetimeValue"))?void 0:n.toArray())||[1,1,1,1];s.setVector4("uOpacityOverLifetimeValue",new mr(a[0],a[1],a[2],r));for(var h=o.getAttributeData("aColor")||[],u=0;u<h.length;u+=32)h[8*u+4]=t,h[8*u+5]=e,h[8*u+6]=i,h[8*u+7]=r},i.setParentTransform=function(t){},i.getTextures=function(){return this.renderer.getTextures()},i.startEmit=function(){this.started&&!this.ended||(this.reset(),this.started=!0,this.ended=!1)},i.stop=function(){this.ended=!0,this.started=!1},i.reset=function(){this.renderer.reset(),this.lastUpdate=0,this.loopStartTime=0,this.lastEmitTime=-1/this.emission.rateOverTime.getValue(0),this.generatedCount=0,this.particleLink=new ah(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},i.update=function(t){var e=this;if(this.started&&!this.frozen){var i=this.lastUpdate+t/1e3,r=this.options,n=this.loopStartTime,s=this.emission;this.lastUpdate=i,this.upDirectionWorld=null,this.renderer.updateTime(i,t);var o=this.particleLink,a=(i-n)/this.item.duration,h=this.timePassed,u=!1,l=function(){e.trails&&!u&&(u=!0,o.forEach(function(t){var i=t[0],r=t[1],n=t[2],s=t[3];i<h?e.clearPointTrail(r):h>n&&e.updatePointTrail(r,a,s,n)}))};if(this.ended){if(this.item.endBehavior!==Je.restart&&Je.destroy===this.item.endBehavior){var c=o.last;c&&c.content[0]<this.lastUpdate&&(this.destroyed=!0)}}else{var f=this.item.duration,d=this.lifetime;if(h<f){var p=1/s.rateOverTime.getValue(d),m=Math.floor((h-this.lastEmitTime)/p),v=m,y=p/m,g=i,b=r.maxCount;this.updateEmitterTransform(h);for(var x=function(){var t=o.first;return e.emissionStopped||o.length===b&&t&&t.content[0]-n>h},_=0;_<v&&_<b&&!x();_++){var E=this.createPoint(d);E.delay+=g+_*y,this.addParticle(E,b),this.lastEmitTime=h}for(var w=s.bursts,T=(null==w?void 0:w.length)-1,S=0;T>=0&&S<b&&!x();T--){var A=w[T],O=!A.disabled&&A.getGeneratorOptions(h,d);if(O){var C=s.burstOffsets[T],I=C&&C[O.cycleIndex]||[0,0,0];A.once&&this.removeBurst(T);for(var R=0;R<O.count&&S<b;R++){var P;if(x())break;var M=this.initPoint(this.shape.generate({total:O.total,index:O.index,burstIndex:R,burstCount:O.count}));M.delay+=g,S++,(P=M.transform).translate.apply(P,[].concat(I)),this.addParticle(M,b)}}}}else if(this.item.endBehavior===Je.restart)l(),this.loopStartTime=i-f,this.lastEmitTime-=f,this.lastUpdate-=f,s.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);else{this.ended=!0,this.item.endBehavior===Je.freeze&&(this.frozen=!0)}}l()}},i.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,s=bt(this.renderer.meshes);!(n=s()).done;){n.value.render(t)}for(var o=0;o<this.renderer.meshes.length;o++){this.renderer.meshes[o].material.colorMask=e[o]}}},i.onDestroy=function(){this.item&&this.item.composition&&this.meshes.forEach(function(t){return t.dispose({material:{textures:Zt.keep}})})},i.getParticleBoxes=function(){var t=this.particleLink,e=this.renderer,i=[],r=this.particleCount,n=0;if(!t||!e)return i;for(var s=t.last,o=!1;!o;){var a=s.content[0],h=s.content[3];if(a>this.timePassed){var u=this.getPointPosition(h);i.push({center:u,size:h.transform.scale}),s.pre?s=s.pre:o=!0}++n>r&&(o=!0)}return i},i.raycast=function(t){var e=this.particleLink,i=this.renderer;if(e&&i){var r=e.last,n=[],s=new pr,o=!1;if(r&&r.content)do{var a=r.content,h=a[0],u=a[1];a[2];var l=a[3];if(h>this.timePassed){var c=this.getPointPosition(l),f=t.ray,d=!1;f&&(d=!!f.intersectSphere({center:c,radius:t.radius},s)),d&&(t.removeParticle&&(i.removeParticlePoint(u),this.clearPointTrail(u),r.content=[0]),n.push(c),t.multiple||(o=!0))}}while((r=r.pre)&&!o);return n}},i.clearPointTrail=function(t){this.trails&&this.trails.dieWithParticles&&this.renderer.clearTrail(t)},i.updatePointTrail=function(t,e,i,r){var n=this.renderer;if(n.hasTrail()){var s=this.trails,o=this.getPointPosition(i),a=s.inheritParticleColor?n.getParticlePointColor(t):[1,1,1,1],h=i.transform.getWorldScale().toArray(),u=1,l=s.lifetime.getValue(e);if(s.sizeAffectsWidth&&(u*=h[0]),s.sizeAffectsLifetime&&(l*=h[0]),s.parentAffectsPosition&&this.transform.parentTransform){o.add(this.transform.parentTransform.position);var c=n.getTrailStartPosition(t);c&&o.subtract(c)}n.addTrailPoint(t,o,{color:a,lifetime:l,size:u,time:r})}},i.getPointPositionByIndex=function(t){var e=this.particleLink.getNodeByIndex(t);return e?this.getPointPosition(e.content[3]):(console.error("Get point error."),null)},i.getPointPosition=function(t){var e=t.transform,i=t.vel,r=t.lifetime,n=t.delay,s=t.gravity,o=void 0===s?[]:s,a=this.options.forceTarget,h=this.lastUpdate-n,u=new pr,l=pr.fromArray(o);e.assignWorldTRS(u);var c=Xo(new pr,this.options,l,h,r,u,i);if(a){var f=a.target||[0,0,0],d=a.curve.getValue(h/r),p=1-d;c.x=c.x*p+f[0]*d,c.y=c.y*p+f[1]*d,c.z=c.z*p+f[2]*d}return c},i.initPoint=function(t){var e=this.options,i=this.lifetime,r=this.shape,n=e.startSpeed.getValue(i),s=e.particleFollowParent?_r.IDENTITY:this.transform.getWorldMatrix(),o=t.position,a=s.transformPoint(o,new pr),h=new ih({position:a,valid:!0}),u=t.direction;if(u=s.transformNormal(u,Th).normalize(),e.startTurbulence&&e.turbulence){for(var l=0;l<3;l++)Ih.setElement(l,e.turbulence[l].getValue(i));Rh.setFromVector3(Ih.negate()),Mh.setFromEuler(Rh).transformNormal(u).normalize()}var c,f=Oh,d=Ch;r.alignSpeedDirection?(d.copyFrom(u),this.upDirectionWorld||(r.upDirection?this.upDirectionWorld=r.upDirection.clone():this.upDirectionWorld=pr.Z.clone(),s.transformNormal(this.upDirectionWorld)),f.crossVectors(d,this.upDirectionWorld).normalize(),f.isZero()&&f.set(1,0,0)):(f.set(1,0,0),d.set(0,1,0));var p=this.textureSheetAnimation;p&&p.animate&&((c=Ph)[0]=p.animationDelay.getValue(i),c[1]=p.animationDuration.getValue(i),c[2]=p.cycles.getValue(i));var m=Ah;e.start3DRotation?m.set(e.startRotationX.getValue(i),e.startRotationY.getValue(i),e.startRotationZ.getValue(i)):e.startRotation?m.set(0,0,e.startRotation.getValue(i)):m.set(0,0,0),h.setRotation(m.x,m.y,m.z);var v=e.startColor.getValue(i);3===v.length&&(v[3]=1);var y=Sh;if(e.start3DSize)y.x=e.startSizeX.getValue(i),y.y=e.startSizeY.getValue(i);else{var g=e.startSize.getValue(i),b=e.sizeAspect.getValue(i);y.x=g,y.y=0===b?0:g/b}var x=u.clone();if(x.multiply(n),!e.particleFollowParent){var _=new pr;this.transform.assignWorldTRS(void 0,void 0,_),y.x*=_.x,y.y*=_.y}return h.setScale(y.x,y.y,1),{size:y,vel:x,color:v,delay:e.startDelay.getValue(i),lifetime:e.startLifetime.getValue(i),uv:Fh(this.uvs,!0),gravity:e.gravity,sprite:c,dirY:d,dirX:f,transform:h}},i.addBurst=function(t,e){var i=!1;if(this.emission.bursts.includes(t)||(this.emission.bursts.push(t),i=!0),i&&xt(e,Array)){var r=this.emission.bursts.indexOf(t);return this.emission.burstOffsets[r]=e,r}return-1},i.removeBurst=function(t){t<this.emission.bursts.length&&(this.emission.burstOffsets[t]=null,this.emission.bursts.splice(t,1))},i.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))},i.stopParticleEmission=function(){this.emissionStopped=!0},i.resumeParticleEmission=function(){this.emissionStopped=!1},i.getBoundingBox=function(){var t=this.getParticleBoxes();return{type:Po.sphere,area:t}},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e;this.props=i,this.destroyed=!1;var r,n,s,o,a,h=i.options,u=i.positionOverLifetime,l=void 0===u?{}:u,c=i.shape,f=null==l?void 0:l.gravityOverLifetime,d=Wo(null==l?void 0:l.gravity),p=i.textureSheetAnimation,m=p?{animationDelay:Ua(p.animationDelay||0),animationDuration:Ua(p.animationDuration||1),cycles:Ua(p.cycles||1),animate:p.animate,col:p.col,row:p.row,total:p.total||p.col*p.row}:void 0,v=!!(c&&c.turbulenceX||(null==c?void 0:c.turbulenceY)||(null==c?void 0:c.turbulenceZ));v&&(r=[Ua(null!=(n=c.turbulenceX)?n:0),Ua(null!=(s=c.turbulenceY)?s:0),Ua(null!=(o=c.turbulenceZ)?o:0)]);this.name="ParticleSystem",this.shape=function(t){if(!t)return new Gs;var e=Ur({radius:1,arc:360,angle:0,arcMode:ii.RANDOM},t),i=t.type,r=js[i];if(!r)throw new Error("Invalid shape: "+i+".");var n=new r(e);if(i!==Se.NONE){var s=t.alignSpeedDirection,o=t.upDirection,a=void 0===o?[0,0,1]:o;n.alignSpeedDirection=s,n.upDirection=pr.fromArray(a).normalize()}return n}(c),this.emission={rateOverTime:Ua(i.emission.rateOverTime),burstOffsets:Dh(null!=(a=i.emission.burstOffsets)?a:[]),bursts:(i.emission.bursts||[]).map(function(t){return new sh(t)})},this.textureSheetAnimation=m;var y,g,b=i.renderer||{},x=i.rotationOverLifetime;x&&((y={}).asRotation=!!x.asRotation,y.z=x.z?Ua(x.z):Ua(0),x.separateAxes&&(y.x=x.x&&Ua(x.x),y.y=x.y&&Ua(x.y))),(null==l?void 0:l.forceTarget)&&(g={target:l.target||[0,0,0],curve:Ua(l.forceCurve||[qe.LINE,[[0,0],[1,1]]])});var _={x:l.linearX&&Ua(l.linearX||0),y:l.linearY&&Ua(l.linearY||0),z:l.linearZ&&Ua(l.linearZ||0),asMovement:l.asMovement},E={x:l.orbitalX&&Ua(l.orbitalX),y:l.orbitalY&&Ua(l.orbitalY),z:l.orbitalZ&&Ua(l.orbitalZ),center:l.orbCenter,asRotation:l.asRotation},w=i.sizeOverLifetime||{},T=i.colorOverLifetime,S=(null==w?void 0:w.separateAxes)?{separateAxes:!0,x:Ua(w.x),y:Ua(w.y)}:{separateAxes:!1,x:Ua(("size"in w?w.size:w.x)||1)};b.anchor=b.anchor||[0,0];var A,O=dr.fromArray(b.anchor);this.options={particleFollowParent:!!h.particleFollowParent,startLifetime:Ua(h.startLifetime),startDelay:Ua(h.startDelay||0),startSpeed:Ua(l.startSpeed||0),startColor:Ua(h.startColor),looping:!1,maxCount:null!=(A=h.maxCount)?A:0,gravityModifier:Ua(f||0),gravity:d,start3DSize:!!h.start3DSize,startTurbulence:v,turbulence:r,speedOverLifetime:l.speedOverLifetime&&Ua(l.speedOverLifetime),linearVelOverLifetime:_,orbitalVelOverLifetime:E,forceTarget:g},h.startRotationZ&&(this.options.startRotation=Ua(h.startRotationZ||0)),(h.startRotationX||h.startRotationY)&&(this.options.start3DRotation=!0,this.options.startRotationX=Ua(h.startRotationX||0),this.options.startRotationY=Ua(h.startRotationY||0),this.options.startRotationZ=Ua(h.startRotationZ||0)),h.start3DSize?(this.options.startSizeX=Ua(h.startSizeX),this.options.startSizeY=Ua(h.startSizeY)):(this.options.startSize=Ua(h.startSize),this.options.sizeAspect=Ua(h.sizeAspect||1));var C=this.getMaskOptions(i),I={meshSlots:h.meshSlots,name:this.name,matrix:_r.IDENTITY,shaderCachePrefix:"",renderMode:b.renderMode||Le.BILLBOARD,side:b.side||_e.DOUBLE,gravity:d,blending:b.blending||be.ALPHA,rotationOverLifetime:y,gravityModifier:this.options.gravityModifier,linearVelOverLifetime:this.options.linearVelOverLifetime,orbitalVelOverLifetime:this.options.orbitalVelOverLifetime,speedOverLifetime:this.options.speedOverLifetime,sprite:m,occlusion:!!b.occlusion,transparentOcclusion:!!b.transparentOcclusion,maxCount:h.maxCount,mask:C.maskRef,maskMode:C.maskMode,forceTarget:g,diffuse:b.texture?this.engine.findObject(b.texture):void 0,sizeOverLifetime:S,anchor:O};if(T){var R=T.color,P=T.opacity;I.colorOverLifetime={},P&&(I.colorOverLifetime.opacity=Ua(T.opacity)),R&&(R[0]===qe.GRADIENT_COLOR?I.colorOverLifetime.color=T.color[1]:R[0]===qe.RGBA_COLOR?I.colorOverLifetime.color=an.createWithData(this.engine,{data:new Uint8Array(R[1]),width:1,height:1}):xt(R,an)&&(I.colorOverLifetime.color=R))}var M,D=[],F=[0,0,1,1];if(i.splits){var L=i.splits[0];F=(M=L[4])?[L[0],L[1],L[3],L[2]]:[L[0],L[1],L[2],L[3]]}if(m&&!m.animate)for(var k=M?m.row:m.col,N=M?m.col:m.row,B=m.total||k*N,U=0,z=0;z<k;z++)for(var V=0;V<N&&U<B;V++,U++)D.push([z*F[2]/k+F[0],V*F[3]/N+F[1],F[2]/k,F[3]/N]);else D.push(F);this.uvs=D,I.textureFlip=M;var G,j=i.trails;j&&(this.trails={lifetime:Ua(j.lifetime),dieWithParticles:!1!==j.dieWithParticles,sizeAffectsWidth:!!j.sizeAffectsWidth,sizeAffectsLifetime:!!j.sizeAffectsLifetime,inheritParticleColor:!!j.inheritParticleColor,parentAffectsPosition:!!j.parentAffectsPosition},C=this.getMaskOptions(j),G={name:"Trail",matrix:_r.IDENTITY,minimumVertexDistance:j.minimumVertexDistance||.02,maxTrailCount:h.maxCount,pointCountPerTrail:Math.round(j.maxPointPerTrail)||32,blending:j.blending,texture:j.texture?this.engine.findObject(j.texture):void 0,opacityOverLifetime:Ua(j.opacityOverLifetime||1),widthOverTrail:Ua(j.widthOverTrail||1),shaderCachePrefix:"",lifetime:this.trails.lifetime,occlusion:!!j.occlusion,transparentOcclusion:!!j.transparentOcclusion,textureMap:j.textureMap,mask:C.maskRef,maskMode:C.maskMode},j.colorOverLifetime&&j.colorOverLifetime[0]===qe.GRADIENT_COLOR&&(G.colorOverLifetime=j.colorOverLifetime[1]),j.colorOverTrail&&j.colorOverTrail[0]===qe.GRADIENT_COLOR&&(G.colorOverTrail=j.colorOverTrail[1])),this.renderer=new Eh(this.engine,I,G),this.renderer.item=this.item,this.renderer.maskManager=this.maskManager,this.meshes=this.renderer.meshes;var H,X=i.interaction;X&&(this.interaction={multiple:X.multiple,radius:null!=(H=X.radius)?H:.4,behavior:X.behavior});this.item.getHitTestParams=this.getHitTestParams,this.item._content=this},i.getMaskOptions=function(t){var e=Tr.NONE,i=0;return t.mask&&(e=this.maskManager.getMaskMode(t.mask),i=this.maskManager.getRefValue()),{maskMode:e,maskRef:i}},Ki(e,[{key:"timePassed",get:function(){return this.lastUpdate-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)}}]),e}(nr);wh=Et([tr(ki.ParticleSystem)],wh);var Th=new pr,Sh=new dr,Ah=new Un,Oh=new pr,Ch=new pr,Ih=new pr,Rh=new Un,Ph=[0,0,0],Mh=new _r;function Dh(t){var e={};return Array.isArray(t)&&t.forEach(function(t){var i=xt(t,Array),r=i?t[0]:t.index,n=e[r];n||(n=e[r]=[]),i?n.push(t.slice(1,4)):n.push([+t.x,+t.y,+t.z])}),e}function Fh(t,e){var i=Math.floor(Math.random()*t.length),r=t[i];return e||t.splice(i,1),r}var Lh,kh,Nh=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).clipPlayables=[],e.clipWeights=[],e}Xe(e,t);var i=e.prototype;return i.processFrame=function(t){for(var e,i=bt(this.clipPlayables);!(e=i()).done;){e.value.processFrame(t)}this.evaluate(t)},i.setClipWeight=function(t,e){if(xt(t,Ka)){for(var i=0;i<this.clipPlayables.length;i++)if(this.clipPlayables[i]===t)return void(this.clipWeights[i]=e)}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}(Ka),Bh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.evaluate=function(t){var e=t.output.getUserData();if(xt(e,Ru)){for(var i=e,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))}},e}(Nh),Uh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.processFrame=function(t){this.value=this.curve.getValue(this.time/this.getDuration())},e}(Ka),zh=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).propertyName="",e}return Xe(e,t),e.prototype.evaluate=function(t){var e=t.output.getUserData();if(e){var i=!1;if(this.propertyValue=e[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 s=this.getClipPlayable(r);if(!xt(s,Uh)){console.error("PropertyTrack added non-PropertyPlayableAsset");continue}var o=s.value;this.addWeightedValue(o,n),i=!0}}i&&(e[this.propertyName]=this.propertyValue)}}},e}(Nh),Vh=function(t){function e(){return t.apply(this,arguments)}Xe(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}(zh),Gh=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue=0},i.addWeightedValue=function(t,e){this.propertyValue+=t*e},e}(zh),jh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.evaluate=function(t){},e}(Nh),Hh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.evaluate=function(t){},e}(Nh),Xh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.processFrame=function(t){var e=t.output.getUserData();xt(e,_u)&&(e.time=this.getTime())},e}(Ka),Wh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.evaluate=function(t){var e=t.output.getUserData();if(xt(e,_u)){for(var i=e,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)}},e}(Nh),Yh=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.evaluate=function(t){},e}(Nh),qh=function(t){function e(){return t.apply(this,arguments)}Xe(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}(zh),Zh=function(t){function e(){return t.apply(this,arguments)}Xe(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}(zh),Kh=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===Je.restart?e%=i:this.endBehavior===Je.freeze&&(e=Math.min(i,e))),e},t}(),Qh=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).trackType=0,e.clipSeed=0,e.clips=[],e.children=[],e}Xe(e,t);var i=e.prototype;return i.updateAnimatedObject=function(){this.parent&&(this.boundObject=this.parent.boundObject)},i.createTrackMixer=function(t){return new Nh(t)},i.createOutput=function(){return new Qa},i.createPlayableGraph=function(t,e){return this.createMixerPlayableGraph(t,e)},i.createMixerPlayableGraph=function(t,e){for(var i,r=[],n=bt(this.clips);!(i=n()).done;){var s=i.value;r.push(s)}return this.compileClips(t,r,e)},i.compileClips=function(t,e,i){for(var r,n=this.createTrackMixer(t),s=bt(e);!(r=s()).done;){var o=r.value,a=this.createClipPlayable(t,o);a.setDuration(o.duration);var h=new Jh(o,a,n,this);i.push(h),n.clipPlayables.push(a),n.setClipWeight(a,0)}return n},i.createPlayable=function(t){return new Ka(t)},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 Kh;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=bt(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,e){return e.asset.createPlayable(t)},i.fromData=function(e){t.prototype.fromData.call(this,e);for(var i,r=bt(this.children);!(i=r()).done;){i.value.parent=this}},e}(Ja);Et([er(Kh)],Qh.prototype,"clips",void 0),Et([er()],Qh.prototype,"children",void 0),Qh=Et([tr(ki.TrackAsset)],Qh),(kh=Lh||(Lh={}))[kh.MasterTrack=0]="MasterTrack",kh[kh.ObjectTrack=1]="ObjectTrack";var Jh=function(){function t(t,e,i,r){this.clip=t,this.playable=e,this.parentMixer=i,this.track=r,xt(this.track.boundObject,Ru)&&(this.particleSystem=this.track.boundObject.getComponent(wh))}return t.prototype.evaluateAt=function(t){var e=this.clip,i=1,r=!1,n=!1,s=this.track.boundObject;t>=e.start+e.duration&&e.endBehavior===Je.destroy?xt(s,Ru)&&Ru.isParticle(s)&&this.particleSystem&&!this.particleSystem.destroyed?i=1:(i=0,r=!0):t-this.clip.start>=0?(i=1,n=!0):t<e.start&&(i=0),n&&this.playable.getPlayState()!==Xa.Playing&&this.playable.play(),this.parentMixer.setClipWeight(this.playable,i);var o=e.toLocalTime(t);this.playable.setTime(o),r&&this.playable.getPlayState()===Xa.Playing&&this.playable.pause()},Ki(t,[{key:"enable",set:function(t){t?this.playable.play():(this.parentMixer.setClipWeight(this.playable,0),this.playable.pause())}}]),t}(),$h=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createTrackMixer=function(t){return new Bh(t)},e}(Qh);$h=Et([tr(ki.ActivationTrack)],$h);var tu=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).propertyNames=[],e.path="",e}Xe(e,t);var i=e.prototype;return i.updateAnimatedObject=function(){for(var t=this.propertyNames,e=this.parent.boundObject,i=0;i<t.length-1;i++){var r=e[t[i]];void 0===r&&console.error("The "+t[i]+" property of "+e+" was not found"),e=r}this.boundObject=e},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=this.path.split(".");this.propertyNames=i},e}(Qh);Et([er()],tu.prototype,"path",void 0);var eu=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.createTrackMixer=function(t){var e=new Gh(t),i=this.propertyNames;if(i.length>0){var r=i[i.length-1];e.propertyName=r}return e},i.updateAnimatedObject=function(){for(var t=this.propertyNames,e=this.parent.boundObject,i=0;i<t.length-1;i++){var r=e[t[i]];void 0===r&&console.error("The "+t[i]+" property of "+e+" was not found"),e=r}this.boundObject=e},e}(tu);eu=Et([tr(ki.FloatPropertyTrack)],eu);var iu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createTrackMixer=function(t){return new Hh(t)},e}(Qh);iu=Et([tr(ki.SpriteColorTrack)],iu);var ru=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.updateAnimatedObject=function(){if(!this.parent||!xt(this.parent.boundObject,Ru))throw new Error("SubCompositionTrack needs to be set under the VFXItem track.");this.boundObject=this.parent.boundObject.getComponent(_u)},i.createTrackMixer=function(t){return new Wh(t)},e}(Qh);ru=Et([tr(ki.SubCompositionTrack)],ru);var nu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createTrackMixer=function(t){return new Yh(t)},e}(Qh);nu=Et([tr(ki.TransformTrack)],nu);var su=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.updateAnimatedObject=function(){xt(this.parent.boundObject,sr)&&(this.parent.boundObject,this.boundObject=this.parent.boundObject.materials[this.index])},e}(Qh);Et([er()],su.prototype,"index",void 0),su=Et([tr("MaterialTrack")],su);var ou=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createTrackMixer=function(t){return new jh(t)},e}(Qh),au=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createTrackMixer=function(t){var e=new qh(t),i=this.propertyNames;if(i.length>0){var r=i[i.length-1];e.propertyName=r}return e},e}(tu);au=Et([tr(ki.Vector4PropertyTrack)],au);var hu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createTrackMixer=function(t){var e=new Zh(t),i=this.propertyNames;if(i.length>0){var r=i[i.length-1];e.propertyName=r}return e},e}(tu);hu=Et([tr("Vector2PropertyTrack")],hu);var uu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createTrackMixer=function(t){var e=new Vh(t),i=this.propertyNames;if(i.length>0){var r=i[i.length-1];e.propertyName=r}return e},e}(tu);uu=Et([tr(ki.ColorPropertyTrack)],uu);var lu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createPlayable=function(t){var e=new Uh(t);return e.curve=Ua(this.curveData),e.value=e.curve.getValue(0),e},e}(Ja);Et([er()],lu.prototype,"curveData",void 0),lu=Et([tr(ki.ColorPropertyPlayableAsset)],lu);var cu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createPlayable=function(t){var e=new Uh(t);return e.curve=Ua(this.curveData),e.value=e.curve.getValue(0),e},e}(Ja);Et([er()],cu.prototype,"curveData",void 0),cu=Et([tr(ki.FloatPropertyPlayableAsset)],cu);var fu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createPlayable=function(t){return new Xh(t)},e}(Ja);fu=Et([tr(ki.SubCompositionPlayableAsset)],fu);var du=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.updateAnimatedObject=function(){},i.create=function(t){if(xt(this.boundObject,Ru)){var e=this.boundObject;if(e.getComponent(wh)){var i=t.createTrack(ou,this,"ParticleTrack");i.boundObject=this.boundObject;var r=i.createClip(yh);r.start=e.start,r.duration=e.duration,r.endBehavior=e.endBehavior}}},e}(Qh);du=Et([tr(ki.ObjectBindingTrack)],du);var pu=function(){function t(t,e,i){this.children=[],this.trackAsset=t,this.mixer=e,this.output=i}return t.prototype.addChild=function(t){this.children.push(t)},t}(),mu=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).tracks=[],e.cacheFlattenedTracks=null,e}Xe(e,t);var i=e.prototype;return i.createPlayable=function(t){for(var e,i=new vu(t),r=bt(this.tracks);!(e=r()).done;){var n=e.value;xt(n,du)&&n.create(this)}return this.sortTracks(this.tracks),i.compileTracks(t,this.flattenedTracks),i},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=bt(t.getChildTracks());!(i=r()).done;){var n=i.value;e.push(n)}for(var s,o=bt(t.getChildTracks());!(s=o()).done;){var a=s.value;this.addSubTracksRecursive(a,e)}},i.sortTracks=function(t){for(var e=[],i=0;i<t.length;i++)e.push(new yu(t[i],i));e.sort(gu),t.length=0;for(var r,n=bt(e);!(r=n()).done;){var s=r.value;t.push(s.track)}},i.fromData=function(t){},Ki(e,[{key:"flattenedTracks",get:function(){if(!this.cacheFlattenedTracks){this.cacheFlattenedTracks=[];for(var t,e=bt(this.tracks);!(t=e()).done;){var i=t.value;this.cacheFlattenedTracks.push(i),this.addSubTracksRecursive(i,this.cacheFlattenedTracks)}}return this.cacheFlattenedTracks}}]),e}(Ja);Et([er()],mu.prototype,"tracks",void 0),mu=Et([tr(ki.TimelineAsset)],mu);var vu=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).clips=[],e.masterTrackInstances=[],e}Xe(e,t);var i=e.prototype;return i.prepareFrame=function(t){},i.evaluate=function(){for(var t,e=this.getTime(),i=bt(this.clips);!(t=i()).done;){t.value.evaluateAt(e)}},i.compileTracks=function(t,e){for(var i,r=e,n={},s=bt(r);!(i=s()).done;){var o=i.value,a=o.createPlayableGraph(t,this.clips),h=o.createOutput();h.setUserData(o.boundObject),t.addOutput(h),h.setSourcePlayable(a);var u=new pu(o,a,h);n[o.getInstanceId()]=u,o.parent||this.masterTrackInstances.push(u)}for(var l,c=bt(r);!(l=c()).done;)for(var f,d=l.value,p=n[d.getInstanceId()],m=bt(d.getChildTracks());!(f=m()).done;){var v=n[f.value.getInstanceId()];p.addChild(v)}},e}(Ka),yu=function(t,e){this.track=t,this.originalIndex=e};function gu(t,e){var i=t.track.boundObject,r=e.track.boundObject;return xt(i,Ru)&&xt(r,Ru)?Ru.isAncestor(i,r)?-1:Ru.isAncestor(r,i)?1:t.originalIndex-e.originalIndex:t.originalIndex-e.originalIndex}var bu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createPlayable=function(t){var e=new Uh(t);return e.curve=Ua(this.curveData),e.value=e.curve.getValue(0),e},e}(Ja);Et([er()],bu.prototype,"curveData",void 0),bu=Et([tr(ki.Vector4PropertyPlayableAsset)],bu);var xu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createPlayable=function(t){var e=new Uh(t);return e.curve=Ua(this.curveData),e.value=e.curve.getValue(0),e},e}(Ja);Et([er()],xu.prototype,"curveData",void 0),xu=Et([tr(ki.Vector2PropertyPlayableAsset)],xu);var _u=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).time=0,e.startTime=0,e.items=[],e.state=Xa.Playing,e.reusable=!1,e.sceneBindings=[],e.graph=new Za,e}Xe(e,t);var i=e.prototype;return i.onStart=function(){var t;this.timelineAsset||(this.timelineAsset=new mu(this.engine)),this.resolveBindings(),this.timelinePlayable=this.timelineAsset.createPlayable(this.graph),this.item.endBehavior!==Je.destroy&&this.setReusable(!0),null==(t=this.item.composition)||t.refContent.push(this.item)},i.setReusable=function(t){for(var i,r=bt(this.timelineAsset.tracks);!(i=r()).done;){var n=i.value.boundObject;if(xt(n,Ru)){var s=n.getComponent(e);s&&s.setReusable(t)}}},i.getReusable=function(){return this.reusable},i.pause=function(){this.state=Xa.Paused},i.resume=function(){this.state=Xa.Playing},i.onUpdate=function(t){if(this.state!==Xa.Paused){var e=this.time;this.timelinePlayable.setTime(e),this.resolveBindings(),this.timelinePlayable.evaluate(),this.graph.evaluate(t)}},i.onEnable=function(){for(var t,e=bt(this.items);!(t=e()).done;){t.value.setActive(!0)}},i.onDisable=function(){for(var t,e=bt(this.items);!(t=e()).done;){t.value.setActive(!1)}},i.onDestroy=function(){this.item.composition&&this.items&&(this.items.forEach(function(t){return t.dispose()}),this.items.length=0)},i.hitTest=function(t,e,i,r,n,s){for(var o,a=function(s){var a=o.items[s];if(a.isActive&&a.transform.getValid()&&!Ru.isComposition(a)&&!l(a)){var c=a.getHitTestParams(n);if(c){var f=!1,d=new pr;if(c.type===Po.triangle)for(var p=c.triangles,m=c.backfaceCulling,v=0;v<p.length;v++){var y=p[v];if(t.intersectTriangle(y,d,m)){f=!0,h.push(d);break}}else if(c.type===Po.box){var g=c.center,b=c.size,x=g.clone().addScaledVector(b,.5),_=g.clone().addScaledVector(b,-.5);t.intersectBox({min:x,max:_},d)&&(f=!0,h.push(d))}else if(c.type===Po.sphere){var E=c.center,w=c.radius;t.intersectSphere({center:E,radius:w},d)&&(f=!0,h.push(d))}else if(c.type===Po.custom){var T=c.collect(t,new dr(e,i));T&&T.length>0&&(T.forEach(function(t){h.push(t)}),f=!0)}if(f){var S={compContent:o.item,id:a.id,name:a.name,position:h[h.length-1],parentId:a.parentId,hitPositions:h,behavior:c.behavior};if(a.emit("click",S),r.push(S),u(S))return{v:r}}}}},h=[],u=(null==s?void 0:s.stop)||Jt,l=(null==s?void 0:s.skip)||Jt,c=(null==s?void 0:s.maxCount)||this.items.length,f=0;f<this.items.length&&r.length<c;f++){var d=(o=this,a(f));if("object"===_t(d))return d.v}return r},i.setChildrenRenderOrder=function(t){for(var i,r=bt(this.items);!(i=r()).done;){var n=i.value;n.renderOrder=t++;var s=n.getComponent(e);s&&(t=s.setChildrenRenderOrder(t))}return t},i.fromData=function(e){t.prototype.fromData.call(this,e);var i,r=e;this.startTime=null!=(i=r.startTime)?i:0},i.resolveBindings=function(){for(var t,e=bt(this.sceneBindings);!(t=e()).done;){var i=t.value;i.key.boundObject=i.value}for(var r,n=bt(this.timelineAsset.tracks);!(r=n()).done;){var s=r.value;this.updateTrackAnimatedObject(s)}},i.updateTrackAnimatedObject=function(t){for(var e,i=bt(t.getChildTracks());!(e=i()).done;){var r=e.value;r.updateAnimatedObject(),this.updateTrackAnimatedObject(r)}},e}(nr);Et([er()],_u.prototype,"items",void 0),Et([er()],_u.prototype,"sceneBindings",void 0),Et([er()],_u.prototype,"timelineAsset",void 0),_u=Et([tr("CompositionComponent")],_u);var Eu,wu,Tu=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=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];var s;null==(s=e.listeners[t])||s.forEach(function(i){var n=i.listener,s=i.options;n.apply(void 0,[].concat(r)),(null==s?void 0:s.once)&&e.off(t,n)})},this.getListeners=function(e){var i;return(null==(i=t.listeners[e])?void 0:i.map(function(t){return t.listener}))||[]}},Su=function(){function t(){this.update=new Ou,this.lateUpdate=new Cu}var e=t.prototype;return e.addComponent=function(t){t.onUpdate!==nr.prototype.onUpdate&&this.update.addComponent(t),t.onLateUpdate!==nr.prototype.onLateUpdate&&this.lateUpdate.addComponent(t)},e.removeComponent=function(t){t.onUpdate!==nr.prototype.onUpdate&&this.update.removeComponent(t),t.onLateUpdate!==nr.prototype.onLateUpdate&&this.lateUpdate.removeComponent(t)},e.clear=function(){this.update.clear(),this.lateUpdate.clear()},t}(),Au=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}(),Ou=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=bt(t);!(i=r()).done;){i.value.onUpdate(e)}},e}(Au),Cu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=bt(t);!(i=r()).done;){i.value.onLateUpdate(e)}},e}(Au),Iu=function(t){function e(i,r){var n,s;(n=t.call(this)||this).sceneTicking=new Su,n.speed=1,n.isEnded=!1,n.loaderData={},n.refContent=[],n.postProcessingEnabled=!1,n.destroyed=!1,n.postLoaders=[],n.paused=!1,n.isEndCalled=!1,n._textures=[];var o,a=i.reusable,h=void 0!==a&&a,u=i.speed,l=void 0===u?1:u,c=i.baseRenderOrder,f=void 0===c?0:c,d=i.renderer,p=i.event,m=i.width,v=i.height,y=i.handleItemMessage;n.renderer=d,n._textures=r.textures,n.postProcessingEnabled=null!=(o=null==(s=r.jsonScene.renderSettings)?void 0:s.postProcessingEnabled)&&o,n.getEngine().renderLevel=r.renderLevel,h&&(n.keepResource=!0,r.consumed=!0);for(var g,b=r.jsonScene.compositions[0],x=bt(r.jsonScene.compositions);!(g=x()).done;){var _=g.value;_.id===r.jsonScene.compositionId&&(b=_)}Xt(b),n.rootItem=new Ru(n.getEngine()),n.rootItem.name="rootItem",n.rootItem.duration=b.duration,n.rootItem.endBehavior=b.endBehavior,n.rootItem.composition=$a(n);for(var E,w,T,S=bt(b.components);!(E=S()).done;){var A=E.value,O=n.getEngine().findObject(A);n.rootItem.components.push(O),O.item=n.rootItem}return n.rootComposition=n.rootItem.getComponent(_u),n.width=m,n.height=v,n.renderOrder=f,n.id=b.id,n.renderer=d,n.event=p,n.statistic={loadStart:null!=(w=r.startTime)?w:0,loadTime:null!=(T=r.totalTime)?T:0,compileTime:0,firstFrameTime:0},n.reusable=h,n.speed=l,n.name=b.name,n.pluginSystem=r.pluginSystem,n.pluginSystem.initializeComposition($a(n),r),n.camera=new nh(n.name,Ur({},null==b?void 0:b.camera,{aspect:m/v})),n.url=r.url,n.interactive=!0,n.handleItemMessage=y,n.createRenderFrame(),n.rendererOptions=null,e.buildItemTree(n.rootItem),n.rootComposition.setChildrenRenderOrder(0),n.pluginSystem.resetComposition($a(n),n.renderFrame),n}Xe(e,t);var i=e.prototype;return i.getDuration=function(){return this.rootItem.duration},i.restart=function(){this.reset(),this.forwardTime(this.startTime)},i.setIndex=function(t){this.renderOrder=t},i.getIndex=function(){return this.renderOrder},i.setSpeed=function(t){this.speed=t},i.setVisible=function(t){this.rootItem.setVisible(t)},i.getSpeed=function(){return this.speed},i.play=function(){this.isEnded&&this.reusable&&this.restart(),this.rootComposition.isStartCalled?this.gotoAndPlay(this.time-this.startTime):this.gotoAndPlay(0)},i.pause=function(){this.paused=!0},i.getPaused=function(){return this.paused},i.resume=function(){this.paused=!1},i.gotoAndPlay=function(t){this.setTime(t),this.resume()},i.gotoAndStop=function(t){this.setTime(t),this.pause()},i.createRenderFrame=function(){this.renderFrame=new fs({camera:this.camera,renderer:this.renderer,keepColorBuffer:this.keepColorBuffer,globalVolume:this.globalVolume,postProcessingEnabled:this.postProcessingEnabled}),this.renderFrame.cachedTextures=this.textures},i.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.pause(),this.emit("goto",{time:t})},i.addItem=function(t){this.items.push(t),t.setParent(this.rootItem)},i.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)},i.reset=function(){this.rendererOptions=null,this.isEnded=!1,this.isEndCalled=!1,this.rootComposition.time=0,this.pluginSystem.resetComposition(this,this.renderFrame)},i.prepareRender=function(){var t=this,e=this.renderFrame;this.postLoaders.length=0,this.pluginSystem.plugins.forEach(function(i){i.prepareRenderFrame(t,e)&&t.postLoaders.push(i)}),this.postLoaders.forEach(function(i){return i.postProcessFrame(t,e)})},i.update=function(t){if(!this.getPaused()){this.rootItem.isDuringPlay||(this.callAwake(this.rootItem),this.rootItem.beginPlay());var e=this.time;this.updateCompositionTime(t*this.speed/1e3);var i=1e3*(this.time-e);this.updatePluginLoaders(i),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()}},i.shouldDispose=function(){return this.isEnded&&this.rootItem.endBehavior===Je.destroy&&!this.reusable},i.callAwake=function(t){for(var e,i=bt(t.components);!(e=i()).done;){var r=e.value;r.isAwakeCalled||(r.onAwake(),r.isAwakeCalled=!0)}for(var n,s=bt(t.children);!(n=s()).done;){var o=n.value;this.callAwake(o)}},i.updateCamera=function(){this.camera.updateMatrix()},i.updatePluginLoaders=function(t){var e=this;this.pluginSystem.plugins.forEach(function(i){return i.onCompositionUpdate(e,t)})},i.updateCompositionTime=function(t){if(this.rootComposition.state!==Xa.Paused&&this.rootComposition.isActiveAndEnabled){var e=this.time+t-this.startTime;t<0&&e<0&&(e=0);var i=this.rootItem.duration,r=this.rootItem.endBehavior,n=!1;if(e-i>.001)switch(n=!0,r){case Je.restart:e%=i,this.restart();break;case Je.freeze:e=Math.min(i,e);case Je.forward:case Je.destroy:}this.rootComposition.time=e+this.startTime,this.isEnded!==n&&(n?this.isEnded=!0:(this.isEnded=!1,this.isEndCalled=!1))}},i.getItemByName=function(t){return this.rootItem.find(t)},i.getHitTestRay=function(t,e){var i=this.renderFrame.editorTransform,r=i.x,n=i.y;return function(t,e,i){var r=i.position,n=new pr(t,e,0),s=new pr;return i.getInverseViewProjectionMatrix().projectPoint(n,s),s.subtract(r),new Vn(r,s)}((t-i.z)/r,(e-i.w)/n,this.camera)},i.getEngine=function(){var t;return null==(t=this.renderer)?void 0:t.engine},i.hitTest=function(t,e,i,r){if(this.isDestroyed||!this.interactive)return[];var n=[],s=this.getHitTestRay(t,e);return this.refContent.forEach(function(o){var a;null==(a=o.getComponent(_u))||a.hitTest(s,t,e,n,i,r)}),n},i.addInteractiveItem=function(t,e){if(e===Ie.MESSAGE)return this.handleItemMessage({name:t.name,phrase:2,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:2,id:t.id}),t.id},i.removeInteractiveItem=function(t,e){e===Ie.MESSAGE&&(this.handleItemMessage({name:t.name,phrase:1,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:1,id:t.id}))},i.destroyItem=function(t){var e=this;t.type==De.composition?t.endBehavior!==Je.freeze&&t.getComponent(_u).items.forEach(function(t){return e.pluginSystem.plugins.forEach(function(i){return i.onCompositionItemRemoved(e,t)})}):(Dt(this.items,t),this.pluginSystem.plugins.forEach(function(i){return i.onCompositionItemRemoved(e,t)}))},i.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()},i.dispose=function(){var t,e,i=this;if(!this.destroyed){this.destroyed=!0;var r={},n=this.textures;n&&this.keepResource&&n.forEach(function(t){(null==t?void 0:t.dispose)&&(r[t.id]=t.dispose,t.dispose=Jt)}),this.rootItem.dispose(),this.renderFrame.dispose(),null==(t=this.rendererOptions)||t.emptyTexture.dispose(),null==(e=this.pluginSystem)||e.destroyComposition(this),this.update=function(){Qt.error("Update disposed composition: "+i.name+".")},this.dispose=Jt,n&&this.keepResource&&n.forEach(function(t){t.dispose=r[t.id],t.dispose()}),this.renderer.env!==yo&&this.renderer.clear({stencilAction:Ar.clear,clearStencil:0,depthAction:Ar.clear,clearDepth:1,colorAction:Ar.clear,clearColor:[0,0,0,0]})}},i.setEditorTransform=function(t,e,i){this.renderFrame.editorTransform.set(t,t,e,i)},i.translateByPixel=function(t,e){this.renderer?this.rootItem.translateByPixel(t,e):console.warn("Renderer not assigned. Operation aborted.")},i.setPositionByPixel=function(t,e){this.renderer?this.rootItem.setPositionByPixel(t,e):console.warn("Renderer not assigned. Operation aborted.")},i.translate=function(t,e,i){this.rootItem.translate(t,e,i)},i.setPosition=function(t,e,i){this.rootItem.setPosition(t,e,i)},i.rotate=function(t,e,i){this.rootItem.rotate(t,e,i)},i.setRotation=function(t,e,i){this.rootItem.setRotation(t,e,i)},i.scale=function(t,e,i){this.rootItem.scale(t,e,i)},i.setScale=function(t,e,i){this.rootItem.setScale(t,e,i)},i.offloadTexture=function(){this.textureOffloaded||(this.textures.forEach(function(t){return t&&t.offloadData()}),this.textureOffloaded=!0)},i.getRendererOptions=function(){return this.rendererOptions||(this.rendererOptions={emptyTexture:this.renderFrame.emptyTexture,cachePrefix:"-"}),this.rendererOptions},i.reloadTexture=function(){var t=this;return yt(function(){return wt(this,function(e){switch(e.label){case 0:return t.textureOffloaded?[4,Promise.all(t.textures.map(function(t){return null==t?void 0:t.reloadData()}))]:[3,2];case 1:e.sent(),t.textureOffloaded=!1,e.label=2;case 2:return[2]}})})()},e.buildItemTree=function(t){for(var e,i=new Map,r=t.getComponent(_u).items,n=bt(r);!(e=n()).done;){var s=e.value;i.set(s.id,s)}for(var o,a=bt(r);!(o=a()).done;){var h=o.value;if(void 0===h.parentId)h.setParent(t);else{var u=i.get(h.parentId);if(!u)throw new Error("The element references a non-existent element, please check the data.");h.setParent(u)}}},Ki(e,[{key:"transform",get:function(){return this.rootItem.transform}},{key:"textures",get:function(){return this._textures}},{key:"items",get:function(){return this.rootComposition.items}},{key:"startTime",get:function(){return this.rootComposition.startTime}},{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)}}]),e}(Tu),Ru=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).children=[],r.transform=new ih,r.time=-1,r.duration=0,r.start=0,r.endBehavior=Je.forward,r.type=De.base,r.components=[],r.isDuringPlay=!1,r.active=!0,r.visible=!0,r.speed=1,r.listIndex=0,r.isEnabled=!1,r.eventProcessor=new Tu,r.name="VFXItem",r.transform.name=r.name,r.transform.engine=e,i&&r.fromData(i),r}Xe(e,t);var i=e.prototype;return i.on=function(t,e,i){this.eventProcessor.on(t,e,i)},i.off=function(t,e){this.eventProcessor.off(t,e)},i.once=function(t,e){this.eventProcessor.once(t,e)},i.emit=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];var n;(n=this.eventProcessor).emit.apply(n,[].concat([t],i))},i.getListeners=function(t){return this.eventProcessor.getListeners(t)},i.setSpeed=function(t){this.speed=t},i.getSpeed=function(){return this.speed},i.addComponent=function(t){var e=new t(this.engine);return this.components.push(e),e.setVFXItem(this),e},i.getComponent=function(t){for(var e,i,r=bt(this.components);!(i=r()).done;){var n=i.value;if(xt(n,t)){e=n;break}}return e},i.getComponents=function(t){for(var e,i=[],r=bt(this.components);!(e=r()).done;){var n=e.value;xt(n,t)&&i.push(n)}return i},i.setParent=function(t){(t!==this||t)&&(this.parent&&Dt(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.beginPlay())},i.setColor=function(t,e,i,r){},i.setOpacity=function(t){},i.setActive=function(t){this.active!==t&&(this.active=!!t,this.onActiveChanged())},i.setVisible=function(t){for(var e,i=bt(this.components);!(e=i()).done;){e.value.enabled=t}this.visible=t},i.getVisible=function(){return this.visible},i.getWorldTransform=function(t){var e=null!=t?t:new ih({valid:!0});return e.cloneFromMatrix(this.transform.getWorldMatrix()),e},i.translate=function(t,e,i){this.transform.translate(t,e,i)},i.rotate=function(t,e,i){var r=new Un(t,e,i),n=xr.fromEuler(r);n.conjugate(),this.transform.rotateByQuat(n)},i.scale=function(t,e,i){this.transform.scaleBy(t,e,i)},i.setPositionByPixel=function(t,e){if(this.composition){var i=this.transform.getWorldPosition().z,r=this.composition.camera.getInverseVPRatio(i),n=r.x,s=r.y,o=this.composition.renderer.getWidth()/2,a=this.composition.renderer.getHeight()/2;this.transform.setPosition((2*t/o-1)*n,(1-2*e/a)*s,i)}},i.setPosition=function(t,e,i){this.transform.setPosition(t,e,i)},i.setRotation=function(t,e,i){this.transform.setRotation(t,e,i)},i.setScale=function(t,e,i){this.transform.setScale(t,e,i)},i.getBoundingBox=function(){},i.getHitTestParams=function(t){},i.getCurrentPosition=function(){var t=new pr;return this.transform.assignWorldTRS(t),t},i.find=function(t){var e;if(this.name===t)return this;var i=[];(e=i).push.apply(e,[].concat(this.children));for(var r=0;r<i.length;){var n,s=i[r];if(r++,s.name===t)return s;(n=i).push.apply(n,[].concat(s.children))}},i.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},i.beginPlay=function(){this.isDuringPlay=!0,this.composition&&this.active&&!this.isEnabled&&this.onEnable();for(var t,e=bt(this.children);!(t=e()).done;){var i=t.value;i.isDuringPlay||i.beginPlay()}},i.onActiveChanged=function(){this.isEnabled?this.onDisable():this.onEnable()},i.onEnable=function(){this.isEnabled=!0;for(var t,e=bt(this.components);!(t=e()).done;){var i=t.value;i.enabled&&!i.isStartCalled&&(i.onStart(),i.isStartCalled=!0)}for(var r,n=bt(this.components);!(r=n()).done;){var s=r.value;s.enabled&&!s.isEnableCalled&&s.enable()}},i.onDisable=function(){this.isEnabled=!1;for(var t,e=bt(this.components);!(t=e()).done;){var i=t.value;i.enabled&&i.isEnableCalled&&i.disable()}},i.fromData=function(i){t.prototype.fromData.call(this,i);var r=i.id,n=i.name,s=i.delay,o=i.parentId,a=i.endBehavior,h=i.transform,u=i.duration,l=void 0===u?0:u;this.props=i,this.type=i.type,this.id=r.toString(),this.name=n,this.start=s||this.start;var c={};if(h){var f;if(c.position=(new pr).copyFrom(h.position),h.quat)c.quat=new xr(h.quat.x,h.quat.y,h.quat.z,h.quat.w);else c.rotation=(new Un).copyFrom(null!=(f=h.eulerHint)?f:h.rotation);c.scale=(new pr).copyFrom(h.scale),h.size&&(c.size=(new dr).copyFrom(h.size)),h.anchor&&(c.anchor=(new dr).copyFrom(h.anchor)),this.transform.setTransform(c)}if(this.transform.name=this.name,this.transform.engine=this.engine,this.parentId=o,this.duration=l,this.endBehavior=a,i.content||(i.content={options:{}}),l<0)throw new Error("Item duration can't be less than 0, see "+go+".");if(i.components){this.components.length=0;for(var d,p=bt(i.components);!(d=p()).done;){var m=d.value,v=this.engine.findObject(m);this.components.push(v),xt(v,wh)&&(this.components.includes(v.renderer)||this.components.push(v.renderer))}}e.isComposition(this)&&this.instantiatePreComposition()},i.toData=function(){var t,e;(this.defination.id=this.guid,this.defination.transform=this.transform.toData(),this.defination.dataType=ki.VFXItemData,"rootItem"!==(null==(t=this.parent)?void 0:t.name))&&(this.defination.parentId=null==(e=this.parent)?void 0:e.guid);if(!this.defination.components){this.defination.components=[];for(var i,r=bt(this.components);!(i=r()).done;){var n=i.value;xt(n,yr)&&this.defination.components.push(n)}}this.defination.content={}},i.translateByPixel=function(t,e){if(this.composition){var i=this.composition.renderer.canvas.getBoundingClientRect(),r=i.width,n=i.height,s=this.transform.getWorldPosition().z,o=this.composition.camera.getInverseVPRatio(s),a=o.x,h=o.y;this.transform.translate(2*t*a/r,-2*e*h/n,0)}},i.dispose=function(){if(this.resetChildrenParent(),this.composition){this.composition.destroyItem(this);for(var t,e=bt(this.components.slice());!(t=e()).done;){t.value.dispose()}this.components=[],this._content=void 0,this._composition=null,this.transform.setValid(!1)}},i.resetChildrenParent=function(){for(var t,e=bt(this.children);!(t=e()).done;){var i=t.value;this.parent&&i.setParent(this.parent)}var r;this.parent&&Dt(null==(r=this.parent)?void 0:r.children,this)},i.instantiatePreComposition=function(){var t=this.props.content.options.refId,e=this.engine.findEffectsObjectData(t);if(!e)throw new Error("Referenced precomposition with Id: "+t+" does not exist.");for(var i,r=bt(e.components);!(i=r()).done;){var n=i.value,s=this.engine.findObject(n);if(s.item=this,this.components.push(s),s.setInstanceId(oe()),xt(s,_u))for(var o,a=bt(s.items);!(o=a()).done;){var h=o.value;h.setInstanceId(oe());for(var u,l=bt(h.components);!(u=l()).done;){u.value.setInstanceId(oe())}}}Iu.buildItemTree(this)},i.resetGUID=function(t){var e,i=null!=(e=null==t?void 0:t.get(this))?e:oe();this.setInstanceId(i);for(var r,n=bt(this.components);!(r=n()).done;){var s,o=r.value,a=null!=(s=null==t?void 0:t.get(o))?s:oe();o.setInstanceId(a)}for(var h,u=bt(this.children);!(h=u()).done;){h.value.resetGUID(t)}},i.gatherPreviousObjectID=function(t){t.set(this,this.getInstanceId());for(var e,i=bt(this.components);!(e=i()).done;){var r=e.value;t.set(r,r.getInstanceId())}for(var n,s=bt(this.children);!(n=s()).done;){n.value.gatherPreviousObjectID(t)}},e.isComposition=function(t){return t.type===De.composition},e.isSprite=function(t){return t.type===De.sprite},e.isParticle=function(t){return t.type===De.particle},e.isNull=function(t){return t.type===De.null},e.isTree=function(t){return t.type===De.tree},e.isCamera=function(t){return t.type===De.camera},e.isAncestor=function(t,e){for(var i=e.parent;i;){if(i===t)return!0;i=i.parent}return!1},Ki(e,[{key:"content",get:function(){return this._content}},{key:"composition",get:function(){return this._composition},set:function(t){this._composition=t;for(var e,i=bt(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=bt(this.components);!(e=i()).done;){var r=e.value;xt(r,sr)&&(r.priority=t)}}}},{key:"isActive",get:function(){return this.active}},{key:"isVisible",get:function(){return this.visible}}]),e}(rr);Ru=Et([tr(ki.VFXItemData)],Ru),(wu=Eu||(Eu={})).is=function(t,e){return t.type===e},wu.isComposition=function(t){return t.type===De.composition},wu.isParticle=function(t){return t.type===De.particle},wu.isNull=function(t){return t.type===De.null};var Pu=[1,1,1,1],Mu=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).renderColor=[1,1,1,1],e}Xe(e,t);var i=e.prototype;return i.processFrame=function(t){var e=t.output.getUserData();if(xt(e,Ru)){if(this.activeComponent||(this.activeComponent=this.getActiveComponent(e)),!this.activeMaterial){var i,r;this.activeMaterial=null==(i=this.activeComponent)?void 0:i.material;var n=null==(r=this.activeMaterial)?void 0:r.getColor("_Color");n&&(this.startColor=n.toArray())}var s,o,a,h=function(t,e){for(var i=0,r=t.length;i<r;i++)t[i]=e;return t}(Pu,1),u=this.time/e.duration,l=this.opacityOverLifetime,c=this.colorOverLifetime;if(c&&(h=function(t,e,i){if(t.length){for(var r,n=1;n<=t.length-1;n++){var s=t[n-1],o=t[n];if(s.stop<=e&&e<=o.stop){r=Nt(s.color,o.color,(e-s.stop)/(o.stop-s.stop));break}}return r||(r=t[t.length-1].color),i?r.map(function(t){return t/255}):r}return[0,0,0,0]}(c,u,!0),s=!0),l&&(h[3]*=l.getValue(u),s=!0),s)!function(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 s=0;s<e.length;s++)t[s]=e[s]}else if(i&&t!==i)for(var o=0;o<i.length;o++)t[o]=i[o]}(this.renderColor,h,this.startColor),null==(a=this.activeMaterial)||null==(o=a.getColor("_Color"))||o.setFromArray(this.renderColor)}},i.create=function(t){this.clipData=t;var e,i=t.colorOverLifetime;i&&(this.opacityOverLifetime=Ua(null!=(e=i.opacity)?e:1),i.color&&i.color[0]===qe.GRADIENT_COLOR&&(this.colorOverLifetime=kt(i.color[1])));return this},i.getActiveComponent=function(t){return t.getComponent(So)},e}(Ka),Du=0,Fu=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.createPlayable=function(t){var e=new Mu(t);return e.create(this.data),e},i.fromData=function(t){this.data=t},e}(Ja);Fu=Et([tr(ki.SpriteColorPlayableAsset)],Fu);var Lu=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).frameAnimationLoop=!1,r.name="MSprite"+Du++,i&&r.fromData(i),r}Xe(e,t);var i=e.prototype;return i.onUpdate=function(t){var e=this,i=this.item.time,r=this.item.duration;i>r&&this.frameAnimationLoop&&(i%=r);var n=Math.min(Math.max(i/r,0),1),s=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()),s){var a,h,u,l,c,f=s.total||s.row*s.col,d=0,p=0,m=1,v=1;if(this.splits){var y=this.splits[0];h=y[4],d=y[0],p=y[1],h?(m=y[3],v=y[2]):(m=y[2],v=y[3])}if(h?(u=1/s.row*m,l=1/s.col*v):(u=1/s.col*m,l=1/s.row*v),s.animate){var g=Math.round(n*(f-1)),b=Math.floor(g/s.col),x=g-b*s.col;c=h?[u*b,l*(s.col-x)]:[u*x,l*(1+b)]}else c=[0,l];null==(a=this.material.getVector4("_TexOffset"))||a.setFromArray([d+c[0],v+p-c[1],u,l])}},i.onDestroy=function(){var t=this.renderer.texture.source;t.sourceType===Cr.video&&(null==t?void 0:t.video)&&(t.video.pause(),t.video.src="",t.video.load())},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.interaction,r=e.options;this.interaction=i;var n=r.startColor||[1,1,1,1];this.material.setColor("_Color",(new br).setFromArray(n))},e}(So);Lu=Et([tr(ki.SpriteComponent)],Lu);var ku=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(je),Nu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(je),Bu=function(){function t(t){this.curveValues={},this.playable=t}var e=t.prototype;return e.setCurveValue=function(t,e,i){return this.findCurveValue(t,e)?this.curveValues[t+e].value=i:this.curveValues[t+e]={componentType:t,propertyName:e,value:i},this.curveValues[t+e]},e.findCurveValue=function(t,e){return this.curveValues[t+e]},t}(),Uu=function(t){function e(e){var i;return(i=t.call(this,e)||this).animationStream=new Bu($a(i)),i}return Xe(e,t),e}(Ka),zu=new Un,Vu=new pr(1,1,1),Gu=new pr,ju=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.start=function(){var t=this.boundObject,e=t.transform.scale;this.originalTransform={position:t.transform.position.clone(),rotation:t.transform.getRotation().clone(),scale:new pr(e.x,e.y,e.x)};var i,r=this.data.positionOverLifetime,n=this.data.rotationOverLifetime,s=this.data.sizeOverLifetime;if(r&&0!==Object.keys(r).length){this.positionOverLifetime=r,r.path&&(this.originalTransform.path=Ua(r.path));var o=r.linearX||r.linearY||r.linearZ;o&&(this.linearVelOverLifetime={x:r.linearX&&Ua(r.linearX),y:r.linearY&&Ua(r.linearY),z:r.linearZ&&Ua(r.linearZ),asMovement:r.asMovement,enabled:!!o});var a=r.orbitalX||r.orbitalY||r.orbitalZ;a&&(this.orbitalVelOverLifetime={x:r.orbitalX&&Ua(r.orbitalX),y:r.orbitalY&&Ua(r.orbitalY),z:r.orbitalZ&&Ua(r.orbitalZ),center:Wo(r.orbCenter),asRotation:r.asRotation,enabled:!!a}),this.speedOverLifetime=r.speedOverLifetime&&Ua(r.speedOverLifetime)}if(s&&(s.separateAxes?(this.sizeSeparateAxes=!0,this.sizeXOverLifetime=Ua(s.x||1),this.sizeYOverLifetime=Ua(s.y||1),this.sizeZOverLifetime=Ua(s.z||1)):this.sizeXOverLifetime=Ua(s.size||1)),n&&(this.rotationOverLifetime={asRotation:n.asRotation,separateAxes:n.separateAxes,z:Ua(n.z||0)},n.separateAxes)){var h=this.rotationOverLifetime;h.x=Ua(n.x||0),h.y=Ua(n.y||0)}this.gravity=pr.fromArray((null==r?void 0:r.gravity)||[]),this.gravityModifier=Ua(null!=(i=null==r?void 0:r.gravityOverLifetime)?i:0),this.direction=(null==r?void 0:r.direction)?pr.fromArray(r.direction).normalize():new pr,this.startSpeed=(null==r?void 0:r.startSpeed)||0,this.velocity=this.direction.clone(),this.velocity.multiply(this.startSpeed)},i.processFrame=function(t){if(!this.boundObject){var e=t.output.getUserData();xt(e,Ru)&&(this.boundObject=e,this.start())}this.boundObject&&this.boundObject.composition&&this.sampleAnimation()},i.sampleAnimation=function(){var t=this,e=this.boundObject,i=e.duration,r=this.time/i;if(r=r<0?0:r>1?1:r,this.sizeXOverLifetime){Vu.x=this.sizeXOverLifetime.getValue(r),this.sizeSeparateAxes?(Vu.y=this.sizeYOverLifetime.getValue(r),Vu.z=this.sizeZOverLifetime.getValue(r)):Vu.z=Vu.y=Vu.x;var n=this.originalTransform.scale;e.transform.setScale(Vu.x*n.x,Vu.y*n.y,Vu.z*n.z)}if(this.rotationOverLifetime){var s=function(e){return t.rotationOverLifetime.asRotation?e.getValue(r):e.getIntegrateValue(0,r,i)},o=s(this.rotationOverLifetime.z),a=this.rotationOverLifetime.separateAxes;zu.x=a?s(this.rotationOverLifetime.x):0,zu.y=a?s(this.rotationOverLifetime.y):0,zu.z=o;var h=zu.addEulers(this.originalTransform.rotation,zu);e.transform.setRotation(h.x,h.y,h.z)}if(this.positionOverLifetime){var u=Gu;Xo(u,this,this.gravity,this.time,i,this.originalTransform.position,this.velocity),this.originalTransform.path&&u.add(this.originalTransform.path.getValue(r)),e.transform.setPosition(u.x,u.y,u.z)}},e}(Uu),Hu=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.createPlayable=function(t){var e=new ju(t);return e.data=this.transformAnimationData,e},i.fromData=function(t){this.transformAnimationData=t},e}(Ja);Hu=Et([tr(ki.TransformPlayableAsset)],Hu);var Xu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.processFrame=function(t){var e=t.output.getUserData();xt(e,Ru)&&(e.time=this.time)},e}(Ka),Wu=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e.prototype.createPlayable=function(t){return new Xu(t)},e}(Ja);Wu=Et([tr(ki.ActivationPlayableAsset)],Wu);var Yu=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).duration=0,e.positionCurves=[],e.rotationCurves=[],e.scaleCurves=[],e.floatCurves=[],e}Xe(e,t);var i=e.prototype;return i.sampleAnimation=function(t,e){var i=e/t.duration;i=i<0?0:i>1?1:i;for(var r,n=bt(this.positionCurves);!(r=n()).done;){var s=r.value,o=s.keyFrames.getValue(i),a=this.findTarget(t,s.path);null==a||a.transform.setPosition(o.x,o.y,o.z)}for(var h,u=bt(this.rotationCurves);!(h=u()).done;){var l=h.value,c=l.keyFrames.getValue(i),f=this.findTarget(t,l.path);null==f||f.transform.setQuaternion(c.x,c.y,c.z,c.w)}for(var d,p=bt(this.scaleCurves);!(d=p()).done;){var m=d.value,v=m.keyFrames.getValue(i),y=this.findTarget(t,m.path);null==y||y.transform.setScale(v.x,v.y,v.z)}},i.fromData=function(t){this.positionCurves.length=0,this.scaleCurves.length=0,this.floatCurves.length=0;for(var e,i=bt(t.positionCurves);!(e=i()).done;){var r=e.value,n={path:r.path,keyFrames:Ua(r.keyFrames)};this.duration=Math.max(this.duration,n.keyFrames.getMaxTime()),this.positionCurves.push(n)}for(var s,o=bt(t.rotationCurves);!(s=o()).done;){var a=s.value,h={path:a.path,keyFrames:Ua(a.keyFrames)};this.duration=Math.max(this.duration,h.keyFrames.getMaxTime()),this.rotationCurves.push(h)}for(var u,l=bt(t.scaleCurves);!(u=l()).done;){var c=u.value,f={path:c.path,keyFrames:Ua(c.keyFrames)};this.duration=Math.max(this.duration,f.keyFrames.getMaxTime()),this.scaleCurves.push(f)}for(var d,p=bt(t.floatCurves);!(d=p()).done;){var m=d.value,v={path:m.path,keyFrames:Ua(m.keyFrames),property:m.property,className:m.className};this.duration=Math.max(this.duration,v.keyFrames.getMaxTime()),this.floatCurves.push(v)}},i.findTarget=function(t,e){for(var i,r=t,n=bt(e);!(i=n()).done;){for(var s,o=i.value,a=!1,h=bt(r.children);!(s=h()).done;){var u=s.value;if(u.name===o){r=u,a=!0;break}}if(!a)return}return r},e}(rr);Yu=Et([tr(ki.AnimationClip)],Yu);var qu=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},Ki(t,null,[{key:"shared",get:function(){return Zu.x=0,Zu.y=0,Zu}}]),t}(),Zu=new qu,Ku=1e-4,Qu=1e-4;function Ju(t,e,i,r,n,s,o,a){var h,u;o?(h=r,u=-i):(h=-r,u=i);var l=t-i*n+h,c=e-r*n+u,f=t+i*s+h,d=e+r*s+u;return a.push(l,c),a.push(f,d),2}function $u(t,e,i,r,n,s,o,a){var h=i-t,u=r-e,l=Math.atan2(h,u),c=Math.atan2(n-t,s-e);a&&l<c?l+=2*Math.PI:!a&&l>c&&(c+=2*Math.PI);var f=l,d=c-l,p=Math.abs(d),m=Math.sqrt(h*h+u*u),v=1+(15*p*Math.sqrt(m)/Math.PI|0),y=d/v;if(f+=y,a){o.push(t,e),o.push(i,r);for(var g=1,b=f;g<v;g++,b+=y)o.push(t,e),o.push(t+Math.sin(b)*m,e+Math.cos(b)*m);o.push(t,e),o.push(n,s)}else{o.push(i,r),o.push(t,e);for(var x=1,_=f;x<v;x++,_+=y)o.push(t+Math.sin(_)*m,e+Math.cos(_)*m),o.push(t,e);o.push(n,s),o.push(t,e)}return 2*v}function tl(t,e,i,r,n,s,o,a,h){var u=Ku;if(0!==t.length){var l=e,c=l.alignment;if(.5!==e.alignment){var f=function(t){var e=t.length;if(e<6)return 1;for(var i=0,r=0,n=t[e-2],s=t[e-1];r<e;r+=2){var o=t[r],a=t[r+1];i+=(o-n)*(a+s),n=o,s=a}return i<0?-1:1}(t);i&&(f*=-1),c=(c-.5)*f+.5}var d=new qu(t[0],t[1]),p=new qu(t[t.length-2],t[t.length-1]),m=r,v=Math.abs(d.x-p.x)<u&&Math.abs(d.y-p.y)<u;if(m){t=t.slice(),v&&(t.pop(),t.pop(),p.set(t[t.length-2],t[t.length-1]));var y=.5*(d.x+p.x),g=.5*(p.y+d.y);t.unshift(y,g),t.push(y,g)}var b=n,x=t.length/2,_=t.length,E=b.length/2,w=l.width/2,T=w*w,S=l.miterLimit*l.miterLimit,A=t[0],O=t[1],C=t[2],I=t[3],R=0,P=0,M=-(O-I),D=A-C,F=0,L=0,k=Math.sqrt(M*M+D*D)+ur;M/=k,D/=k,M*=w,D*=w;var N=2*(1-c),B=2*c;m||(l.cap===Ci.Round?_+=$u(A-M*(N-B)*.5,O-D*(N-B)*.5,A-M*N,O-D*N,A+M*B,O+D*B,b,!0)+2:l.cap===Ci.Square&&(_+=Ju(A,O,M,D,N,B,!0,b))),b.push(A-M*N,O-D*N),b.push(A+M*B,O+D*B);for(var U=1;U<x-1;++U){A=t[2*(U-1)],O=t[2*(U-1)+1],C=t[2*U],I=t[2*U+1],R=t[2*(U+1)],P=t[2*(U+1)+1],M=-(O-I),D=A-C,M/=k=Math.sqrt(M*M+D*D)+ur,D/=k,M*=w,D*=w,F=-(I-P),L=C-R,F/=k=Math.sqrt(F*F+L*L)+ur,L/=k,F*=w,L*=w;var z=C-A,V=O-I,G=C-R,j=P-I,H=z*G+V*j,X=V*G-j*z,W=X<0;if(Math.abs(X)<.001*Math.abs(H))b.push(C-M*N,I-D*N),b.push(C+M*B,I+D*B),H>=0&&(l.join===Ri.Round?_+=$u(C,I,C-M*N,I-D*N,C-F*N,I-L*N,b,!1)+4:_+=2,b.push(C-F*B,I-L*B),b.push(C+F*N,I+L*N));else{var Y=(-M+A)*(-D+I)-(-M+C)*(-D+O),q=(-F+R)*(-L+I)-(-F+C)*(-L+P),Z=(z*q-G*Y)/X,K=(j*Y-V*q)/X,Q=(Z-C)*(Z-C)+(K-I)*(K-I),J=C+(Z-C)*N,$=I+(K-I)*N,tt=C-(Z-C)*B,et=I-(K-I)*B,it=W?N:B;Q<=Math.min(z*z+V*V,G*G+j*j)+it*it*T?l.join===Ri.Bevel||Q/T>S?(W?(b.push(J,$),b.push(C+M*B,I+D*B),b.push(J,$),b.push(C+F*B,I+L*B)):(b.push(C-M*N,I-D*N),b.push(tt,et),b.push(C-F*N,I-L*N),b.push(tt,et)),_+=2):l.join===Ri.Round?W?(b.push(J,$),b.push(C+M*B,I+D*B),_+=$u(C,I,C+M*B,I+D*B,C+F*B,I+L*B,b,!0)+4,b.push(J,$),b.push(C+F*B,I+L*B)):(b.push(C-M*N,I-D*N),b.push(tt,et),_+=$u(C,I,C-M*N,I-D*N,C-F*N,I-L*N,b,!1)+4,b.push(C-F*N,I-L*N),b.push(tt,et)):(b.push(J,$),b.push(tt,et)):(b.push(C-M*N,I-D*N),b.push(C+M*B,I+D*B),l.join===Ri.Round?_+=W?$u(C,I,C+M*B,I+D*B,C+F*B,I+L*B,b,!0)+2:$u(C,I,C-M*N,I-D*N,C-F*N,I-L*N,b,!1)+2:l.join===Ri.Miter&&Q/T<=S&&(W?(b.push(tt,et),b.push(tt,et)):(b.push(J,$),b.push(J,$)),_+=2),b.push(C-F*N,I-L*N),b.push(C+F*B,I+L*B),_+=2)}}A=t[2*(x-2)],O=t[2*(x-2)+1],C=t[2*(x-1)],M=-(O-(I=t[2*(x-1)+1])),D=A-C,M/=k=Math.sqrt(M*M+D*D)+ur,D/=k,M*=w,D*=w,b.push(C-M*N,I-D*N),b.push(C+M*B,I+D*B),m||(l.cap===Ci.Round?_+=$u(C-M*(N-B)*.5,I-D*(N-B)*.5,C-M*N,I-D*N,C+M*B,I+D*B,b,!1)+2:l.cap===Ci.Square&&(_+=Ju(C,I,M,D,N,B,!1,b)));for(var rt=Qu*Qu,nt=E;nt<_+E-2;++nt)A=b[2*nt],O=b[2*nt+1],C=b[2*(nt+1)],I=b[2*(nt+1)+1],R=b[2*(nt+2)],P=b[2*(nt+2)+1],Math.abs(A*(I-P)+C*(P-O)+R*(O-I))<rt||a.push(nt,nt+1,nt+2)}}var el=function(){},il="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},rl={exports:{}};!function(t){var e;function i(t,e){return t.b===e.b&&t.a===e.a}function r(t,e){return t.b<e.b||t.b===e.b&&t.a<=e.a}function n(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 s(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 o(t,e){return t.a<e.a||t.a===e.a&&t.b<=e.b}function a(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 h(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){return r(t.b.a,t.a)}function l(t){return r(t.a,t.b.a)}function c(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 f(t){var e=y(t.b);return b(e,t.c),b(e.b,t.c),x(e,t.a),e}function d(t,e){var i=!1,r=!1;t!==e&&(e.a!==t.a&&(r=!0,E(e.a,t.a)),e.d!==t.d&&(i=!0,w(e.d,t.d)),g(e,t),r||(b(e,t.a),t.a.c=t),i||(x(e,t.d),t.d.a=t))}function p(t){var e=t.b,i=!1;t.d!==t.b.d&&(i=!0,w(t.d,t.b.d)),t.c===t?E(t.a,null):(t.b.d.a=$(t),t.a.c=t.c,g(t,$(t)),i||x(t,t.d)),e.c===e?(E(e.a,null),w(e.d,null)):(t.d.a=$(e),e.a.c=e.c,g(e,$(e))),_(t)}function m(t){var e=y(t),i=e.b;return g(e,t.e),e.a=t.b.a,b(i,e.a),e.d=i.d=t.d,e=e.b,g(t.b,$(t.b)),g(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 v(t,e){var i=!1,r=y(t),n=r.b;return e.d!==t.d&&(i=!0,w(e.d,t.d)),g(r,t.e),g(n,e),r.a=t.b.a,n.a=e.a,r.d=n.d=t.d,t.d.a=n,i||x(r,t.d),r}function y(t){var e=new J,i=new J,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 g(t,e){var i=t.c,r=e.c;i.b.e=e,r.b.e=t,t.c=r,e.c=i}function b(t,e){var i=e.f,r=new et(e,i);i.e=r,e.f=r,i=r.c=t;do{i.a=r,i=i.c}while(i!==t)}function x(t,e){var i=e.d,r=new Q(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 _(t){var e=t.h;t=t.b.h,e.b.h=t,t.b.h=e}function E(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 w(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 S=4e150;function A(t,e){t.f+=e.f,t.b.f+=e.b.f}function O(t,e,i){return t=t.a,e=e.a,i=i.a,e.b.a===t?i.b.a===t?r(e.a,i.a)?0>=s(i.b.a,e.a,i.a):0<=s(e.b.a,i.a,e.a):0>=s(i.b.a,t,i.a):i.b.a===t?0<=s(e.b.a,t,e.a):(e=n(e.b.a,t,e.a))>=(t=n(i.b.a,t,i.a))}function C(t){t.a.i=null;var e=t.e;e.a.c=e.c,e.c.a=e.a,t.e=null}function I(t,e){p(t.a),t.c=!1,t.a=e,e.i=t}function R(t){var e=t.a.a;do{t=dt(t)}while(t.a.a===e);return t.c&&(I(t,e=v(ft(t).a.b,t.a.e)),t=dt(t)),t}function P(t,e,i){var r=new ct;return r.a=i,r.e=X(t.f,e.e,r),i.i=r}function M(t,e){switch(t.s){case 100130:return!!(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 D(t){var e=t.a,i=e.d;i.c=t.d,i.a=e,C(t)}function F(t,e,i){for(t=e,e=e.a;t!==i;){t.c=!1;var r=ft(t),n=r.a;if(n.a!==e.a){if(!r.c){D(t);break}I(r,n=v(e.c.b,n.b))}e.c!==n&&(d($(n),n),d(e,n)),D(t),e=r.a,t=r}return e}function L(t,e,i,r,n,s){var o=!0;do{P(t,e,i.b),i=i.c}while(i!==r);for(null===n&&(n=ft(e).a.b.c);(i=(r=ft(e)).a.b).a===n.a;)i.c!==n&&(d($(i),i),d($(n),i)),r.f=e.f-i.f,r.d=M(t,r.f),e.b=!0,!o&&U(t,e)&&(A(i,n),C(e),p(n)),o=!1,e=r,n=i;e.b=!0,s&&V(t,e)}function k(t,e,i,r,n){var s=[e.g[0],e.g[1],e.g[2]];e.d=null,e.d=t.o&&t.o(s,i,r,t.c)||null,null===e.d&&(n?t.n||(K(t,100156),t.n=!0):e.d=i[0])}function N(t,e,i){var r=[null,null,null,null];r[0]=e.a.d,r[1]=i.a.d,k(t,e.a,r,[.5,.5,0,0],!1),d(e,i)}function B(t,e,i,r,n){var s=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),a=n+1;r[n]=.5*o/(s+o),r[a]=.5*s/(s+o),t.g[0]+=r[n]*e.g[0]+r[a]*i.g[0],t.g[1]+=r[n]*e.g[1]+r[a]*i.g[1],t.g[2]+=r[n]*e.g[2]+r[a]*i.g[2]}function U(t,e){var n=ft(e),o=e.a,a=n.a;if(r(o.a,a.a)){if(0<s(a.b.a,o.a,a.a))return!1;if(i(o.a,a.a)){if(o.a!==a.a){n=t.e;var h=o.a.h;if(0<=h){var u=(n=n.b).d,l=n.e,c=n.c,f=c[h];u[f]=u[n.a],c[u[f]]=f,f<=--n.a&&(1>=f||r(l[u[f>>1]],l[u[f]])?ut(n,f):lt(n,f)),l[h]=null,c[h]=n.b,n.b=h}else for(n.c[-(h+1)]=null;0<n.a&&null===n.c[n.d[n.a-1]];)--n.a;N(t,$(a),o)}}else m(a.b),d(o,$(a)),e.b=n.b=!0}else{if(0>s(o.b.a,a.a,o.a))return!1;dt(e).b=e.b=!0,m(o.b),d($(a),o)}return!0}function z(t,e){var u=ft(e),l=e.a,f=u.a,p=l.a,v=f.a,y=l.b.a,g=f.b.a,b=new et;if(s(y,t.a,p),s(g,t.a,v),p===v||Math.min(p.a,y.a)>Math.max(v.a,g.a))return!1;if(r(p,v)){if(0<s(g,p,v))return!1}else if(0>s(y,v,p))return!1;var x,_,E=y,w=p,T=g,S=v;if(r(E,w)||(x=E,E=w,w=x),r(T,S)||(x=T,T=S,S=x),r(E,T)||(x=E,E=T,T=x,x=w,w=S,S=x),r(T,w)?r(w,S)?(0>(x=n(E,T,w))+(_=n(T,w,S))&&(x=-x,_=-_),b.b=c(x,T.b,_,w.b)):(0>(x=s(E,T,w))+(_=-s(E,S,w))&&(x=-x,_=-_),b.b=c(x,T.b,_,S.b)):b.b=(T.b+w.b)/2,o(E,w)||(x=E,E=w,w=x),o(T,S)||(x=T,T=S,S=x),o(E,T)||(x=E,E=T,T=x,x=w,w=S,S=x),o(T,w)?o(w,S)?(0>(x=a(E,T,w))+(_=a(T,w,S))&&(x=-x,_=-_),b.a=c(x,T.a,_,w.a)):(0>(x=h(E,T,w))+(_=-h(E,S,w))&&(x=-x,_=-_),b.a=c(x,T.a,_,S.a)):b.a=(T.a+w.a)/2,r(b,t.a)&&(b.b=t.a.b,b.a=t.a.a),E=r(p,v)?p:v,r(E,b)&&(b.b=E.b,b.a=E.a),i(b,p)||i(b,v))return U(t,e),!1;if(!i(y,t.a)&&0<=s(y,t.a,b)||!i(g,t.a)&&0>=s(g,t.a,b)){if(g===t.a)return m(l.b),d(f.b,l),l=ft(e=R(e)).a,F(t,ft(e),u),L(t,e,$(l),l,l,!0),!0;if(y===t.a){m(f.b),d(l.e,$(f)),v=(p=u=e).a.b.a;do{p=dt(p)}while(p.a.b.a===v);return p=ft(e=p).a.b.c,u.a=$(f),L(t,e,(f=F(t,u,null)).c,l.b.c,p,!0),!0}return 0<=s(y,t.a,b)&&(dt(e).b=e.b=!0,m(l.b),l.a.b=t.a.b,l.a.a=t.a.a),0>=s(g,t.a,b)&&(e.b=u.b=!0,m(f.b),f.a.b=t.a.b,f.a.a=t.a.a),!1}return m(l.b),m(f.b),d($(f),l),l.a.b=b.b,l.a.a=b.a,l.a.h=rt(t.e,l.a),l=l.a,f=[0,0,0,0],b=[p.d,y.d,v.d,g.d],l.g[0]=l.g[1]=l.g[2]=0,B(l,p,y,f,0),B(l,v,g,f,2),k(t,l,b,f,!0),dt(e).b=e.b=u.b=!0,!1}function V(t,e){for(var i=ft(e);;){for(;i.b;)e=i,i=ft(i);if(!e.b&&(i=e,null===(e=dt(e))||!e.b))break;e.b=!1;var n,o=e.a,a=i.a;if(n=o.b.a!==a.b.a)t:{var h=ft(n=e),u=n.a,l=h.a,c=void 0;if(r(u.b.a,l.b.a)){if(0>s(u.b.a,l.b.a,u.a)){n=!1;break t}dt(n).b=n.b=!0,c=m(u),d(l.b,c),c.d.c=n.d}else{if(0<s(l.b.a,u.b.a,l.a)){n=!1;break t}n.b=h.b=!0,c=m(l),d(u.e,l.b),c.b.d.c=n.d}n=!0}if(n&&(i.c?(C(i),p(a),a=(i=ft(e)).a):e.c&&(C(e),p(o),o=(e=dt(i)).a)),o.a!==a.a)if(o.b.a===a.b.a||e.c||i.c||o.b.a!==t.a&&a.b.a!==t.a)U(t,e);else if(z(t,e))break;o.a===a.a&&o.b.a===a.b.a&&(A(a,o),C(e),p(o),e=dt(i))}}function G(t,e){t.a=e;for(var n=e.c;null===n.i;)if((n=n.c)===e.c){n=t;var o=e;(u=new ct).a=o.c.b;var a=(c=n.f).a;do{a=a.a}while(null!==a.b&&!c.c(c.b,u,a.b));var h=ft(c=a.b),u=c.a;a=h.a;if(0===s(u.b.a,o,u.a))i((u=c.a).a,o)||i(u.b.a,o)||(m(u.b),c.c&&(p(u.c),c.c=!1),d(o.c,u),G(n,o));else{var l=r(a.b.a,u.b.a)?c:h;h=void 0;c.d||l.c?(h=l===c?v(o.c.b,u.e):v(a.b.c.b,o.c).b,l.c?I(l,h):(u=n,(c=P(n,c,h)).f=dt(c).f+c.a.f,c.d=M(u,c.f)),G(n,o)):L(n,c,o.c,o.c,null,!0)}return}if(c=(u=ft(n=R(n.i))).a,(u=F(t,u,null)).c===c){u=(c=u).c,a=ft(n),h=n.a,l=a.a;var c,f=!1;h.b.a!==l.b.a&&z(t,n),i(h.a,t.a)&&(d($(u),h),u=ft(n=R(n)).a,F(t,ft(n),a),f=!0),i(l.a,t.a)&&(d(c,$(l)),c=F(t,a,null),f=!0),f?L(t,n,c.c,u,u,!0):(o=r(l.a,h.a)?$(l):h,L(t,n,o=v(c.c.b,o),o.c,o.c,!1),o.b.i.c=!0,V(t,n))}else L(t,n,u.c,c,c,!0)}function j(t,e){var i=new ct,r=f(t.b);r.a.b=S,r.a.a=e,r.b.a.b=-S,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=X(r=t.f,r.a,i),i.e=r}function H(t){this.a=new W,this.b=t,this.c=O}function X(t,e,i){do{e=e.c}while(null!==e.b&&!t.c(t.b,e.b,i));return t=new W(i,e.a,e),e.a.c=t,e.a=t}function W(t,e,i){this.b=t||null,this.a=e||this,this.c=i||this}function Y(){this.d=q,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 q=0;function Z(t,e){if(t.d!==e)for(;t.d!==e;)if(t.d<e)switch(t.d){case q:K(t,100151),t.u(null);break;case 1:K(t,100152),t.t()}else switch(t.d){case 2:K(t,100154),t.v();break;case 1:K(t,100153),t.w()}}function K(t,e){t.p&&t.p(e,t.c)}function Q(t,e){this.b=t||this,this.d=e||this,this.a=null,this.c=!1}function J(){this.h=this,this.i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function $(t){return t.b.e}function tt(){this.c=new et,this.a=new Q,this.b=new J,this.d=new J,this.b.b=this.d,this.d.b=this.b}function et(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 it(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new st}function rt(t,e){if(t.e){var i,r=t.b,n=++r.a;return 2*n>r.f&&(r.f*=2,r.c=ot(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&&lt(r,n),i}return r=t.a++,t.c[r]=e,-(r+1)}function nt(t){if(0===t.a)return ht(t.b);var e=t.c[t.d[t.a-1]];if(0!==t.b.a&&r(at(t.b),e))return ht(t.b);do{--t.a}while(0<t.a&&null===t.c[t.d[t.a-1]]);return e}function st(){this.d=ot([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 ot(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 at(t){return t.e[t.d[1]]}function ht(t){var e=t.d,i=t.e,r=t.c,n=e[1],s=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&&ut(t,1)),s}function ut(t,e){for(var i=t.d,n=t.e,s=t.c,o=e,a=i[o];;){var h=o<<1;h<t.a&&r(n[i[h+1]],n[i[h]])&&(h+=1);var u=i[h];if(h>t.a||r(n[a],n[u])){i[o]=a,s[a]=o;break}i[o]=u,s[u]=o,o=h}}function lt(t,e){for(var i=t.d,n=t.e,s=t.c,o=e,a=i[o];;){var h=o>>1,u=i[h];if(0===h||r(n[u],n[a])){i[o]=a,s[a]=o;break}i[o]=u,s[u]=o,o=h}}function ct(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ft(t){return t.e.c.b}function dt(t){return t.e.a.b}(e=Y.prototype).x=function(){Z(this,q)},e.B=function(t,e){switch(t){case 100142:return;case 100140:switch(e){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=e)}break;case 100141:return void(this.m=!!e);default:return void K(this,100900)}K(this,100901)},e.y=function(t){switch(t){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:K(this,100900)}return!1},e.A=function(t,e,i){this.j[0]=t,this.j[1]=e,this.j[2]=i},e.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:K(this,100900)}},e.C=function(t,e){var i=!1,r=[0,0,0];Z(this,2);for(var n=0;3>n;++n){var s=t[n];-1e150>s&&(s=-1e150,i=!0),1e150<s&&(s=1e150,i=!0),r[n]=s}i&&K(this,100155),null===(i=this.q)?d(i=f(this.b),i.b):(m(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},e.u=function(t){Z(this,q),this.d=1,this.b=new tt,this.c=t},e.t=function(){Z(this,1),this.d=2,this.q=null},e.v=function(){Z(this,2),this.d=1},e.w=function(){Z(this,1),this.d=q;var t=!1,e=[c=this.j[0],n=this.j[1],a=this.j[2]];if(0===c&&0===n&&0===a){for(var n=[-2e150,-2e150,-2e150],o=[2e150,2e150,2e150],a=[],h=[],c=(t=this.b.c).e;c!==t;c=c.e)for(var f=0;3>f;++f){var d=c.g[f];d<o[f]&&(o[f]=d,h[f]=c),d>n[f]&&(n[f]=d,a[f]=c)}if(c=0,n[1]-o[1]>n[0]-o[0]&&(c=1),n[2]-o[2]>n[c]-o[c]&&(c=2),o[c]>=n[c])e[0]=0,e[1]=0,e[2]=1;else{for(n=0,o=h[c],a=a[c],h=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],f=[0,0,0],c=t.e;c!==t;c=c.e)f[0]=c.g[0]-a.g[0],f[1]=c.g[1]-a.g[1],f[2]=c.g[2]-a.g[2],h[0]=o[1]*f[2]-o[2]*f[1],h[1]=o[2]*f[0]-o[0]*f[2],h[2]=o[0]*f[1]-o[1]*f[0],(d=h[0]*h[0]+h[1]*h[1]+h[2]*h[2])>n&&(n=d,e[0]=h[0],e[1]=h[1],e[2]=h[2]);0>=n&&(e[0]=e[1]=e[2]=0,e[T(o)]=1)}t=!0}for(h=T(e),c=this.b.c,n=(h+1)%3,a=(h+2)%3,h=0<e[h]?1:-1,e=c.e;e!==c;e=e.e)e.b=e.g[n],e.a=h*e.g[a];if(t){for(e=0,c=(t=this.b.a).b;c!==t;c=c.b)if(!(0>=(n=c.a).f))do{e+=(n.a.b-n.b.a.b)*(n.a.a+n.b.a.a),n=n.e}while(n!==c.a);if(0>e)for(t=(e=this.b.c).e;t!==e;t=t.e)t.a=-t.a}for(this.n=!1,c=(e=this.b.b).h;c!==e;c=t)t=c.h,n=c.e,i(c.a,c.b.a)&&c.e.e!==c&&(N(this,n,c),p(c),n=(c=n).e),n.e===c&&(n!==c&&(n!==t&&n!==t.b||(t=t.h),p(n)),c!==t&&c!==t.b||(t=t.h),p(c));for(this.e=e=new it,c=(t=this.b.c).e;c!==t;c=c.e)c.h=rt(e,c);for(function(t){t.d=[];for(var e=0;e<t.a;e++)t.d[e]=e;t.d.sort(function(t){return function(e,i){return r(t[e],t[i])?1:-1}}(t.c)),t.e=!0,function(t){for(var e=t.a;1<=e;--e)ut(t,e);t.h=!0}(t.b)}(e),this.f=new H(this),j(this,-S),j(this,S);null!==(e=nt(this.e));){for(;;){t:if(c=this.e,0===c.a)t=at(c.b);else if(t=c.c[c.d[c.a-1]],0!==c.b.a&&(c=at(c.b),r(c,t))){t=c;break t}if(null===t||!i(t,e))break;t=nt(this.e),N(this,e.c,t.c)}G(this,e)}for(this.a=this.f.a.a.b.a.a,e=0;null!==(t=this.f.a.a.b);)t.h||++e,C(t);for(this.f=null,(e=this.e).b=null,e.d=null,this.e=e.c=null,c=(e=this.b).a.b;c!==e.a;c=t)t=c.b,(c=c.a).e.e===c&&(A(c.c,c),p(c));if(!this.n){if(e=this.b,this.m)for(c=e.b.h;c!==e.b;c=t)t=c.h,c.b.d.c!==c.d.c?c.f=c.d.c?1:-1:p(c);else for(c=e.a.b;c!==e.a;c=t)if(t=c.b,c.c){for(c=c.a;r(c.b.a,c.a);c=c.c.b);for(;r(c.a,c.b.a);c=c.e);for(n=c.c.b,a=void 0;c.e!==n;)if(r(c.b.a,n.a)){for(;n.e!==c&&(u(n.e)||0>=s(n.a,n.b.a,n.e.b.a));)n=(a=v(n.e,n)).b;n=n.c.b}else{for(;n.e!==c&&(l(c.c.b)||0<=s(c.b.a,c.a,c.c.b.a));)c=(a=v(c,c.c.b)).b;c=c.e}for(;n.e.e!==c;)n=(a=v(n.e,n)).b}if(this.h||this.i||this.k||this.l)if(this.m){for(t=(e=this.b).a.b;t!==e.a;t=t.b)if(t.c){this.h&&this.h(2,this.c),c=t.a;do{this.k&&this.k(c.a.d,this.c),c=c.e}while(c!==t.a);this.i&&this.i(this.c)}}else{for(e=this.b,t=!!this.l,c=!1,n=-1,a=e.a.d;a!==e.a;a=a.d)if(a.c){c||(this.h&&this.h(4,this.c),c=!0),h=a.a;do{t&&(n!==(o=h.b.d.c?0:1)&&(n=o,this.l&&this.l(!!n,this.c))),this.k&&this.k(h.a.d,this.c),h=h.e}while(h!==a.a)}c&&this.i&&this.i(this.c)}if(this.r){for(c=(e=this.b).a.b;c!==e.a;c=t)if(t=c.b,!c.c){a=(n=c.a).e,h=void 0;do{a=(h=a).e,h.d=null,null===h.b.d&&(h.c===h?E(h.a,null):(h.a.c=h.c,g(h,$(h))),(o=h.b).c===o?E(o.a,null):(o.a.c=o.c,g(o,$(o))),_(h))}while(h!==n);n=c.d,(c=c.b).d=n,n.b=c}return this.r(this.b),void(this.c=this.b=null)}}this.b=this.c=null},il.libtess={GluTesselator:Y,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}},Y.prototype.gluDeleteTess=Y.prototype.x,Y.prototype.gluTessProperty=Y.prototype.B,Y.prototype.gluGetTessProperty=Y.prototype.y,Y.prototype.gluTessNormal=Y.prototype.A,Y.prototype.gluTessCallback=Y.prototype.z,Y.prototype.gluTessVertex=Y.prototype.C,Y.prototype.gluTessBeginPolygon=Y.prototype.u,Y.prototype.gluTessBeginContour=Y.prototype.t,Y.prototype.gluTessEndContour=Y.prototype.v,Y.prototype.gluTessEndPolygon=Y.prototype.w,t.exports=il.libtess}(rl);var nl,sl=((nl=new rl.exports.GluTesselator).gluTessCallback(rl.exports.gluEnum.GLU_TESS_VERTEX_DATA,function(t,e){e[e.length]=t[0],e[e.length]=t[1]}),nl.gluTessCallback(rl.exports.gluEnum.GLU_TESS_BEGIN,function(t){t!==rl.exports.primitiveType.GL_TRIANGLES&&console.info("expected TRIANGLES but got type: "+t)}),nl.gluTessCallback(rl.exports.gluEnum.GLU_TESS_ERROR,function(t){console.error("error callback, error number: "+t)}),nl.gluTessCallback(rl.exports.gluEnum.GLU_TESS_COMBINE,function(t,e,i){return[t[0],t[1],t[2]]}),nl.gluTessCallback(rl.exports.gluEnum.GLU_TESS_EDGE_FLAG,function(t){}),nl);function ol(t){sl.gluTessNormal(0,0,1);var e=[];sl.gluTessBeginPolygon(e);for(var i=0;i<t.length;i++){sl.gluTessBeginContour();for(var r=t[i],n=0;n<r.length;n+=2){var s=[r[n],r[n+1],0];sl.gluTessVertex(s,s)}sl.gluTessEndContour()}return sl.gluTessEndPolygon(),e}var al=function(t){function e(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];var n;(n=t.call(this)||this).points=[],n.closePath=!1;var s=Array.isArray(i[0])?i[0]:i;if("number"!=typeof s[0]){for(var o=[],a=0,h=s.length;a<h;a++)o.push(s[a].x,s[a].y);s=o}return n.points=s,n.closePath=!0,n}Xe(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,s=r-1;n<r;s=n++){var o=this.points[2*n],a=this.points[2*n+1],h=this.points[2*s],u=this.points[2*s+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-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 s=ol([t]),o=e.length/2;0===s.length&&this.getLineEndPointsTriangle(t,s);for(var a=0;a<s.length;a++)e[2*i+a]=s[a];for(var h=s.length/2,u=0;u<h;u++)r[n+u]=o+u},i.getLineEndPointsTriangle=function(t,e){if(!t||t.length<2||t.length%2!=0)throw new Error("Invalid points array");if(2!==t.length){var i=t[2]-t[0],r=t[3]-t[1],n=t[0],s=t[1],o=t[0],a=t[1];if(Math.abs(i)>=Math.abs(r))for(var h=0;h<t.length;h+=2){var u=t[h],l=t[h+1];u<n&&(n=u,s=l),u>o&&(o=u,a=l)}else for(var c=0;c<t.length;c+=2){var f=t[c],d=t[c+1];d<s&&(n=f,s=d),d>a&&(o=f,a=d)}e.push(n,s,o,a,o,a)}else e.push(t[0],t[1],t[0],t[1],t[0],t[1])},Ki(e,[{key:"lastX",get:function(){return this.points[this.points.length-2]}},{key:"lastY",get:function(){return this.points[this.points.length-1]}}]),e}(el),hl=1.1920929e-7;function ul(t,e,i,r,n,s,o,a,h,u){var l=(1-Math.min(.99,Math.max(0,null!=u?u:.5)))/5;return function(t,e,i,r,n,s,o,a,h,u){ll(t,e,i,r,n,s,o,a,h,u,0),h.push(o,a)}(e,i,r,n,s,o,a,h,t,l*=l),t}function ll(t,e,i,r,n,s,o,a,h,u,l){if(!(l>8)){var c=(t+i)/2,f=(e+r)/2,d=(i+n)/2,p=(r+s)/2,m=(n+o)/2,v=(s+a)/2,y=(c+d)/2,g=(f+p)/2,b=(d+m)/2,x=(p+v)/2,_=(y+b)/2,E=(g+x)/2;if(l>0){var w=o-t,T=a-e,S=Math.abs((i-o)*T-(r-a)*w),A=Math.abs((n-o)*T-(s-a)*w);if(S>hl&&A>hl){if((S+A)*(S+A)<=u*(w*w+T*T))return void h.push(_,E)}else if(S>hl){if(S*S<=u*(w*w+T*T))return void h.push(_,E)}else if(A>hl){if(A*A<=u*(w*w+T*T))return void h.push(_,E)}else if((w=_-(t+o)/2)*w+(T=E-(e+a)/2)*T<=u)return void h.push(_,E)}ll(t,e,c,f,y,g,_,E,h,u,l+1),ll(_,E,b,x,m,v,o,a,h,u,l+1)}}var cl,fl,dl=function(t){function e(e,i,r,n){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),(s=t.call(this)||this).type="ellipse",s.x=e,s.y=i,s.halfWidth=r,s.halfHeight=n,s}Xe(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)<=1},i.strokeContains=function(t,e,i){var r=this.halfWidth,n=this.halfHeight;if(r<=0||n<=0)return!1;var s=i/2,o=r-s,a=n-s,h=r+s,u=n+s,l=t-this.x,c=e-this.y;return l*l/(o*o)+c*c/(a*a)>1&&l*l/(h*h)+c*c/(u*u)<=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 s=Math.ceil(5*Math.sqrt(r+n)),o=8*s+0+0;if(0===o)return t;if(0===s)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 a=0,h=4*s+0+2,u=h,l=o,c=0+r,f=0,d=e+c,p=e-c,m=i+f;t[a++]=d,t[a++]=m,t[--h]=m,t[--h]=p;for(var v=1;v<s;v++){var y=Math.PI/2*(v/s),g=0+Math.cos(y)*r,b=0+Math.sin(y)*n,x=e+g,_=e-g,E=i+b,w=i-b;t[a++]=x,t[a++]=E,t[--h]=E,t[--h]=_,t[u++]=_,t[u++]=w,t[--l]=w,t[--l]=x}d=e+(c=0),p=e-c,m=i+(f=0+n);var T=i-f;return t[a++]=d,t[a++]=m,t[--l]=T,t[--l]=d,t},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var s=0,o=0,a=0;a<t.length;a+=2)s+=t[a],o+=t[a+1];s/=t.length/2,o/=t.length/2;var h=i;e[2*h]=s,e[2*h+1]=o;for(var u=h++,l=0;l<t.length;l+=2)e[2*h]=t[l],e[2*h+1]=t[l+1],l>0&&(r[n++]=h,r[n++]=u,r[n++]=h-1),h++;r[n++]=u+1,r[n++]=u,r[n++]=h-1}},e}(el);(fl=cl||(cl={}))[fl.Star=0]="Star",fl[fl.Polygon=1]="Polygon";var pl=function(t){function e(e,i,r,n,s,o){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),(a=t.call(this)||this).pointCount=e,a.outerRadius=i,a.innerRadius=r,a.outerRoundness=n,a.innerRoundness=s,a.starType=o,a.v=[],a.in=[],a.out=[],a}Xe(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)ul(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;ul(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 s=ol([t]),o=e.length/2,a=0;a<s.length;a++)e[2*i+a]=s[a];for(var h=s.length/2,u=0;u<h;u++)r[n+u]=o+u},i.buildStarPath=function(){this.v=[],this.in=[],this.out=[];var t,e,i,r,n=2*Math.floor(this.pointCount),s=2*Math.PI/n,o=!0,a=this.outerRadius,h=this.innerRadius,u=this.outerRoundness/100,l=this.innerRoundness/100,c=2*Math.PI*a/(2*n),f=2*Math.PI*h/(2*n),d=-Math.PI/2;for(t=0;t<n;t++){i=o?u:l,r=o?c:f;var p=(e=o?a:h)*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*s}},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,s=2*Math.PI*r/(4*e),o=.5*-Math.PI;for(t=0;t<e;t++){var a=r*Math.cos(o),h=r*Math.sin(o),u=0===a&&0===h?0:h/Math.sqrt(a*a+h*h),l=0===a&&0===h?0:-a/Math.sqrt(a*a+h*h),c=2*t;this.v[c]=a,this.v[c+1]=h,this.in[c]=a+u*s*n*1,this.in[c+1]=h+l*s*n*1,this.out[c]=a-u*s*n*1,this.out[c+1]=h-l*s*n*1,o+=1*i}},e}(el),ml=function(t){function e(e,i,r,n,s){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===s&&(s=20),(o=t.call(this)||this).x=e,o.y=i,o.width=r,o.height=n,o.roundness=s,o}Xe(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,s=this.y+r,o=e=Math.max(0,Math.min(this.roundness/100,1)*Math.min(i,r)),a=i-o,h=r-e;if(o>=0&&e>=0&&a>=0&&h>=0){var u=5*Math.ceil(2.3*Math.sqrt(o+e)),l=8*u+(a?4:0)+(h?4:0);if(0!==l){if(0===u)return t[0]=t[6]=n+a,t[1]=t[3]=s+h,t[2]=t[4]=n-a,void(t[5]=t[7]=s-h);var c=0,f=4*u+(a?2:0)+2,d=f,p=l,m=a+o,v=h,y=n+m,g=n-m,b=s+v;if(t[c++]=y,t[c++]=b,t[--f]=b,t[--f]=g,h){var x=s-v;t[d++]=g,t[d++]=x,t[--p]=x,t[--p]=y}for(var _=1;_<u;_++){var E=Math.PI/2*(_/u),w=a+Math.cos(E)*o,T=h+Math.sin(E)*e,S=n+w,A=n-w,O=s+T,C=s-T;t[c++]=S,t[c++]=O,t[--f]=O,t[--f]=A,t[d++]=A,t[d++]=C,t[--p]=C,t[--p]=S}y=n+(m=a),g=n-m,b=s+(v=h+e);var I=s-v;t[c++]=y,t[c++]=b,t[--p]=I,t[--p]=y,a&&(t[c++]=g,t[c++]=b,t[--p]=I,t[--p]=g)}}},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var s=0,o=0,a=0;a<t.length;a+=2)s+=t[a],o+=t[a+1];s/=t.length/2,o/=t.length/2;var h=i;e[2*h]=s,e[2*h+1]=o;for(var u=h++,l=0;l<t.length;l+=2)e[2*h]=t[l],e[2*h+1]=t[l+1],l>0&&(r[n++]=h,r[n++]=u,r[n++]=h-1),h++;r[n++]=u+1,r[n++]=u,r[n++]=h-1}},e}(el),vl=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=bt(this.graphicsPath.instructions);!(t=e()).done;){var i=t.value,r=i.action,n=i.data;switch(r){case"bezierCurveTo":this.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5],n[6]);break;case"moveTo":this.moveTo(n[0],n[1]);break;case"ellipse":this.ellipse(n[0],n[1],n[2],n[3],n[4]);break;case"polyStar":this.polyStar(n[0],n[1],n[2],n[3],n[4],n[5],n[6]);break;case"rect":this.rect(n[0],n[1],n[2],n[3],n[4]);break;case"closePath":this.closePath()}}this.endPoly()},e.bezierCurveTo=function(t,e,i,r,n,s,o){this.ensurePoly();var a=this.currentPoly;return ul(a.points,a.lastX,a.lastY,t,e,i,r,n,s,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 dl(t,e,i,r),n),this},e.polyStar=function(t,e,i,r,n,s,o){return this.drawShape(new pl(t,e,i,r,n,s),o),this},e.rect=function(t,e,i,r,n,s){return this.drawShape(new ml(t,e,i,r,n),s),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 al).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 al,this.currentPoly.points.push(0,0))},t}(),yl=function(){function t(){this.instructions=[],this.dirty=!1}var e=t.prototype;return e.bezierCurveTo=function(t,e,i,r,n,s,o){return this.instructions.push({action:"bezierCurveTo",data:[t,e,i,r,n,s,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,s){return this.instructions.push({action:"rect",data:[t,e,i,r,n,s]}),this.dirty=!0,this},e.polyStar=function(t,e,i,r,n,s,o){return this.instructions.push({action:"polyStar",data:[t,e,i,r,n,s,o]}),this.dirty=!0,this},e.clear=function(){return this.instructions.length=0,this.dirty=!0,this},Ki(t,[{key:"shapePath",get:function(){return this._shapePath||(this._shapePath=new vl(this)),this.dirty&&(this.dirty=!1,this._shapePath.buildPath()),this._shapePath}}]),t}();function gl(t,e){return!e||"object"!==_t(e)&&"function"!=typeof e?$a(t):e}var bl=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 Xt(t),t}if(function(t){return hh[t]}("offscreen_canvas"))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?Mt(this.elements,t):t.remove()},t}(),xl=new bl,_l=function(){function t(t){this.width=0,this.height=0;var e=t.textHeight,i=void 0===e?100:e,r=t.textWidth,n=void 0===r?100:r,s=t.textOverflow,o=void 0===s?vi.clip:s,a=t.textBaseline,h=void 0===a?gi.top:a,u=t.textAlign,l=void 0===u?xi.left:u,c=t.text,f=void 0===c?" ":c,d=t.letterSpace,p=void 0===d?0:d,m=t.autoWidth,v=void 0!==m&&m,y=t.fontSize,g=t.lineHeight,b=void 0===g?y:g,x=y+p;this.autoWidth=v,this.maxTextWidth=f.length*x,this.width=n,this.height=i,this.letterSpace=p,this.overflow=o,this.textBaseline=h,this.textAlign=l,this.lineHeight=b}var e=t.prototype;return e.getOffsetY=function(t,e,i,r){var n=t.outlineWidth,s=t.fontScale,o=(i-r)/3,a=r+n*s,h=i*(e-1),u=0;switch(this.textBaseline){case gi.top:u=a+o;break;case gi.middle:u=(this.height*s-h+a)/2;break;case gi.bottom:u=this.height*s-h-o}return u},e.getOffsetX=function(t,e){var i=0;switch(this.textAlign){case xi.left:i=t.outlineWidth*t.fontScale;break;case xi.middle:i=(this.width*t.fontScale-e)/2;break;case xi.right:i=this.width*t.fontScale-e}return i},e.setSize=function(t,e){this.width=t,this.height=e},t}(),El=function(t){this.isUnderline=!1,this.underlineHeight=1,this.isOutlined=!1,this.outlineWidth=0,this.hasShadow=!1,this.fontDesc="",this.fontScale=2,this.fontOffset=0;var e,i,r,n,s,o,a=t.textColor,h=void 0===a?[1,1,1,1]:a,u=t.fontSize,l=void 0===u?40:u,c=t.outline,f=t.shadow,d=t.fontWeight,p=void 0===d?"normal":d,m=t.fontStyle,v=void 0===m?"normal":m,y=t.fontFamily,g=void 0===y?"sans-serif":y;(this.textColor=h,this.textWeight=p,this.fontStyle=v,this.fontFamily=g,this.fontSize=l,c)&&(this.isOutlined=!0,this.outlineColor=null!=(e=c.outlineColor)?e:[1,1,1,1],this.outlineWidth=null!=(i=c.outlineWidth)?i:1,this.fontOffset+=this.outlineWidth);f&&(this.hasShadow=!0,this.shadowBlur=null!=(r=f.shadowBlur)?r:2,this.shadowColor=null!=(n=f.shadowColor)?n:[0,0,0,1],this.shadowOffsetX=null!=(s=f.shadowOffsetX)?s:0,this.shadowOffsetY=null!=(o=f.shadowOffsetY)?o:0);this.fontStyle!==Ti.normal&&(this.fontOffset+=this.fontSize*Math.tan(.20943951))},wl=["serif","sans-serif","monospace","courier"],Tl=0,Sl=function(t){function e(e,i){var r;if((r=t.call(this,e)||this).isDirty=!0,r.lineCount=0,r.maxLineWidth=0,r.SCALE_FACTOR=.1,r.ALPHA_FIX_VALUE=1/255,r.name="MText"+Tl++,i&&r.fromData(i),r.canvas=xl.getCanvas(),xl.saveCanvas(r.canvas),r.context=r.canvas.getContext("2d",{willReadFrequently:!0}),!i)return gl(r);var n=i.options;return r.updateWithOptions(n),r.updateTexture(),r}Xe(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.interaction,r=e.options;this.interaction=i,this.updateWithOptions(r),this.renderText(r),this.material.setColor("_Color",new br(1,1,1,1))},i.updateWithOptions=function(t){},i.updateTexture=function(t){},e}(So);Sl=Et([tr(ki.TextComponent)],Sl);var Al,Ol=function(){function t(){}var e=t.prototype;return e.renderText=function(t){this.updateTexture()},e.updateWithOptions=function(t){this.textStyle=new El(t),this.textLayout=new _l(t),this.text=t.text.toString(),this.lineCount=this.getLineCount(t.text,!0)},e.getLineCount=function(t,e){for(var i=this.context,r=this.textLayout,n=r.letterSpace,s=r.overflow,o=e?this.textStyle.fontSize/10:1/this.textStyle.fontScale,a=this.textLayout.width+this.textStyle.fontOffset,h=1,u=0,l=0;l<t.length;l++){var c,f,d=t[l],p=(null!=(f=null==i||null==(c=i.measureText(d))?void 0:c.width)?f:0)*o;u+=n,s===vi.display?"\n"===d?(h++,u=0):(u+=p,this.maxLineWidth=Math.max(this.maxLineWidth,u)):((u+p>a&&l>0||"\n"===d)&&(h++,this.maxLineWidth=Math.max(this.maxLineWidth,u),u=0),"\n"!==d&&(u+=p))}return h},e.setFontSize=function(t){if(this.textStyle.fontSize!==t){var e=this.textStyle.fontSize-t;this.textLayout.lineHeight+=e,this.textStyle.fontSize=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.setText=function(t){this.text!==t&&(this.text=t.toString(),this.lineCount=this.getLineCount(t,!1),this.isDirty=!0)},e.setTextAlign=function(t){this.textLayout.textAlign!==t&&(this.textLayout.textAlign=t,this.isDirty=!0)},e.setTextBaseline=function(t){this.textLayout.textBaseline!==t&&(this.textLayout.textBaseline=t,this.isDirty=!0)},e.setTextColor=function(t){this.textStyle.textColor!==t&&(this.textStyle.textColor=t,this.isDirty=!0)},e.setFontFamily=function(t){this.textStyle.fontFamily!==t||Wt(t)?(this.textStyle.fontFamily=t,this.isDirty=!0):console.warn("The font is either the current font or an risky font family.")},e.setOutlineColor=function(t){this.textStyle.outlineColor!==t&&(this.textStyle.outlineColor=t,this.isDirty=!0)},e.setOutlineWidth=function(t){this.textStyle.outlineWidth!==t&&(this.textStyle.outlineWidth=t,this.isDirty=!0)},e.setShadowBlur=function(t){this.textStyle.shadowBlur!==t&&(this.textStyle.shadowBlur=t,this.isDirty=!0)},e.setOverflow=function(t){this.textLayout.overflow=t,this.isDirty=!0},e.setShadowColor=function(t){this.textStyle.shadowColor!==t&&(this.textStyle.shadowColor=t,this.isDirty=!0)},e.setShadowOffsetX=function(t){this.textStyle.shadowOffsetX!==t&&(this.textStyle.shadowOffsetX=t,this.isDirty=!0)},e.setShadowOffsetY=function(t){this.textStyle.shadowOffsetY!==t&&(this.textStyle.shadowOffsetY=t,this.isDirty=!0)},e.setFontScale=function(t){this.textStyle.fontScale!==t&&(this.textStyle.fontScale=t,this.isDirty=!0)},e.setAutoWidth=function(t){this.textLayout.autoWidth!==t&&(this.textLayout.autoWidth=t,this.isDirty=!0)},e.updateTexture=function(t){if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){var e=this.context,i=this.textStyle,r=this.textLayout,n=i.fontScale,s=(r.width+i.fontOffset)*n,o=r.lineHeight*this.lineCount,a=i.fontSize*n,h=r.lineHeight*n;i.fontDesc=this.getFontDesc(a),this.char=(this.text||"").split(""),this.canvas.width=s,r.autoWidth?(this.canvas.height=o*n,this.item.transform.size.set(1,o/r.height)):this.canvas.height=r.height*n;var u=this.canvas.height;e.fillStyle="rgba(255, 255, 255, 0.0039)",t||(e.translate(0,u),e.scale(1,-1)),this.maxLineWidth>s&&r.overflow===vi.display?e.font=this.getFontDesc(a*s/this.maxLineWidth):e.font=i.fontDesc,e.clearRect(0,0,s,u),i.hasShadow&&this.setupShadow(),i.isOutlined&&this.setupOutline(),e.fillStyle="rgba("+i.textColor[0]+", "+i.textColor[1]+", "+i.textColor[2]+", "+i.textColor[3]+")";for(var l=[],c=0,f=r.getOffsetY(i,this.lineCount,h,a),d=[],p=[],m=0;m<this.char.length;m++){var v=this.char[m],y=e.measureText(v);((c+=r.letterSpace*n)+y.width>s&&m>0||"\n"===v)&&(l.push({y:f,width:c,chars:d,charOffsetX:p}),c=0,f+=h,d=[],p=[]),"\n"!==v&&(d.push(v),p.push(c),c+=y.width)}l.push({y:f,width:c,chars:d,charOffsetX:p}),l.forEach(function(t){var n=r.getOffsetX(i,t.width);t.chars.forEach(function(r,s){i.isOutlined&&e.strokeText(r,n+t.charOffsetX[s],t.y),e.fillText(r,n+t.charOffsetX[s],t.y)})}),i.hasShadow&&(e.shadowColor="transparent");var g=e.getImageData(0,0,this.canvas.width,this.canvas.height),b=an.createWithData(this.engine,{data:new Uint8Array(g.data),width:g.width,height:g.height},{flipY:t,magFilter:Pr.LINEAR,minFilter:Pr.LINEAR,wrapS:Pr.CLAMP_TO_EDGE,wrapT:Pr.CLAMP_TO_EDGE});this.renderer.texture=b,this.material.setTexture("_MainTex",b),this.isDirty=!1}},e.getFontDesc=function(t){var e=this.textStyle,i=e.fontSize,r=e.fontScale,n=e.fontFamily,s=e.textWeight,o=e.fontStyle,a=(t||i*r).toString()+"px ";return wl.includes(n)?a+=n:a+='"'+n+'"',s!==Ei.normal&&(a=s+" "+a),o!==Ti.normal&&(a=o+" "+a),a},e.setupOutline=function(){var t=this.context,e=this.textStyle,i=e.outlineColor,r=e.outlineWidth,n=i[0],s=i[1],o=i[2],a=i[3];t&&(t.strokeStyle="rgba("+255*n+", "+255*s+", "+255*o+", "+a+")",t.lineWidth=2*r)},e.setupShadow=function(){var t=this.context,e=this.textStyle,i=e.outlineColor,r=e.shadowBlur,n=e.shadowOffsetX,s=e.shadowOffsetY,o=i[0],a=i[1],h=i[2],u=i[3];t&&(t.shadowColor="rgba("+255*o+", "+255*a+", "+255*h+", "+u+")",t.shadowBlur=r,t.shadowOffsetX=n,t.shadowOffsetY=-s)},t}();Al=Sl,[Ol].forEach(function(t){Object.getOwnPropertyNames(t.prototype).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t.prototype,e);if(!i)throw new Error("Cannot find property descriptor of class "+t);Object.defineProperty(Al.prototype,e,i)})});var Cl=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(je),Il=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(rr),Rl=function(t){function e(){return t.apply(this,arguments)}return Xe(e,t),e}(rr);Et([er()],Rl.prototype,"buffer",void 0),Rl=Et([tr(ki.BinaryAsset)],Rl);var Pl=function(){function t(){}return t.serialize=function(e,i){e.toData(),i||(i={});var r=ir(e);if(r)for(var n,s=bt(Object.keys(r));!(n=s()).done;){var o=n.value,a=e[o];"number"==typeof a||"string"==typeof a||"boolean"==typeof a||t.checkTypedArray(a)?i[o]=a:te(a)?(i[o]||(i[o]=[]),t.serializeArrayProperty(a,i[o],0)):rr.is(a)?i[o]={id:a.getInstanceId()}:ie(a)&&(i[o]||(i[o]={}),t.serializeObjectProperty(a,i[o],0))}for(var h,u=bt(Object.keys(e.defination));!(h=u()).done;){var l=h.value,c=e.defination[l];"number"==typeof c||"string"==typeof c||"boolean"==typeof c||t.checkTypedArray(c)?i[l]=c:te(c)?(i[l]||(i[l]=[]),t.serializeArrayProperty(c,i[l],0)):rr.is(c)?i[l]={id:c.getInstanceId()}:ie(c)&&(i[l]||(i[l]={}),t.serializeObjectProperty(c,i[l],0))}return i},t.deserialize=function(e,i){i.defination=e;var r=ir(i),n=i.engine;if(r)for(var s,o=bt(Object.keys(r));!(s=o()).done;){var a=s.value,h=e[a];if(void 0!==h){var u=r[a].type;i[a]=t.deserializeProperty(h,n,0,u)}}i.fromData(i.defination)},t.checkTypedArray=function(t){return xt(t,Int8Array)||xt(t,Uint8Array)||xt(t,Uint8ClampedArray)||xt(t,Int16Array)||xt(t,Uint16Array)||xt(t,Int32Array)||xt(t,Uint32Array)||xt(t,Float32Array)||xt(t,Float64Array)||xt(t,ArrayBuffer)},t.checkDataPath=function(t){return!!(ie(t)&&1===Object.keys(t).length&&"id"in t&&$t(t.id)&&32===t.id.length)},t.checkGLTFNode=function(t){return ie(t)&&void 0!==t.nodeIndex&&void 0!==t.isJoint},t.checkImageSource=function(t){return re(t)||xt(t,HTMLImageElement)},t.deserializeProperty=function(e,i,r,n,s){if(void 0===s&&(s=!0),!(r>14)){if(te(e)){for(var o,a=[],h=bt(e);!(o=h()).done;){var u=o.value;a.push(t.deserializeProperty(u,i,r+1,n,s))}return a}if(t.checkDataPath(e)){var l=i.findObject(e);return s?l:e}if(ie(e)&&e.constructor===Object){var c;c=n?new n:{};for(var f,d=bt(Object.keys(e));!(f=d()).done;){var p=f.value;c[p]=t.deserializeProperty(e[p],i,r+1,void 0,s)}return c}return e}console.error("The nested object layers of the serialized data exceed the maximum limit.")},t.serializeObjectProperty=function(e,i,r){if(r>14)console.error("The nested object layers of the serialized data exceed the maximum limit.");else{i||(i={});for(var n,s=bt(Object.keys(e));!(n=s()).done;){var o=n.value,a=e[o];"number"==typeof a||"string"==typeof a||"boolean"==typeof a||t.checkTypedArray(e)?i[o]=a:te(a)?(i[o]||(i[o]=[]),t.serializeArrayProperty(a,i[o],r+1)):rr.is(a)?i[o]={id:a.getInstanceId()}:ie(a)&&(i[o]||(i[o]={}),t.serializeObjectProperty(a,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.");else{i||(i=[]);for(var n=0;n<e.length;n++){var s=e[n];"number"==typeof s||"string"==typeof s||"boolean"==typeof s||t.checkTypedArray(e)?i[n]=s:te(s)?(i[n]||(i[n]=[]),t.serializeArrayProperty(s,i[n],r+1)):rr.is(s)?i[n]={id:s.getInstanceId()}:ie(s)&&(i[n]||(i[n]={}),t.serializeObjectProperty(s,i[n],r+1))}}},t}(),Ml=function(){function t(t){this.engine=t}var e=t.prototype;return e.loadGUID=function(e){if(!e)return null;var i,r=e.id,n=this.findData(r);if(n){switch(n.dataType){case ki.Material:i=Tn.create(this.engine);break;case ki.Geometry:i=Bn.create(this.engine);break;case ki.Texture:i=an.create(this.engine);break;default:var s=t.getClass(n.dataType);s&&(i=new s(this.engine))}if(i)return i.setInstanceId(n.id),this.engine.addInstance(i),Pl.deserialize(n,i),i;console.error("Constructor for DataType: "+n.dataType+" not found.")}else console.error("Object data with uuid: "+r+" not found.")},e.findData=function(t){return this.engine.jsonSceneData[t]},t.getClass=function(t){return $i[t]},t}();function Dl(t,e){if(!t.includes(e))return t.push(e),!0}function Fl(t){if(Number.isFinite(t))return[qe.CONSTANT,t];if(t){var e=t[0],i=t[1];if(Array.isArray(e))return;if("static"===e||e===qe.CONSTANT)return[qe.CONSTANT,t[1]];if("lines"===e)return[qe.LINE,t[1]];if(e===qe.LINE){var r=i.map(function(t){return[Ke.LINE,t]});return[qe.BEZIER_CURVE,r]}return"curve"===e||e===qe.CURVE?[qe.BEZIER_CURVE,tc(i)]:t}}function Ll(t,e){return Array.isArray(t)&&"random"===t[0]?[qe.CONSTANT,t[1][e]]:Fl(t)}function kl(t){return t&&"color"===t[0]?zl(t[1],!0):[1,1,1,1]}function Nl(t,e){if(t)return"colors"===t[0]?[qe.COLORS,t[1].map(function(t){return zl(t,e)})]:"gradient"===t[0]?Ul(t[1],e):"color"===t[0]?[qe.RGBA_COLOR,zl(t[1],e)]:t}function Bl(t){return t&&"random"===t[0]?[qe.RANDOM,t[1]]:Fl(t)}function Ul(t,e){if(t){var i=[];return Object.getOwnPropertyNames(t).forEach(function(r){var n=function(t){var e=/^(-)?([\d+.]+)%$/.exec(t);if(e)return+e[2]/100*(e[1]?-1:1);return+t}(r),s=zl(t[r],e);i.push([n,s[0],s[1],s[2],s[3]])}),i=i.sort(function(t,e){return t[0]-e[0]}),[qe.GRADIENT_COLOR,i]}}function zl(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 xt(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:Math.round(255*t[3])]);return e&&(i=function(t){if(Array.isArray(t))return t.map(function(t){return Number.isFinite(t/255)?Number((t/255).toFixed(6)):0})}(i)),i}function Vl(t,e){return Array.isArray(t)?t[0]===qe.GRADIENT_COLOR?t:("gradient"===t[0]||"color"===t[0])&&Ul(t[1],e):Ul(t,e)}function Gl(t){if(t){if(3===t.length)return[qe.CONSTANT_VEC3,t];var e=t[0];if("path"===e||"bezier"===e||e===qe.BEZIER_PATH||e===qe.LINEAR_PATH){var i=t[1],r=i[0],n=i[1],s=i[2],o=tc(r);if(!s){s=[];for(var a=0;a<n.length;a++){var h=n[a].slice();0===a?s.push(h):a<n.length-1?(s.push(h),s.push(h)):s.push(h)}}return[qe.BEZIER_CURVE_PATH,[o,n,s]]}return t}}function jl(t){for(var e,i=bt(Object.keys(t));!(e=i()).done;){var r=e.value;t[r]=Number(t[r])}return t}function Hl(t){for(var e,i=bt(Object.keys(t));!(e=i()).done;){var r=e.value;void 0===t[r]&&delete t[r]}return t}var Xl,Wl=Math.cos,Yl=Math.sin,ql=Math.PI/180,Zl=180/Math.PI;function Kl(t,e){return t?[t[0]-.5,.5-t[1]]:e?Jl[e]:[0,0]}var Ql,Jl=((Xl={})[Ne.PARTICLE_ORIGIN_CENTER]=[0,0],Xl[Ne.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],Xl[Ne.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],Xl[Ne.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],Xl[Ne.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],Xl[Ne.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],Xl[Ne.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],Xl[Ne.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],Xl[Ne.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],Xl);function $l(t,e,i,r){var n=i[0],s=i[1],o=r[0],a=o-n;return[[n+(o-n)/3,s+(t*=a)/3],[o-(o-n)/3,r[1]-(e*=a)/3]]}function tc(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]]],s=0;s<t.length-1;s++){var o=t[s][3]*(e-i),a=t[s+1][2]*(e-i),h=[t[s][0],t[s][1]],u=[t[s+1][0],t[s+1][1]];if(h[0]!=u[0]){var l=$l(o,a,h,u),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],u[0],u[1]])}else n[n.length-1].push(u[0]),n[n.length-1].push(u[1])}return n.map(function(t,e){return 0===e?[Ke.EASE_OUT,t]:e===n.length-1?[Ke.EASE_IN,t]:[Ke.EASE,t]})}function ec(t){return t.compositions.forEach(function(t){t.items.forEach(function(t){t.type===De.null&&t.endBehavior===Je.destroy&&(t.endBehavior=Je.freeze)})}),t.version=me["2_1"],t}var ic=new Map,rc=new Map;function nc(t){for(var e,i=bt(t.components);!(e=i()).done;){var r=e.value;if(r.dataType===ki.ShapeComponent){var n=r;if(n.type===Ai.Custom){var s,o=n;(null==(s=o.shapes)?void 0:s.length)>0&&o.shapes[0].fill&&(o.fill=o.shapes[0].fill);for(var a,h=new Array(o.easingIns.length),u=new Array(o.easingOuts.length).fill(!1),l=bt(o.shapes);!(a=l()).done;)for(var c,f=bt(a.value.indexes);!(c=f()).done;){var d=c.value,p=o.points[d.point],m=o.easingIns[d.easingIn],v=o.easingOuts[d.easingOut];h[d.easingIn]||(m.x-=p.x,m.y-=p.y,h[d.easingIn]=!0),u[d.easingOut]||(v.x-=p.x,v.y-=p.y,u[d.easingOut]=!0)}}}}return t}function sc(t){ic.clear(),rc.clear();for(var e,i=t.compositions,r=t.items,n=bt(t.components);!(e=n()).done;){var s=e.value;ic.set(s.id,s)}for(var o,a=bt(r);!(o=a()).done;){var h=o.value;rc.set(h.id,h)}for(var u,l=bt(i);!(u=l()).done;){ac(u.value)}return t}function oc(t){var e;null==(e=t.plugins)||e.forEach(function(e,i){"richtext"===e&&(t.plugins[i]="rich-text")});for(var i,r=bt(t.items);!(i=r()).done;){var n=i.value;if(n.type===De.sprite){var s=ic.get(n.components[0].id);if(s){var o=s.renderer.shape,a=void 0;a=Number.isInteger(o)?t.shapes[o]:o,s.renderer.shape=a}}}for(var h,u=t.compositionId,l={},c=bt(t.compositions);!(h=c()).done;){var f=h.value,d=oe();l[f.id]=d,f.id===u&&(t.compositionId=d),f.id=d;var p={id:oe(),dataType:"CompositionComponent",items:f.items,timelineAsset:f.timelineAsset,sceneBindings:f.sceneBindings,startTime:f.startTime};f.timelineAsset=void 0,f.sceneBindings=void 0,f.startTime=void 0,f.components=[{id:p.id}],t.components.push(p)}for(var m,v=bt(t.items);!(m=v()).done;){var y=m.value;if(y.content){var g=y.content.options;g&&void 0!==g.refId&&(g.refId=l[g.refId])}}return t}function ac(t){for(var e,i=bt(t.items);!(e=i()).done;){var r=e.value,n=rc.get(r.id);if(!n)return;if(n.type===De.sprite||n.type===De.particle||n.type===De.spine||n.type===De.text||n.type===De.richtext||n.type===De.video||n.type===De.shape){var s=ic.get(n.components[0].id);s&&hc(s)}}}function hc(t){var e=t.renderer,i=null==e?void 0:e.maskMode;i&&i!==Tr.NONE&&(i===Tr.MASK?(t.mask={isMask:!0},Ql=t.id):i!==we.OBSCURED&&i!==we.REVERSE_OBSCURED||(t.mask={inverted:i===we.REVERSE_OBSCURED,reference:{id:Ql}}))}function uc(t){for(var e,i,r,n=function(){var t=h.value;3!==t.endBehavior&&1!==t.endBehavior||(t.endBehavior=Je.freeze),t.items=t.items.filter(function(t){return"8"!==t.type}),t.items.forEach(function(t){t.type===De.particle&&(t.content.filter&&delete t.content.filter)});for(var e,i=bt(t.items);!(e=i()).done;){var r=e.value;u[r.id]=oe(),r.oldId=r.id,r.id=u[r.id],l[r.id]=r}t.items.forEach(function(e,i){if(e.parentId)if(e.parentId.includes("^")){var r=e.parentId.split("^")[0],n=e.parentId.split("^")[1];e.parentId=u[r]+"^"+n}else e.parentId=u[e.parentId];s.items.push(e),t.items[i]={id:e.id}});var n=Ur({},t,{timelineAsset:{id:""},sceneBindings:[]});s.compositions.push(n),function(t,e,i){for(var r,n=[],s=[],o=[],a={tracks:[],id:oe(),dataType:"TimelineAsset"},h=bt(t.items);!(r=h()).done;){var u=e[r.value.id],l=[],c={id:oe(),dataType:"ActivationPlayableAsset"};o.push(c);var f={id:oe(),dataType:"ActivationTrack",children:[],clips:[{start:u.delay,duration:u.duration,endBehavior:u.endBehavior,asset:{id:c.id}}]};if(l.push({id:f.id}),s.push(f),u.type!==De.particle){var d={id:oe(),dataType:"TransformPlayableAsset",sizeOverLifetime:u.content.sizeOverLifetime,rotationOverLifetime:u.content.rotationOverLifetime,positionOverLifetime:u.content.positionOverLifetime};o.push(d);var p={id:oe(),dataType:"TransformTrack",children:[],clips:[{start:u.delay,duration:u.duration,endBehavior:u.endBehavior,asset:{id:d.id}}]};l.push({id:p.id}),s.push(p)}if(u.type===De.sprite||u.type===De.text){var m={id:oe(),dataType:"SpriteColorPlayableAsset",colorOverLifetime:u.content.colorOverLifetime};o.push(m);var v={id:oe(),dataType:"SpriteColorTrack",children:[],clips:[{start:u.delay,duration:u.duration,endBehavior:u.endBehavior,asset:{id:m.id}}]};l.push({id:v.id}),s.push(v)}if(u.type===De.composition){var y={id:oe(),dataType:"SubCompositionPlayableAsset"};o.push(y);var g={id:oe(),dataType:"SubCompositionTrack",children:[],clips:[{start:u.delay,duration:u.duration,endBehavior:u.endBehavior,asset:{id:y.id}}]};l.push({id:g.id}),s.push(g)}var b={id:oe(),dataType:"ObjectBindingTrack",children:l,clips:[]};s.push(b),a.tracks.push({id:b.id}),n.push({key:{id:b.id},value:{id:u.id}})}for(var x,_=[],E=bt(s);!(x=E()).done;){var w=x.value;_.push({id:w.id})}t.timelineAsset={id:a.id},t.sceneBindings=n,i.miscs.push(a);for(var T,S=bt(s);!(T=S()).done;){var A=T.value;i.miscs.push(A)}for(var O,C=bt(o);!(O=C()).done;){var I=O.value;i.miscs.push(I)}}(n,l,s)},s=Ur({},t,{items:[],compositions:[],components:[],materials:[],shaders:[],geometries:[],animations:[],miscs:[]}),o=bt(s.images);!(i=o()).done;){i.value.id=oe()}if(null!=(e=s).textures||(e.textures=[]),s.textures.forEach(function(t){var e;t.id=oe(),t.dataType=ki.Texture,t.source={id:null==(e=s.images[t.source])?void 0:e.id}}),s.textures.length<s.images.length)for(var a=s.textures.length;a<s.images.length;a++)s.textures.push({id:oe(),dataType:ki.Texture,source:{id:s.images[a].id},flipY:!0});t.bins&&(r=t.bins,s.bins=r.map(function(t){return{url:t.url,dataType:"BinaryAsset",id:oe()}}));for(var h,u={},l={},c=bt(t.compositions);!(h=c()).done;)n();for(var f,d=bt(s.items);!(f=d()).done;){var p=f.value;if(p.content){if(p.content.renderer&&void 0!==p.content.renderer.texture){var m=p.content.renderer.texture;p.content.renderer.texture={id:s.textures[m].id}}if(p.content.trails&&void 0!==p.content.trails.texture){var v=p.content.trails.texture;p.content.trails.texture={id:s.textures[v].id}}}if(p.transform){var y,g,b,x=[].concat(null!=(y=p.transform.position)?y:[0,0,0]),_=[].concat(null!=(g=p.transform.rotation)?g:[0,0,0]),E=[].concat(null!=(b=p.transform.scale)?b:[1,1,1]);if(Object.assign(p,{transform:{position:{x:x[0],y:x[1],z:x[2]},eulerHint:{x:_[0],y:_[1],z:_[2]},scale:{x:E[0],y:E[1],z:E[0]}}}),p.type===De.sprite&&(p.transform.size={x:E[0],y:E[1]},p.transform.scale={x:1,y:1,z:1}),p.type===De.sprite){var w=p.content;w.renderer||(w.renderer={});var T,S,A,O,C=w.renderer,I=Kl(C.anchor,C.particleOrigin),R=p.transform.size;if(!C.anchor&&void 0!==C.particleOrigin)p.transform.position.x+=-I[0]*(null!=(T=null==R?void 0:R.x)?T:1),p.transform.position.y+=-I[1]*(null!=(S=null==R?void 0:R.y)?S:1);p.transform.anchor={x:I[0]*(null!=(A=null==R?void 0:R.x)?A:1),y:I[1]*(null!=(O=null==R?void 0:R.y)?O:1)}}}if(p.type===De.particle){var P=p.content;P.renderer||(P.renderer={});var M=P.renderer;P.renderer.anchor=Kl(M.anchor,M.particleOrigin)}if(p.type===De.camera&&p.content.positionOverLifetime&&0!==Object.keys(p.content.positionOverLifetime).length&&(p.content.positionOverLifetime.asMovement=!0),void 0!==p.pn){var D=p.pn,F=t.plugins,L=void 0===F?[]:F;void 0!==D&&Number.isInteger(D)&&(p.pluginName=L[D])}switch("editor-gizmo"===p.pluginName&&(p.type="editor-gizmo"),"orientation-transformer"===p.pluginName&&(p.type="orientation-transformer"),p.content.options.target&&"editor-gizmo"===p.pluginName&&(p.content.options.target=u[p.content.options.target]),p.type===De.spine&&t.spines&&0!==t.spines.length&&cc(t.spines[p.content.options.spine],p.content,s),p.type!==De.sprite&&p.type!==De.particle&&p.type!==De.mesh&&p.type!==De.skybox&&p.type!==De.light&&"camera"!==p.type&&p.type!==De.tree&&p.type!==De.interact&&p.type!==De.camera&&p.type!==De.text&&p.type!==De.spine&&"editor-gizmo"!==p.type&&"orientation-transformer"!==p.type||(p.components=[],s.components.push(p.content),p.content.id=oe(),p.content.item={id:p.id},p.dataType=ki.VFXItemData,p.components.push({id:p.content.id})),p.type!==De.null&&p.type!==De.composition||(p.components=[],p.dataType=ki.VFXItemData),p.type){case De.sprite:p.content.dataType=ki.SpriteComponent;break;case De.particle:p.content.dataType=ki.ParticleSystem;break;case De.mesh:p.content.dataType=ki.MeshComponent;break;case De.skybox:p.content.dataType=ki.SkyboxComponent;break;case De.light:p.content.dataType=ki.LightComponent;break;case"camera":p.content.dataType=ki.CameraComponent;break;case"editor-gizmo":p.content.dataType="GizmoComponent";break;case"orientation-transformer":p.content.dataType="OrientationComponent";break;case De.tree:p.content.dataType=ki.TreeComponent;break;case De.interact:p.content.dataType=ki.InteractComponent;break;case De.camera:p.content.dataType=ki.CameraController;break;case De.text:p.content.dataType=ki.TextComponent;break;case De.spine:p.content.dataType=ki.SpineComponent}}return s.version=me["3_0"],s}function lc(t){if(t)for(var e,i=bt(Object.keys(t));!(e=i()).done;){var r=e.value,n=t[r],s=Array.isArray(n);s&&2===n.length&&Array.isArray(n[1])?t[r]="path"===r?Gl(n):Fl(n):s||"object"!=typeof n||lc(n)}}function cc(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}})}}function fc(t,e){var i,r=t.options,n=t.velocityOverLifetime||{},s={path:Gl(null==(i=t.transform)?void 0:i.path),gravity:r.gravity,gravityOverLifetime:Fl(r.gravityModifier),direction:r.direction,startSpeed:r.startSpeed,asMovement:n.asMovement,linearX:Fl(n.linearX),linearY:Fl(n.linearY),linearZ:Fl(n.linearZ),asRotation:n.asRotation,orbCenter:n.orbCenter,orbitalX:Fl(n.orbitalX),orbitalY:Fl(n.orbitalY),orbitalZ:Fl(n.orbitalZ),speedOverLifetime:Fl(n.speedOverLifetime)};Hl(s);var o={options:{startColor:kl(r.startColor)},positionOverLifetime:s};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 a=t.rotationOverLifetime;if(a){var h=o.rotationOverLifetime={separateAxes:a.separateAxes,asRotation:a.asRotation};h.separateAxes?(h.x=Fl(a.x),h.y=Fl(a.y),h.z=Fl(a.z)):h.z=Fl(a.angularVelocity)}var u=t.colorOverLifetime;if(u){var l=o.colorOverLifetime={opacity:Fl(u.opacity)};u.color&&(l.color=Vl(u.color))}var c=t.sizeOverLifetime;return c&&(o.sizeOverLifetime={separateAxes:c.separateAxes,size:Fl(c.size),x:Fl(c.x),y:Fl(c.y),z:Fl(c.z)}),o}var dc="2.5.3",pc=/^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/,mc=/^(\d+)\.(\d+)$/,vc=!1;function yc(t){if(!t||"object"!=typeof t)throw new Error("Invalid input: Expected a JSON object.");var e,i;(function(t){var e=t.playerVersion||{},i=e.web,r=void 0===i?"":i;if(r){var n,s,o=null!=(n=pc.exec(r))?n:[],a=null!=(s=pc.exec(dc))?s:[],h=o[1],u=o[2],l=a[1],c=a[2];return Number(l)<Number(h)||Number(l)===Number(h)&&Number(c)<Number(u)}return!1})(t)&&console.warn("The JSON need higher than "+(null==(e=t.playerVersion)?void 0:e.web)+" runtime version(current: "+dc+"). Some features may not work as expected.");if(function(t){var e,i=null==(e=t.version)?void 0:e.split(".");!i||Number(i[0])>2||2===Number(i[0])&&Number(i[1])>=2||t.compositions.forEach(function(t){t.items.forEach(function(t){t.type!==De.mesh&&t.type!==De.light||(t.endBehavior=1===t.endBehavior?Je.destroy:t.endBehavior)})})}(t),pc.test(t.version))return vc="0"===(null==(i=/^(\d+)/.exec(t.version))?void 0:i[0]),oc(sc(nc(uc(ec(function(t){var e;gc=me["1_0"];var i=t.plugins||[];(null==(e=t.bins)?void 0:e.length)&&(gc=me["1_3"]);var r,n=(t.requires||[]).slice(),s=t.images.map(function(e,i){return function(t,e,i){var r=i[e];if("string"==typeof t)return{id:oe(),renderLevel:r,url:t};if(t.template)return{id:oe(),url:t.url,template:t.template,webp:t.webp,renderLevel:r};if(t.compressed)return{id:oe(),url:t.url,compressed:{astc:t.compressed.android,pvrtc:t.compressed.iOS},webp:t.webp,renderLevel:r};if(t.url)return{id:oe(),url:t.url,webp:t.webp,renderLevel:r};if(t&&t.sourceType)return t;throw new Error("Invalid image type.")}(e,i,t.imageTags||[])}),o=t.textures||s.map(function(t,e){return{source:e,flipY:!0}}),a={plugins:i,shapes:t.shapes||[],type:"ge",version:gc,playerVersion:null!=(r=t.playerVersion)?r:{web:"",native:""},compositionId:t.compositionId+"",compositions:t.compositions.map(function(t){return function(t,e){void 0===e&&(e={});var i,r={id:t.id+"",camera:Ur({clipMode:0},t.camera),duration:t.duration,endBehavior:t.endBehavior,items:t.items.map(function(t){return function(t,e){void 0===e&&(e={});var i,r,n,s,o,a,h,u=De.base,l=t.endBehavior,c=NaN;t.content?(u=t.type||De.plugin,h=t.pn,a=t.pluginName,s=t.content,n=t.content,isNaN(h)&&!a&&(a=s.options.type),t.duration&&(c=t.duration),r=t.transform||y(n.transform)):t.particle?(u=De.particle,r=y((n=t.particle).transform,vc,!0),s=function(t){var e=t.options,i=t.transform,r={type:Se.NONE};if(t.shape){var n,s=null==(n=t.shape.shape)?void 0:n.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,"");if(r=Ur({},t.shape,{type:Se[s]}),t.shape.upDirection){var o=t.shape.upDirection,a=o[0],h=o[1],u=o[2];0===a&&0===h&&0===u&&delete r.upDirection}}e.startTurbulence&&(r.turbulenceX=Bl(e.turbulenceX),r.turbulenceY=Bl(e.turbulenceY),r.turbulenceZ=Bl(e.turbulenceZ));var l=t.emission;l.bursts&&l.bursts.length>0&&(l.bursts=l.bursts.map(function(t){return jl(t)})),l.burstOffsets&&l.burstOffsets.length>0&&(l.burstOffsets=l.burstOffsets.map(function(t){return jl(t)})),l.rateOverTime&&(l.rateOverTime=Bl(l.rateOverTime));var c={renderer:t.renderer,shape:r,splits:t.splits,emission:l,options:{startLifetime:Bl(e.startLifetime),start3DSize:!!e.start3DSize,startSize:Bl(e.startSize),startSizeX:Bl(e.startSizeX),startSizeY:Bl(e.startSizeY),sizeAspect:Bl(e.sizeAspect),maxCount:e.maxCount,startDelay:Bl(e.startDelay),startColor:Nl(e.startColor,!0),startRotationZ:Bl(e.startRotation||e.startRotationZ),particleFollowParent:e.particleFollowParent}};e.start3DRotation&&(c.options.startRotationX=Bl(e.startRotationX),c.options.startRotationY=Bl(e.startRotationY)),i&&i.path&&(c.emitterTransform={path:Gl(i.path)});var f=t.sizeOverLifetime;f&&(f.separateAxes?c.sizeOverLifetime={separateAxes:!0,x:Bl(f.x),y:Bl(f.y)}:c.sizeOverLifetime={size:Bl(f.size)});var d=t.velocityOverLifetime||{},p=d.speedOverLifetime;p=p?Fl(p):void 0,c.positionOverLifetime={gravity:e.gravity,gravityOverLifetime:Fl(e.gravityModifier),startSpeed:Bl(e.startSpeed),speedOverLifetime:p,asMovement:d.asMovement,linearX:Bl(d.linearX),linearY:Bl(d.linearY),linearZ:Bl(d.linearZ),asRotation:d.asRotation,orbCenter:d.orbCenter,orbitalX:Bl(d.orbitalX),orbitalY:Bl(d.orbitalY),orbitalZ:Bl(d.orbitalZ),forceTarget:d.forceTarget,target:d.target,forceCurve:Fl(d.forceCurve)},Hl(c.positionOverLifetime);var m=t.rotationOverLifetime;m&&(c.rotationOverLifetime={separateAxes:m.separateAxes,asRotation:m.asRotation,z:Bl(m.separateAxes?m.z:m.angularVelocity)},m.separateAxes&&(c.rotationOverLifetime.y=Fl(m.y),c.rotationOverLifetime.x=Fl(m.x)));var v=t.colorOverLifetime;if(v){var y=c.colorOverLifetime={opacity:Fl(v.opacity)};v.color&&(y.color=Vl(v.color))}var g=t.textureSheetAnimation;g&&(c.textureSheetAnimation={row:g.row,col:g.col,total:g.total,animate:g.animate,cycles:Fl(g.cycles),animationDelay:Ll(g.animationDelay,0),animationDuration:Ll(g.animationDuration,0)});var b=t.trails;b&&(c.trails={lifetime:Bl(b.lifetime),dieWithParticles:b.dieWithParticles,maxPointPerTrail:b.maxPointPerTrail,minimumVertexDistance:b.minimumVertexDistance,widthOverTrail:Fl(b.widthOverTrail),colorOverTrail:b.colorOverTrail&&Vl(b.colorOverTrail,!1),blending:b.blending,colorOverLifetime:b.colorOverLifetime&&Vl(b.colorOverLifetime,!1),inheritParticleColor:b.inheritParticleColor,occlusion:b.occlusion,transparentOcclusion:b.transparentOcclusion,orderOffset:b.orderOffset,sizeAffectsLifetime:b.sizeAffectsLifetime,sizeAffectsWidth:b.sizeAffectsWidth,texture:b.texture,parentAffectsPosition:b.parentAffectsPosition,opacityOverLifetime:Bl(b.opacityOverLifetime)}),c.trails&&Hl(c.trails);var x=t.interaction;return x&&(c.interaction={behavior:x.behavior,radius:x.radius,multiple:x.multiple}),c}(n)):t.sprite?(u=De.sprite,s=function(t,e){var i=fc(t,e),r=t.textureSheetAnimation;return r&&(i.textureSheetAnimation={row:r.row,col:r.col,total:r.total||void 0,animate:r.animate}),i.renderer=t.renderer,t.splits&&(i.splits=t.splits),t.interaction&&(i.interaction=t.interaction),i}(n=t.sprite,r=y(n.transform,!1,!0))):t.cal?(u=De.null,s=fc(n=t.cal,r=y(n.transform,!1,!0))):t.ui?(u=De.interact,r=y((n=t.ui).transform),s=function(t){var e,i=t.options;switch(i.type){case"click":e={type:Ie.CLICK,showPreview:i.showPreview,previewColor:i.previewColor&&kl(i.previewColor),behavior:i.behavior||Pe.NOTIFY};break;case"drag":e={type:Ie.DRAG,enableInEditor:!!i.enableInEditor,dxRange:i.dxRange,dyRange:i.dyRange,target:i.target};break;case"message":e={type:Ie.MESSAGE}}return{options:e}}(n),r.scale=[n.options.width||1,n.options.height||1,1]):t.model&&(n=t.model,1===t.model.options.type&&(u=De.camera,r=y(n.transform),s=function(t){var e,i=t.options,r={options:{fov:i.fov,far:i.far,near:i.near,clipMode:i.clipMode}},n=t.velocityOverLifetime;if(n||(null==(e=t.transform)?void 0:e.path)){var s,o={path:Gl(null==(s=t.transform)?void 0:s.path),linearX:Fl(null==n?void 0:n.translateX),linearY:Fl(null==n?void 0:n.translateY),linearZ:Fl(null==n?void 0:n.translateZ)};Hl(o),r.positionOverLifetime=o}var a=t.rotationOverLifetime;if(a){var h={separateAxes:a.separateAxes,x:Fl(null==a?void 0:a.rotateX),y:Fl(null==a?void 0:a.rotateY),z:a.separateAxes?Fl(null==a?void 0:a.rotateZ):Fl(a.rotation)};Hl(h),r.rotationOverLifetime=h}return r}(n)));if(null==(i=s.renderer)?void 0:i.anchor){var f=new Float32Array(s.renderer.anchor);f[0]==_c&&f[1]==_c?delete s.renderer.anchor:e.requires&&Dl(e.requires,"anchor")}if(n){var d,p,m=null==(d=n.options)?void 0:d.looping;if(m)l=Array.isArray(m)?m[1]?Je.restart:Je.destroy:Je.restart;else l=l||(null==n||null==(p=n.options)?void 0:p.endBehavior)||Je.destroy;n.options.renderLevel&&(o=n.options.renderLevel),isNaN(c)&&(c=n.options.duration)}var v={type:u,name:t.name,delay:t.delay,duration:c,id:t.id+"",transform:r,endBehavior:l,renderLevel:o,content:s};a?e.plugins?(Dl(e.plugins,a),v.pn=e.plugins.indexOf(a)):v.pluginName=a:Number.isInteger(h)&&(v.pn=h);t.parentId&&(v.parentId=t.parentId+"");return v;function y(t,e,i){if(t){var r={},n=t.rotation;if(n&&(r.rotation=e?[-n[0],-n[1],-n[2]]:[n[0],n[1],n[2]],i)){var s=function(t,e,i,r){var n=Wl(e*ql/2),s=Wl(i*ql/2),o=Wl(r*ql/2),a=Yl(e*ql/2),h=Yl(i*ql/2),u=Yl(r*ql/2);return t[0]=a*s*o+n*h*u,t[1]=n*h*o-a*s*u,t[2]=n*s*u+a*h*o,t[3]=n*s*o-a*h*u,t}(xc,r.rotation[0],r.rotation[1],r.rotation[2]);r.rotation=function(t,e){var i,r,n,s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,l=o+o,c=a+a,f=s*u,d=o*u,p=o*l,m=a*c,v=h*c,y=1-p-m,g=d-v,b=d+v,x=1-f-m,_=a*u-h*l,E=a*l+h*u,w=1-f-p;return t[1]=Math.asin((r=-1,(i=-_)>(n=1)?n:i<r?r:i))*Zl,Math.abs(_)<.9999999?(t[0]=Math.atan2(E,w)*Zl,t[2]=Math.atan2(b,y)*Zl):(t[0]=0,t[2]=Math.atan2(-g,x)*Zl),t}([],s)}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{}}}(t,e)}),name:t.name},n=t.startTime||t.st;n&&(r.startTime=n);var s=null==(i=t.meta)?void 0:i.previewSize;s&&s[0]===s[1]&&0===s[0]&&(s=void 0);s&&(r.previewSize=s);return r}(t,{plugins:i,requires:n})}),images:s,imgUsage:t._imgs,binUsage:t.binUsage,spines:t.spines,requires:t.requires,textures:o,bins:(t.bins||[]).slice()};t._textures&&(a._textures=t._textures);return a}(t))))));vc=!1;var r=mc.exec(t.version)||[],n=Number(r[1]),s=Number(r[2]);if(n)return(n<2||2===n&&s<4)&&(t=function(t){return t.compositions.map(function(t){for(var e,i=bt(t.items);!(e=i()).done;)lc(e.value.content)}),t}(t)),n<3&&(t=uc(ec(t))),r=mc.exec(t.version)||[],n=Number(r[1]),s=Number(r[2]),n<4&&(s<2&&(t=nc(t)),s<3&&(t=sc(t)),s<4&&(t=oc(t))),t;throw new Error("Invalid JSON version: "+t.version+".")}var gc=me["1_0"];var bc,xc=[0,0,0,1],_c=.5;var Ec,wc,Tc=((bc={})[ye.S]=[ye.S,ye.BPlus,ye.APlus],bc[ye.A]=[ye.A,ye.BPlus,ye.APlus],bc[ye.B]=[ye.B,ye.BPlus],bc);function Sc(t,e){if(!t||!e)return!0;var i=Tc[e];return!!i&&i.includes(t)}function Ac(t,e){var i,r,n=null!=(r=null==t?void 0:t.background)?r:{},s=n.name,o=n.url;return s&&(e&&e[s]?i=e[s]:o&&(i=o)),i}function Oc(t,e,i){return Cc.apply(this,arguments)}function Cc(){return(Cc=yt(function(t,e,i){var r,n;return wt(this,function(s){switch(s.label){case 0:return"string"!=typeof t?[3,2]:[4,Yr(t)];case 1:return r=s.sent(),[3,3];case 2:r=t,s.label=3;case 3:if(!r)throw new Error("Image not provided.");if(!e)return[2,r];if(n=Ac(e,i)){if($t(n)&&n!==r.src)return[2,Yr(n)];if(xt(n,HTMLImageElement))return[2,n]}return[2,r]}})})).apply(this,arguments)}(wc=Ec||(Ec={})).isJSONObject=function(t){return ie(t)&&"jsonScene"in t},wc.isURL=function(t){return ie(t)&&"url"in t},wc.isWithOptions=function(t){return ie(t)&&"options"in t};var Ic=1,Rc=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=new zr),this.options=t,this.downloader=e,this.assets={},this.sourceFrom={},this.id=Ic++,this.timers=[],this.updateOptions(t)}var e=t.prototype;return e.updateOptions=function(t){void 0===t&&(t={}),this.options=t,t.pluginData||(t.pluginData={});var e=t.timeout,i=void 0===e?10:e;this.timeout=i},e.loadScene=function(t,e,i){var r=this;return yt(function(){var n,s,o,a,h,u,l,c,f,d,p,m,v;return wt(this,function(y){return s=$t(t)?t:r.id,o=performance.now(),a=[],h=null==e?void 0:e.engine.gpuCapability,l=null!=(u=null==h?void 0:h.detail.compressedTexture)?u:ps.NONE,c={},d=!1,p=new Promise(function(t,e){f=window.setTimeout(function(){d=!0,r.removeTimer(f);var t=performance.now()-o;e(new Error("Load time out: totalTime: "+t.toFixed(4)+"ms "+a.join(" ")+", url: "+s+"."))},1e3*r.timeout),r.timers.push(f)}),m=yt(function(t,e){var i,r,n,s;return wt(this,function(o){switch(o.label){case 0:if(d)return[3,4];i=performance.now(),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e()];case 2:return r=o.sent(),n=performance.now()-i,a.push("["+t+": "+n.toFixed(2)+"]"),c[t]=n,[2,r];case 3:throw s=o.sent(),new Error("Load error in "+t+", "+s+".");case 4:throw new Error("Load canceled.")}})}),v=yt(function(){var e,h,u,d,p,v,y,g,b,x,_,E,w,T;return wt(this,function(S){switch(S.label){case 0:return $t(t)?(h=new URL(t,location.href).href,r.baseUrl=h,[4,m("loadJSON",function(){return r.loadJSON(h)})]):[3,2];case 1:return n=S.sent(),[3,3];case 2:n=t,r.baseUrl=location.href,S.label=3;case 3:return Ec.isJSONObject(n)?(e=Ur({},n),[3,9]):[3,4];case 4:return[4,m("processJSON",function(){return r.processJSON(n)})];case 5:return u=S.sent(),d=u.jsonScene,p=u.pluginSystem,v=d.bins,y=void 0===v?[]:v,g=d.images,b=d.fonts,[4,Promise.all([m("processBins",function(){return r.processBins(y)}),m("processImages",function(){return r.processImages(g,l)}),m("plugin:processAssets",function(){return r.processPluginAssets(d,p,i)}),m("processFontURL",function(){return r.processFontURL(b)})])];case 6:return x=S.sent(),_=x[0],E=x[1],[4,m("processTextures",function(){return r.processTextures(E,_,d)})];case 7:return w=S.sent(),e={timeInfos:c,url:t,renderLevel:r.options.renderLevel,storage:{},pluginSystem:p,jsonScene:d,bins:_,textureOptions:w,textures:[],images:E,assets:r.assets},[4,m("plugin:prepareResource",function(){return p.loadResources(e,r.options)})];case 8:S.sent(),S.label=9;case 9:return T=performance.now()-o,Qt.info("Load asset: totalTime: "+T.toFixed(4)+"ms "+a.join(" ")+", url: "+s+"."),window.clearTimeout(f),r.removeTimer(f),e.totalTime=T,e.startTime=o,e.timeInfos=c,[2,e]}})}),[2,Promise.race([p,v()])]})})()},e.getAssets=function(){return this.assets},e.processJSON=function(t){var e=this;return yt(function(){var i,r,n;return wt(this,function(s){switch(s.label){case 0:return i=yc(t),r=i.plugins,[4,(n=new fe(void 0===r?[]:r)).processRawJSON(i,e.options)];case 1:return s.sent(),[2,{jsonScene:i,pluginSystem:n}]}})})()},e.processBins=function(t){var e=this;return yt(function(){var i,r,n;return wt(this,function(s){return i=e.options.renderLevel,r=e.baseUrl,n=t.map(function(n){if(xt(n,ArrayBuffer))return n;if(Sc(n.renderLevel,i))return e.loadBins(new URL(n.url,r).href);throw new Error("Invalid bins source: "+JSON.stringify(t)+".")}),[2,Promise.all(n)]})})()},e.processFontURL=function(e){var i=this;return yt(function(){var r;return wt(this,function(n){return e?(r=e.map(yt(function(e){var r,n,s;return wt(this,function(o){switch(o.label){case 0:if(!e.fontURL||t.fontCache.has(e.fontFamily))return[3,4];Wt(e.fontFamily)||console.warn("Risky font family: "+e.fontFamily+"."),o.label=1;case 1:return o.trys.push([1,3,,4]),r=new URL(e.fontURL,i.baseUrl).href,[4,(s=new FontFace(null!=(n=e.fontFamily)?n:"","url("+r+")")).load()];case 2:return o.sent(),document.fonts.add(s),t.fontCache.add(e.fontFamily),[3,4];case 3:return o.sent(),Qt.warn("Invalid font family or font source: "+JSON.stringify(e.fontURL)+"."),[3,4];case 4:return[2]}})})),[2,Promise.all(r)]):[2]})})()},e.processImages=function(t,e){void 0===e&&(e=0);var i=this;return yt(function(){var r,n,s,o,a,h,u,l;return wt(this,function(c){switch(c.label){case 0:return r=i.options,n=r.useCompressedTexture,s=r.variables,o=r.disableWebP,a=r.disableAVIF,h=i.baseUrl,u=t.map(yt(function(t,r){var u,l,c,f,d,p,m,v,y,g,b,x,_,E,w,T,S,A,O,C,I;return wt(this,function(r){switch(r.label){case 0:if(u=t.url,l=t.webp,c=t.avif,f=new URL(u,h).href,d=!o&&l?new URL(l,h).href:void 0,p=!a&&c?new URL(c,h).href:void 0,m=t.id,!("template"in t))return[3,8];if(v=t.template,!(y=v.background))return[3,7];g=Ac(v,s),b=y.type===Mi.video,x=y&&b?Qr:Yr,r.label=1;case 1:return r.trys.push([1,6,,7]),[4,$r(g,x)];case 2:return xt(_=r.sent(),HTMLVideoElement)?(i.sourceFrom[m]={url:_.src,type:Cr.video},[2,_]):[3,3];case 3:return y&&Array.isArray(g)&&s&&(s[y.name]=_.src),i.sourceFrom[m]={url:_.src,type:Cr.image},[4,Oc(_,v,s)];case 4:return[2,r.sent()];case 5:return[3,7];case 6:throw E=r.sent(),new Error("Failed to load. Check the template or if the URL is "+(b?"video":"image")+" type, URL: "+g+", Error: "+(E.message||E)+".");case 7:return[3,9];case 8:if("compressed"in t&&n&&e){if(w=t.compressed,e===ps.ASTC?T=w.astc:e===ps.PVRTC&&(T=w.pvrtc),T)return S=new URL(T,h).href,i.sourceFrom[m]={url:S,type:Cr.compressed},[2,i.loadBins(S)]}else if(xt(t,HTMLImageElement)||xt(t,HTMLCanvasElement)||xt(t,HTMLVideoElement)||xt(t,an))return[2,t];r.label=9;case 9:return p?[4,Xr(f,p)]:[3,11];case 10:return I=r.sent(),[3,13];case 11:return[4,jr(f,d)];case 12:I=r.sent(),r.label=13;case 13:return O=(A=I).url,C=A.image,i.sourceFrom[m]={url:O,type:Cr.image},[2,C]}})})),[4,Promise.all(u)];case 1:return l=c.sent(),i.assignImagesToAssets(t,l),[2,l]}})})()},e.processPluginAssets=function(t,e,i){var r=this;return yt(function(){var n,s,o,a,h;return wt(this,function(u){switch(u.label){case 0:return[4,e.processAssets(t,i)];case 1:for(n=u.sent(),s=n.reduce(function(t,e){return t.assets=t.assets.concat(e.assets),t.loadedAssets=t.loadedAssets.concat(e.loadedAssets),t},{assets:[],loadedAssets:[]}),o=s.assets,a=s.loadedAssets,h=0;h<o.length;h++)r.assets[o[h].id]=a[h];return[2]}})})()},e.processTextures=function(t,e,i){var r=this;return yt(function(){var n,s,o;return wt(this,function(a){return s=null!=(n=i.textures)?n:t.map(function(t,e){return{source:e}}),o=s.map(yt(function(t,n){var s,o,a,h,u,l;return wt(this,function(c){switch(c.label){case 0:if(xt(t,an))return[2,t];if(!("mipmaps"in t))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,en(t,e,r.assets,i.bins)];case 2:return[2,c.sent()];case 3:throw s=c.sent(),new Error("Load texture "+n+" fails, error message: "+s+".");case 4:return o=t.source,a=t.id,u="",ie(o)?(h=r.assets[o.id],u=o.id,[3,7]):[3,5];case 5:return"string"!=typeof o?[3,7]:[4,Yr(ae(o))];case 6:h=c.sent(),c.label=7;case 7:if(h)return l=function(t,e,i){var r={id:i,dataType:ki.Texture};if(xt(t,an))return Ur({},t.source,r);if(xt(t,HTMLImageElement)||re(t))return Ur({image:t,sourceType:Cr.image,sourceFrom:e,keepImageSource:!0,minFilter:Pr.LINEAR,magFilter:Pr.LINEAR},r);if(xt(t,HTMLVideoElement))return Ur({sourceType:Cr.video,video:t,minFilter:Pr.LINEAR,magFilter:Pr.LINEAR},r);if(xt(t,ArrayBuffer))return Ur({},dn(t),{sourceFrom:e},r);if("width"in t&&"height"in t&&"data"in t)return Ur({sourceType:Cr.data,data:t,wrapS:Pr.CLAMP_TO_EDGE,wrapT:Pr.CLAMP_TO_EDGE,minFilter:Pr.NEAREST,magFilter:Pr.NEAREST},r);throw new Error("Invalid texture options.")}(h,r.sourceFrom[u],a),[2,l.sourceType===Cr.compressed?l:Ur({},l,t)];throw new Error("Invalid texture source: "+o+".")}})})),[2,Promise.all(o)]})})()},e.loadJSON=function(t){var e=this;return yt(function(){return wt(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)})})]})})()},e.loadBins=function(t){var e=this;return yt(function(){return wt(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)})})]})})()},e.assignImagesToAssets=function(t,e){for(var i=0;i<t.length;i++)this.assets[t[i].id]=e[i]},e.removeTimer=function(t){var e=this.timers.indexOf(t);-1!==e&&this.timers.splice(e,1)},e.dispose=function(){this.timers.length&&this.timers.map(function(t){return window.clearTimeout(t)}),this.assets={},this.sourceFrom={},this.timers=[]},t}();Rc.fontCache=new Set;var Pc,Mc,Dc=function(){function t(t){this.engine=t,this.builtinObjects=[],this.builtinObjects.push(ln(t))}var e=t.prototype;return e.assembleSceneLoadOptions=function(t,e){void 0===e&&(e={});var i=t;return Ec.isURL(t)&&(Ec.isJSONObject(t)||(i=t.url),Ec.isWithOptions(t)&&(e=Ur({},e,t.options))),{source:i,options:e}},e.updateTextVariables=function(t,e){var i=this;void 0===e&&(e={}),t.jsonScene.items.forEach(function(t){if(t.type===De.text||t.type===De.richtext){var r=e[t.name];if(!r)return;t.components.forEach(function(t){var e=t.id,n=i.engine.findEffectsObjectData(e);(null==n?void 0:n.dataType)!==ki.TextComponent&&(null==n?void 0:n.dataType)!==ki.RichTextComponent||(n.options.text=r)})}})},e.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()},e.prepareAssets=function(t,e){this.engine.clearResources();for(var i,r=bt(Object.keys(e));!(i=r()).done;){var n=i.value,s=e[n],o=new Il(this.engine);o.data=s,o.setInstanceId(n)}this.engine.addPackageDatas(t);for(var a,h=bt(this.builtinObjects);!(a=h()).done;){var u=a.value;this.engine.addInstance(u)}},e.createShaderVariant=function(){for(var t,e=bt(Object.keys(this.engine.objectInstance));!(t=e()).done;){var i=t.value,r=this.engine.objectInstance[i];xt(r,Tn)&&r.createShaderVariant()}},e.destroyBuiltinObjects=function(){for(var t,e=bt(this.builtinObjects);!(t=e()).done;){t.value.dispose()}this.builtinObjects.length=0},e.dispose=function(){this.destroyBuiltinObjects()},t}(),Fc=new Int32Array(2),Lc=new Float32Array(Fc.buffer),kc=new Float64Array(Fc.buffer),Nc=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];(Mc=Pc||(Pc={}))[Mc.UTF8_BYTES=1]="UTF8_BYTES",Mc[Mc.UTF16_STRING=2]="UTF16_STRING";var Bc=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 Fc[0]=this.readInt32(t),Lc[0]},e.readFloat64=function(t){return Fc[Nc?0:1]=this.readInt32(t),Fc[Nc?1:0]=this.readInt32(t+4),kc[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){Lc[0]=e,this.writeInt32(t,Fc[0])},e.writeFloat64=function(t,e){kc[0]=e,this.writeInt32(t,Fc[Nc?0:1]),this.writeInt32(t+4,Fc[Nc?1:0])},e.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+4+4)throw new 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===Pc.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 new 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}(),Uc=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=Bc.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=1+~(this.bb.capacity()-this.space+i)&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 new TypeError("FlatBuffers: struct must be serialized inline.")},e.notNested=function(){if(this.isNested)throw new 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 new 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=2*(i+2);this.addInt16(r);var n=0,s=this.space;t:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(o)){for(var a=2;a<r;a+=2)if(this.bb.readInt16(s+a)!=this.bb.readInt16(o+a))continue t;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){var n=e;if(this.prep(this.minalign,8+r),4!=n.length)throw new TypeError("FlatBuffers: file identifier must be length 4");for(var s=3;s>=0;s--)this.writeInt8(n.charCodeAt(s))}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 new 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){return null==t?0:(e=xt(t,Uint8Array)?t: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());var e},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)throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");e.push(this.createObjectOffset(r))}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 new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,r=Bc.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r},t}(),zc=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 Vc(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}(),Vc=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=zc.createDataVector(t,this.data);return zc.createFBEffectsObjectData(t,e,i)},t}(),Gc=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 zc).__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 jc(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}(),jc=function(){function t(t){void 0===t&&(t=[]),this.exportObjects=t}return t.prototype.pack=function(t){var e=Gc.createExportObjectsVector(t,t.createObjectOffsetList(this.exportObjects));return Gc.createFBEffectsPackageData(t,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.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 Xc(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}(),Xc=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 Hc.createFBSubMesh(t,this.offset,this.indexCount,this.vertexCount)},t}(),Wc=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 Yc(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,s,o){return t.startFBVertexChannel(e),t.addSemantic(e,i),t.addOffset(e,r),t.addFormat(e,n),t.addDimension(e,s),t.addNormalize(e,o),t.endFBVertexChannel(e)},t}(),Yc=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 Wc.createFBVertexChannel(t,e,this.offset,this.format,this.dimension,this.normalize)},t}(),qc=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 Wc).__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 Zc(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}(),Zc=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=qc.createChannelsVector(t,t.createObjectOffsetList(this.channels));return qc.createFBVertexData(t,this.vertexCount,e)},t}(),Kc=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 qc).__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 Hc).__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 Qc(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}(),Qc=function(){function t(t,e,i,r,n,s,o,a,h,u,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===s&&(s=[]),void 0===o&&(o=0),void 0===a&&(a=null),void 0===h&&(h=[]),void 0===u&&(u=[]),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=s,this.mode=o,this.buffer=a,this.binaryData=h,this.boneNames=u,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=Kc.createSubMeshesVector(t,t.createObjectOffsetList(this.subMeshes)),s=null!==this.buffer?t.createString(this.buffer):0,o=Kc.createBinaryDataVector(t,this.binaryData),a=Kc.createBoneNamesVector(t,t.createObjectOffsetList(this.boneNames)),h=null!==this.rootBoneName?t.createString(this.rootBoneName):0,u=Kc.createInverseBindMatricesVector(t,this.inverseBindMatrices);return Kc.startFBGeometryData(t),Kc.addId(t,e),Kc.addName(t,i),Kc.addVertexData(t,r),Kc.addIndexFormat(t,this.indexFormat),Kc.addIndexOffset(t,this.indexOffset),Kc.addSubMeshes(t,n),Kc.addMode(t,this.mode),Kc.addBuffer(t,s),Kc.addBinaryData(t,o),Kc.addBoneNames(t,a),Kc.addRootBoneName(t,h),Kc.addInverseBindMatrices(t,u),Kc.endFBGeometryData(t)},t}(),Jc=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 Uc(1),i=new jc,r=[],n=bt(this.exportObjectDatas);!(t=n()).done;){var s=t.value,o=void 0;s.dataType===ki.Geometry&&(o=new Vc("Geometry",this.geometryDataToBinary(s))),o&&r.push(o)}return i.exportObjects=r,Gc.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.deserializeFromBinary=function(t){for(var e=new Bc(t),i=Gc.getRootAsFBEffectsPackageData(e),r=0;r<i.exportObjectsLength();r++){var n=i.exportObjects(r);if(n){var s=n.dataArray(),o=n.dataType();if(s){var a=void 0;o===ki.Geometry&&(a=this.binaryToGeometryData(s)),a&&this.exportObjectDatas.push(a)}}}},e.geometryDataToBinary=function(t){var e=new Uc(1),i=new Qc,r=t.indexFormat,n=t.indexOffset,s=t.mode,o=t.id,a=t.vertexData,h=t.boneNames,u=void 0===h?[]:h,l=t.rootBoneName,c=void 0===l?"":l,f=t.inverseBindMatrices,d=void 0===f?[]:f,p=t.binaryData,m=void 0===p?[]:p;i.indexFormat=r,i.indexOffset=n,i.mode=s,i.id=o,i.boneNames=u,i.rootBoneName=c,i.inverseBindMatrices=d,i.binaryData=m;var v=new Zc;v.vertexCount=a.vertexCount,v.channels=[];for(var y,g=bt(a.channels);!(y=g()).done;){var b=y.value,x=b.semantic,_=b.offset,E=b.format,w=b.dimension,T=b.normalize,S=new Yc(x,_,E,w,T);v.channels.push(S)}i.vertexData=v;for(var A,O=[],C=bt(t.subMeshes);!(A=C()).done;){var I=A.value,R=I.offset,P=I.indexCount,M=I.vertexCount,D=new Xc(R,P,M);O.push(D)}return i.subMeshes=O,Gc.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.binaryToGeometryData=function(t){var e=new Bc(t),i=Kc.getRootAsFBGeometryData(e),r={vertexCount:0,channels:[]},n=i.vertexData();if(n){r.vertexCount=n.vertexCount();for(var s=0;s<n.channelsLength();s++){var o=n.channels(s);if(o){var a,h={semantic:null!=(a=o.semantic())?a:"",offset:o.offset(),format:o.format(),dimension:o.dimension(),normalize:o.normalize()};r.channels.push(h)}}}for(var u=[],l=0;l<i.subMeshesLength();l++){var c=i.subMeshes(l);if(c){var f={offset:c.offset(),vertexCount:c.vertexCount(),indexCount:c.indexCount()};u.push(f)}}for(var d=[],p=0;p<i.boneNamesLength();p++){var m=i.boneNames(p);d.push(m)}var v,y,g,b,x=i.inverseBindMatricesArray();return{vertexData:r,indexFormat:i.indexFormat(),indexOffset:i.indexOffset(),subMeshes:u,mode:i.mode(),buffer:null!=(v=i.buffer())?v:"",boneNames:d,rootBoneName:null!=(y=i.rootBoneName())?y:"",inverseBindMatrices:x?Array.from(x):void 0,binaryData:null!=(g=i.binaryDataArray())?g:void 0,id:null!=(b=i.id())?b:"",dataType:ki.Geometry}},t}(),$c=function(){function t(){this.renderErrors=new Set,this.destroyed=!1,this.textures=[],this.materials=[],this.geometries=[],this.meshes=[],this.renderPasses=[],this.jsonSceneData={},this.objectInstance={},this.assetLoader=new Ml(this),this.emptyTexture=ln(this),this.transparentTexture=cn(this)}var e=t.prototype;return e.clearResources=function(){this.jsonSceneData={},this.objectInstance={}},e.addEffectsObjectData=function(t){this.jsonSceneData[t.id]=t},e.findEffectsObjectData=function(t){return this.jsonSceneData[t]},e.addInstance=function(t){this.objectInstance[t.getInstanceId()]=t},e.findObject=function(t){return ie(t)&&t.constructor===Object?this.objectInstance[t.id]?this.objectInstance[t.id]:this.assetLoader.loadGUID(t):t},e.removeInstance=function(t){delete this.objectInstance[t]},e.addPackageDatas=function(t){for(var e,i=t.jsonScene,r=t.textureOptions,n=void 0===r?[]:r,s=i.items,o=void 0===s?[]:s,a=i.materials,h=void 0===a?[]:a,u=i.shaders,l=void 0===u?[]:u,c=i.geometries,f=void 0===c?[]:c,d=i.components,p=void 0===d?[]:d,m=i.animations,v=void 0===m?[]:m,y=i.bins,g=void 0===y?[]:y,b=i.miscs,x=void 0===b?[]:b,_=bt(i.compositions);!(e=_()).done;){var E=e.value;this.addEffectsObjectData(E)}for(var w,T=bt(o);!(w=T()).done;){var S=w.value;Sc(S.renderLevel,t.renderLevel)||(S.components=[],S.type=De.null),this.addEffectsObjectData(S)}for(var A,O=bt(h);!(A=O()).done;){var C=A.value;this.addEffectsObjectData(C)}for(var I,R=bt(l);!(I=R()).done;){var P=I.value;this.addEffectsObjectData(P)}for(var M,D=bt(f);!(M=D()).done;){var F=M.value;this.addEffectsObjectData(F)}for(var L,k=bt(p);!(L=k()).done;){var N=L.value;this.addEffectsObjectData(N)}for(var B,U=bt(v);!(B=U()).done;){var z=B.value;this.addEffectsObjectData(z)}for(var V,G=bt(x);!(V=G()).done;){var j=V.value;this.addEffectsObjectData(j)}for(var H=0;H<g.length;H++){var X=g[H],W=t.bins[H];if(X.dataType===ki.BinaryAsset)X.buffer=W,X.id&&this.addEffectsObjectData(X);else{var Y=new Jc;Y.deserializeFromBinary(new Uint8Array(W));for(var q,Z=bt(Y.exportObjectDatas);!(q=Z()).done;){var K=q.value;this.addEffectsObjectData(K)}}}for(var Q,J=bt(n);!(Q=J()).done;){var $=Q.value;this.addEffectsObjectData($)}},e.createVFXItems=function(t){var e=this;return yt(function(){var i,r,n,s,o;return wt(this,function(a){for(i=t.jsonScene,r=bt(i.items);!(n=r()).done;)s=n.value,"ECS"!==(o=s.type)&&"camera"!==o&&o!==De.sprite&&o!==De.particle&&o!==De.mesh&&o!==De.skybox&&o!==De.light&&o!==De.tree&&o!==De.interact&&o!==De.camera||e.database&&e.assetLoader.loadGUID(s);return[2]})})()},e.addTexture=function(t){this.destroyed||Mt(this.textures,t)},e.removeTexture=function(t){this.destroyed||Dt(this.textures,t)},e.addMaterial=function(t){this.destroyed||Mt(this.materials,t)},e.removeMaterial=function(t){this.destroyed||Dt(this.materials,t)},e.addGeometry=function(t){this.destroyed||Mt(this.geometries,t)},e.removeGeometry=function(t){this.destroyed||Dt(this.geometries,t)},e.addMesh=function(t){this.destroyed||Mt(this.meshes,t)},e.removeMesh=function(t){this.destroyed||Dt(this.meshes,t)},e.addRenderPass=function(t){this.destroyed||Mt(this.renderPasses,t)},e.removeRenderPass=function(t){this.destroyed||Dt(this.renderPasses,t)},e.getShaderLibrary=function(){return this.renderer.getShaderLibrary()},e.dispose=function(){if(!this.destroyed){this.destroyed=!0;var t=[];this.renderPasses.length>0&&t.push("Pass "+this.renderPasses.length),this.meshes.length>0&&t.push("Mesh "+this.meshes.length),this.geometries.length>0&&t.push("Geom "+this.geometries.length),this.textures.length>0&&t.push("Tex "+this.textures.length),t.length>0&&Qt.warn("Release GPU memory: "+t.join(", ")+"."),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.textures=[],this.materials=[],this.geometries=[],this.meshes=[],this.renderPasses=[],this.renderer=null}},Ki(t,[{key:"isDestroyed",get:function(){return this.destroyed}}]),t}(),tf=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=fr(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 new Error("The tick object must implement the tick method.");this.tickers.push(t)},Ki(t,[{key:"deltaTime",get:function(){return this.dt}}]),t}();ce("camera",Do,Ru),ce("text",Cl,Ru),ce("sprite",qa,Ru),ce("particle",ku,Ru),ce("cal",Nu,Ru),ce("interact",zo,Ru);var ef;Qt.info("Core version: 2.5.3.");var rf,nf=((ef={})[Pr.RGBA]=34842,ef[Pr.RGB]=34843,ef[Pr.ALPHA]=33325,ef[Pr.RED]=33325,ef[Pr.LUMINANCE_ALPHA]=33327,ef[Pr.LUMINANCE]=33325,ef),sf=((rf={})[Pr.RGBA]=34836,rf[Pr.RGB]=34837,rf[Pr.ALPHA]=33326,rf[Pr.RED]=33326,rf[Pr.LUMINANCE_ALPHA]=33328,rf[Pr.LUMINANCE]=33326,rf),of=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).initialized=!1,i&&r.fromData(i),r}Xe(e,t);var i=e.prototype;return i.bind=function(t){this.pipelineContext.bindTexture(this.target,this.textureBuffer,t)},i.initialize=function(){if(!this.initialized){var t=this.engine;t.addTexture(this),this.pipelineContext=t.getGLPipelineContext();var e=this.pipelineContext.gl,i=this.source,r=i.target,n=void 0===r?e.TEXTURE_2D:r,s=i.name;this.textureBuffer=e.createTexture(),cf(this.textureBuffer,s),this.target=n,this.update(this.source),this.release(),this.initialized=!0}},i.clone=function(){var t=new e(this.engine,this.source);return t.sourceFrom=this.sourceFrom,t.sourceType=this.sourceType,t.width=this.width,t.height=this.height,t},i.release=function(){switch(this.source.sourceType){case Cr.image:delete this.source.image,delete this.source.cube;break;case Cr.data:delete this.source.data;break;case Cr.compressed:case Cr.mipmaps:delete this.source.mipmaps}},i.update=function(t){var e=this;if(!this.pipelineContext||!this.textureBuffer)return this.width=0,void(this.height=0);var i,r,n=this.target,s=this.source,o=this.pipelineContext.gl,a=this.engine.gpuCapability.detail,h=s.sourceType,u=s.data,l=s.cube,c=s.image,f=s.video,d=s.mipmaps,p=s.mipmaps,m=t.data,v=t.cube,y=t.generateMipmap,g=t.mipmaps,b=s.format,x=s.type,_=s.internalFormat,E=0,w=0;if(this.bind(h===Cr.video),x===Pr.HALF_FLOAT?((x=a.halfFloatTexture)||Qt.error("Half float texture is not support."),Mr(o)&&_===b&&(b===Pr.LUMINANCE&&(b=Pr.RED),_=nf[b]),a.halfFloatLinear||(s.minFilter=s.magFilter=o.NEAREST,Qt.warn("Half float linear not support, change to NEAREST."))):x===o.FLOAT&&((x=a.floatTexture)||Qt.error("Float texture is not support."),Mr(o)&&_===b&&(b===Pr.LUMINANCE&&(b=Pr.RED),_=sf[b]),a.floatLinear||(s.minFilter=o.NEAREST,s.magFilter=o.NEAREST,Qt.warn("Float linear not support, change to NEAREST."))),void 0===s.premultiplyAlpha&&(s.premultiplyAlpha=!1),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),void 0===s.flipY&&(s.flipY=!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,s.flipY),h===Cr.framebuffer)m&&(E=null!=(i=m.width)?i:0,w=null!=(r=m.height)?r:0,E&&w&&(this.width!==E||this.height!==w)&&o.texImage2D(n,0,_,E,w,0,b,x,null));else if(h===Cr.data){var T;if(n===o.TEXTURE_CUBE_MAP)v.forEach(function(t,i){var r=e.texImage2DData(o,o.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,_,b,x,t),n=r[0],s=r[1];E=Math.max(n,E),w=Math.max(s,w)});else T=this.texImage2DData(o,n,0,_,b,x,u),E=T[0],w=T[1]}else if(h===Cr.image||h===Cr.video){if(n===o.TEXTURE_CUBE_MAP)l.forEach(function(t,i){var r=e.texImage2D(o,o.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,_,b,x,t),n=r[0],s=r[1];E=Math.max(n,E),w=Math.max(s,w)});else if(n===o.TEXTURE_2D){var S,A=null!=c?c:f;S=this.texImage2D(o,n,0,_,b,x,A),E=S[0],w=S[1]}y&&(af(E)&&af(w)||Mr(o))&&o.generateMipmap(n)}else if(h===Cr.mipmaps){var O;n===o.TEXTURE_2D?d.forEach(function(t,i){var r;(O="data"in t?e.texImage2DData(o,n,i,_,b,x,t):e.texImage2D(o,n,i,_,b,x,t),0===i)&&(E=(r=O)[0],w=r[1])}):n===o.TEXTURE_CUBE_MAP&&p.forEach(function(t,i){t.forEach(function(t,r){var n;(O="data"in t?e.texImage2DData(o,o.TEXTURE_CUBE_MAP_POSITIVE_X+r,i,_,b,x,t):e.texImage2D(o,o.TEXTURE_CUBE_MAP_POSITIVE_X+r,i,_,b,x,t),0===i)&&(E=(n=O)[0],w=n[1])})})}else h===Cr.compressed&&g&&0!==g.length&&(E=g[0].width,w=g[0].height,g.forEach(function(t,e){o.compressedTexImage2D(n,e,_,t.width,t.height,0,t.data)}));this.width=E,this.height=w,this.setTextureFilters(o,n,s)},i.setTextureFilters=function(t,e,i){var r=i.anisotropic,n=void 0===r?4:r,s=i.wrapS,o=void 0===s?t.CLAMP_TO_EDGE:s,a=i.wrapT,h=void 0===a?t.CLAMP_TO_EDGE:a,u=this.engine.gpuCapability;this.target===t.TEXTURE_2D&&u.setTextureAnisotropic(t,this.target,n);var l=Mr(t)||af(this.width)&&af(this.height),c=i.magFilter?i.magFilter:t.NEAREST,f=i.minFilter?i.minFilter:t.NEAREST;l||f!==t.LINEAR_MIPMAP_LINEAR&&f!==t.LINEAR_MIPMAP_NEAREST&&f!==t.NEAREST_MIPMAP_LINEAR&&f!==t.NEAREST_MIPMAP_NEAREST||(f=t.LINEAR),t.texParameteri(e,t.TEXTURE_MIN_FILTER,f),t.texParameteri(e,t.TEXTURE_MAG_FILTER,c),t.texParameteri(e,t.TEXTURE_WRAP_S,l?o:t.CLAMP_TO_EDGE),t.texParameteri(e,t.TEXTURE_WRAP_T,l?h:t.CLAMP_TO_EDGE)},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e,r=this.assembleOptions(i),n=r.sourceType,s=r.sourceFrom,o=r.name,a=void 0===o?"":o;this.source=r,this.sourceType=n,this.sourceFrom=s,this.name=a,this.guid=e.id},i.texImage2D=function(t,e,i,r,n,s,o){var a,h=this,u=this.source,l=u.sourceType,c=u.minFilter,f=u.magFilter,d=u.wrapS,p=u.wrapT,m=null!=(a=this.engine.gpuCapability.detail.maxTextureSize)?a:2048,v=o;if(l!==Cr.video){var y=c!==t.NEAREST||f!==t.NEAREST||d!==t.CLAMP_TO_EDGE||p!==t.CLAMP_TO_EDGE;(y=y||o.width>m||o.height>m)&&setTimeout(function(){v=h.resizeImage(o)})}t.texImage2D(e,i,r,n,s,v);var g=[v.width,v.height];return l===Cr.video?[o.videoWidth,o.videoHeight]:g},i.texImage2DData=function(t,e,i,r,n,s,o){var a=o.data,h=o.width,u=o.height,l=n===t.UNSIGNED_BYTE?new Uint8Array(a.buffer,a.byteOffset,a.byteLength/a.BYTES_PER_ELEMENT):a;return t.texImage2D(e,i,r,h,u,0,n,s,l),[h,u]},i.resizeImage=function(t,e,i){var r,n=null!=(r=this.engine.gpuCapability.detail.maxTextureSize)?r:2048;if(Mr(this.pipelineContext.gl)&&t.width<n&&t.height<n)return t;var s=function(t,e,i,r){var n=t.width,s=t.height,o=Math.min(e,i||Yo(n)),a=Math.min(e,r||Yo(s));if(a!==s||o!==n){var h=xl.getCanvas(),u=h.getContext("2d");return h.width=o,h.height=a,null==u||u.drawImage(t,0,0,n,s,0,0,o,a),Qt.warn("Image resize from "+n+"x"+s+" to "+o+"x"+a+"."),h}}(t,n,e,i);return s||t},i.reloadData=function(){var t=this;return yt(function(){return wt(this,function(e){switch(e.label){case 0:return t.offloaded?[4,gn().reload(t)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})()},i.offloadData=function(){if(this.initialized&&gn().canOffloadTexture(this.source.sourceFrom)){var t=this.target,e=this.pipelineContext.gl;if(e&&this.textureBuffer){var i=new Uint8Array([255]);if(this.bind(),t===e.TEXTURE_2D)e.texImage2D(t,0,e.LUMINANCE,1,1,0,e.LUMINANCE,e.UNSIGNED_BYTE,i);else if(t===e.TEXTURE_CUBE_MAP)for(var r=[e.TEXTURE_CUBE_MAP_NEGATIVE_X,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,e.TEXTURE_CUBE_MAP_NEGATIVE_Z,e.TEXTURE_CUBE_MAP_POSITIVE_X,e.TEXTURE_CUBE_MAP_POSITIVE_Y,e.TEXTURE_CUBE_MAP_POSITIVE_Z],n=0;n<r.length;n++)e.texImage2D(r[n],0,e.LUMINANCE,1,1,0,e.LUMINANCE,e.UNSIGNED_BYTE,i);e.generateMipmap(t),this.width=1,this.height=1}this.offloaded=!0}},i.uploadCurrentVideoFrame=function(){var t=this;return yt(function(){return wt(this,function(e){return t.source.sourceType===Cr.video&&t.source.video&&t.initialized?(t.update({video:t.source.video}),[2,!0]):[2,!1]})})()},i.updateSource=function(t){this.source=this.assembleOptions(Ur({},this.source,t)),this.sourceType=this.source.sourceType,this.sourceFrom=this.source.sourceFrom,this.update(this.source)},i.restore=function(){},i.dispose=function(){this.pipelineContext&&this.textureBuffer&&this.pipelineContext.gl.deleteTexture(this.textureBuffer),this.width=0,this.height=0,this.textureBuffer=null,this.destroyed=!0,this.update=function(){Qt.error("This texture has been destroyed.")},this.initialize=se,void 0!==this.engine&&this.engine.removeTexture(this)},e}(an);function af(t){return!(t&t-1)&&0!==t}var hf=function(){function t(t,e){this.ready=!1,this.disposed=!1,this.gl=t.getGLPipelineContext().gl,this.vaoExt=t.gpuCapability.vaoExt,this.vao=this.createVertexArray(e)}var e=t.prototype;return e.bind=function(){this.bindVertexArray(this.vao)},e.unbind=function(){this.bindVertexArray(null)},e.createVertexArray=function(t){var e=null;return Mr(this.gl)&&(e=this.gl.createVertexArray()),!e&&this.vaoExt&&(e=this.vaoExt.createVertexArrayOES()),cf(e,t),e},e.bindVertexArray=function(t){var e;Mr(this.gl)?this.gl.bindVertexArray(t):null==(e=this.vaoExt)||e.bindVertexArrayOES(t)},e.dispose=function(){var t;Mr(this.gl)?this.gl.deleteVertexArray(this.vao):null==(t=this.vaoExt)||t.deleteVertexArrayOES(this.vao)},t}(),uf=1,lf=function(){function t(t){this.engine=t,this.textures=[],this.renderbuffers=[],this.framebuffers=[],this.destroyed=!1;var e={width:1,height:1,data:new Uint8Array([255])},i=t.getGLPipelineContext(),r=i.gl;this.gl=r,this.pipelineContext=i,this.emptyTexture2D=new of(t,{data:e,sourceType:Cr.data,format:r.LUMINANCE,internalFormat:r.LUMINANCE,type:r.UNSIGNED_BYTE}),this.emptyTexture2D.initialize(),this.emptyTextureCube=new of(t,{target:r.TEXTURE_CUBE_MAP,cube:[e,e,e,e,e,e],sourceType:Cr.data,format:r.LUMINANCE,internalFormat:r.LUMINANCE,type:r.UNSIGNED_BYTE}),this.emptyTextureCube.initialize(),this.name="GLGPURenderer"+uf,uf++}var e=t.prototype;return e.copy2=function(t,e){var i=this.gl;if(i){this.sourceFbo||(this.sourceFbo=i.createFramebuffer()),this.targetFbo||(this.targetFbo=i.createFramebuffer());var r=this.pipelineContext;r.bindFramebuffer(i.FRAMEBUFFER,this.sourceFbo),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t.textureBuffer,0),r.bindFramebuffer(i.FRAMEBUFFER,this.targetFbo),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e.textureBuffer,0),r.bindFramebuffer(i.READ_FRAMEBUFFER,this.sourceFbo),r.bindFramebuffer(i.DRAW_FRAMEBUFFER,this.targetFbo);var n=t.getWidth()===t.getHeight()&&e.getWidth()==e.getHeight()?i.NEAREST:i.LINEAR;i.blitFramebuffer(0,0,t.getWidth(),t.getHeight(),0,0,e.getWidth(),e.getHeight(),i.COLOR_BUFFER_BIT,n),r.bindFramebuffer(i.FRAMEBUFFER,null),r.bindFramebuffer(i.READ_FRAMEBUFFER,null),r.bindFramebuffer(i.DRAW_FRAMEBUFFER,null)}},e.resetColorAttachments=function(t,e){t.bind(),t.resetColorTextures(e)},e.createGLRenderbuffer=function(t){var e=this.gl.createRenderbuffer();return e&&Mt(this.renderbuffers,t),e},e.resize=function(t,e){var i=this.gl;(i&&i.drawingBufferWidth!==t||i.drawingBufferHeight!==e)&&(i.canvas.width=t,i.canvas.height=e,i.viewport(0,0,t,e),this.framebuffers.forEach(function(i){var r=i.viewport;i.isCustomViewport||i.resize(r[0],r[1],t*i.viewportScale,e*i.viewportScale)}))},e.drawGeometry=function(t,e,i){if(this.gl){var r=t,n=e.shaderVariant.program;if(n){var s=n.setupAttributes(r),o=this.gl,a=r.indicesBuffer,h=r.drawStart,u=r.drawCount,l=r.mode,c=r.subMeshes;if(c&&c.length){var f,d=c[i];if(u<0)return;if(h=d.offset,a)u=null!=(f=d.indexCount)?f:0;else u=d.vertexCount}a?o.drawElements(l,u,a.type,null!=h?h:0):o.drawArrays(l,h,u),null==s||s.unbind()}}else console.warn("GLGPURenderer has not bound a gl object, unable to render geometry.")},e.createGLFramebuffer=function(t,e){var i=this.gl.createFramebuffer();if(!i)throw new Error("Failed to create WebGL framebuffer. gl isContextLost="+this.gl.isContextLost());return Mt(this.framebuffers,t),cf(i,e,e),i},e.createVAO=function(t){return new hf(this.engine,t)},e.deleteGLTexture=function(t){t.textureBuffer&&!this.destroyed&&(this.gl.deleteTexture(t.textureBuffer),Dt(this.textures,t),delete t.textureBuffer)},e.deleteGPUBuffer=function(t){t&&!this.destroyed&&(this.gl.deleteBuffer(t.glBuffer),delete t.glBuffer)},e.deleteGLFramebuffer=function(t){t&&!this.destroyed&&(this.gl.deleteFramebuffer(t.fbo),Dt(this.framebuffers,t),delete t.fbo)},e.deleteGLRenderbuffer=function(t){t&&!this.destroyed&&(this.gl.deleteRenderbuffer(t.buffer),Dt(this.renderbuffers,t),delete t.buffer)},e.deleteResource=function(){var t=this,e=this.gl;e&&(e.deleteFramebuffer(this.sourceFbo),e.deleteFramebuffer(this.targetFbo),this.emptyTexture2D.dispose(),this.emptyTextureCube.dispose(),this.framebuffers.forEach(function(e){return t.deleteGLFramebuffer(e)}),this.framebuffers.length=0,this.renderbuffers.forEach(function(e){return t.deleteGLRenderbuffer(e)}),this.renderbuffers.length=0,this.textures.forEach(function(e){return t.deleteGLTexture(e)}),this.textures.length=0)},e.lost=function(t){Qt.error("WebGL context lost, destroying glRenderer by default to prevent memory leaks. Event target: "+t.target+"."),this.deleteResource()},e.dispose=function(){this.deleteResource(),this.emptyTexture2D=this.emptyTextureCube=this.pipelineContext=this.gpu=this.gl=null,this.destroyed=!0},Ki(t,[{key:"height",get:function(){var t;return null==(t=this.gl)?void 0:t.drawingBufferHeight}},{key:"width",get:function(){var t;return null==(t=this.gl)?void 0:t.drawingBufferWidth}},{key:"canvas",get:function(){return this.gl.canvas}},{key:"isDestroyed",get:function(){return this.destroyed}}]),t}();function cf(t,e,i){void 0!==e&&null!==t&&(t.__SPECTOR_Metadata={name:e},t.__SPECTOR_Object_TAG?(t.__SPECTOR_Object_TAG.displayText=e,i&&(t.__SPECTOR_Object_TAG.id=i)):t.__SPECTOR_Object_TAG={displayText:e,id:""})}var ff,df,pf=function(){function t(t,e){this.pipelineContext=t,this.byteLength=0,this.destroyed=!1;var i=e.name,r=e.data,n=e.elementCount,s=e.target,o=void 0===s?Pr.ARRAY_BUFFER:s,a=e.type,h=void 0===a?Pr.FLOAT:a,u=e.usage,l=void 0===u?Pr.STATIC_DRAW:u,c=function(t){var e,i;return null!=(i=null==(e=mf[t])?void 0:e.BYTES_PER_ELEMENT)?i:0}(h);this.target=o,this.type=h,this.usage=l,this.glBuffer=this.createGLBuffer(i),this.bytesPerElement=c,r?this.bufferData(r):n&&this.bufferData(c*n)}var e=t.prototype;return e.createGLBuffer=function(t){var e=this.pipelineContext.gl.createBuffer();return cf(e,t),e},e.bind=function(){this.pipelineContext.gl.bindBuffer(this.target,this.glBuffer)},e.bufferData=function(t){var e="number"==typeof t?t:t.byteLength;if(this.pipelineContext){this.byteLength=e;var i=this.pipelineContext.gl,r=this.target;i.bindBuffer(r,this.glBuffer),0===e?i.bufferData(r,1,this.usage):(i.bufferData(r,e,this.usage),"number"!=typeof t&&i.bufferSubData(r,0,t))}else this.byteLength=0},e.bufferSubData=function(t,e){if(this.pipelineContext){var i=this.pipelineContext.gl,r=this.target,n=t*this.bytesPerElement,s=n+e.byteLength;i.bindBuffer(r,this.glBuffer),s>this.byteLength&&(this.byteLength=s,i.bufferData(r,s,this.usage)),i.bufferSubData(r,n,e)}else this.byteLength=0},e.dispose=function(){this.pipelineContext.gl.deleteBuffer(this.glBuffer),this.glBuffer=null,this.destroyed=!0},e.readSubData=function(t,e){return!!Mr(this.pipelineContext.gl)&&(this.pipelineContext.gl.getBufferSubData(this.target,t*this.bytesPerElement,e),!0)},Ki(t,[{key:"elementCount",get:function(){return this.byteLength/this.bytesPerElement}},{key:"isDestroyed",get:function(){return this.destroyed}}]),t}(),mf=((ff={})[Pr.INT]=Int32Array,ff[Pr.FLOAT]=Float32Array,ff[Pr.SHORT]=Int16Array,ff[Pr.BYTE]=Int8Array,ff[Pr.UNSIGNED_BYTE]=Uint8Array,ff[Pr.UNSIGNED_INT]=Uint32Array,ff[Pr.UNSIGNED_SHORT]=Uint16Array,ff);var vf=((df={})[Uint8Array.BYTES_PER_ELEMENT]=Pr.UNSIGNED_BYTE,df[Uint16Array.BYTES_PER_ELEMENT]=Pr.UNSIGNED_SHORT,df[Uint32Array.BYTES_PER_ELEMENT]=Pr.UNSIGNED_INT,df),yf=1,gf=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).drawCount=0,r.buffers={},r.vaos={},r.skin={},r.initialized=!1,r.indicesReleasable=!1,r.attributesName=[],r.destroyed=!1,i&&r.processProps(i),r}Xe(e,t);var i=e.prototype;return i.getOptions=function(){return Ur({},this.options)},i.initialize=function(){var t=this;if(!this.initialized){var e=this.engine;Xt(e),e.addGeometry(this);var i=this.engine.getGLPipelineContext();Object.keys(this.bufferProps).forEach(function(e){t.buffers[e]=new pf(i,t.bufferProps[e])}),this.indices&&(this.indicesBuffer=this.createIndicesBuffer(i,this.indices)),this.initialized=!0,this.flush(),this.options=void 0}},i.getAttributeBuffer=function(t){if(this.initialized){var e=this.attributes[t].dataSource;return this.buffers[e]}},i.setAttributeData=function(t,e){if(null!=this.bufferProps){var i=this.getAttributeBufferOption(t),r=this.attributes[t].dataSource;if(i){var n=i.usage,s=i.target;this.bufferProps[r]={data:e,usage:n,target:s,elementCount:e.length},this.dirtyFlags[r].discard=!0,this.dirtyFlags[r].dirty=!0}}},i.getAttributeData=function(t){if(null!=this.bufferProps){var e=this.getAttributeBufferOption(t);return e?e.data:void 0}},i.setAttributeSubData=function(t,e,i){if(null!=this.bufferProps){var r=this.getAttributeBufferOption(t);if(r&&null!=r.data){var n=e,s=e+i.length;if(r.data.length<s){var o=new i.constructor(s);o.set(r.data),r.data=o,this.dirtyFlags[t].discard=!0}else if(!this.dirtyFlags[t].discard){var a=this.dirtyFlags[t];void 0!==a.start&&(a.start=Math.min(a.start,n)),void 0!==a.end&&(a.end=Math.max(a.end,s-1))}r.data.set(i,n),this.dirtyFlags[t].dirty=!0}}},i.getIndexData=function(){return this.indices},i.setIndexData=function(t){(xt(t,Uint8Array)||xt(t,Uint16Array)||xt(t,Uint32Array))&&(this.indices=t,this.dirtyFlags.index.discard=!0,this.dirtyFlags.index.dirty=!0)},i.setIndexSubData=function(t,e){if(this.indices){var i,r=t,n=t+e.length;if(this.indices.length<n){var s=new e.constructor(n);s.set(this.indices),this.indices=s,this.dirtyFlags.index.discard=!0}else if(!this.dirtyFlags.index.discard){var o=this.dirtyFlags.index;void 0!==o.start&&(o.start=Math.min(o.start,r)),void 0!==o.end&&(o.end=Math.max(o.end,n-1))}null==(i=this.indices)||i.set(e,r),this.dirtyFlags.index.dirty=!0}},i.getAttributeStride=function(t){var e=this.attributes[t],i=e.stride,r=e.size,n=e.type;return i||r*Nn[n]},i.getAttributeNames=function(){return this.attributesName},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 this.skin},i.getAttributeBufferOption=function(t){var e=this.attributes[t];return e?this.bufferProps[e.dataSource]:void 0},i.createIndicesBuffer=function(t,e){var i=vf[e.BYTES_PER_ELEMENT],r={data:e,target:Pr.ELEMENT_ARRAY_BUFFER,type:i,name:this.name+"##index"};return new pf(t,r)},i.flush=function(){var t=this;if(this.initialized){var e=this.attributes,i=this.bufferProps,r=this.indices;Object.keys(this.dirtyFlags).forEach(function(n){var s,o,a=t.dirtyFlags[n];if("index"==n)s=t.indicesBuffer,o=r;else{var h=e[n].dataSource;s=t.buffers[h],o=i[h].data}if((a.dirty||a.discard)&&s&&o){if(a.discard)s.bufferData(o);else if(void 0!==a.start&&void 0!==a.end){var u=a.start*o.BYTES_PER_ELEMENT+o.byteOffset,l=a.end-a.start+1,c=new o.constructor(o.buffer,u,l);s.bufferSubData(a.start,c)}a.start=Number.POSITIVE_INFINITY,a.end=0,a.dirty=a.discard=!1}}),Object.keys(this.attributesReleasable).forEach(function(r){var n=t.attributesReleasable[r],s=e[r].dataSource;i[s]&&n&&(i[s].data=void 0)}),this.indicesReleasable}},i.processProps=function(t){var e=t,i=e.drawStart,r=void 0===i?0:i,n=e.drawCount,s=e.mode,o=e.indices,a=e.name,h=void 0===a?"effectsGeometry:"+yf++:a,u=e.bufferUsage,l=void 0===u?Pr.STATIC_DRAW:u;this.name=h;var c={},f=[],d={},p={},m={},v=l;this.drawStart=r,void 0!==n&&(this.drawCount=n),this.mode=isNaN(s)?Pr.TRIANGLES:s,Object.keys(e.attributes).forEach(function(t){var i=e.attributes[t],r=i.size,n=i.stride,s=i.offset,o=i.normalize,a=i.type,h=void 0===a?Pr.FLOAT:a,u=i.releasable,l=i.data;if(!h||"dataSource"in i||l||(l=function(t){return t===Pr.INT?new Int32Array(0):t===Pr.SHORT?new Int16Array(0):new Float32Array(0)}(h)),l){var y=xt(l,Float32Array)?Pr.FLOAT:Pr.INT;c[t]={data:l,usage:v,target:Pr.ARRAY_BUFFER,name:t},d[t]={size:r,stride:n,offset:s,type:null!=h?h:y,normalize:!!o,dataSource:t},m[t]=null!=u&&u,p[t]={dirty:!0,discard:!0,start:Number.POSITIVE_INFINITY,end:0}}else{var g=i.dataSource;g&&(d[t]={size:r,stride:n,offset:s,type:h,dataSource:g,normalize:!!o})}f.push(t)}),p.index={dirty:!0,discard:!0,start:Number.POSITIVE_INFINITY,end:0},this.indices=null==o?void 0:o.data,this.indicesReleasable=!0===(null==o?void 0:o.releasable),this.bufferProps=c,this.attributes=d,this.attributesName=f,this.attributesReleasable=m,this.dirtyFlags=p,this.options=e,this.initialized=!1},i.fromData=function(e){var i,r=this;if(t.prototype.fromData.call(this,e),this.subMeshes=e.subMeshes,e.buffer?i=new Uint8Array(function(t){for(var e=atob(t),i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);var n=i.buffer;return n}(e.buffer)):e.binaryData&&(i=e.binaryData),i){var n=e.vertexData.vertexCount;if(this.hasSemantic(e)){var s={mode:Pr.TRIANGLES,attributes:{}};if(e.vertexData.channels.forEach(function(t){var e,o=null!=(e=bf[t.semantic])?e:t.semantic,a=r.createVertexTypedArray(t,i,n);s.attributes[o]={type:Fr(t.format),size:t.dimension,data:a,normalize:t.normalize}}),e.indexFormat!==Gi.None){var o=this.createIndexTypedArray(e.indexFormat,i,e.indexOffset);s.indices={data:o},s.drawCount=o.length}else s.drawCount=n;this.processProps(s)}else{var a=e.vertexData.channels[0],h=e.vertexData.channels[1],u=e.vertexData.channels[2],l=this.createVertexTypedArray(a,i,n),c=this.createVertexTypedArray(h,i,n),f=this.createVertexTypedArray(u,i,n),d=this.createIndexTypedArray(e.indexFormat,i,e.indexOffset),p={mode:Pr.TRIANGLES,attributes:{aPos:{type:Fr(a.format),size:3,data:l,normalize:a.normalize},aUV:{type:Fr(h.format),size:2,data:c,normalize:h.normalize},aNormal:{type:Fr(u.format),size:3,data:f,normalize:u.normalize}}};p.indices={data:d},p.drawCount=d.length,this.processProps(p)}this.skin={boneNames:e.boneNames,rootBoneName:e.rootBoneName,inverseBindMatrices:e.inverseBindMatrices}}},i.dispose=function(){var t,e=this;(this.drawStart=0,this.drawCount=NaN,this.bufferProps={},this.indices=void 0,this.attributes={},this.attributesName=[],this.options=void 0,this.initialized)&&(Object.keys(this.buffers).forEach(function(t){e.buffers[t].dispose()}),this.buffers={},null==(t=this.indicesBuffer)||t.dispose(),Object.keys(this.vaos).forEach(function(t){var i;null==(i=e.vaos[t])||i.dispose(),e.vaos[t]=void 0}),this.indicesBuffer=void 0,void 0!==this.engine&&(this.engine.removeGeometry(this),this.engine=void 0));this.destroyed=!0},i.createVertexTypedArray=function(t,e,i){var r=e.buffer;switch(t.format){case zi.Float32:return new Float32Array(r,e.byteOffset+t.offset,t.dimension*i);case zi.Int16:return new Int16Array(r,e.byteOffset+t.offset,t.dimension*i);case zi.Int8:return new Int8Array(r,e.byteOffset+t.offset,t.dimension*i);case zi.UInt16:return new Uint16Array(r,e.byteOffset+t.offset,t.dimension*i);case zi.UInt8:return new Uint8Array(r,e.byteOffset+t.offset,t.dimension*i);default:return console.error("Invalid vertex format type: "+t.format+"."),new Float32Array(r,e.byteOffset+t.offset,t.dimension*i)}},i.createIndexTypedArray=function(t,e,i){var r=e.buffer;switch(t){case Gi.UInt16:return new Uint16Array(r,e.byteOffset+i);case Gi.UInt32:return new Uint32Array(r,e.byteOffset+i);default:return console.error("Invalid index format type: "+t+"."),new Uint32Array(r,e.byteOffset+i)}},i.hasSemantic=function(t){var e=!1;return t.vertexData.channels.forEach(function(t){t.semantic&&t.semantic.length>0&&(e=!0)}),e},Ki(e,[{key:"isDestroyed",get:function(){return this.destroyed}},{key:"isInitialized",get:function(){return this.initialized}}]),e}(Bn),bf={POSITION:"aPos",TEXCOORD0:"aUV",TEXCOORD_0:"aUV",TEXCOORD1:"aUV2",NORMAL:"aNormal",TANGENT:"aTangent",COLOR:"aColor",JOINTS:"aJoints",JOINTS_0:"aJoints",WEIGHTS:"aWeights",WEIGHTS_0:"aWeights",POSITION_BS0:"aTargetPosition0",POSITION_BS1:"aTargetPosition1",POSITION_BS2:"aTargetPosition2",POSITION_BS3:"aTargetPosition3",POSITION_BS4:"aTargetPosition4",POSITION_BS5:"aTargetPosition5",POSITION_BS6:"aTargetPosition6",POSITION_BS7:"aTargetPosition7",NORMAL_BS0:"aTargetNormal0",NORMAL_BS1:"aTargetNormal1",NORMAL_BS2:"aTargetNormal2",NORMAL_BS3:"aTargetNormal3",TANGENT_BS0:"aTargetTangent0",TANGENT_BS1:"aTargetTangent1",TANGENT_BS2:"aTargetTangent2",TANGENT_BS3:"aTargetTangent3"};var xf,_f,Ef=function(){function t(){this.reset()}var e=t.prototype;return e.setBlendColor=function(t){var e=t[0],i=t[1],r=t[2],n=t[3];this.blendColor[0]===e&&this.blendColor[1]===i&&this.blendColor[2]===r&&this.blendColor[3]===n||(this.blendColor[0]=e,this.blendColor[1]=i,this.blendColor[2]=r,this.blendColor[3]=n)},e.setBlending=function(t){this.blending!==t&&(this.blending=t)},e.setBlendFunctionParameters=function(t){var e=t[0],i=t[1],r=t[2],n=t[3];this.blendFunctionParameters[0]===e&&this.blendFunctionParameters[1]===i&&this.blendFunctionParameters[2]===r&&this.blendFunctionParameters[3]===n||(this.blendFunctionParameters[0]=e,this.blendFunctionParameters[1]=i,this.blendFunctionParameters[2]=r,this.blendFunctionParameters[3]=n)},e.setBlendEquationParameters=function(t){var e=t[0],i=t[1];this.blendEquationParameters[0]===e&&this.blendEquationParameters[1]===i||(this.blendEquationParameters[0]=e,this.blendEquationParameters[1]=i)},e.setDepthTest=function(t){this.depthTest!==t&&(this.depthTest=t)},e.setDepthMask=function(t){this.depthMask!==t&&(this.depthMask=t)},e.setDepthRange=function(t){this.depthRange[0]===t[0]&&this.depthRange[1]===t[1]||(this.depthRange[0]=t[0],this.depthRange[1]=t[1])},e.setDepthFunc=function(t){this.depthFunc!==t&&(this.depthFunc=t)},e.setPolygonOffsetFill=function(t){this.polygonOffsetFill!==t&&(this.polygonOffsetFill=t)},e.setPolygonOffset=function(t){this.polygonOffset[0]===t[0]&&this.polygonOffset[1]===t[1]||(this.polygonOffset[0]=t[0],this.polygonOffset[1]=t[1])},e.setSampleAlphaToCoverage=function(t){this.sampleAlphaToCoverage!==t&&(this.sampleAlphaToCoverage=t)},e.setColorMask=function(t){this.colorMask[0]=t,this.colorMask[1]=t,this.colorMask[2]=t,this.colorMask[3]=t},e.setStencilTest=function(t){this.stencilTest!==t&&(this.stencilTest=t)},e.setStencilMask=function(t){this.stencilMask[0]===t[0]&&this.stencilMask[1]===t[1]||(this.stencilMask[0]=t[0],this.stencilMask[1]=t[1])},e.setStencilRef=function(t){this.stencilRef[0]===t[0]&&this.stencilRef[1]===t[1]||(this.stencilRef[0]=t[0],this.stencilRef[1]=t[1])},e.setStencilFunc=function(t){this.stencilFunc[0]===t[0]&&this.stencilFunc[1]===t[1]||(this.stencilFunc[0]=t[0],this.stencilFunc[1]=t[1])},e.setStencilOpFail=function(t){this.stencilOpFail[0]===t[0]&&this.stencilOpFail[1]===t[1]||(this.stencilOpFail[0]=t[0],this.stencilOpFail[1]=t[1])},e.setStencilOpZFail=function(t){this.stencilOpZFail[0]===t[0]&&this.stencilOpZFail[1]===t[1]||(this.stencilOpZFail[0]=t[0],this.stencilOpZFail[1]=t[1])},e.setStencilOpZPass=function(t){this.stencilOpZPass[0]===t[0]&&this.stencilOpZPass[1]===t[1]||(this.stencilOpZPass[0]=t[0],this.stencilOpZPass[1]=t[1])},e.setCulling=function(t){this.culling!==t&&(this.culling=t)},e.setFrontFace=function(t){this.frontFace!==t&&(this.frontFace=t)},e.setCullFace=function(t){this.cullFace!==t&&(this.cullFace=t)},e.reset=function(){this.blending=!1,this.blendColor=[0,0,0,0],this.blendFunctionParameters=[Pr.ONE,Pr.ONE_MINUS_SRC_ALPHA,Pr.ONE,Pr.ONE_MINUS_SRC_ALPHA],this.blendEquationParameters=[Pr.FUNC_ADD,Pr.FUNC_ADD],this.depthTest=!0,this.depthMask=!0,this.depthRange=[0,1],this.depthFunc=Pr.LESS,this.polygonOffset=[0,0],this.polygonOffsetFill=!1,this.sampleAlphaToCoverage=!1,this.colorMask=[!0,!0,!0,!0],this.stencilTest=!1,this.stencilMask=[255,255],this.stencilRef=[0,0],this.stencilFunc=[Pr.ALWAYS,Pr.ALWAYS],this.stencilOpFail=[Pr.KEEP,Pr.KEEP],this.stencilOpZFail=[Pr.KEEP,Pr.KEEP],this.stencilOpZPass=[Pr.KEEP,Pr.KEEP],this.culling=!1,this.frontFace=Pr.CCW,this.cullFace=Pr.FRONT},e.apply=function(t){if(t.toggle(Pr.SAMPLE_ALPHA_TO_COVERAGE,this.sampleAlphaToCoverage),t.toggle(Pr.BLEND,this.blending),t.toggle(Pr.DEPTH_TEST,this.depthTest),t.toggle(Pr.STENCIL_TEST,this.stencilTest),t.toggle(Pr.CULL_FACE,this.culling),t.toggle(Pr.POLYGON_OFFSET_FILL,this.polygonOffsetFill),this.stencilTest&&(t.stencilMaskSeparate(Pr.BACK,this.stencilMask[1]),t.stencilMaskSeparate(Pr.FRONT,this.stencilMask[0]),t.stencilFuncSeparate(Pr.BACK,this.stencilFunc[0],this.stencilRef[0],this.stencilMask[0]),t.stencilFuncSeparate(Pr.FRONT,this.stencilFunc[1],this.stencilRef[1],this.stencilMask[1]),t.stencilOpSeparate(Pr.BACK,this.stencilOpFail[0],this.stencilOpZFail[0],this.stencilOpZPass[0]),t.stencilOpSeparate(Pr.FRONT,this.stencilOpFail[1],this.stencilOpZFail[1],this.stencilOpZPass[1])),this.blending){var e=this,i=e.blendColor,r=e.blendEquationParameters,n=e.blendFunctionParameters;t.blendColor(i[0],i[1],i[2],i[3]),t.blendEquationSeparate(r[0],r[1]),t.blendFuncSeparate(n[0],n[1],n[2],n[3])}t.colorMask(this.colorMask[0],this.colorMask[1],this.colorMask[2],this.colorMask[3]),this.depthTest&&(t.depthMask(this.depthMask),t.depthFunc(this.depthFunc),t.depthRange(this.depthRange[0],this.depthRange[1])),this.culling&&(t.cullFace(this.cullFace),t.frontFace(this.frontFace)),this.polygonOffsetFill&&t.polygonOffset(this.polygonOffset[0],this.polygonOffset[1])},t}(),wf=mr,Tf=_r,Sf=function(t){function e(e,i){var r;return(r=t.call(this,e,i)||this).floats={},r.ints={},r.vector2s={},r.vector3s={},r.vector4s={},r.colors={},r.quaternions={},r.matrices={},r.matrice3s={},r.textures={},r.floatArrays={},r.vector4Arrays={},r.matrixArrays={},r.samplers=[],r.uniforms=[],r.uniformDirty=!0,r.macrosDirty=!0,r.glMaterialState=new Ef,i&&(r.shader=new On(e),r.shader.shaderData=Ur({},i.shader,{id:oe(),dataType:ki.Shader})),r}Xe(e,t);var i=e.prototype;return i.enableMacro=function(t,e){this.isMacroEnabled(t)&&this.enabledMacros[t]===e||(this.enabledMacros[t]=null==e||e,this.macrosDirty=!0)},i.disableMacro=function(t){this.isMacroEnabled(t)&&(delete this.enabledMacros[t],this.macrosDirty=!0)},i.isMacroEnabled=function(t){return void 0!==this.enabledMacros[t]},i.initialize=function(){var t=this,e=this.engine;this.createShaderVariant(),this.shaderVariant.initialize(),this.initialized||(e.addMaterial(this),Object.keys(this.textures).forEach(function(e){var i=t.textures[e];ee(i.initialize)?i.initialize():Qt.error("Failed to initialize texture: "+JSON.stringify(i)+". Ensure the texture conforms to the expected format.")}),this.initialized=!0)},i.createShaderVariant=function(){(this.shaderDirty||this.macrosDirty)&&(this.shaderVariant=this.shader.createVariant(this.enabledMacros),this.macrosDirty=!1,this.shaderDirty=!1,this.uniformDirty=!0)},i.setupStates=function(t){this.glMaterialState.apply(t)},i.use=function(t,e){var i=t.engine.getGLPipelineContext(),r=this.shaderVariant;if(r.program){var n;if(r.program.bind(),this.setupStates(i),e){for(var s,o=bt(e.uniforms);!(s=o()).done;)n=s.value,this.checkUniform(n);for(var a,h=bt(e.samplers);!(a=h()).done;)n=a.value,this.samplers.includes(n)||(this.samplers.push(n),this.uniformDirty=!0)}if(this.uniformDirty&&(r.fillShaderInformation(this.uniforms,this.samplers),this.uniformDirty=!1),e){for(n in e.floats)r.setFloat(n,e.floats[n]);for(n in e.ints)r.setInt(n,e.ints[n]);for(n in e.vector4s)r.setVector4(n,e.vector4s[n]);for(n in e.vector3s)r.setVector3(n,e.vector3s[n]);for(n in e.matrices)r.setMatrix(n,e.matrices[n])}for(n in this.textures)this.textures[n].textureBuffer||this.textures[n].initialize();for(n in this.floats)r.setFloat(n,this.floats[n]);for(n in this.ints)r.setInt(n,this.ints[n]);for(n in this.floatArrays)r.setFloats(n,this.floatArrays[n]);for(n in this.textures)r.setTexture(n,this.textures[n]);for(n in this.vector2s)r.setVector2(n,this.vector2s[n]);for(n in this.vector3s)r.setVector3(n,this.vector3s[n]);for(n in this.vector4s)r.setVector4(n,this.vector4s[n]);for(n in this.colors)r.setColor(n,this.colors[n]);for(n in this.quaternions)r.setQuaternion(n,this.quaternions[n]);for(n in this.matrices)r.setMatrix(n,this.matrices[n]);for(n in this.matrice3s)r.setMatrix3(n,this.matrice3s[n]);for(n in this.vector4Arrays)r.setVector4Array(n,this.vector4Arrays[n]);for(n in this.matrixArrays)r.setMatrixArray(n,this.matrixArrays[n])}else{var u;null==(u=this.engine)||u.renderErrors.add(new Error("Shader program is not initialized."))}},i.getFloat=function(t){return this.floats[t]},i.setFloat=function(t,e){this.checkUniform(t),this.floats[t]=e},i.getInt=function(t){return this.ints[t]},i.setInt=function(t,e){this.checkUniform(t),this.ints[t]=e},i.getFloats=function(t){return this.floatArrays[t]},i.setFloats=function(t,e){this.checkUniform(t),this.floatArrays[t]=e},i.getVector2=function(t){return this.vector2s[t]},i.setVector2=function(t,e){this.checkUniform(t),this.vector2s[t]=e},i.getVector3=function(t){return this.vector3s[t]},i.setVector3=function(t,e){this.checkUniform(t),this.vector3s[t]=e},i.getVector4=function(t){return this.vector4s[t]},i.setVector4=function(t,e){this.checkUniform(t),this.vector4s[t]=e},i.getColor=function(t){return this.colors[t]},i.setColor=function(t,e){this.checkUniform(t),this.colors[t]=e},i.getQuaternion=function(t){return this.quaternions[t]},i.setQuaternion=function(t,e){this.checkUniform(t),this.quaternions[t]=e},i.getMatrix=function(t){return this.matrices[t]},i.setMatrix=function(t,e){this.checkUniform(t),this.matrices[t]=e},i.setMatrix3=function(t,e){this.checkUniform(t),this.matrice3s[t]=e},i.getVector4Array=function(t){return this.vector4Arrays[t]},i.setVector4Array=function(t,e){this.checkUniform(t),this.vector4Arrays[t]=[];for(var i,r=bt(e);!(i=r()).done;){var n=i.value;this.vector4Arrays[t].push(n.x,n.y,n.z,n.w)}},i.getMatrixArray=function(t){return this.matrixArrays[t]},i.setMatrixArray=function(t,e){this.checkUniform(t),this.matrixArrays[t]=[];for(var i,r=bt(e);!(i=r()).done;)for(var n=i.value,s=0;s<16;s++)this.matrixArrays[t].push(n.elements[s])},i.setMatrixNumberArray=function(t,e){this.checkUniform(t),this.matrixArrays[t]=e},i.getTexture=function(t){return this.textures[t]},i.setTexture=function(t,e){this.samplers.includes(t)||(this.samplers.push(t),this.uniformDirty=!0),this.textures[t]=e},i.hasUniform=function(t){return this.uniforms.includes(t)||this.samplers.includes(t)},i.clone=function(t){var i=t||this.props,r=this.engine;Xt(r);var n=new e(r,i);return n.glMaterialState=Object.assign(new Ef,n.glMaterialState),n.floats=this.floats,n.ints=this.ints,n.vector2s=this.vector2s,n.vector3s=this.vector3s,n.vector4s=this.vector4s,n.colors=this.colors,n.quaternions=this.quaternions,n.matrices=this.matrices,n.textures=this.textures,n.floatArrays=this.floatArrays,n.vector4Arrays=this.vector4Arrays,n.matrixArrays=this.matrixArrays,n.samplers=this.samplers,n.uniforms=this.uniforms,n.uniformDirty=!0,n},i.fromData=function(e){t.prototype.fromData.call(this,e),this.uniforms=[],this.samplers=[],this.textures={},this.floats={},this.ints={},this.floatArrays={},this.vector4s={};var i=Ur({},e);void 0!==e.stringTags.RenderType&&(this.blending=e.stringTags.RenderType===Ue.Transparent),void 0!==e.floats.ZTest&&(this.depthTest=0!==e.floats.ZTest),void 0!==e.floats.ZWrite&&(this.depthMask=0!==e.floats.ZWrite);var r,n,s=e.stringTags.RenderFace;for(r in s===Ve.Front?(this.culling=!0,this.cullFace=Pr.BACK):s===Ve.Back?(this.culling=!0,this.cullFace=Pr.FRONT):this.culling=!1,i.floats)this.setFloat(r,i.floats[r]);for(r in i.ints)this.setInt(r,i.ints[r]);for(r in i.vector4s){var o=i.vector4s[r];this.setVector4(r,new mr(o.x,o.y,o.z,o.w))}for(r in i.colors){var a=i.colors[r];this.setColor(r,new br(a.r,a.g,a.b,a.a))}for(r in i.textures){var h=i.textures[r],u=this.engine.findObject(h.texture);this.setTexture(r,u);var l=h.offset,c=h.scale;l&&c&&this.setVector4(r+"_ST",new wf(c.x,c.y,l.x,l.y))}if(e.shader){var f=this.engine.findObject(e.shader);f&&(this.shader=f,this.shaderSource=f.shaderData)}this.stringTags=null!=(n=e.stringTags)?n:{},this.initialized=!1},i.toData=function(){var t=this.defination;for(var e in this.shader&&(t.shader=this.shader),t.floats={},t.ints={},t.vector4s={},t.colors={},t.textures={},t.dataType=ki.Material,t.stringTags=this.stringTags,this.floats)t.floats[e]=this.floats[e];for(var i in this.ints)t.ints[i]=this.ints[i];for(var r in this.vector4s)t.vector4s[r]=this.vector4s[r];for(var n in this.colors)t.colors[n]=this.colors[n];for(var s in this.textures){t.textures[s]||(t.textures[s]={texture:this.textures[s]});var o=t.textures[s],a=this.getVector4(s+"_ST");a&&(o.scale={x:a.x,y:a.y},o.offset={x:a.z,y:a.w},delete t.vector4s[s+"_ST"])}return t},i.cloneUniforms=function(t){var e,i=t;for(e in i.floats)this.setFloat(e,i.floats[e]);for(e in i.ints)this.setInt(e,i.ints[e]);for(e in i.floatArrays)this.setFloats(e,i.floatArrays[e]);for(e in i.textures)this.setTexture(e,i.textures[e]);for(e in i.vector2s)this.setVector2(e,i.vector2s[e]);for(e in i.vector3s)this.setVector3(e,i.vector3s[e]);for(e in i.vector4s)this.setVector4(e,i.vector4s[e]);for(e in i.colors)this.setColor(e,i.colors[e]);for(e in i.quaternions)this.setQuaternion(e,i.quaternions[e]);for(e in i.matrices)this.setMatrix(e,i.matrices[e]);for(e in i.vector4Arrays){for(var r=[],n=0;n<i.vector4Arrays[e].length;n+=4)r.push(new wf(i.vector4Arrays[e][n],i.vector4Arrays[e][n+1],i.vector4Arrays[e][n+2],i.vector4Arrays[e][n+3]));this.setVector4Array(e,r)}for(e in i.matrixArrays){for(var s=[],o=0;o<i.matrixArrays[e].length;o+=16){for(var a=Tf.fromIdentity(),h=0;h<16;h++)a.elements[h]=i.matrixArrays[e][o+h];s.push(a)}this.setMatrixArray(e,s)}},i.checkUniform=function(t){this.uniforms.includes(t)||(this.uniforms.push(t),this.uniformDirty=!0)},i.dispose=function(t){var e,i=this;this.destroyed||(null==(e=this.shaderVariant)||e.dispose(),(null==t?void 0:t.textures)!==Zt.keep&&Object.keys(this.textures).forEach(function(t){var e=i.textures[t];e!==i.engine.emptyTexture&&e.dispose()}),this.shaderSource=null,this.uniformSemantics={},this.floats={},this.ints={},this.vector2s={},this.vector3s={},this.vector4s={},this.quaternions={},this.matrices={},this.matrice3s={},this.textures={},this.floatArrays={},this.vector4Arrays={},this.matrixArrays={},this.samplers=[],this.uniforms=[],this.initialize=se,this.destroyed=!0,void 0!==this.engine&&this.engine.removeMaterial(this))},Ki(e,[{key:"blending",get:function(){return this.glMaterialState.blending},set:function(t){void 0!==t&&this.glMaterialState.setBlending(t)}},{key:"blendColor",get:function(){return this.glMaterialState.blendColor},set:function(t){t&&this.glMaterialState.setBlendColor(t)}},{key:"blendFunction",get:function(){return this.glMaterialState.blendFunctionParameters},set:function(t){t&&this.glMaterialState.setBlendFunctionParameters(t)}},{key:"blendEquation",get:function(){return this.glMaterialState.blendEquationParameters},set:function(t){t&&this.glMaterialState.setBlendEquationParameters(t)}},{key:"depthTest",get:function(){return this.glMaterialState.depthTest},set:function(t){void 0!==t&&this.glMaterialState.setDepthTest(t)}},{key:"depthMask",get:function(){return this.glMaterialState.depthMask},set:function(t){void 0!==t&&this.glMaterialState.setDepthMask(t)}},{key:"depthRange",get:function(){return this.glMaterialState.depthRange},set:function(t){t&&this.glMaterialState.setDepthRange(t)}},{key:"depthFunc",get:function(){return this.glMaterialState.depthFunc},set:function(t){void 0!==t&&this.glMaterialState.setDepthFunc(t)}},{key:"polygonOffsetFill",get:function(){return this.glMaterialState.polygonOffsetFill},set:function(t){void 0!==t&&this.glMaterialState.setPolygonOffsetFill(t)}},{key:"polygonOffset",get:function(){return this.glMaterialState.polygonOffset},set:function(t){t&&this.glMaterialState.setPolygonOffset(t)}},{key:"sampleAlphaToCoverage",get:function(){return this.glMaterialState.sampleAlphaToCoverage},set:function(t){void 0!==t&&this.glMaterialState.setSampleAlphaToCoverage(t)}},{key:"colorMask",get:function(){return this.glMaterialState.colorMask[0]},set:function(t){this.glMaterialState.setColorMask(t)}},{key:"stencilTest",get:function(){return this.glMaterialState.stencilTest},set:function(t){void 0!==t&&this.glMaterialState.setStencilTest(t)}},{key:"stencilMask",get:function(){return this.glMaterialState.stencilMask},set:function(t){t&&this.glMaterialState.setStencilMask(t)}},{key:"stencilRef",get:function(){return this.glMaterialState.stencilRef},set:function(t){t&&this.glMaterialState.setStencilRef(t)}},{key:"stencilFunc",get:function(){return this.glMaterialState.stencilFunc},set:function(t){t&&this.glMaterialState.setStencilFunc(t)}},{key:"stencilOpFail",get:function(){return this.glMaterialState.stencilOpFail},set:function(t){t&&this.glMaterialState.setStencilOpFail(t)}},{key:"stencilOpZFail",get:function(){return this.glMaterialState.stencilOpZFail},set:function(t){t&&this.glMaterialState.setStencilOpZFail(t)}},{key:"stencilOpZPass",get:function(){return this.glMaterialState.stencilOpZPass},set:function(t){t&&this.glMaterialState.setStencilOpZPass(t)}},{key:"culling",get:function(){return this.glMaterialState.culling},set:function(t){void 0!==t&&this.glMaterialState.setCulling(t)}},{key:"frontFace",get:function(){return this.glMaterialState.frontFace},set:function(t){void 0!==t&&this.glMaterialState.setFrontFace(t)}},{key:"cullFace",get:function(){return this.glMaterialState.cullFace},set:function(t){void 0!==t&&this.glMaterialState.setCullFace(t)}},{key:"isDestroyed",get:function(){return this.destroyed}}]),e}(Tn),Af=function(){function t(t){if(this.renderer=t,1===t.engine.gpuCapability.level){this.copyRenderPass=this.createCopyRenderPass().initialize(t);var e=this.copyRenderPass.meshes[0].material.shaderSource;t.pipelineContext.shaderLibrary.addShader(e)}}var e=t.prototype;return e.resetColorAttachments=function(t,e){this.renderer&&t.resetColorAttachments(e)},e.copyTexture=function(t,e){this.renderer&&(t.initialize(),e.initialize(),e.updateSource({sourceType:Cr.framebuffer,data:{width:e.getWidth()||t.getWidth(),height:e.getHeight()||t.getHeight()}}),2===this.renderer.engine.gpuCapability.level?this.copy2(t,e):this.copy1(t,e))},e.copy2=function(t,e){var i=this.renderer.getFramebuffer();this.renderer.glRenderer.copy2(t,e),this.renderer.setFramebuffer(i)},e.copy1=function(t,e){var i=this.copyRenderPass;if(i){var r=this.renderer;if(r){var n=i.framebuffer;n.viewport[2]=e.getWidth()||t.getWidth(),n.viewport[3]=e.getHeight()||t.getHeight(),r.glRenderer.resetColorAttachments(n,[e]),i.meshes[0].material.setTexture("uTex",t),r.renderRenderPass(i)}}},e.createCopyRenderPass=function(){var t="mri-copy-mesh",e={texture:{format:Pr.RGBA}},i=this.renderer.engine,r=new gf(i,{name:t,mode:Pr.TRIANGLE_STRIP,attributes:{aPos:{type:Pr.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),n=i.gpuCapability.level,s=new Sf(i,{name:t,shader:{cacheId:"$mri-internal-copy",name:t,vertex:"\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.))/2.;\n}",fragment:"\nprecision highp float;\nvarying vec2 vTex;\nuniform sampler2D uTex;\nvoid main(){\n gl_FragColor = texture2D(uTex,vTex);\n}",glslVersion:2===n?_n.GLSL3:_n.GLSL1}});s.blending=!1,s.depthTest=!1,s.culling=!1;var o=new Kn(i,{name:t,geometry:r,material:s,priority:0});return new Of(this.renderer,{name:"mri-copy-rp",clearAction:{colorAction:Ar.whatever},attachments:[e],meshes:[o]})},e.dispose=function(){var t;this.renderer&&(null==(t=this.copyRenderPass)||t.dispose(),this.renderer=void 0)},t}(),Of=function(t){function e(){return t.apply(this,arguments)}Xe(e,t);var i=e.prototype;return i.configure=function(t){this.currentFramebuffer=t.getFramebuffer(),t.setFramebuffer(this.framebuffer)},i.execute=function(t){this.clearAction&&t.clear(this.clearAction),t.renderMeshes(this.meshes),this.storeAction&&t.clear(this.storeAction),t.setFramebuffer(this.currentFramebuffer)},e}(es),Cf=function(){function t(t,e,i){var r=this;void 0===e&&(e="webgl"),void 0===i&&(i={}),this.canvas=t,this.glType=e,this.restoreHandlers=[],this.lostHandlers=[],Xt(t),this.gl=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 new Error("This browser does not support WebGL or the WebGL version is incorrect. Please check your WebGL version.");return r}(t,e,i),this.contextLostListener=function(t){for(var e,i,n=bt(r.lostHandlers);!(i=n()).done;){i.value.lost(t)}null==(e=r.canvas)||e.removeEventListener("webglcontextlost",r.contextLostListener)},this.contextRestoredListener=function(t){for(var e,i,n=bt(r.restoreHandlers);!(i=n()).done;){i.value.restore()}null==(e=r.canvas)||e.addEventListener("webglcontextlost",r.contextLostListener)},t.addEventListener("webglcontextlost",this.contextLostListener),t.addEventListener("webglcontextrestored",this.contextRestoredListener)}var e=t.prototype;return e.dispose=function(){this.canvas&&(this.canvas.removeEventListener("webglcontextlost",this.contextLostListener),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredListener)),this.gl=null,this.canvas=null},e.addLostHandler=function(t){this.lostHandlers.push(t)},e.removeLostHandler=function(t){var e=this.lostHandlers.indexOf(t);e>-1&&this.lostHandlers.splice(e,1)},e.addRestoreHandler=function(t){this.restoreHandlers.push(t)},e.removeRestoreHandler=function(t){var e=this.restoreHandlers.indexOf(t);e>-1&&this.restoreHandlers.splice(e,1)},t}(),If=function(t){function e(e){var i;return(i=t.call(this)||this).gpuCapability=new Ts(e),i}Xe(e,t);var i=e.prototype;return i.dispose=function(){this.destroyed||t.prototype.dispose.call(this)},i.getGLRenderer=function(){return this.renderer},i.getGLRendererInternal=function(){return this.getGLRenderer().glRenderer},i.getGLPipelineContext=function(){return this.getGLRenderer().pipelineContext},e}($c),Rf=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).initialized=!1,void 0!==i&&r.initialize(i),r}Xe(e,t);var i=e.prototype;return i.initialize=function(t){this.initialized||(this.initialized=!0,this.renderer=t,this.buffer=t.createGLRenderbuffer(this))},i.setSize=function(t,e){if(this.initialized){if(this.renderer&&(t!==this.size[0]||e!==this.size[1])){var i=this.renderer,r=i.gl;i.pipelineContext.bindRenderbuffer(r.RENDERBUFFER,this.buffer),t&&e?r.renderbufferStorage(r.RENDERBUFFER,this.format,this.size[0]=t,this.size[1]=e):Qt.error("Invalid render buffer size: "+t+"x"+e+".")}}else Qt.error("Can't set size for uninitialized render buffer.")},i.dispose=function(){this.renderer&&(this.renderer.deleteGLRenderbuffer(this),this.renderer=null,this.buffer=null),this.destroyed=!0,this.initialize=se},e}(Es),Pf=1,Mf=function(t){function e(e,i){var r;(r=t.call(this)||this).attachmentTextures=[];var n,s=e.depthStencilAttachment,o=e.viewport,a=e.isCustomViewport,h=e.storeAction,u=e.viewportScale,l=void 0===u?1:u,c=e.name,f=void 0===c?"GLFramebuffer"+Pf++:c;return r.renderer=i,r.engine=i.engine,r.depthStencilStorageType=null!=(n=null==s?void 0:s.storageType)?n:Gn.none,r.viewport=o,r.isCustomViewport=!!a,r.viewportScale=l,r.name=f,r.storeAction=h,r.updateProps(e),r}Xe(e,t);var i=e.prototype;return i.getDepthTexture=function(){return this.depthTexture},i.getStencilTexture=function(){return this.stencilTexture},i.getColorTextures=function(){return this.colorTextures},i.updateAttachmentTextures=function(){var t=this;this.attachmentTextures.length=0,this.colorTextures.forEach(function(e){e.initialize(),Mt(t.attachmentTextures,e.textureBuffer)}),this.stencilTexture&&Mt(this.attachmentTextures,this.stencilTexture.textureBuffer),this.depthTexture&&Mt(this.attachmentTextures,this.depthTexture.textureBuffer)},i.updateProps=function(t){var e,i,r=this.renderer,n=this.engine.gpuCapability,s=null!=(i=t.depthStencilAttachment)?i:{storageType:Gn.none},o=t.attachments.length>0,a=!0;if(this.externalStorage=!1,t.attachments.length>1&&!n.detail.drawBuffers)throw new Error("Multiple color attachments not support.");var h=null==(e=t.depthStencilAttachment)?void 0:e.texture,u=n.detail.readableDepthStencilTextures,l=s.storageType,c=s.storage;if(this.colorTextures=t.attachments.slice(),!o&&l!==Gn.none)throw new Error("Use depth stencil attachment without color attachments.");switch(o&&(this.fbo=r.glRenderer.createGLFramebuffer(this,this.name)),l){case Gn.depth_stencil_opaque:if(c){if(!xt(c,Rf))throw new Error("Invalid depth stencil attachment storage.");this.depthStencilRenderbuffer=c,this.externalStorage=!0}else this.depthStencilRenderbuffer=new Rf({format:Pr.DEPTH_STENCIL,attachment:Pr.DEPTH_STENCIL_ATTACHMENT,storageType:l},r.glRenderer);a=!1;break;case Gn.depth_16_opaque:if(c){if(!xt(c,Rf))throw new Error("Invalid depth attachment storage.");this.depthStencilRenderbuffer=c,this.externalStorage=!0}else this.depthStencilRenderbuffer=new Rf({attachment:Pr.DEPTH_ATTACHMENT,format:Pr.DEPTH_COMPONENT16,storageType:l},r.glRenderer);break;case Gn.stencil_8_opaque:if(c){if(!xt(c,Rf))throw new Error("Invalid stencil attachment storage.");this.depthStencilRenderbuffer=c,this.externalStorage=!0}else this.depthStencilRenderbuffer=new Rf({attachment:Pr.STENCIL_ATTACHMENT,format:Pr.STENCIL_INDEX8,storageType:l},r.glRenderer);break;case Gn.depth_16_texture:if(!u)throw new Error("Depth texture is not support in framebuffer.");this.depthTexture=null!=h?h:new of(this.engine,{sourceType:Cr.framebuffer,format:Pr.DEPTH_COMPONENT,internalFormat:n.internalFormatDepth16,type:Pr.UNSIGNED_SHORT,name:this.name+"##depthTex"}),this.depthTexture.initialize();break;case Gn.depth_24_stencil_8_texture:if(!u)throw new Error("Depth stencil texture is not support in framebuffer.");this.depthTexture=this.stencilTexture=null!=h?h:new of(this.engine,{sourceType:Cr.framebuffer,format:Pr.DEPTH_STENCIL,internalFormat:n.internalFormatDepth24_stencil8,type:n.UNSIGNED_INT_24_8,name:this.name+"##dpthStclTex"}),this.depthTexture.initialize(),a=!0}this.storeInvalidAttachments=this.getStoreAttachments(this.storeAction,a),this.updateAttachmentTextures()},i.getStoreAttachments=function(t,e){var i=this.renderer.glRenderer.gl,r=this.colorTextures.length;if(t&&Mr(i)&&r>0){var n=[];if(t.depthAction===Hn.clear&&this.depthStorage&&Mt(n,e?i.DEPTH_ATTACHMENT:i.DEPTH_STENCIL_ATTACHMENT),t.stencilAction===Hn.clear&&this.stencilStorage&&Mt(n,e?i.STENCIL_ATTACHMENT:i.DEPTH_STENCIL_ATTACHMENT),t.colorAction===Hn.clear)for(var s=0;s<r;s++)Mt(n,i["COLOR_ATTACHMENT"+s]);return n}},i.unbind=function(){var t=this.storeInvalidAttachments;if(null==t?void 0:t.length){var e=this.renderer.glRenderer.gl;Mr(e)&&e.invalidateFramebuffer(e.FRAMEBUFFER,t)}this.renderer.pipelineContext.bindSystemFramebuffer()},i.bind=function(){var t=this;if(this.fbo){var e=this.renderer.glRenderer.gl,i=this.renderer.pipelineContext,r=this.viewport,n=r[0],s=r[1],o=r[2],a=r[3];i.bindFramebuffer(e.FRAMEBUFFER,this.fbo),i.viewport(n,s,o,a);var h=this.renderer.glRenderer.emptyTexture2D.textureBuffer;Object.keys(i.textureUnitDict).forEach(function(e){var r=i.textureUnitDict[e];r&&r!==h&&t.attachmentTextures.includes(r)&&(i.activeTexture(+e),t.renderer.glRenderer.emptyTexture2D.bind())});for(var u=0;u<4;u++)i.activeTexture(e.TEXTURE0+u),this.renderer.glRenderer.emptyTexture2D.bind();if(!this.ready){var l=this,c=l.depthStencilRenderbuffer,f=l.depthTexture,d=l.stencilTexture;if(i.activeTexture(e.TEXTURE0),c)c.setSize(o,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,c.attachment,e.RENDERBUFFER,c.buffer);else if(f){f.source.data={width:o,height:a},f.update({data:{width:o,height:a,data:new Uint16Array(0)}});var p=f&&d?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.framebufferTexture2D(e.FRAMEBUFFER,p,e.TEXTURE_2D,f.textureBuffer,0)}this.resetColorTextures(this.colorTextures);var m=e.checkFramebufferStatus(e.FRAMEBUFFER);if(m!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer failed. gl status="+m+", gl error="+e.getError()+", gl isContextLost="+e.isContextLost()+".");this.ready=!0}}},i.resetColorTextures=function(t){var e=t,i=this.renderer.glRenderer.gl,r=this.engine.gpuCapability,n=this.viewport,s=[];if(e){for(var o,a=bt(e);!(o=a()).done;){o.value.initialize()}this.colorTextures=e.slice()}this.renderer.pipelineContext.activeTexture(i.TEXTURE0),this.colorTextures.forEach(function(t,e){var o={width:n[2],height:n[3],data:new Uint8Array(0)};t.update({data:o}),r.framebufferTexture2D(i,i.FRAMEBUFFER,e,i.TEXTURE_2D,t.textureBuffer),s.push(!0)}),r.drawBuffers(i,s),this.updateAttachmentTextures()},i.resize=function(t,e,i,r){var n=this.viewport,s=n[0],o=n[1],a=n[2],h=n[3];s===t&&o===e&&a===i&&h===r||(this.viewport=[t,e,i,r],this.ready=!1,this.bind())},i.dispose=function(t){if(this.renderer){this.renderer.glRenderer.deleteGLFramebuffer(this),delete this.fbo;var e,i,r=(null==t?void 0:t.depthStencilAttachment)?t.depthStencilAttachment:Qn.force;if(r===Qn.force||r===Qn.keepExternal&&!this.externalStorage)null==(e=this.depthStencilRenderbuffer)||e.dispose(),null==(i=this.depthTexture)||i.dispose();this.renderer=this.stencilRenderbuffer=this.depthStencilRenderbuffer=null}},Ki(e,[{key:"stencilStorage",get:function(){if(this.depthStencilStorageType!==Gn.depth_16_opaque)return this.depthStencilRenderbuffer}},{key:"depthStorage",get:function(){if(this.depthStencilStorageType!==Gn.stencil_8_opaque)return this.depthStencilRenderbuffer}}]),e}(Os),Df=((xf={})[Pr.FLOAT]=1,xf[Pr.INT]=1,xf[Pr.UNSIGNED_INT]=1,xf[Pr.SHORT]=1,xf[Pr.BOOL]=1,xf[Pr.UNSIGNED_SHORT]=1,xf[Pr.FLOAT_VEC2]=2,xf[Pr.FLOAT_VEC3]=3,xf[Pr.FLOAT_VEC4]=4,xf[Pr.FLOAT_MAT2]=4,xf[Pr.FLOAT_MAT3]=9,xf[Pr.FLOAT_MAT4]=16,xf[Pr.FLOAT_MAT2x3]=6,xf[Pr.FLOAT_MAT2x4]=8,xf[Pr.FLOAT_MAT4x3]=12,xf[Pr.FLOAT_MAT4x2]=8,xf[Pr.FLOAT_MAT3x4]=12,xf[Pr.FLOAT_MAT3x2]=6,xf[Pr.INT_VEC2]=2,xf[Pr.INT_VEC3]=3,xf[Pr.INT_VEC4]=4,xf[Pr.UNSIGNED_INT_VEC2]=2,xf[Pr.UNSIGNED_INT_VEC3]=3,xf[Pr.UNSIGNED_INT_VEC4]=4,xf[Pr.BOOL_VEC2]=2,xf[Pr.BOOL_VEC3]=3,xf[Pr.BOOL_VEC4]=4,xf),Ff=Bf(Float32Array),Lf=Bf(Int32Array),kf=Bf(Uint8Array);function Nf(t){return function(e,i,r,n){var s={start:i[1],dirty:!0};if(i[2]>1){var o=e;if(o.length){for(var a=n[1]||o.length,h=i[4]/t.BYTES_PER_ELEMENT,u=s.buffer=new t(a*h),l=n[0]||0,c=0;c<a;c++)u[c*h]=o[c+l];s.start+=l*h}}else s.buffer=new t([e]);return s}}function Bf(t){return function(e,i,r,n){for(var s=i[8],o=i[2],a=i[5],h=1===o?s:i[4],u=a?h/a:1,l=h/t.BYTES_PER_ELEMENT/u,c=s/t.BYTES_PER_ELEMENT/l,f=Df[i[0]],d=f/u,p=(n[0]||0)*f,m=n[1]?u*n[1]:c,v=new t(l*m),y={start:i[1]+h*(n[0]||0),dirty:!0,buffer:v},g=0,b=0,x=p;g<m;g++){for(var _=0;_<d;_++)v[b+_]=e[x+_];b+=l,x+=d}return y}}function Uf(t,e){for(var i=function(i){var s=t.getActiveUniformBlockName(e,i);Xt(s);var o={index:t.getUniformBlockIndex(e,s),usedByVertexShader:t.getActiveUniformBlockParameter(e,i,t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),usedByFragmentShader:t.getActiveUniformBlockParameter(e,i,t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),size:t.getActiveUniformBlockParameter(e,i,t.UNIFORM_BLOCK_DATA_SIZE),uniformIndices:t.getActiveUniformBlockParameter(e,i,t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES),used:!1,uniforms:{},name:s,id:""};o.used=o.usedByVertexShader||o.usedByFragmentShader,r[i]=o;for(var a=o.uniformIndices,h=[],u=0;u<a.length;u++){var l=t.getActiveUniform(e,a[u]).name.replace("[0]","");o.uniforms[l]=[0,0,0,0,0,0,0,u,0],h[u]=l,n.push(l)}[t.UNIFORM_TYPE,t.UNIFORM_OFFSET,t.UNIFORM_SIZE,t.UNIFORM_BLOCK_INDEX,t.UNIFORM_ARRAY_STRIDE,t.UNIFORM_MATRIX_STRIDE,t.UNIFORM_IS_ROW_MAJOR].forEach(function(i,r){t.getActiveUniforms(e,a,i).forEach(function(t,e){var i=h[e];o.uniforms[i][r]=+t})});for(var c=0;c<h.length;c++){var f=o.uniforms[h[c]],d=o.uniforms[h[c+1]],p=d?d[1]:o.size;f[8]=p-f[1]}o.id=function(t){var e=t.name,i=t.size,r=t.uniforms,n=t.uniformIndices,s=Object.keys(r).map(function(t){return t+"["+r[t].join(":")+"]"}).join("+");return zf(e+"+",i+"+",n.length+"+",s)}(o)+""},r=[],n=[],s=t.getProgramParameter(e,t.ACTIVE_UNIFORM_BLOCKS),o=0;o<s;++o)i(o);return{blockSpecs:r,blockUniformNames:n}}function zf(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(var r=0,n=0;n<arguments.length;n++)for(var s=e[n],o=0;o<s.length;o++)r=Math.imul(31,r)+s.charCodeAt(o)|0;return r}(_f={})[Pr.FLOAT]=Nf(Float32Array),_f[Pr.INT]=Nf(Int32Array),_f[Pr.UNSIGNED_INT]=Nf(Uint32Array),_f[Pr.SHORT]=Nf(Int16Array),_f[Pr.BOOL]=Nf(Uint8Array),_f[Pr.UNSIGNED_SHORT]=Nf(Uint16Array),_f[Pr.FLOAT_VEC2]=Ff,_f[Pr.FLOAT_VEC3]=Ff,_f[Pr.FLOAT_VEC4]=Ff,_f[Pr.FLOAT_MAT2]=Ff,_f[Pr.FLOAT_MAT3]=Ff,_f[Pr.FLOAT_MAT4]=Ff,_f[Pr.FLOAT_MAT2x3]=Ff,_f[Pr.FLOAT_MAT2x4]=Ff,_f[Pr.FLOAT_MAT4x3]=Ff,_f[Pr.FLOAT_MAT4x2]=Ff,_f[Pr.FLOAT_MAT3x4]=Ff,_f[Pr.FLOAT_MAT3x2]=Ff,_f[Pr.INT_VEC2]=Lf,_f[Pr.INT_VEC3]=Lf,_f[Pr.INT_VEC4]=Lf,_f[Pr.UNSIGNED_INT_VEC2]=Lf,_f[Pr.UNSIGNED_INT_VEC3]=Lf,_f[Pr.UNSIGNED_INT_VEC4]=Lf,_f[Pr.BOOL_VEC2]=kf,_f[Pr.BOOL_VEC3]=kf,_f[Pr.BOOL_VEC4]=kf;var Vf=function(){function t(t,e,i){var r=this;this.engine=t,this.program=e,this.id=i,this.uniformBlockMap={},this.pipelineContext=t.getGLPipelineContext();var n=this.pipelineContext.gl;(this.pipelineContext.useProgram(e),this.attribInfoMap=this.createAttribMap(),Mr(n))&&Uf(n,e).blockSpecs.forEach(function(t){return r.uniformBlockMap[t.name]=t});this.pipelineContext.useProgram(null)}var e=t.prototype;return e.bind=function(){this.pipelineContext.useProgram(this.program)},e.setupAttributes=function(t){var e,i,r=this,n=this.id,s=this.pipelineContext.gl;return t.vaos[n]?i=t.vaos[n]:((i=new hf(this.engine,t.name+"-"+n))||console.error("Failed to create VAO object."),t.vaos[n]=i),i&&i.vao&&(i.bind(),i.ready)||(Object.keys(this.attribInfoMap).forEach(function(e){var i=r.attribInfoMap[e],n=t.attributes[e];if(n){var o=t.buffers[n.dataSource];if(!o)throw new Error("Failed to find a buffer named '"+(n.dataSource||e)+"'. Please ensure the buffer is correctly initialized and bound.");o.bind(),s.enableVertexAttribArray(i.loc),s.vertexAttribPointer(i.loc,n.size,n.type,n.normalize,n.stride||0,n.offset||0)}}),null==(e=t.indicesBuffer)||e.bind(),i&&(i.ready=!0)),i},e.createAttribMap=function(){for(var t=this.pipelineContext.gl,e=this.program,i={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=0;n<r;n++){var s=t.getActiveAttrib(e,n);if(s){var o=s.name,a=s.type,h=s.size,u=t.getAttribLocation(e,o);i[o]={type:a,name:o,size:h,loc:u}}}return i},e.dispose=function(){this.pipelineContext&&(this.pipelineContext.gl.deleteProgram(this.program),this.pipelineContext=null)},t}(),Gf=function(t){function e(e,i){var r;return(r=t.call(this,e,i)||this).initialized=!1,r.uniformLocations={},r.samplerChannels={},r}Xe(e,t);var i=e.prototype;return i.initialize=function(){this.initialized||this.engine.getGLPipelineContext().shaderLibrary.compileShader(this)},i.setFloat=function(t,e){this.pipelineContext.setFloat(this.uniformLocations[t],e)},i.setInt=function(t,e){this.pipelineContext.setInt(this.uniformLocations[t],e)},i.setFloats=function(t,e){this.pipelineContext.setFloats(this.uniformLocations[t],e)},i.setTexture=function(t,e){this.pipelineContext.setTexture(this.uniformLocations[t],this.samplerChannels[t],e)},i.setVector2=function(t,e){this.pipelineContext.setVector2(this.uniformLocations[t],e)},i.setVector3=function(t,e){this.pipelineContext.setVector3(this.uniformLocations[t],e)},i.setVector4=function(t,e){this.pipelineContext.setVector4(this.uniformLocations[t],e)},i.setColor=function(t,e){this.pipelineContext.setColor(this.uniformLocations[t],e)},i.setQuaternion=function(t,e){this.pipelineContext.setQuaternion(this.uniformLocations[t],e)},i.setMatrix=function(t,e){this.pipelineContext.setMatrix(this.uniformLocations[t],e)},i.setMatrix3=function(t,e){this.pipelineContext.setMatrix3(this.uniformLocations[t],e)},i.setVector4Array=function(t,e){this.pipelineContext.setVector4Array(this.uniformLocations[t],e)},i.setMatrixArray=function(t,e){this.pipelineContext.setMatrixArray(this.uniformLocations[t],e)},i.fillShaderInformation=function(t,e){var i=e.slice();t=t.concat(i);for(var r,n=this.pipelineContext.getUniforms(this.program.program,t),s=0;s<t.length;s++)this.uniformLocations[t[s]]=n[s];for(r=0;r<i.length;r++){null==this.uniformLocations[i[r]]&&(i.splice(r,1),r--)}for(r=0;r<i.length;r++){var o=i[r];this.samplerChannels[o]=r}},i.toData=function(){var t=this.defination;t.dataType=ki.Shader,t.id=this.guid,t.vertex=this.source.vertex,t.fragment=this.source.fragment},i.dispose=function(){var t;this.compileResult&&this.compileResult.shared||null==(t=this.program)||t.dispose()},e}(An),jf=0,Hf=function(){function t(t,e){this.engine=t,this.pipelineContext=e,this.shaderResults={},this.programMap={},this.glVertShaderMap=new Map,this.glFragShaderMap=new Map,this.shaderAllDone=!1,this.cachedShaders={},this.glAsyncCompileExt=t.gpuCapability.glAsyncCompileExt}var e=t.prototype;return e.compileAllShaders=function(t){var e=this;if(this.shaderAllDone)t&&t([]);else{for(var i,r=[],n=bt(Object.keys(this.cachedShaders));!(i=n()).done;){var s=i.value;this.cachedShaders[s].initialized||r.push(s)}t?r.length?Promise.all(r.map(function(t){return new Promise(function(i){return e.compileShader(e.cachedShaders[t],i)})})).then(t).catch(function(){return 0}):t([]):r.map(function(t){return e.compileShader(e.cachedShaders[t])}),this.shaderAllDone=!0}},e.addShader=function(t,e){var i,r,n=[];t.macros&&(i=n).push.apply(i,[].concat(t.macros));e&&(r=n).push.apply(r,[].concat(e));var s=Ur({},t,{vertex:ss.genFinalShaderCode({level:this.engine.gpuCapability.level,shaderType:Er.vertex,shader:t.vertex,macros:n}),fragment:ss.genFinalShaderCode({level:this.engine.gpuCapability.level,shaderType:Er.fragment,shader:t.fragment,macros:n})}),o=this.computeShaderCacheId(s);if(this.cachedShaders[o])return o;this.shaderAllDone=!1;var a=!1;return(s.shared||s.cacheId)&&(a=!0),this.cachedShaders[o]=new Gf(this.engine,Ur({},s,{vertex:s.vertex,fragment:s.fragment,name:s.name||o,shared:a})),this.cachedShaders[o].id=o,o},e.createShader=function(t,e){var i=this.addShader(t,e);return this.cachedShaders[i]},e.compileShader=function(t,e){var i=this,r=t.source,n=r.shared,s=r.vertex,o=r.fragment,a=r.name,h=t.source.cacheId,u=!1;(n||h)&&(u=!0);var l=this.pipelineContext.gl,c={shared:u,status:bn.compiling},f=this.createProgram(l,s,o,c),d=this.glAsyncCompileExt,p=performance.now(),m=function(e){c.status=bn.success,c.compileTime=performance.now()-p,t.program=e,t.initialized=!0,t.pipelineContext=i.pipelineContext,void 0!==i.programMap[t.id]&&console.warn("Find duplicated shader id: "+t.id+"."),i.programMap[t.id]=e},v=function(){if(i.engine.isDestroyed)return console.warn("The player is destroyed during the loadScene process. Please check the timing of calling loadScene and dispose. A common situation is that when calling loadScene, await is not added. This will cause dispose to be called before loadScene is completed."),null==e?void 0:e(c);if(t.initialized)return null==e?void 0:e(c);var r=(!e||!d||d&&1==l.getProgramParameter(c.program,d.COMPLETION_STATUS_KHR))&&f();if(r){if(c.status!==bn.fail){cf(r,a);var n=new Vf(i.engine,r,t.id);if(l.validateProgram(r),l.getProgramParameter(r,l.VALIDATE_STATUS))m(n);else{var h=l.getProgramInfoLog(r);(null==h?void 0:h.includes("the same texture"))||(null==h?void 0:h.includes("Two textures of different types use the same sampler"))?m(n):(c.status=bn.fail,c.error=h,console.error("compileProgramError: "+h,"\nvertex:\n",s,"\nfragment:\n",o),l.deleteProgram(r))}}null==e||e(c)}else e&&requestAnimationFrame(v)};t.compileResult=c,v()},e.computeShaderCacheId=function(t){var e=t.vertex,i=void 0===e?"":e,r=t.fragment,n=void 0===r?"":r,s=t.shared,o=t.cacheId;return s||o?o||"shared_"+zf(i,n):"instanced_"+jf++},e.createProgram=function(t,e,i,r){var n=t.createProgram(),s=this.createGLShader(t,t.VERTEX_SHADER,e),o=this.createGLShader(t,t.FRAGMENT_SHADER,i);return n&&s&&o?(t.attachShader(n,s),t.attachShader(n,o),t.linkProgram(n),r.program=n,r.status=bn.compiling,function(){if(r.program=void 0,!t.getProgramParameter(n,t.LINK_STATUS)){var a=t.getProgramInfoLog(n);console.error("Failed to link program: "+a+".");var h=Xf(t,s,"vertex",e),u=Xf(t,o,"fragment",i);return r.status=bn.fail,h&&(r.error=h.error,r.status=h.status),u&&(r.error=u.error,r.status=u.status),n}return n}):(r.status=bn.fail,function(){return null})},e.createGLShader=function(t,e,i){var r=e===t.VERTEX_SHADER?this.glVertShaderMap:this.glFragShaderMap,n=zf(null!=i?i:""),s=r.get(n);if(s)return s;var o=t.createShader(e);return o&&(t.shaderSource(o,i),t.compileShader(o),r.set(n,o)),o},e.deleteShader=function(t){var e=this.programMap[t];void 0!==e&&(e.dispose(),delete this.programMap[t]),void 0!==this.shaderResults[t]&&delete this.shaderResults[t]},e.restore=function(){},e.dispose=function(){var t=this;if(Object.keys(this.programMap).forEach(function(e){t.programMap[e].dispose()}),this.programMap={},this.pipelineContext){var e=this.pipelineContext.gl;this.glFragShaderMap.forEach(function(t){e.deleteShader(t)}),this.glVertShaderMap.forEach(function(t){e.deleteShader(t)}),this.glVertShaderMap=new Map,this.glFragShaderMap=new Map}},t}();function Xf(t,e,i,r){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var n=t.getShaderInfoLog(e);return console.error("compile "+i+" error: "+n,(null!=r?r:"").split("\n").map(function(t,e){return e+1+" "+t}).join("\n")),{error:n,status:bn.fail}}}var Wf=function(){function t(t,e){this.engine=t,this.gl=e,this.gl=e,this.shaderLibrary=new Hf(t,this),this.maxTextureCount=this.gl.TEXTURE0+this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)-1,this.reset()}var e=t.prototype;return e.dispose=function(){this.shaderLibrary.dispose(),this.reset()},e.reset=function(){this.glCapabilityCache={},this.activeTextureIndex=Pr.TEXTURE0,this.textureUnitDict={},this.currentFramebuffer={},this.pixelStorei={},this.currentRenderbuffer={}},e.toggle=function(t,e){e?this.enable(t):this.disable(t)},e.enable=function(t){!0!==this.glCapabilityCache[t]&&(this.glCapabilityCache[t]=!0,this.gl.enable(t))},e.disable=function(t){!1!==this.glCapabilityCache[t]&&(this.glCapabilityCache[t]=!1,this.gl.disable(t))},e.bindFramebuffer=function(t,e){this.currentFramebuffer[t]!==e&&(this.currentFramebuffer[t]=e,this.gl.bindFramebuffer(t,e))},e.bindRenderbuffer=function(t,e){this.currentRenderbuffer[t]!==e&&(this.currentRenderbuffer[t]=e,this.gl.bindRenderbuffer(t,e))},e.bindSystemFramebuffer=function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,null)},e.useProgram=function(t){this.set1("useProgram",t)},e.clear=function(t){this.gl.clear(t)},e.clearDepth=function(t){this.set1("clearDepth",t)},e.depthFunc=function(t){this.set1("depthFunc",t)},e.depthMask=function(t){this.set1("depthMask",t)},e.polygonOffset=function(t,e){this.set2("polygonOffset",t,e)},e.depthRange=function(t,e){this.set2("depthRange",t,e)},e.clearStencil=function(t){this.set1("clearStencil",t)},e.stencilMask=function(t){this.stencilMaskSeparate(this.gl.FRONT,t),this.stencilMaskSeparate(this.gl.BACK,t)},e.stencilFunc=function(t,e,i){this.stencilFuncSeparate(this.gl.FRONT,t,e,i),this.stencilFuncSeparate(this.gl.BACK,t,e,i)},e.stencilFuncSeparate=function(t,e,i,r){this.set4("stencilFuncSeparate",t,e,i,r)},e.stencilMaskSeparate=function(t,e){this.set2("stencilMaskSeparate",t,e)},e.stencilOp=function(t,e,i){this.stencilOpSeparate(this.gl.FRONT,t,e,i),this.stencilOpSeparate(this.gl.BACK,t,e,i)},e.stencilOpSeparate=function(t,e,i,r){this.set4("stencilOpSeparate",t,e,i,r)},e.cullFace=function(t){this.set1("cullFace",t)},e.frontFace=function(t){this.set1("frontFace",t)},e.clearColor=function(t,e,i,r){this.set4("clearColor",t,e,i,r)},e.colorMask=function(t,e,i,r){this.set4("colorMask",t,e,i,r)},e.blendColor=function(t,e,i,r){this.set4("blendColor",t,e,i,r)},e.blendFunc=function(t,e){this.blendFuncSeparate(t,e,t,e)},e.blendFuncSeparate=function(t,e,i,r){this.set4("blendFuncSeparate",t,e,i,r)},e.blendEquation=function(t){this.set1("blendEquation",t)},e.blendEquationSeparate=function(t,e){this.set2("blendEquationSeparate",t,e)},e.setPixelStorei=function(t,e){this.pixelStorei[t]!==e&&(this.pixelStorei[t]=e,this.gl.pixelStorei(t,e))},e.viewport=function(t,e,i,r){this.set4("viewport",t,e,i,r)},e.activeTexture=function(t){t=Math.min(t,this.maxTextureCount),this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},e.bindTexture=function(t,e,i){(this.currentTextureBinding!==e||i)&&(this.gl.bindTexture(t,e),this.currentTextureBinding=e),this.textureUnitDict[this.activeTextureIndex]=e},e.set1=function(t,e){this.glCapabilityCache[t]!==e&&(this.glCapabilityCache[t]=e,this.gl[t](e))},e.set2=function(t,e,i){var r=this.glCapabilityCache[t];r||(r=this.glCapabilityCache[t]={x:NaN,y:NaN}),r.x===e&&r.y===i||this.gl[t](r.x=e,r.y=i)},e.set3=function(t,e,i,r){var n=this.glCapabilityCache[t];n||(n=this.glCapabilityCache[t]={x:NaN,y:NaN,z:NaN}),n.x===e&&n.y===i&&n.z===r||this.gl[t](n.x=e,n.y=i,n.z=r)},e.set4=function(t,e,i,r,n){var s=this.glCapabilityCache[t];s||(s=this.glCapabilityCache[t]={x:NaN,y:NaN,z:NaN,w:NaN}),s.x===e&&s.y===i&&s.z===r&&s.w===n||this.gl[t](s.x=e,s.y=i,s.z=r,s.w=n)},e.get=function(t){return this.glCapabilityCache[t]},e.setFloat=function(t,e){t&&this.gl.uniform1f(t,e)},e.setInt=function(t,e){t&&this.gl.uniform1i(t,e)},e.setFloats=function(t,e){t&&this.gl.uniform1fv(t,e)},e.setVector2=function(t,e){this.setFloat2(t,e.x,e.y)},e.setVector3=function(t,e){this.setFloat3(t,e.x,e.y,e.z)},e.setVector4=function(t,e){this.setFloat4(t,e.x,e.y,e.z,e.w)},e.setColor=function(t,e){this.setFloat4(t,e.r,e.g,e.b,e.a)},e.setQuaternion=function(t,e){this.setFloat4(t,e.x,e.y,e.z,e.w)},e.setVector4Array=function(t,e){t&&e.length%4==0&&this.gl.uniform4fv(t,e)},e.setMatrix=function(t,e){t&&this.gl.uniformMatrix4fv(t,!1,e.elements)},e.setMatrix3=function(t,e){t&&this.gl.uniformMatrix3fv(t,!1,e.elements)},e.setMatrixArray=function(t,e){t&&e.length%16==0&&this.gl.uniformMatrix4fv(t,!1,e)},e.setTexture=function(t,e,i){if(t){this.gl.activeTexture(this.gl.TEXTURE0+e);var r=i.target;this.gl.bindTexture(r,i.textureBuffer),this.gl.uniform1i(t,e)}},e.getUniforms=function(t,e){for(var i=[],r=0;r<e.length;r++)i.push(this.gl.getUniformLocation(t,e[r]));return i},e.setFloat4=function(t,e,i,r,n){t&&this.gl.uniform4f(t,e,i,r,n)},e.setFloat3=function(t,e,i,r){t&&this.gl.uniform3f(t,e,i,r)},e.setFloat2=function(t,e,i){t&&this.gl.uniform2f(t,e,i)},t}(),Yf=function(t){function e(e,i,r){var n;(n=t.call(this)||this).canvas=e,n.temporaryRTs={};var s=Ur({preserveDrawingBuffer:void 0,alpha:!0,stencil:!0,antialias:!0,depth:!0,premultipliedAlpha:!0},r);n.context=new Cf(e,i,s);var o=n.context.gl;return Xt(o),n.engine=new If(o),n.engine.renderer=$a(n),n.pipelineContext=new Wf(n.engine,o),n.glRenderer=new lf(n.engine),n.extension=new Af($a(n)),n.renderingData={currentFrame:{}},n.framebuffer=new Mf({storeAction:{},viewport:[0,0,n.width,n.height],attachments:[new of(n.engine,{sourceType:Cr.framebuffer,data:{width:n.width,height:n.height}})],depthStencilAttachment:{storageType:Gn.none}},$a(n)),n}Xe(e,t);var i=e.prototype;return i.renderRenderFrame=function(t){var e,i=t;i.resource&&i.resource.color_b.initialize(),i.emptyTexture.initialize(),i.transparentTexture.initialize();var r=i._renderPasses;if(this.isDestroyed)console.error("Renderer is destroyed, target: GLRenderer.");else{null==(e=i.renderer.getShaderLibrary())||e.compileAllShaders(),this.setFramebuffer(null),this.clear(i.clearAction);var n=i.camera;this.renderingData.currentFrame=i,this.renderingData.currentCamera=n,this.setGlobalMatrix("effects_MatrixInvV",n.getInverseViewMatrix()),this.setGlobalMatrix("effects_MatrixV",n.getViewMatrix()),this.setGlobalMatrix("effects_MatrixVP",n.getViewProjectionMatrix()),this.setGlobalMatrix("_MatrixP",n.getProjectionMatrix()),this.setGlobalVector3("effects_WorldSpaceCameraPos",n.position),Gt(r);for(var s,o=bt(r);!(s=o()).done;){var a=s.value,h=a.delegate;null==h.willBeginRenderPass||h.willBeginRenderPass.call(h,a,this.renderingData),this.renderRenderPass(a),null==h.didEndRenderPass||h.didEndRenderPass.call(h,a,this.renderingData)}for(var u,l=bt(r);!(u=l()).done;){u.value.frameCleanup(this)}}},i.renderRenderPass=function(t){this.renderingData.currentPass=t,t.initialize(this),t.configure(this),t.execute(this)},i.renderMeshes=function(t){for(var e,i=this.renderingData.currentPass.delegate,r=bt(t);!(e=r()).done;){var n=e.value;null==i.willRenderMesh||i.willRenderMesh.call(i,n,this.renderingData),n.render(this),null==i.didRenderMesh||i.didRenderMesh.call(i,n,this.renderingData)}},i.setGlobalFloat=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.floats[t]=e},i.setGlobalVector4=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.vector4s[t]=e},i.getGlobalVector4=function(t){return this.renderingData.currentFrame.globalUniforms.vector4s[t]},i.setGlobalInt=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.ints[t]=e},i.setGlobalMatrix=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.matrices[t]=e},i.setGlobalVector3=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.vector3s[t]=e},i.drawGeometry=function(t,e,i){if(void 0===i&&(i=0),t&&e){e.initialize(),t.initialize(),t.flush();var r=this.renderingData;r.currentFrame.editorTransform&&e.setVector4("uEditorTransform",r.currentFrame.editorTransform);try{e.use(this,r.currentFrame.globalUniforms)}catch(t){return void console.error(t)}this.glRenderer.drawGeometry(t,e,i)}},i.setFramebuffer=function(t){t?(this.framebuffer=t,this.framebuffer.bind(),this.setViewport(t.viewport[0],t.viewport[1],t.viewport[2],t.viewport[3])):(this.pipelineContext.bindSystemFramebuffer(),this.setViewport(0,0,this.getWidth(),this.getHeight()))},i.getFramebuffer=function(){return this.framebuffer},i.getTemporaryRT=function(t,e,i,r,n,s){if(this.temporaryRTs[t])return this.temporaryRTs[t];var o,a,h=Gn.none;n===vs.Linear?o=Pr.LINEAR:n===vs.Nearest&&(o=Pr.NEAREST),s===gs.RGBA32?a=Pr.UNSIGNED_BYTE:s===gs.RGBAHalf&&(a=Pr.HALF_FLOAT),0===r?h=Gn.none:16===r?h=Gn.depth_16_opaque:24===r&&(h=Gn.depth_24_stencil_8_texture);var u=new of(this.engine,{sourceType:Cr.framebuffer,minFilter:o,magFilter:o,internalFormat:Pr.RGBA,format:Pr.RGBA,type:a}),l=new Mf({name:t,storeAction:{},viewport:[0,0,e,i],viewportScale:1,isCustomViewport:!0,attachments:[u],depthStencilAttachment:{storageType:h}},this);return this.temporaryRTs[t]=l,l},i.setViewport=function(t,e,i,r){this.pipelineContext.viewport(t,e,i,r)},i.clear=function(t){var e=this.pipelineContext,i=0;if(t.colorAction===Ar.clear){var r=t.clearColor;r&&e.clearColor(r[0],r[1],r[2],r[3]),e.colorMask(!0,!0,!0,!0),i=Pr.COLOR_BUFFER_BIT}if(t.stencilAction===Ar.clear&&(e.stencilMask(255),e.clearStencil(t.clearStencil||0),i|=Pr.STENCIL_BUFFER_BIT),t.depthAction===Ar.clear){var n=t.clearDepth;e.depthMask(!0),e.clearDepth(Number.isFinite(n)?n:1),i|=Pr.DEPTH_BUFFER_BIT}i&&e.clear(i)},i.addLostHandler=function(t){this.context.addLostHandler(t)},i.addRestoreHandler=function(t){this.context.addRestoreHandler(t)},i.getShaderLibrary=function(){return this.pipelineContext.shaderLibrary},i.getWidth=function(){return this.width},i.getHeight=function(){return this.height},i.dispose=function(){var t;this.context.dispose(),this.extension.dispose(),this.pipelineContext.dispose(),null==(t=this.glRenderer)||t.dispose(),this.canvas=null,this.engine.dispose()},i.lost=function(t){t.preventDefault(),this.pipelineContext.dispose(),this.extension.dispose(),this.glRenderer.lost(t)},i.restore=function(){var t=this.context.gl;if(!t)throw new Error("Can not restore automatically because losing gl context.");this.engine.gpuCapability=new Ts(t),this.engine.renderer=this,this.pipelineContext=new Wf(this.engine,t),this.glRenderer=new lf(this.engine),this.extension=new Af(this)},i.resize=function(t,e){var i=this.glRenderer;i&&(this.width===t&&this.height===e||i.resize(t,e))},i.checkGlobalUniform=function(t){var e=this.renderingData.currentFrame.globalUniforms;e.uniforms.includes(t)||e.uniforms.push(t)},Ki(e,[{key:"isDestroyed",get:function(){var t=this.glRenderer;return!t||t.isDestroyed}},{key:"height",get:function(){var t,e;return null!=(e=null==(t=this.glRenderer)?void 0:t.height)?e:0}},{key:"width",get:function(){var t,e;return null!=(e=null==(t=this.glRenderer)?void 0:t.width)?e:0}}]),e}(Cs),qf="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#MvjnY",Zf="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#ulfNT",Kf="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#lLlSW",Qf="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#WZaWg",Jf="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#YSWQr",$f="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#IzodZ",td="https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#X0ulg";var ed=new Map;var id=1,rd=function(t){function e(e){var i;(i=t.call(this)||this).compositions=[],i.displayScale=1,i.resumePending=!1,i.disposed=!1,i.assetManagers=[],i.speed=1,i.baseCompositionIndex=0,i.useExternalCanvas=!1,i.lost=function(t){var e;null==(e=i.ticker)||e.pause(),i.compositions.forEach(function(e){return e.lost(t)}),i.renderer.lost(t),i.handleEmitEvent("webglcontextlost",t),nd($a(i),!1)};var r=$a(i);i.restore=yt(function(){var t;return wt(this,function(e){switch(e.label){case 0:return r.renderer.restore(),[4,Promise.all(r.compositions.map(yt(function(t){var e,i,n,s,o,a,h,u,l,c,f,d;return wt(this,function(p){switch(p.label){case 0:return e=t.time,i=t.url,n=t.speed,s=t.keepResource,o=t.reusable,a=t.renderOrder,h=t.transform,u=t.videoState,[4,r.loadScene(i)];case 1:(l=p.sent()).speed=n,l.reusable=o,l.keepResource=s,l.renderOrder=a,l.transform.setPosition(h.position.x,h.position.y,h.position.z),l.transform.setRotation(h.rotation.x,h.rotation.y,h.rotation.z),l.transform.setScale(h.scale.x,h.scale.y,h.scale.z),c=0,p.label=2;case 2:return c<u.length?u[c]?((f=l.textures[c].source.video).currentTime=null!=(d=u[c])?d:0,[4,f.play()]):[3,4]:[3,5];case 3:p.sent(),p.label=4;case 4:return c++,[3,2];case 5:return l.isEnded=!1,l.gotoAndPlay(e),[2,l]}})})))];case 1:return r.compositions=e.sent(),r.emit("webglcontextrestored"),null==(t=r.ticker)||t.resume(),navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)&&r.canvas&&(r.canvas.style.display="none",window.setTimeout(function(){r.canvas.style.display=""},0)),[2]}})}),i.handleResume=function(){i.emit("update",{player:$a(i),playing:!0})},i.handleClick=function(t){var e=t.x,r=t.y,n=[];i.compositions.forEach(function(t){for(var s,o=bt(t.hitTest(e,r));!(s=o()).done;){var a=s.value;n.push(Ur({},a,{player:$a(i),composition:t}))}});for(var s=0;s<n.length;s++){var o=n[s],a=o.behavior||Pe.NOTIFY;a===Pe.NOTIFY?(i.emit("click",Ur({},o,{compositionId:o.composition.id,compositionName:o.composition.name})),o.composition.emit("click",Ur({},o,{compositionId:o.composition.id,compositionName:o.composition.name}))):a===Pe.RESUME_PLAYER&&i.resume()}};var n=e.container,s=e.canvas,o=e.fps,a=e.name,h=e.pixelRatio,u=e.manualRender,l=e.reportGPUTime,c=e.renderFramework,f=e.notifyTouch,d=e.onError,p=e.interactive,m=void 0!==p&&p,v=e.renderOptions,y=void 0===v?{}:v,g=e.env,b=void 0===g?"":g,x=y.willCaptureImage,_=y.premultipliedAlpha;if(i.onError=d,"debug-disable"===c)return gl(i);var E,w,T=(E=/iPhone OS (\d+)_(\d+)/.exec(navigator.userAgent))&&("13"===E[1]||"16"===E[1]&&"5"===E[2])?"webgl":"webgl2";c&&(T="webgl"===c?"webgl":"webgl2"),i.reportGPUTime=l,i.pixelRatio=Number.isFinite(h)?h:function(){if("object"==typeof screen&&"object"==typeof document){var t=Math.max(document.documentElement.clientWidth,window.innerWidth||0),e=screen.width/t;return Math.min(2*e,2)}return 1}(),i.offscreenMode=!0,i.env=b,i.name=a||""+id++;try{if(Rr.length)throw new Error("Errors before player create: "+Rr.map(function(t,e){return"\n "+(e+1)+": "+t})+".",{cause:"webgliniterror"});s?(i.canvas=s,i.useExternalCanvas=!0):(sd(n),i.canvas=document.createElement("canvas"),n.appendChild(i.canvas)),i.container=i.canvas.parentElement,i.renderer=Cs.create(i.canvas,T,{preserveDrawingBuffer:x,premultipliedAlpha:_}),i.renderer.env=b,i.renderer.addLostHandler({lost:i.lost}),i.renderer.addRestoreHandler({restore:i.restore}),i.gpuCapability=i.renderer.engine.gpuCapability,i.assetService=new Dc(i.renderer.engine),u||(i.ticker=new tf(o),i.ticker.add(i.tick.bind($a(i)))),i.event=new Lo(i.canvas,!!f),i.event.bindListeners(),i.event.addEventListener(Fo,i.handleClick),i.interactive=m,i.resize(),(w=i.gpuCapability.detail).maxVertexUniforms>=256?32:w.maxVertexUniforms>=128&&16}catch(t){i.canvas&&!i.useExternalCanvas&&i.canvas.remove(),i.handleThrowError(t)}return ed.forEach(function(t){t.gpuCapability.type!==i.gpuCapability.type&&Qt.warn("Create player with different WebGL version: old="+t.gpuCapability.type+", new="+i.gpuCapability.type+".\nsee "+td+".")}),ed.set(i.canvas,$a(i)),function(){for(var t,e=[],i=bt(ed.values());!(t=i()).done;){var r=t.value;r.paused||e.push(r)}e.length>1&&Qt.error("Current running player count: "+e.length+", see "+$f+".",e)}(),nd($a(i),!0),i}Xe(e,t);var i=e.prototype;return i.setSpeed=function(t){isNaN(t)||(this.speed=t)},i.getSpeed=function(){return this.speed},i.getCompositionByName=function(t){return this.compositions.find(function(e){return e.name===t})},i.getCompositions=function(){return this.compositions.sort(function(t,e){return t.getIndex()-e.getIndex()})},i.getAssetManager=function(){return this.assetManagers},i.loadScene=function(t,e){var i=this;return yt(function(){var r,n,s,o,a,h,u,l,c,f,d,p,m,v,y,g,b,x,_,E;return wt(this,function(w){switch(w.label){case 0:return Xt(i.renderer,"Renderer is not exist, maybe the Player has been disabled or in gl 'debug-disable' mode."),o=performance.now(),a=[],h=[],l=null==(u=null==e?void 0:e.autoplay)||u,c=null==(n=i.renderer.engine.gpuCapability)||null==(r=n.detail)?void 0:r.asyncShaderCompile,f=i.baseCompositionIndex,te(t)?(d=a).push.apply(d,[].concat(t)):a.push(t),i.baseCompositionIndex+=a.length,l&&(i.autoPlaying=!0),p=[],[4,Promise.all(a.map(yt(function(t,r){var n,s,o,a,u,c,d,m;return wt(this,function(v){switch(v.label){case 0:return n=i.assetService.assembleSceneLoadOptions(t,Ur({autoplay:l},e)),s=n.source,o=n.options,u=null!=(a=null==o?void 0:o.autoplay)?a:l,c=new Rc(o),i.assetManagers.push(c),[4,c.loadScene(s,i.renderer,{env:i.env})];case 1:return d=v.sent(),i.disposed?(h.length=0,[2]):(i.assetService.prepareAssets(d,d.assets),i.assetService.updateTextVariables(d,c.options.variables),i.assetService.initializeTexture(d),d.pluginSystem.precompile(d.jsonScene.compositions,i.renderer),(m=i.createComposition(d,o)).setIndex(f+r),h[r]=m,p[r]=u,[2])}})})))];case 1:return w.sent(),m=performance.now(),[4,new Promise(function(t){var e;null==(e=i.renderer.getShaderLibrary())||e.compileAllShaders(function(){return t(null)})})];case 2:for(w.sent(),v=performance.now()-m,y=0;y<h.length;y++)p[y]?h[y].play():h[y].pause(),i.compositions.push(h[y]);for(null==(s=i.ticker)||s.start(),g=h.map(function(t){return t.name}),b=performance.now()-o,x=bt(h);!(_=x()).done;)(E=_.value).statistic.compileTime=v,E.statistic.firstFrameTime=b;return Qt.info("First frame ["+g+"]: "+b.toFixed(4)+"ms."),Qt.info("Shader "+(c?"async":"sync")+" compile ["+g+"]: "+v.toFixed(4)+"ms."),[2,te(t)?h:h[0]]}})})()},i.createComposition=function(t,e){var i=this;void 0===e&&(e={});var r=this.renderer,n=new Iu(Ur({},e,{renderer:r,width:r.getWidth(),height:r.getHeight(),event:this.event,handleItemMessage:function(t){i.emit("message",t)}}),t);return this.ticker&&e.renderLevel===ye.B&&this.ticker.setFPS(Math.min(this.ticker.getFPS(),30)),this.env!==yo&&this.assetService.createShaderVariant(),n},i.play=function(){var t;this.offscreenMode&&(this.resize(),this.offscreenMode=!1),this.autoPlaying=!0,this.compositions.map(function(t){t.play()}),null==(t=this.ticker)||t.start()},i.gotoAndPlay=function(t){this.offscreenMode&&(this.resize(),this.offscreenMode=!1),this.autoPlaying=!0,this.compositions.map(function(e){e.gotoAndPlay(t)}),this.ticker?this.ticker.start():this.doTick(0,!0)},i.gotoAndStop=function(t){var e;this.offscreenMode&&(this.resize(),this.offscreenMode=!1),this.autoPlaying=!1,this.compositions.map(function(e){e.gotoAndStop(t)}),this.ticker&&!(null==(e=this.ticker)?void 0:e.getPaused())||this.doTick(0,!0),this.emit("update",{player:this,playing:!1})},i.playSequence=function(t){for(var e,i=function(e){t[e].on("end",function(){t[e+1].play()})},r=0;r<t.length-1;r++)i(r);t[0].play(),null==(e=this.ticker)||e.start()},i.pause=function(t){var e;this.paused||(null==(e=this.ticker)||e.pause(),this.emit("pause"),this.emit("update",{player:this,playing:!1}),t&&t.offloadTexture&&this.offloadTexture())},i.resume=function(){var t=this;return yt(function(){var e;return wt(this,function(i){switch(i.label){case 0:return t.resumePending?[2]:t.paused?(t.resumePending=!0,[4,Promise.all(t.compositions.map(function(t){return t.reloadTexture()}))]):[3,2];case 1:i.sent(),t.resumePending=!1,t.handleResume(),i.label=2;case 2:return null==(e=t.ticker)||e.resume(),[2]}})})()},i.tick=function(t){this.doTick(t,this.forceRenderNextFrame),this.forceRenderNextFrame=!1},i.doTick=function(t,e){var i,r=this,n=this.renderer.engine.renderErrors;n.size>0&&(this.handleEmitEvent("rendererror",n.values().next().value),null==(i=this.ticker)||i.pause());t=Math.min(t,33)*this.speed;var s=this.compositions,o=!1;s.sort(function(t,e){return t.getIndex()-e.getIndex()});for(var a,h=[],u=0;u<s.length;u++){var l=s[u];l.textureOffloaded?(o=!0,Qt.error("Composition "+l.name+" texture offloaded, skip render."),h.push(l)):(!l.isDestroyed&&l.renderer&&l.update(t),l.isDestroyed||h.push(l))}if(this.compositions=h,this.baseCompositionIndex=this.compositions.length,o)return this.handleEmitEvent("rendererror",new Error("Play when texture offloaded.")),null==(a=this.ticker)?void 0:a.pause();if(!this.paused||e){var c=this.gpuCapability.level,f=this.renderer.context.gl,d=2===c&&this.reportGPUTime?function(t){var e=t.getExtension("EXT_disjoint_timer_query_webgl2");if(e){var i=t.createQuery(),r=yt(function(){return wt(this,function(n){return[2,new Promise(function(n,s){if(i){var o=t.getQueryParameter(i,t.QUERY_RESULT_AVAILABLE),a=t.getParameter(e.GPU_DISJOINT_EXT);if(o&&!a){var h=t.getQueryParameter(i,t.QUERY_RESULT);n(h/1e3/1e3)}(o||a)&&(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}}}(f):void 0;if(null==d||d.begin(),this.compositions.length||this.compositions.length<s.length||e){this.renderer.setFramebuffer(null),this.renderer.clear({stencilAction:Ar.clear,clearStencil:0,depthAction:Ar.clear,clearDepth:1,colorAction:Ar.clear,clearColor:[0,0,0,0]});for(var p=0;p<s.length;p++)!s[p].renderFrame.isDestroyed&&this.renderer.renderRenderFrame(s[p].renderFrame)}null==d||d.end(),null==d||d.getTime().then(function(t){return null==r.reportGPUTime?void 0:r.reportGPUTime.call(r,null!=t?t:0)}).catch,this.autoPlaying&&this.emit("update",{player:this,playing:!0})}},i.resizeToAspect=function(t,e){void 0===e&&(e=1),t!==this.displayAspect&&(this.displayAspect=t),e!==this.displayScale&&(this.displayScale=e),this.resize()},i.resize=function(){var t,e,i,r,n=this.canvas.parentElement;if(n){var s=this.getTargetSize(n);t=s[0],e=s[1],i=s[2],r=s[3]}else t=i=this.canvas.width,e=r=this.canvas.height;var o=t/e;if(t&&e){var a,h=document.documentElement.clientWidth;i>2*h&&Qt.error("DPI overflowed, width "+i+" is more than 2x document width "+h+", see "+Zf+".");var u=this.env?this.gpuCapability.detail.maxTextureSize:2048;(i>u||r>u)&&(Qt.error("Container size overflowed "+i+"x"+r+", see "+qf+"."),o>1?(i=Math.round(u),r=Math.round(u/o)):(r=Math.round(u),i=Math.round(u*o))),this.renderer.resize(i,r),this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",Qt.info("Resize player "+this.name+" ["+i+","+r+","+t+","+e+"]."),null==(a=this.compositions)||a.forEach(function(t){t.camera.aspect=o})}},i.clearCanvas=function(t){t?this.renderer.clear({stencilAction:Ar.clear,clearStencil:0,depthAction:Ar.clear,clearDepth:1,colorAction:Ar.clear,clearColor:[0,0,0,0]}):this.forceRenderNextFrame=!0},i.destroyCurrentCompositions=function(){this.compositions.forEach(function(t){return t.dispose()}),this.compositions.length=0,this.baseCompositionIndex=0},i.dispose=function(t){var e;if(Qt.info("Call player destroyed: "+this.name+"."),!this.disposed){ed.delete(this.canvas),this.pause(),null==(e=this.ticker)||e.stop(),this.assetManagers.forEach(function(t){return t.dispose()}),this.compositions.forEach(function(t){return t.dispose()}),this.compositions.length=0,this.renderer&&(this.renderer.context.removeLostHandler({lost:this.lost}),this.renderer.context.removeRestoreHandler({restore:this.restore}),this.renderer.dispose(!t)),this.event&&this.event.dispose(),this.assetService.dispose(),nd(this,!1),xt(this.canvas,HTMLCanvasElement)&&!t&&this.renderer.context&&(xl.dispose(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas.remove());var i=function(t){return"Never use destroyed player: "+t+" again, see "+Jf+"."}(this.name),r=function(){return function(t){throw new Error(t)}(i)},n=function(){return t=i,Promise.reject(t);var t};this.tick=r,this.resize=r,this.loadScene=n,this.play=n,this.gotoAndPlay=n,this.gotoAndStop=n,this.playSequence=r,this.destroyCurrentCompositions=r,this.resume=n,this.disposed=!0}},i.offloadTexture=function(){this.compositions.forEach(function(t){return t.offloadTexture()})},i.getTargetSize=function(t){sd(t);var e,i,r=this.displayAspect,n=null==window.getComputedStyle?void 0:window.getComputedStyle.call(window,t),s=0,o=0;(n?(s=parseInt(n.width,10),o=parseInt(n.height,10)):(s=t.clientWidth,o=t.clientHeight),r)?s/o>r?e=(i=o*this.displayScale)*r:i=(e=s*this.displayScale)/r:(e=s,i=o);var a=this.pixelRatio,h=e,u=i;if(e=Math.round(e*a),(i=Math.round(i*a))<1||i<1){if(!this.offscreenMode)throw new Error("Invalid container size "+e+"x"+i+", see "+Kf+".");e=i=h=u=1}return[h,u,e,i]},i.handleThrowError=function(t){if(!this.onError)throw t;this.onError(t)},i.handleEmitEvent=function(t,e){this.onError?xt(e,Event)?this.onError(new Error(e.type,{cause:t}),e):xt(e,Error)?this.onError(new Error(e.message,{cause:t}),e):this.onError(new Error("Unknown error.",{cause:t}),e):(console.warn("["+t+"] event is deprecated, please use 'onError' instead."),this.emit(t,e))},Ki(e,[{key:"compositionCount",get:function(){return this.compositions.length}},{key:"hasPlayable",get:function(){return this.compositions.length>0}},{key:"paused",get:function(){var t;return null==(t=this.ticker)?void 0:t.getPaused()}},{key:"interactive",get:function(){return this.event.enabled},set:function(t){this.event.enabled=t}}]),e}(Tu);function nd(t,e){Object.keys(he).forEach(function(i){var r=he[i],n=e?r.onPlayerCreated:r.onPlayerDestroy;null==n||n(t)})}function sd(t){if(null==t)throw new Error("Container is not an HTMLElement, see "+Qf+".")}Et([function(t,e,i){var r=i.value;return i.value=yt(function(){var e,i,n,s,o=arguments;return wt(this,function(a){switch(a.label){case 0:for(e=o.length,i=new Array(e),n=0;n<e;n++)i[n]=o[n];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r.apply(this,i)];case 2:return[2,a.sent()];case 3:return s=a.sent(),t.handleThrowError.call(this,s),[3,4];case 4:return[2]}})}),i}],rd.prototype,"loadScene",null),an.create=function(t,e){return new of(t,e)},an.createWithData=function(t,e,i){void 0===e&&(e=function(t){$t(t)&&(t=Lt(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}("#fff")),void 0===i&&(i={});var r=i.type,n=void 0===r?Pr.UNSIGNED_BYTE:r,s=i.format,o=void 0===s?Pr.RGBA:s,a=i.internalFormat,h=i.wrapS,u=void 0===h?Pr.MIRRORED_REPEAT:h,l=i.wrapT,c=void 0===l?Pr.MIRRORED_REPEAT:l,f=i.minFilter,d=void 0===f?Pr.NEAREST:f,p=i.magFilter,m=void 0===p?Pr.NEAREST:p,v=i.flipY,y=void 0!==v&&v;return new of(t,{data:e,type:n,sourceType:Cr.data,format:o,internalFormat:a||o,wrapS:u,wrapT:c,minFilter:d,magFilter:m,flipY:y})},Tn.create=function(t,e){return new Sf(t,e)},Bn.create=function(t,e){return new gf(t,e)},Kn.create=function(t,e){return new Kn(t,e)},Es.create=function(t){return new Rf(t)},Os.create=function(t,e){return new Mf(t,e)},Cs.create=function(t,e,i){return new Yf(t,e,i)},$c.create=function(t){return new If(t)};function od(t,e){return(od=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ad(t,e){if("function"!=typeof e&&null!==e)throw new 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&&od(t,e)}Qt.info("Player version: 2.5.3.");var hd,ud,ld=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).name="rich-text",e}return ad(e,t),e}(je);function cd(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}function fd(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 cd(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?cd(t,e):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 new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(ud=hd||(hd={})).ContextStart="ContextStart",ud.Text="Text",ud.ContextEnd="ContextEnd";var dd=/^<([a-z]+)(=([^>]+))?>$/,pd=/^<\/([a-z]+)>$/,md=[["ContextStart",/^<[a-z]+(=[^>]+)?>/],["Text",/^[^</>=]+/],["ContextEnd",/^<\/[a-z]+>/]],vd=function(t,e,i){if(void 0===e&&(e=[]),void 0===i&&(i=0),!t)return e;for(var r,n=fd(md);!(r=n()).done;){var s,o=r.value,a=o[0],h=(null!=(s=o[1].exec(t))?s:[])[0];if(h){var u=h.length;return vd(t.slice(u),e.concat({tokenType:a,value:h}),i+u)}}throw new Error('Unexpected token: "'+t[0]+'" at position '+i+' while reading "'+t+'"')};function yd(t){return function(e){for(var i,r=fd(function(t){var e=function(){var t=a();if("Text"===(null==t?void 0:t.tokenType))return o(),t.value},i=function(){var t=a();if("ContextStart"===(null==t?void 0:t.tokenType)){o();var e,i=t.value.match(dd);if(i)return{attributeName:i[1],attributeParam:null!=(e=i[3])?e:""};throw new Error("Expected a start tag marker at position "+s)}return{}},r=function(){var t=a();if("ContextEnd"===(null==t?void 0:t.tokenType)){o();var e=t.value.match(pd);if(e)return{attributeName:e[1]};throw new Error("Expect an end tag marker at position "+s)}return{}},n=vd(t),s=0,o=function(){var t,e=n.shift();return s+=null!=(t=null==e?void 0:e.value.length)?t:0,e},a=function(){return n[0]},h=[];return function t(n,o){for(void 0===n&&(n=[]),void 0===o&&(o="");;){var a=e();if(a)h.push({attributes:n,text:a});else{var u=i(),l=u.attributeName,c=u.attributeParam;if(!l){if(o){var f=r().attributeName;if(!f)throw new Error('Expect an end tag marker "'+o+'" at position '+s+" but found no tag!");if(f!==o)throw new Error('Expect an end tag marker "'+o+'" at position '+s+' but found tag "'+f+'"');return}break}t(n.concat({attributeName:l,attributeParam:c}),l)}}}(),h}(e));!(i=r()).done;){var n=i.value,s=n.text,o=n.attributes.reduce(function(t,e){var i=e.attributeName,r=e.attributeParam;return i&&(t[i]=r),t},{});t(s,o)}}}function gd(t,e){if(void 0===e&&(e=1),3!==(t=t.replace(/^#/,"")).length&&4!==t.length||(t=t.split("").map(function(t){return t+t}).join("")),8===t.length){var i=parseInt(t.slice(6,8),16)/255;t=t.slice(0,6),e=i}var r=parseInt(t,16);return[r>>16&255,r>>8&255,255&r,e]}function bd(t,e){if(void 0===e&&(e=1),"string"!=typeof t||!t)throw new Error("Invalid color string");return t.startsWith("#")?gd(t,e):gd(function(t){if("string"!=typeof t||!t)throw new Error("Invalid color name provided");if("undefined"==typeof document)throw new Error("This method requires a browser environment");var e=document.createElement("canvas"),i=e.getContext("2d");if(i)try{return i.fillStyle=t,i.fillStyle}finally{e.remove()}throw new Error("Failed to get 2D context for color conversion!")}(t))}var xd=0,_d=function(t){function e(e){var i;return(i=t.call(this,e)||this).processedTextOptions=[],i.singleLineHeight=1.571,i.size=null,i.initialized=!1,i.canvasSize=null,i.name="MRichText"+xd++,i}ad(e,t);var i=e.prototype;return i.generateTextProgram=function(t){var e=this;this.processedTextOptions=[],yd(function(t,i){/^\n+$/.test(t)&&(t=t.replace(/\n/g,"\n ")),t.split("\n").forEach(function(t,r){var n={text:t,fontSize:e.textStyle.fontSize,isNewLine:!1};r>0&&(n.isNewLine=!0),"b"in i&&(n.fontWeight=qi.TextWeight.bold),"i"in i&&(n.fontStyle=qi.FontStyle.italic),"size"in i&&i.size&&(n.fontSize=parseInt(i.size,10)),"color"in i&&i.color&&(n.fontColor=bd(i.color)),e.processedTextOptions.push(n)})})(t)},i.updateTexture=function(t){var e=this;if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){this.generateTextProgram(this.text);var i=0,r=0,n=this.textLayout,s=this.textStyle,o=n.overflow,a=n.letterSpace,h=void 0===a?0:a,u=this.context;u.save();var l=[],c=s.fontSize*this.textStyle.fontScale,f={richOptions:[],offsetX:[],width:0,lineHeight:c*this.singleLineHeight,offsetY:c*(this.singleLineHeight-1)/2};if(this.processedTextOptions.forEach(function(t){var n=t.text,o=t.isNewLine,a=t.fontSize;o&&(l.push(f),i=Math.max(i,f.width),f={richOptions:[],offsetX:[],width:0,lineHeight:c*e.singleLineHeight,offsetY:c*(e.singleLineHeight-1)/2},r+=f.lineHeight),u.font=(t.fontWeight||s.textWeight)+" 10px "+(t.fontFamily||s.fontFamily);var d=u.measureText(n),p=d.width;if(void 0!==d.actualBoundingBoxLeft&&void 0!==d.actualBoundingBoxRight){var m=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;m>0&&(p=Math.max(p,m))}var v=a*e.singleLineHeight*e.textStyle.fontScale;v>f.lineHeight&&(r+=v-f.lineHeight,f.lineHeight=v,f.offsetY=a*e.textStyle.fontScale*(e.singleLineHeight-1)/2),f.offsetX.push(f.width),f.width+=(p<=0?0:p)*a*e.SCALE_FACTOR*e.textStyle.fontScale+n.length*h,f.richOptions.push(t)}),l.push(f),i=Math.max(i,f.width),r+=f.lineHeight,0!==i&&0!==r){void 0!==this.size&&null!==this.size||(this.size=this.item.transform.size.clone());var d=this.size,p=d.x,m=void 0===p?1:p,v=d.y,y=void 0===v?1:v;if(!this.initialized){this.canvasSize=this.canvasSize?this.canvasSize:new qn.Vector2(i,r);var g=this.canvasSize,b=g.x,x=g.y;this.item.transform.size.set(m*b*this.SCALE_FACTOR*this.SCALE_FACTOR,y*x*this.SCALE_FACTOR*this.SCALE_FACTOR),this.size=this.item.transform.size.clone(),this.initialized=!0}Xt(this.canvasSize);var _=this.canvasSize,E=_.x,w=_.y;if(this.textLayout.width=E/s.fontScale,this.textLayout.height=w/s.fontScale,this.canvas.width=E,this.canvas.height=w,u.clearRect(0,0,E,w),u.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",t||(u.translate(0,w),u.scale(1,-1)),0!==l.length){var T=n.getOffsetY(s,l.length,c*this.singleLineHeight,s.fontSize);l.forEach(function(t,i){var r=t.richOptions,n=t.offsetX,a=t.width,h=a,l=n;if(o===qi.TextOverflow.display&&a>E){var c=E/a;h*=c,l=n.map(function(t){return t*c})}var f=e.textLayout.getOffsetX(s,h);i>0&&(T+=t.lineHeight-t.offsetY),r.forEach(function(t,e){var i=s.fontScale,r=s.textColor,n=s.fontFamily,h=s.textWeight,c=s.fontStyle,d=t.text,p=t.fontSize,m=t.fontColor,v=void 0===m?r:m,y=t.fontFamily,g=void 0===y?n:y,b=t.fontWeight,x=void 0===b?h:b,_=t.fontStyle,w=void 0===_?c:_,S=p;o===qi.TextOverflow.display&&a>E&&(S/=a/E);var A=l[e]+f;u.font=w+" "+x+" "+S*i+"px "+g,u.fillStyle="rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")",u.fillText(d,A,T)})});var S=u.getImageData(0,0,this.canvas.width,this.canvas.height),A=an.createWithData(this.engine,{data:new Uint8Array(S.data),width:S.width,height:S.height},{flipY:t,magFilter:Pr.LINEAR,minFilter:Pr.LINEAR,wrapS:Pr.CLAMP_TO_EDGE,wrapT:Pr.CLAMP_TO_EDGE});this.renderer.texture=A,this.material.setTexture("_MainTex",A),this.isDirty=!1,u.restore()}}else this.isDirty=!1}},i.setShadowOffsetY=function(t){throw new Error("Method not implemented.")},i.setShadowBlur=function(t){throw new Error("Method not implemented.")},i.setShadowOffsetX=function(t){throw new Error("Method not implemented.")},i.setShadowColor=function(t){throw new Error("Method not implemented.")},i.setOutlineWidth=function(t){throw new Error("Method not implemented.")},i.setAutoWidth=function(t){throw new Error("Method not implemented.")},i.updateWithOptions=function(t){this.textStyle=new El(t),this.textLayout=new _l(t),this.textLayout.textBaseline=t.textBaseline||qi.TextBaseline.middle,this.text=t.text?t.text.toString():" "},i.renderText=function(t){var e=t.size;e&&(this.canvasSize=new qn.Vector2(e[0],e[1])),this.updateTexture()},e}(Sl);_d=function(t,e,i,r){var n,s=arguments.length,o=s<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 a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}([tr(qi.DataType.RichTextComponent)],_d);var Ed,wd,Td,Sd,Ad,Od,Cd,Id,Rd,Pd,Md,Dd,Fd,Ld,kd,Nd,Bd,Ud,zd,Vd,Gd,jd,Hd,Xd,Wd,Yd,qd,Zd,Kd,Qd,Jd,$d,tp,ep,ip,rp,np,sp,op,ap;ce("rich-text",ld,Ru),Qt.info("Plugin rich text version: 2.5.3."),(wd=Ed||(Ed={}))[wd.WEBGL_LEGACY=0]="WEBGL_LEGACY",wd[wd.WEBGL=1]="WEBGL",wd[wd.WEBGL2=2]="WEBGL2",(Sd=Td||(Td={}))[Sd.UNKNOWN=0]="UNKNOWN",Sd[Sd.WEBGL=1]="WEBGL",Sd[Sd.CANVAS=2]="CANVAS",(Od=Ad||(Ad={}))[Od.COLOR=16384]="COLOR",Od[Od.DEPTH=256]="DEPTH",Od[Od.STENCIL=1024]="STENCIL",(Id=Cd||(Cd={}))[Id.NORMAL=0]="NORMAL",Id[Id.ADD=1]="ADD",Id[Id.MULTIPLY=2]="MULTIPLY",Id[Id.SCREEN=3]="SCREEN",Id[Id.OVERLAY=4]="OVERLAY",Id[Id.DARKEN=5]="DARKEN",Id[Id.LIGHTEN=6]="LIGHTEN",Id[Id.COLOR_DODGE=7]="COLOR_DODGE",Id[Id.COLOR_BURN=8]="COLOR_BURN",Id[Id.HARD_LIGHT=9]="HARD_LIGHT",Id[Id.SOFT_LIGHT=10]="SOFT_LIGHT",Id[Id.DIFFERENCE=11]="DIFFERENCE",Id[Id.EXCLUSION=12]="EXCLUSION",Id[Id.HUE=13]="HUE",Id[Id.SATURATION=14]="SATURATION",Id[Id.COLOR=15]="COLOR",Id[Id.LUMINOSITY=16]="LUMINOSITY",Id[Id.NORMAL_NPM=17]="NORMAL_NPM",Id[Id.ADD_NPM=18]="ADD_NPM",Id[Id.SCREEN_NPM=19]="SCREEN_NPM",Id[Id.NONE=20]="NONE",Id[Id.SRC_OVER=0]="SRC_OVER",Id[Id.SRC_IN=21]="SRC_IN",Id[Id.SRC_OUT=22]="SRC_OUT",Id[Id.SRC_ATOP=23]="SRC_ATOP",Id[Id.DST_OVER=24]="DST_OVER",Id[Id.DST_IN=25]="DST_IN",Id[Id.DST_OUT=26]="DST_OUT",Id[Id.DST_ATOP=27]="DST_ATOP",Id[Id.ERASE=26]="ERASE",Id[Id.SUBTRACT=28]="SUBTRACT",Id[Id.XOR=29]="XOR",(Pd=Rd||(Rd={}))[Pd.POINTS=0]="POINTS",Pd[Pd.LINES=1]="LINES",Pd[Pd.LINE_LOOP=2]="LINE_LOOP",Pd[Pd.LINE_STRIP=3]="LINE_STRIP",Pd[Pd.TRIANGLES=4]="TRIANGLES",Pd[Pd.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Pd[Pd.TRIANGLE_FAN=6]="TRIANGLE_FAN",(Dd=Md||(Md={}))[Dd.RGBA=6408]="RGBA",Dd[Dd.RGB=6407]="RGB",Dd[Dd.RG=33319]="RG",Dd[Dd.RED=6403]="RED",Dd[Dd.RGBA_INTEGER=36249]="RGBA_INTEGER",Dd[Dd.RGB_INTEGER=36248]="RGB_INTEGER",Dd[Dd.RG_INTEGER=33320]="RG_INTEGER",Dd[Dd.RED_INTEGER=36244]="RED_INTEGER",Dd[Dd.ALPHA=6406]="ALPHA",Dd[Dd.LUMINANCE=6409]="LUMINANCE",Dd[Dd.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",Dd[Dd.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",Dd[Dd.DEPTH_STENCIL=34041]="DEPTH_STENCIL",(Ld=Fd||(Fd={}))[Ld.TEXTURE_2D=3553]="TEXTURE_2D",Ld[Ld.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",Ld[Ld.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",Ld[Ld.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",Ld[Ld.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",Ld[Ld.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",Ld[Ld.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",Ld[Ld.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",Ld[Ld.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",(Nd=kd||(kd={}))[Nd.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",Nd[Nd.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",Nd[Nd.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",Nd[Nd.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",Nd[Nd.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",Nd[Nd.UNSIGNED_INT=5125]="UNSIGNED_INT",Nd[Nd.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",Nd[Nd.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",Nd[Nd.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",Nd[Nd.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",Nd[Nd.BYTE=5120]="BYTE",Nd[Nd.SHORT=5122]="SHORT",Nd[Nd.INT=5124]="INT",Nd[Nd.FLOAT=5126]="FLOAT",Nd[Nd.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",Nd[Nd.HALF_FLOAT=36193]="HALF_FLOAT",(Ud=Bd||(Bd={}))[Ud.FLOAT=0]="FLOAT",Ud[Ud.INT=1]="INT",Ud[Ud.UINT=2]="UINT",(Vd=zd||(zd={}))[Vd.NEAREST=0]="NEAREST",Vd[Vd.LINEAR=1]="LINEAR",(jd=Gd||(Gd={}))[jd.CLAMP=33071]="CLAMP",jd[jd.REPEAT=10497]="REPEAT",jd[jd.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",(Xd=Hd||(Hd={}))[Xd.OFF=0]="OFF",Xd[Xd.POW2=1]="POW2",Xd[Xd.ON=2]="ON",Xd[Xd.ON_MANUAL=3]="ON_MANUAL",(Yd=Wd||(Wd={}))[Yd.NPM=0]="NPM",Yd[Yd.UNPACK=1]="UNPACK",Yd[Yd.PMA=2]="PMA",Yd[Yd.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",Yd[Yd.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",Yd[Yd.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",Yd[Yd.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",(Zd=qd||(qd={}))[Zd.NO=0]="NO",Zd[Zd.YES=1]="YES",Zd[Zd.AUTO=2]="AUTO",Zd[Zd.BLEND=0]="BLEND",Zd[Zd.CLEAR=1]="CLEAR",Zd[Zd.BLIT=2]="BLIT",(Qd=Kd||(Kd={}))[Qd.AUTO=0]="AUTO",Qd[Qd.MANUAL=1]="MANUAL",($d=Jd||(Jd={})).LOW="lowp",$d.MEDIUM="mediump",$d.HIGH="highp",(ep=tp||(tp={}))[ep.NONE=0]="NONE",ep[ep.SCISSOR=1]="SCISSOR",ep[ep.STENCIL=2]="STENCIL",ep[ep.SPRITE=3]="SPRITE",ep[ep.COLOR=4]="COLOR",(rp=ip||(ip={}))[rp.RED=1]="RED",rp[rp.GREEN=2]="GREEN",rp[rp.BLUE=4]="BLUE",rp[rp.ALPHA=8]="ALPHA",(sp=np||(np={}))[sp.NONE=0]="NONE",sp[sp.LOW=2]="LOW",sp[sp.MEDIUM=4]="MEDIUM",sp[sp.HIGH=8]="HIGH",(ap=op||(op={}))[ap.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",ap[ap.ARRAY_BUFFER=34962]="ARRAY_BUFFER",ap[ap.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER";var hp={createCanvas:function(t,e){var i=document.createElement("canvas");return i.width=t,i.height=e,i},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var t;return null!==(t=document.baseURI)&&void 0!==t?t:window.location.href},fetch:function(t,e){return fetch(t,e)}},up=/iPhone/i,lp=/iPod/i,cp=/iPad/i,fp=/\biOS-universal(?:.+)Mac\b/i,dp=/\bAndroid(?:.+)Mobile\b/i,pp=/Android/i,mp=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,vp=/Silk/i,yp=/Windows Phone/i,gp=/\bWindows(?:.+)ARM\b/i,bp=/BlackBerry/i,xp=/BB10/i,_p=/Opera Mini/i,Ep=/\b(CriOS|Chrome)(?:.+)Mobile/i,wp=/Mobile(?:.+)Firefox\b/i,Tp=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};var Sp=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var i=e.userAgent,r=i.split("[FBAN");void 0!==r[1]&&(i=r[0]),void 0!==(r=i.split("Twitter"))[1]&&(i=r[0]);var n=function(t){return function(e){return e.test(t)}}(i),s={apple:{phone:n(up)&&!n(yp),ipod:n(lp),tablet:!n(up)&&(n(cp)||Tp(e))&&!n(yp),universal:n(fp),device:(n(up)||n(lp)||n(cp)||n(fp)||Tp(e))&&!n(yp)},amazon:{phone:n(mp),tablet:!n(mp)&&n(vp),device:n(mp)||n(vp)},android:{phone:!n(yp)&&n(mp)||!n(yp)&&n(dp),tablet:!n(yp)&&!n(mp)&&!n(dp)&&(n(vp)||n(pp)),device:!n(yp)&&(n(mp)||n(vp)||n(dp)||n(pp))||n(/\bokhttp\b/i)},windows:{phone:n(yp),tablet:n(gp),device:n(yp)||n(gp)},other:{blackberry:n(bp),blackberry10:n(xp),opera:n(_p),firefox:n(wp),chrome:n(Ep),device:n(bp)||n(xp)||n(_p)||n(wp)||n(Ep)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}(globalThis.navigator);var Ap={ADAPTER:hp,MIPMAP_TEXTURES:Hd.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:np.NONE,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(Sp.tablet||Sp.phone){var i;if(Sp.apple.device)if(i=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(i[1],10)<11&&(e=!1);if(Sp.android.device)if(i=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(i[1],10)<7&&(e=!1)}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:Kd.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:Gd.CLAMP,SCALE_MODE:zd.LINEAR,PRECISION_VERTEX:Jd.HIGH,PRECISION_FRAGMENT:Sp.apple.device?Jd.HIGH:Jd.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!Sp.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},Op=c(y(),1),Cp=c(g(),1),Ip=c(ft(),1),Rp={parse:Ip.parse,format:Ip.format,resolve:Ip.resolve};Ap.RETINA_PREFIX=/@([0-9\.]+)x/,Ap.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Pp,Mp=!1,Dp="6.5.10";var Fp={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Lp(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function kp(t){var e=t.toString(16);return"#"+(e="000000".substring(0,6-e.length)+e)}function Np(t){return"string"==typeof t&&"#"===(t=Fp[t.toLowerCase()]||t)[0]&&(t=t.slice(1)),parseInt(t,16)}var Bp=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[Cd.NORMAL_NPM]=Cd.NORMAL,t[Cd.ADD_NPM]=Cd.ADD,t[Cd.SCREEN_NPM]=Cd.SCREEN,e[Cd.NORMAL]=Cd.NORMAL_NPM,e[Cd.ADD]=Cd.ADD_NPM,e[Cd.SCREEN]=Cd.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Up(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function zp(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}function Vp(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Gp(t){return!(t&t-1||!t)}function jp(t){var e=(t>65535?1:0)<<4,i=((t>>>=e)>255?1:0)<<3;return e|=i,e|=i=((t>>>=i)>15?1:0)<<2,(e|=i=((t>>>=i)>3?1:0)<<1)|(t>>>=i)>>1}function Hp(t,e,i){var r,n=t.length;if(!(e>=n||0===i)){var s=n-(i=e+i>n?n-e:i);for(r=e;r<s;++r)t[r]=t[r+i];t.length=s}}function Xp(t){return 0===t?0:t<0?-1:1}var Wp=0;function Yp(){return++Wp}var qp={};function Zp(t,e,i){if(void 0===i&&(i=3),!qp[e]){var r=(new Error).stack;void 0===r?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(r=r.split("\n").splice(i).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(r))),qp[e]=!0}}var Kp,Qp={},Jp=Object.create(null),$p=Object.create(null);!function(){function t(t,e,i){this.canvas=Ap.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||Ap.RESOLUTION,this.resize(t,e)}t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0})}();function tm(t,e){var i=Ap.RETINA_PREFIX.exec(t);return i?parseFloat(i[1]):void 0!==e?e:1}var em,im,rm=function(){return rm=Object.assign||function(t){for(var e,i=arguments,r=1,n=arguments.length;r<n;r++)for(var s in e=i[r])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},rm.apply(this,arguments)};(im=em||(em={})).Application="application",im.RendererPlugin="renderer-webgl-plugin",im.CanvasRendererPlugin="renderer-canvas-plugin",im.Loader="loader",im.LoadParser="load-parser",im.ResolveParser="resolve-parser",im.CacheParser="cache-parser",im.DetectionParser="detection-parser";var nm,sm,om=function(t){if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");var e="object"!=typeof t.extension?{type:t.extension}:t.extension;t=rm(rm({},e),{ref:t})}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t=rm({},t)).type&&(t.type=[t.type]),t},am={_addHandlers:null,_removeHandlers:null,_queue:{},remove:function(){for(var t=arguments,e=this,i=[],r=0;r<arguments.length;r++)i[r]=t[r];return i.map(om).forEach(function(t){t.type.forEach(function(i){var r,n;return null===(n=(r=e._removeHandlers)[i])||void 0===n?void 0:n.call(r,t)})}),this},add:function(){for(var t=arguments,e=this,i=[],r=0;r<arguments.length;r++)i[r]=t[r];return i.map(om).forEach(function(t){t.type.forEach(function(i){var r=e._addHandlers,n=e._queue;r[i]?r[i](t):(n[i]=n[i]||[],n[i].push(t))})}),this},handle:function(t,e,i){var r=this._addHandlers=this._addHandlers||{},n=this._removeHandlers=this._removeHandlers||{};if(r[t]||n[t])throw new Error("Extension type "+t+" already has a handler");r[t]=e,n[t]=i;var s=this._queue;return s[t]&&(s[t].forEach(function(t){return e(t)}),delete s[t]),this},handleByMap:function(t,e){return this.handle(t,function(t){e[t.name]=t.ref},function(t){delete e[t.name]})},handleByList:function(t,e){return this.handle(t,function(i){var r,n;e.includes(i.ref)||(e.push(i.ref),t===em.Loader&&(null===(n=(r=i.ref).add)||void 0===n||n.call(r)))},function(t){var i=e.indexOf(t.ref);-1!==i&&e.splice(i,1)})}},hm=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,i,r,n,s,o,a){if(arguments.length>8)throw new Error("max arguments reached");var h=this.name,u=this.items;this._aliasCount++;for(var l=0,c=u.length;l<c;l++)u[l][h](t,e,i,r,n,s,o,a);return u===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(hm.prototype,{dispatch:{value:hm.prototype.emit},run:{value:hm.prototype.emit}}),Ap.TARGET_FPMS=.06,(sm=nm||(nm={}))[sm.INTERACTION=50]="INTERACTION",sm[sm.HIGH=25]="HIGH",sm[sm.NORMAL=0]="NORMAL",sm[sm.LOW=-25]="LOW",sm[sm.UTILITY=-50]="UTILITY";var um,lm,cm=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=0),void 0===r&&(r=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=r}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),fm=function(){function t(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new cm(null,null,1/0),this.deltaMS=1/Ap.TARGET_FPMS,this.elapsedMS=1/Ap.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,i){return void 0===i&&(i=nm.NORMAL),this._addListener(new cm(t,e,i))},t.prototype.addOnce=function(t,e,i){return void 0===i&&(i=nm.NORMAL),this._addListener(new cm(t,e,i,!0))},t.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*Ap.TARGET_FPMS;for(var r=this._head,n=r.next;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),i=Math.min(Math.max(0,e)/1e3,Ap.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),dm=function(){function t(){}return t.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,nm.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?fm.shared:new fm,t.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t.extension=em.Application,t}(),pm=2*Math.PI,mm=180/Math.PI,vm=Math.PI/180;(lm=um||(um={}))[lm.POLY=0]="POLY",lm[lm.RECT=1]="RECT",lm[lm.CIRC=2]="CIRC",lm[lm.ELIP=3]="ELIP",lm[lm.RREC=4]="RREC";var ym=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}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},t}(),gm=[new ym,new ym,new ym,new ym],bm=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=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=um.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},t.prototype.intersects=function(t,e){if(!e){var i=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=i)return!1;var r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}var n=this.left,s=this.right,o=this.top,a=this.bottom;if(s<=n||a<=o)return!1;var h=gm[0].set(t.left,t.top),u=gm[1].set(t.left,t.bottom),l=gm[2].set(t.right,t.top),c=gm[3].set(t.right,t.bottom);if(l.x<=h.x||u.y<=h.y)return!1;var f=Math.sign(e.a*e.d-e.b*e.c);if(0===f)return!1;if(e.apply(h,h),e.apply(u,u),e.apply(l,l),e.apply(c,c),Math.max(h.x,u.x,l.x,c.x)<=n||Math.min(h.x,u.x,l.x,c.x)>=s||Math.max(h.y,u.y,l.y,c.y)<=o||Math.min(h.y,u.y,l.y,c.y)>=a)return!1;var d=f*(u.y-h.y),p=f*(h.x-u.x),m=d*n+p*o,v=d*s+p*o,y=d*n+p*a,g=d*s+p*a;if(Math.max(m,v,y,g)<=d*h.x+p*h.y||Math.min(m,v,y,g)>=d*c.x+p*c.y)return!1;var b=f*(h.y-l.y),x=f*(l.x-h.x),_=b*n+x*o,E=b*s+x*o,w=b*n+x*a,T=b*s+x*a;return!(Math.max(_,E,w,T)<=b*h.x+x*h.y||Math.min(_,E,w,T)>=b*c.x+x*c.y)},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this},t.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),xm=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.radius=i,this.type=um.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,r=this.x-t,n=this.y-e;return(r*=r)+(n*=n)<=i},t.prototype.getBounds=function(){return new bm(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},t}(),_m=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.width=i,this.height=r,this.type=um.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,r=(e-this.y)/this.height;return(i*=i)+(r*=r)<=1},t.prototype.getBounds=function(){return new bm(this.x-this.width,this.y-this.height,this.width,this.height)},t.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),Em=function(){function t(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];var r=Array.isArray(e[0])?e[0]:e;if("number"!=typeof r[0]){for(var n=[],s=0,o=r.length;s<o;s++)n.push(r[s].x,r[s].y);r=n}this.points=r,this.type=um.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,s=r-1;n<r;s=n++){var o=this.points[2*n],a=this.points[2*n+1],h=this.points[2*s],u=this.points[2*s+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-o)+o&&(i=!i)}return i},t.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce(function(t,e){return t+", "+e},"")+"]"},t}(),wm=function(){function t(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=um.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;var r=t-(this.x+i),n=e-(this.y+i),s=i*i;if(r*r+n*n<=s)return!0;if((r=t-(this.x+this.width-i))*r+n*n<=s)return!0;if(r*r+(n=e-(this.y+this.height-i))*n<=s)return!0;if((r=t-(this.x+i))*r+n*n<=s)return!0}return!1},t.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},t}(),Tm=function(){function t(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),this._x=i,this._y=r,this.cb=t,this.scope=e}return t.prototype.clone=function(e,i){return void 0===e&&(e=this.cb),void 0===i&&(i=this.scope),new t(e,i,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},t.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Sm=function(){function t(t,e,i,r,n,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=0),void 0===s&&(s=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=s}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,i,r,n,s){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=s,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},t.prototype.apply=function(t,e){e=e||new ym;var i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new ym;var i=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*i*r+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.a,n=this.c,s=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=s*e-this.ty*i,this.ty=s*i+this.ty*e,this},t.prototype.append=function(t){var e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,i,r,n,s,o,a,h){return this.a=Math.cos(o+h)*n,this.b=Math.sin(o+h)*n,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,i=this.b,r=this.c,n=this.d,s=t.pivot,o=-Math.atan2(-r,n),a=Math.atan2(i,e),h=Math.abs(o+a);return h<1e-5||Math.abs(pm-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=a),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(s.x*e+s.y*r),t.position.y=this.ty+(s.x*i+s.y*n),t},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,s=t*r-e*i;return this.a=r/s,this.b=-e/s,this.c=-i/s,this.d=t/s,this.tx=(i*this.ty-r*n)/s,this.ty=-(t*this.ty-e*n)/s,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),Am=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Om=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Cm=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Im=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Rm=[],Pm=[],Mm=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];Rm.push(e);for(var i=0;i<16;i++)for(var r=Mm(Am[t]*Am[i]+Cm[t]*Om[i]),n=Mm(Om[t]*Am[i]+Im[t]*Om[i]),s=Mm(Am[t]*Cm[i]+Cm[t]*Im[i]),o=Mm(Om[t]*Cm[i]+Im[t]*Im[i]),a=0;a<16;a++)if(Am[a]===r&&Om[a]===n&&Cm[a]===s&&Im[a]===o){e.push(a);break}}for(t=0;t<16;t++){var h=new Sm;h.set(Am[t],Om[t],Cm[t],Im[t],0,0),Pm.push(h)}}();var Dm={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return Am[t]},uY:function(t){return Om[t]},vX:function(t){return Cm[t]},vY:function(t){return Im[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Rm[t][e]},sub:function(t,e){return Rm[t][Dm.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Dm.S:Dm.N:2*Math.abs(e)<=Math.abs(t)?t>0?Dm.E:Dm.W:e>0?t>0?Dm.SE:Dm.SW:t>0?Dm.NE:Dm.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Pm[Dm.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Fm=function(){function t(){this.worldTransform=new Sm,this.localTransform=new Sm,this.position=new Tm(this.onChange,this,0,0),this.scale=new Tm(this.onChange,this,1,1),this.pivot=new Tm(this.onChange,this,0,0),this.skew=new Tm(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();Ap.PREFER_ENV=Sp.any?Ed.WEBGL:Ed.WEBGL2,Ap.STRICT_TEXTURE_CACHE=!1;var Lm=[];function km(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=Lm.length-1;n>=0;--n){var s=Lm[n];if(s.test&&s.test(t,i))return new s(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Nm=function(t,e){return Nm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Nm(t,e)};function Bm(t,e){function i(){this.constructor=t}Nm(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Um=function(){return Um=Object.assign||function(t){for(var e,i=arguments,r=1,n=arguments.length;r<n;r++)for(var s in e=i[r])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},Um.apply(this,arguments)};var zm=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new hm("setRealSize"),this.onUpdate=new hm("update"),this.onError=new hm("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,i){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(t,e){return!1},t}(),Vm=function(t){function e(e,i){var r=this,n=i||{},s=n.width,o=n.height;if(!s||!o)throw new Error("BufferResource width or height invalid");return(r=t.call(this,s,o)||this).data=e,r}return Bm(e,t),e.prototype.upload=function(t,e,i){var r=t.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Wd.UNPACK);var n=e.realWidth,s=e.realHeight;return i.width===n&&i.height===s?r.texSubImage2D(e.target,0,0,0,n,s,e.format,i.type,this.data):(i.width=n,i.height=s,r.texImage2D(e.target,0,i.internalFormat,n,s,0,e.format,i.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(zm),Gm={scaleMode:zd.NEAREST,format:Md.RGBA,alphaMode:Wd.NPM},jm=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null);var r=t.call(this)||this,n=(i=i||{}).alphaMode,s=i.mipmap,o=i.anisotropicLevel,a=i.scaleMode,h=i.width,u=i.height,l=i.wrapMode,c=i.format,f=i.type,d=i.target,p=i.resolution,m=i.resourceOptions;return!e||e instanceof zm||((e=km(e,m)).internal=!0),r.resolution=p||Ap.RESOLUTION,r.width=Math.round((h||0)*r.resolution)/r.resolution,r.height=Math.round((u||0)*r.resolution)/r.resolution,r._mipmap=void 0!==s?s:Ap.MIPMAP_TEXTURES,r.anisotropicLevel=void 0!==o?o:Ap.ANISOTROPIC_LEVEL,r._wrapMode=l||Ap.WRAP_MODE,r._scaleMode=void 0!==a?a:Ap.SCALE_MODE,r.format=c||Md.RGBA,r.type=f||kd.UNSIGNED_BYTE,r.target=d||Fd.TEXTURE_2D,r.alphaMode=void 0!==n?n:Wd.UNPACK,r.uid=Yp(),r.touched=0,r.isPowerOfTwo=!1,r._refreshPOT(),r._glTextures={},r.dirtyId=0,r.dirtyStyleId=0,r.cacheId=null,r.valid=h>0&&u>0,r.textureCacheIds=[],r.destroyed=!1,r.resource=null,r._batchEnabled=0,r._batchLocation=0,r.parentTextureArray=null,r.setResource(e),r}return Bm(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Gp(this.realWidth)&&Gp(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $p[this.cacheId],delete Jp[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,i,r){void 0===r&&(r=Ap.STRICT_TEXTURE_CACHE);var n="string"==typeof t,s=null;if(n)s=t;else{if(!t._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+Yp()}s=t._pixiId}var a=$p[s];if(n&&r&&!a)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return a||((a=new e(t,i)).cacheId=s,e.addToCache(a,s)),a},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var s=new Vm(t,{width:i,height:r}),o=t instanceof Float32Array?kd.FLOAT:kd.UNSIGNED_BYTE;return new e(s,Object.assign({},Gm,n||{width:i,height:r,type:o}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$p[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$p[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$p[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete $p[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r<t.textureCacheIds.length;++r)delete $p[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(Op.default),Hm=function(t){function e(e,i){var r=this,n=i||{},s=n.width,o=n.height;(r=t.call(this,s,o)||this).items=[],r.itemDirtyIds=[];for(var a=0;a<e;a++){var h=new jm;r.items.push(h),r.itemDirtyIds.push(-2)}return r.length=e,r._load=null,r.baseTexture=null,r}return Bm(e,t),e.prototype.initFromArray=function(t,e){for(var i=0;i<this.length;i++)t[i]&&(t[i].castToBaseTexture?this.addBaseTextureAt(t[i].castToBaseTexture(),i):t[i]instanceof zm?this.addResourceAt(t[i],i):this.addResourceAt(km(t[i],e),i))},e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=e,this.items[i].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=null,this.items[i].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map(function(t){return t.resource}).filter(function(t){return t}).map(function(t){return t.load()});return this._load=Promise.all(e).then(function(){var e=t.items[0],i=e.realWidth,r=e.realHeight;return t.resize(i,r),Promise.resolve(t)}),this._load},e}(zm),Xm=function(t){function e(e,i){var r,n,s=this,o=i||{},a=o.width,h=o.height;return Array.isArray(e)?(r=e,n=e.length):n=e,s=t.call(this,n,{width:a,height:h})||this,r&&s.initFromArray(r,i),s}return Bm(e,t),e.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=Fd.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,e,i){var r=this,n=r.length,s=r.itemDirtyIds,o=r.items,a=t.gl;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,e.format,i.type,null);for(var h=0;h<n;h++){var u=o[h];s[h]<u.dirtyId&&(s[h]=u.dirtyId,u.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,h,u.resource.width,u.resource.height,1,e.format,i.type,u.resource.source))}return!0},e}(Hm),Wm=function(t){function e(e){var i=this,r=e,n=r.naturalWidth||r.videoWidth||r.width,s=r.naturalHeight||r.videoHeight||r.height;return(i=t.call(this,n,s)||this).source=e,i.noSubImage=!1,i}return Bm(e,t),e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=function(t,e){if(void 0===e&&(e=globalThis.location),0===t.indexOf("data:"))return"";e=e||globalThis.location,Kp||(Kp=document.createElement("a")),Kp.href=t;var i=Rp.parse(Kp.href),r=!i.port&&""===e.port||i.port===e.port;return i.hostname===e.hostname&&r&&i.protocol===e.protocol?"":"anonymous"}(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,s=e.realWidth,o=e.realHeight;if((r=r||this.source)instanceof HTMLImageElement){if(!r.complete||0===r.naturalWidth)return!1}else if(r instanceof HTMLVideoElement&&r.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Wd.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||i.width!==s||i.height!==o?(i.width=s,i.height=o,n.texImage2D(e.target,0,i.internalFormat,e.format,i.type,r)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,i.type,r),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source,i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;this.resize(i,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(zm),Ym=function(t){function e(e){return t.call(this,e)||this}return Bm(e,t),e.test=function(t){var e=globalThis.OffscreenCanvas;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(Wm),qm=function(t){function e(i,r){var n=this,s=r||{},o=s.width,a=s.height,h=s.autoLoad,u=s.linkBaseTexture;if(i&&i.length!==e.SIDES)throw new Error("Invalid length. Got "+i.length+", expected 6");n=t.call(this,6,{width:o,height:a})||this;for(var l=0;l<e.SIDES;l++)n.items[l].target=Fd.TEXTURE_CUBE_MAP_POSITIVE_X+l;return n.linkBaseTexture=!1!==u,i&&n.initFromArray(i,r),!1!==h&&n.load(),n}return Bm(e,t),e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=Fd.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,e,i){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=Fd.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,i,r){for(var n=this.itemDirtyIds,s=0;s<e.SIDES;s++){var o=this.items[s];(n[s]<o.dirtyId||r.dirtyId<i.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(t,o,r),n[s]=o.dirtyId):n[s]<-1&&(t.gl.texImage2D(o.target,0,r.internalFormat,i.realWidth,i.realHeight,0,i.format,r.type,null),n[s]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(Hm),Zm=function(t){function e(e,i){var r=this;if(i=i||{},!(e instanceof HTMLImageElement)){var n=new Image;Wm.crossOrigin(n,e,i.crossorigin),n.src=e,e=n}return r=t.call(this,e)||this,!e.complete&&r._width&&r._height&&(r._width=0,r._height=0),r.url=e.src,r._process=null,r.preserveBitmap=!1,r.createBitmap=(void 0!==i.createBitmap?i.createBitmap:Ap.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,r.alphaMode="number"==typeof i.alphaMode?i.alphaMode:null,r.bitmap=null,r._load=null,!1!==i.autoLoad&&r.load(),r}return Bm(e,t),e.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise(function(t,i){var r=e.source;e.url=r.src;var n=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?n():(r.onload=n,r.onerror=function(t){i(t),e.onError.emit(t)})})),this._load},e.prototype.process=function(){var t=this,e=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);var i=globalThis.createImageBitmap,r=!e.crossOrigin||"anonymous"===e.crossOrigin;return this._process=fetch(e.src,{mode:r?"cors":"no-cors"}).then(function(t){return t.blob()}).then(function(r){return i(r,0,0,e.width,e.height,{premultiplyAlpha:null===t.alphaMode||t.alphaMode===Wd.UNPACK?"premultiply":"none"})}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process},e.prototype.upload=function(e,i,r){if("number"==typeof this.alphaMode&&(i.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0,s=i._glTextures;for(var o in s){var a=s[o];if(a!==r&&a.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},e}(Wm),Km=function(t){function e(e,i){var r=this;return i=i||{},(r=t.call(this,Ap.ADAPTER.createCanvas())||this)._width=0,r._height=0,r.svg=e,r.scale=i.scale||1,r._overrideWidth=i.width,r._overrideHeight=i.height,r._resolve=null,r._crossorigin=i.crossorigin,r._load=null,!1!==i.autoLoad&&r.load(),r}return Bm(e,t),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise(function(i){if(t._resolve=function(){t.resize(t.source.width,t.source.height),i(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()})),this._load},e.prototype._loadSvg=function(){var t=this,e=new Image;Wm.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(i){t._resolve&&(e.onerror=null,t.onError.emit(i))},e.onload=function(){if(t._resolve){var i=e.width,r=e.height;if(!i||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var n=i*t.scale,s=r*t.scale;(t._overrideWidth||t._overrideHeight)&&(n=t._overrideWidth||t._overrideHeight/r*i,s=t._overrideHeight||t._overrideWidth/i*r),n=Math.round(n),s=Math.round(s);var o=t.source;o.width=n,o.height=s,o._pixiId="canvas_"+Yp(),o.getContext("2d").drawImage(e,0,0,i,r,0,0,n,s),t._resolve(),t._resolve=null}}},e.getSize=function(t){var i=e.SVG_SIZE.exec(t),r={};return i&&(r[i[1]]=Math.round(parseFloat(i[3])),r[i[5]]=Math.round(parseFloat(i[7]))),r},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,i){return"svg"===i||"string"==typeof t&&t.startsWith("data:image/svg+xml")||"string"==typeof t&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Wm),Qm=function(t){function e(i,r){var n=this;if(r=r||{},!(i instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),"string"==typeof i&&(i=[i]);var o=i[0].src||i[0];Wm.crossOrigin(s,o,r.crossorigin);for(var a=0;a<i.length;++a){var h=document.createElement("source"),u=i[a],l=u.src,c=u.mime,f=(l=l||i[a]).split("?").shift().toLowerCase(),d=f.slice(f.lastIndexOf(".")+1);c=c||e.MIME_TYPES[d]||"video/"+d,h.src=l,h.type=c,s.appendChild(h)}i=s}return(n=t.call(this,i)||this).noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=r.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=!1!==r.autoPlay,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),!1!==r.autoLoad&&n.load(),n}return Bm(e,t),e.prototype.update=function(e){if(!this.destroyed){var i=fm.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise(function(i){t.valid?i(t):(t._resolve=i,e.load())}),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()},e.prototype._isSourceReady=function(){return this.source.readyState>2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(fm.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(fm.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(fm.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(fm.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(fm.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,i){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Wm),Jm=function(t){function e(e){return t.call(this,e)||this}return Bm(e,t),e.test=function(t){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap},e}(Wm);Lm.push(Zm,Jm,Ym,Qm,Km,Vm,qm,Xm);var $m={__proto__:null,Resource:zm,BaseImageResource:Wm,INSTALLED:Lm,autoDetectResource:km,AbstractMultiResource:Hm,ArrayResource:Xm,BufferResource:Vm,CanvasResource:Ym,CubeResource:qm,ImageResource:Zm,SVGResource:Km,VideoResource:Qm,ImageBitmapResource:Jm},tv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Bm(e,t),e.prototype.upload=function(t,e,i){var r=t.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Wd.UNPACK);var n=e.realWidth,s=e.realHeight;return i.width===n&&i.height===s?r.texSubImage2D(e.target,0,0,0,n,s,e.format,i.type,this.data):(i.width=n,i.height=s,r.texImage2D(e.target,0,i.internalFormat,n,s,0,e.format,i.type,this.data)),!0},e}(Vm),ev=function(){function t(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new hm("disposeFramebuffer"),this.multisample=np.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new jm(null,{scaleMode:zd.NEAREST,resolution:1,mipmap:Hd.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new jm(new tv(null,{width:this.width,height:this.height}),{scaleMode:zd.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Hd.OFF,format:Md.DEPTH_COMPONENT,type:kd.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i<this.colorTextures.length;i++){var r=this.colorTextures[i],n=r.resolution;r.setSize(t/n,e/n)}if(this.depthTexture){n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,e/n)}}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),iv=function(t){function e(e){void 0===e&&(e={});var i=this;"number"==typeof e&&(e={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]});return e.width=e.width||100,e.height=e.height||100,e.multisample=void 0!==e.multisample?e.multisample:np.NONE,(i=t.call(this,null,e)||this).mipmap=Hd.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new ev(i.realWidth,i.realHeight).addColorTexture(0,i),i.framebuffer.multisample=e.multisample,i.maskStack=[],i.filterStack=[{}],i}return Bm(e,t),e.prototype.resize=function(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(jm),rv=function(){function t(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return t.prototype.set=function(t,e,i){var r=e.width,n=e.height;if(i){var s=t.width/2/r,o=t.height/2/n,a=t.x/r+s,h=t.y/n+o;i=Dm.add(i,Dm.NW),this.x0=a+s*Dm.uX(i),this.y0=h+o*Dm.uY(i),i=Dm.add(i,2),this.x1=a+s*Dm.uX(i),this.y1=h+o*Dm.uY(i),i=Dm.add(i,2),this.x2=a+s*Dm.uX(i),this.y2=h+o*Dm.uY(i),i=Dm.add(i,2),this.x3=a+s*Dm.uX(i),this.y3=h+o*Dm.uY(i)}else this.x0=t.x/r,this.y0=t.y/n,this.x1=(t.x+t.width)/r,this.y1=t.y/n,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/n,this.x3=t.x/r,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},t.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},t}(),nv=new rv;function sv(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}var ov=function(t){function e(i,r,n,s,o,a){var h=t.call(this)||this;if(h.noFrame=!1,r||(h.noFrame=!0,r=new bm(0,0,1,1)),i instanceof e&&(i=i.baseTexture),h.baseTexture=i,h._frame=r,h.trim=s,h.valid=!1,h._uvs=nv,h.uvMatrix=null,h.orig=n||r,h._rotate=Number(o||0),!0===o)h._rotate=2;else if(h._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return h.defaultAnchor=a?new ym(a.x,a.y):new ym(0,0),h._updateID=0,h.textureCacheIds=[],i.valid?h.noFrame?i.valid&&h.onBaseTextureUpdated(i):h.frame=r:i.once("loaded",h.onBaseTextureUpdated,h),h.noFrame&&i.on("update",h.onBaseTextureUpdated,h),h}return Bm(e,t),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var i=this.baseTexture.resource;i&&i.url&&Jp[i.url]&&e.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),i=this._frame===this.orig?t:this.orig.clone(),r=new e(this.baseTexture,!this.noFrame&&t,i,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(r._frame=t),r},e.prototype.updateUvs=function(){this._uvs===nv&&(this._uvs=new rv),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,i,r){void 0===i&&(i={}),void 0===r&&(r=Ap.STRICT_TEXTURE_CACHE);var n="string"==typeof t,s=null;if(n)s=t;else if(t instanceof jm){if(!t.cacheId){var o=i&&i.pixiIdPrefix||"pixiid";t.cacheId=o+"-"+Yp(),jm.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){o=i&&i.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+Yp()}s=t._pixiId}var a=Jp[s];if(n&&r&&!a)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return a||t instanceof jm?!a&&t instanceof jm&&(a=new e(t),e.addToCache(a,s)):(i.resolution||(i.resolution=tm(t)),(a=new e(new jm(t,i))).baseTexture.cacheId=s,jm.addToCache(a.baseTexture,s),e.addToCache(a,s)),a},e.fromURL=function(t,i){var r=Object.assign({autoLoad:!1},null==i?void 0:i.resourceOptions),n=e.from(t,Object.assign({resourceOptions:r},i),!1),s=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):s.load().then(function(){return Promise.resolve(n)})},e.fromBuffer=function(t,i,r,n){return new e(jm.fromBuffer(t,i,r,n))},e.fromLoader=function(t,i,r,n){var s=new jm(t,Object.assign({scaleMode:Ap.SCALE_MODE,resolution:tm(i)},n)),o=s.resource;o instanceof Zm&&(o.url=i);var a=new e(s);return r||(r=i),jm.addToCache(a.baseTexture,r),e.addToCache(a,r),r!==i&&(jm.addToCache(a.baseTexture,i),e.addToCache(a,i)),a.baseTexture.valid?Promise.resolve(a):new Promise(function(t){a.baseTexture.once("loaded",function(){return t(a)})})},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Jp[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),Jp[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Jp[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Jp[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r<t.textureCacheIds.length;++r)Jp[t.textureCacheIds[r]]===t&&delete Jp[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,i=t.y,r=t.width,n=t.height,s=e+r>this.baseTexture.width,o=i+n>this.baseTexture.height;if(s||o){var a=s&&o?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new jm),sv(e._EMPTY),sv(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=Ap.ADAPTER.createCanvas(16,16),i=t.getContext("2d");t.width=16,t.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),e._WHITE=new e(jm.from(t)),sv(e._WHITE),sv(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(Op.default),av=function(t){function e(e,i){var r=t.call(this,e,i)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return Bm(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,i){void 0===i&&(i=!0);var r=this.baseTexture.resolution,n=Math.round(t*r)/r,s=Math.round(e*r)/r;this.valid=n>0&&s>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=s,i&&this.baseTexture.resize(n,s),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var i=arguments,r=[],n=1;n<arguments.length;n++)r[n-1]=i[n];return"number"==typeof t&&(Zp("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:r[0],scaleMode:r[1],resolution:r[2]}),new e(new iv(t))},e}(ov),hv=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e,i){void 0===i&&(i=np.NONE);var r=new iv(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new av(r)},t.prototype.getOptimalTexture=function(t,e,i,r){var n;void 0===i&&(i=1),void 0===r&&(r=np.NONE),t=Math.ceil(t*i-1e-6),e=Math.ceil(e*i-1e-6),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?n=r>1?-r:-1:(n=((65535&(t=Vp(t)))<<16|65535&(e=Vp(e)))>>>0,r>1&&(n+=4294967296*r)),this.texturePool[n]||(this.texturePool[n]=[]);var s=this.texturePool[n].pop();return s||(s=this.createTexture(t,e,r)),s.filterPoolKey=n,s.setResolution(i),s},t.prototype.getFilterTexture=function(t,e,i){var r=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||np.NONE);return r.filterFrame=t.filterFrame,r},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var r=0;r<i.length;r++)i[r].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){for(var e in this.enableFullScreen=t.width>0&&t.height>0,this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var r=0;r<i.length;r++)i[r].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},t.SCREEN_KEY=-1,t}(),uv=function(){function t(t,e,i,r,n,s,o){void 0===e&&(e=0),void 0===i&&(i=!1),void 0===r&&(r=kd.FLOAT),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=s,this.instance=o}return t.prototype.destroy=function(){this.buffer=null},t.from=function(e,i,r,n,s){return new t(e,i,r,n,s)},t}(),lv=0,cv=function(){function t(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=lv++,this.disposeRunner=new hm("disposeBuffer")}return t.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(t.prototype,"index",{get:function(){return this.type===op.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?op.ELEMENT_ARRAY_BUFFER:op.ARRAY_BUFFER},enumerable:!1,configurable:!0}),t.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new t(e)},t}(),fv={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var dv={5126:4,5123:2,5121:1},pv=0,mv={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},vv=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=pv++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new hm("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(t,e,i,r,n,s,o,a){if(void 0===i&&(i=0),void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof cv||(e instanceof Array&&(e=new Float32Array(e)),e=new cv(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,i,r,n);return this}var l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new uv(l,i,r,n,s,o,a),this.instanced=this.instanced||a,this},t.prototype.getAttribute=function(t){return this.attributes[t]},t.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},t.prototype.addIndex=function(t){return t instanceof cv||(t instanceof Array&&(t=new Uint16Array(t)),t=new cv(t)),t.type=op.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],i=[],r=new cv;for(t in this.attributes){var n=this.attributes[t],s=this.buffers[n.buffer];e.push(s.data),i.push(n.size*dv[n.type]/4),n.buffer=0}for(r.data=function(t,e){for(var i=0,r=0,n={},s=0;s<t.length;s++)r+=e[s],i+=t[s].length;var o=new ArrayBuffer(4*i),a=null,h=0;for(s=0;s<t.length;s++){var u=e[s],l=t[s],c=zp(l);n[c]||(n[c]=new fv[c](o)),a=n[c];for(var f=0;f<l.length;f++)a[(f/u|0)*r+h+f%u]=l[f];h+=u}return new Float32Array(o)}(e,i),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var e=new t,i=0;i<this.buffers.length;i++)e.buffers[i]=new cv(this.buffers[i].data.slice(0));for(var i in this.attributes){var r=this.attributes[i];e.attributes[i]=new uv(r.buffer,r.size,r.normalized,r.type,r.stride,r.start,r.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=op.ELEMENT_ARRAY_BUFFER),e},t.merge=function(e){for(var i,r=new t,n=[],s=[],o=[],a=0;a<e.length;a++){i=e[a];for(var h=0;h<i.buffers.length;h++)s[h]=s[h]||0,s[h]+=i.buffers[h].data.length,o[h]=0}for(a=0;a<i.buffers.length;a++)n[a]=new(mv[zp(i.buffers[a].data)])(s[a]),r.buffers[a]=new cv(n[a]);for(a=0;a<e.length;a++){i=e[a];for(h=0;h<i.buffers.length;h++)n[h].set(i.buffers[h].data,o[h]),o[h]+=i.buffers[h].data.length}if(r.attributes=i.attributes,i.indexBuffer){r.indexBuffer=r.buffers[i.buffers.indexOf(i.indexBuffer)],r.indexBuffer.type=op.ELEMENT_ARRAY_BUFFER;var u=0,l=0,c=0,f=0;for(a=0;a<i.buffers.length;a++)if(i.buffers[a]!==i.indexBuffer){f=a;break}for(var a in i.attributes){var d=i.attributes[a];(0|d.buffer)===f&&(l+=d.size*dv[d.type]/4)}for(a=0;a<e.length;a++){var p=e[a].indexBuffer.data;for(h=0;h<p.length;h++)r.indexBuffer.data[h+c]+=u;u+=e[a].buffers[f].data.length/l,c+=p.length}}return r},t}(),yv=function(t){function e(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return Bm(e,t),e}(vv),gv=function(t){function e(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new cv(e.vertices),e.uvBuffer=new cv(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return Bm(e,t),e.prototype.map=function(t,e){var i=0,r=0;return this.uvs[0]=i,this.uvs[1]=r,this.uvs[2]=i+e.width/t.width,this.uvs[3]=r,this.uvs[4]=i+e.width/t.width,this.uvs[5]=r+e.height/t.height,this.uvs[6]=i,this.uvs[7]=r+e.height/t.height,i=e.x,r=e.y,this.vertices[0]=i,this.vertices[1]=r,this.vertices[2]=i+e.width,this.vertices[3]=r,this.vertices[4]=i+e.width,this.vertices[5]=r+e.height,this.vertices[6]=i,this.vertices[7]=r+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(vv),bv=0,xv=function(){function t(t,e,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=bv++,this.static=!!e,this.ubo=!!i,t instanceof cv?(this.buffer=t,this.buffer.type=op.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new cv(new Float32Array(1)),this.buffer.type=op.UNIFORM_BUFFER,this.autoManage=!0))}return t.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},t.prototype.add=function(e,i,r){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new t(i,r)},t.from=function(e,i,r){return new t(e,i,r)},t.uboFrom=function(e,i){return new t(e,null==i||i,!0)},t}(),_v=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=np.NONE,this.sourceFrame=new bm,this.destinationFrame=new bm,this.bindingSourceFrame=new bm,this.bindingDestinationFrame=new bm,this.filters=[],this.transform=null}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),Ev=[new ym,new ym,new ym,new ym],wv=new Sm,Tv=function(){function t(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new hv,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new yv,this.quadUv=new gv,this.tempRect=new bm,this.activeState={},this.globalUniforms=new xv({outputFrame:new bm,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return t.prototype.push=function(t,e){for(var i,r,n=this.renderer,s=this.defaultFilterStack,o=this.statePool.pop()||new _v,a=this.renderer.renderTexture,h=e[0].resolution,u=e[0].multisample,l=e[0].padding,c=e[0].autoFit,f=null===(i=e[0].legacy)||void 0===i||i,d=1;d<e.length;d++){var p=e[d];h=Math.min(h,p.resolution),u=Math.min(u,p.multisample),l=this.useMaxPadding?Math.max(l,p.padding):l+p.padding,c=c&&p.autoFit,f=f||null===(r=p.legacy)||void 0===r||r}1===s.length&&(this.defaultFilterStack[0].renderTexture=a.current),s.push(o),o.resolution=h,o.multisample=u,o.legacy=f,o.target=t,o.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),o.sourceFrame.pad(l);var m=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB(wv.copyFrom(n.projection.transform).invert(),m),c?(o.sourceFrame.fit(m),(o.sourceFrame.width<=0||o.sourceFrame.height<=0)&&(o.sourceFrame.width=0,o.sourceFrame.height=0)):o.sourceFrame.intersects(m)||(o.sourceFrame.width=0,o.sourceFrame.height=0),this.roundFrame(o.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,h,u),o.filters=e,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var v=this.tempRect;v.x=0,v.y=0,v.width=o.sourceFrame.width,v.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(a.sourceFrame),o.bindingDestinationFrame.copyFrom(a.destinationFrame),o.transform=n.projection.transform,n.projection.transform=null,a.bind(o.renderTexture,o.sourceFrame,v),n.framebuffer.clear(0,0,0,0)},t.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),i=e.filters;this.activeState=e;var r=this.globalUniforms.uniforms;r.outputFrame=e.sourceFrame,r.resolution=e.resolution;var n=r.inputSize,s=r.inputPixel,o=r.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],s[0]=Math.round(n[0]*e.resolution),s[1]=Math.round(n[1]*e.resolution),s[2]=1/s[0],s[3]=1/s[1],o[0]=.5*s[2],o[1]=.5*s[3],o[2]=e.sourceFrame.width*n[2]-.5*s[2],o[3]=e.sourceFrame.height*n[3]-.5*s[3],e.legacy){var a=r.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,r.filterClamp=r.inputClamp}this.globalUniforms.update();var h=t[t.length-1];if(this.renderer.framebuffer.blit(),1===i.length)i[0].apply(this,e.renderTexture,h.renderTexture,qd.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var u=e.renderTexture,l=this.getOptimalFilterTexture(u.width,u.height,e.resolution);l.filterFrame=u.filterFrame;var c=0;for(c=0;c<i.length-1;++c){1===c&&e.multisample>1&&((l=this.getOptimalFilterTexture(u.width,u.height,e.resolution)).filterFrame=u.filterFrame),i[c].apply(this,u,l,qd.CLEAR,e);var f=u;u=l,l=f}i[c].apply(this,u,h.renderTexture,qd.BLEND,e),c>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(u),this.returnFilterTexture(l)}e.clear(),this.statePool.push(e)},t.prototype.bindAndClear=function(t,e){void 0===e&&(e=qd.CLEAR);var i=this.renderer,r=i.renderTexture,n=i.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=t.filterFrame.width,s.height=t.filterFrame.height,r.bind(t,t.filterFrame,s)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=1&n.stateId||this.forceClear;(e===qd.CLEAR||e===qd.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},t.prototype.applyFilter=function(t,e,i,r){var n=this.renderer;n.state.set(t.state),this.bindAndClear(i,r),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(Rd.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(Rd.TRIANGLE_STRIP))},t.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,r=i.sourceFrame,n=i.destinationFrame,s=e._texture.orig,o=t.set(n.width,0,0,n.height,r.x,r.y),a=e.worldTransform.copyTo(Sm.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o},t.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},t.prototype.getOptimalFilterTexture=function(t,e,i,r){return void 0===i&&(i=1),void 0===r&&(r=np.NONE),this.texturePool.getOptimalTexture(t,e,i,r)},t.prototype.getFilterTexture=function(t,e,i){if("number"==typeof t){var r=t;t=e,e=r}t=t||this.activeState.renderTexture;var n=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||np.NONE);return n.filterFrame=t.filterFrame,n},t.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},t.prototype.emptyPool=function(){this.texturePool.clear(!0)},t.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},t.prototype.transformAABB=function(t,e){var i=Ev[0],r=Ev[1],n=Ev[2],s=Ev[3];i.set(e.left,e.top),r.set(e.left,e.bottom),n.set(e.right,e.top),s.set(e.right,e.bottom),t.apply(i,i),t.apply(r,r),t.apply(n,n),t.apply(s,s);var o=Math.min(i.x,r.x,n.x,s.x),a=Math.min(i.y,r.y,n.y,s.y),h=Math.max(i.x,r.x,n.x,s.x),u=Math.max(i.y,r.y,n.y,s.y);e.x=o,e.y=a,e.width=h-o,e.height=u-a},t.prototype.roundFrame=function(t,e,i,r,n){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(n){var s=n.a,o=n.b,a=n.c,h=n.d;if((Math.abs(o)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(h)>1e-4))return}(n=n?wv.copyFrom(n):wv.identity()).translate(-i.x,-i.y).scale(r.width/i.width,r.height/i.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}},t}(),Sv=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),Av=function(){function t(t){this.renderer=t,this.emptyRenderer=new Sv(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,r=e-1;r>=0;--r)t[r]=i[r]||null,t[r]&&(t[r]._batchLocation=r)},t.prototype.boundArray=function(t,e,i,r){for(var n=t.elements,s=t.ids,o=t.count,a=0,h=0;h<o;h++){var u=n[h],l=u._batchLocation;if(l>=0&&l<r&&e[l]===u)s[h]=l;else for(;a<r;){var c=e[a];if(!c||c._batchEnabled!==i||c._batchLocation!==a){s[h]=a,u._batchLocation=a,e[a]=u;break}a++}}},t.prototype.destroy=function(){this.renderer=null},t}(),Ov=0,Cv=function(){function t(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(t.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),t.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Ov++},t.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=Ov++,this.renderer.runners.contextChange.emit(t)},t.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},t.prototype.createContext=function(t,e){var i;if(Ap.PREFER_ENV>=Ed.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},t.prototype.getExtensions=function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},t.prototype.handleContextLost=function(t){var e=this;t.preventDefault(),setTimeout(function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()},0)},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},t}(),Iv=function(){return function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=np.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}(),Rv=new bm,Pv=function(){function t(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new ev(10,10),this.msaaSamples=null}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new bm,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;Ap.PREFER_ENV===Ed.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},t.prototype.bind=function(t,e,i){void 0===i&&(i=0);var r=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=i),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var s=0;s<t.colorTextures.length;s++){var o=t.colorTextures[s];this.renderer.texture.unbind(o.parentTextureArray||o)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var a=e.width>>i,h=e.height>>i,u=a/e.width;this.setViewport(e.x*u,e.y*u,a,h)}else{a=t.width>>i,h=t.height>>i;this.setViewport(0,0,a,h)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},t.prototype.setViewport=function(t,e,i,r){var n=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),n.width===i&&n.height===r&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=i,n.height=r,this.gl.viewport(t,e,i,r))},Object.defineProperty(t.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),t.prototype.clear=function(t,e,i,r,n){void 0===n&&(n=Ad.COLOR|Ad.DEPTH);var s=this.gl;s.clearColor(t,e,i,r),s.clear(n)},t.prototype.initFramebuffer=function(t){var e=this.gl,i=new Iv(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},t.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var r=t.colorTextures,n=r.length;e.drawBuffers||(n=Math.min(n,1));for(var s=0;s<n;s++){var o=r[s],a=o.parentTextureArray||o;this.renderer.texture.bind(a,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},t.prototype.updateFramebuffer=function(t,e){var i=this.gl,r=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures,s=n.length;i.drawBuffers||(s=Math.min(s,1)),r.multisample>1&&this.canMultisampleFramebuffer(t)?(r.msaaBuffer=r.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,r.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,i.RGBA8,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(i.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var o=[],a=0;a<s;a++){var h=n[a],u=h.parentTextureArray||h;this.renderer.texture.bind(u,0),0===a&&r.msaaBuffer||(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+a,h.target,u._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+a))}if((o.length>1&&i.drawBuffers(o),t.depthTexture)&&this.writeDepthTexture){var l=t.depthTexture;this.renderer.texture.bind(l,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?r.stencil&&(i.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,r.stencil),r.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,r.stencil))},t.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},t.prototype.detectSamples=function(t){var e=this.msaaSamples,i=np.NONE;if(t<=1||null===e)return i;for(var r=0;r<e.length;r++)if(e[r]<=t){i=e[r];break}return 1===i&&(i=np.NONE),i},t.prototype.blit=function(t,e,i){var r=this,n=r.current,s=r.renderer,o=r.gl,a=r.CONTEXT_UID;if(2===s.context.webGLVersion&&n){var h=n.glFramebuffers[a];if(h){if(!t){if(!h.msaaBuffer)return;var u=n.colorTextures[0];if(!u)return;h.blitFramebuffer||(h.blitFramebuffer=new ev(n.width,n.height),h.blitFramebuffer.addColorTexture(0,u)),(t=h.blitFramebuffer).colorTextures[0]!==u&&(t.colorTextures[0]=u,t.dirtyId++,t.dirtyFormat++),t.width===n.width&&t.height===n.height||(t.width=n.width,t.height=n.height,t.dirtyId++,t.dirtySize++)}e||((e=Rv).width=n.width,e.height=n.height),i||(i=e);var l=e.width===i.width&&e.height===i.height;this.bind(t),o.bindFramebuffer(o.READ_FRAMEBUFFER,h.framebuffer),o.blitFramebuffer(e.left,e.top,e.right,e.bottom,i.left,i.top,i.right,i.bottom,o.COLOR_BUFFER_BIT,l?o.NEAREST:o.LINEAR)}}},t.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&r.deleteRenderbuffer(i.msaaBuffer),i.stencil&&r.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},t.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<e.length;i++)this.disposeFramebuffer(e[i],t)},t.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.stencil=!0;var i=t.width,r=t.height,n=this.gl,s=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,s),e.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,e.multisample,n.DEPTH24_STENCIL8,i,r):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,i,r),e.stencil=s,n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,s)}}},t.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new bm},t.prototype.destroy=function(){this.renderer=null},t}(),Mv={5126:4,5123:2,5121:1},Dv=function(){function t(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){var i=this.renderer.context.extensions.vertexArrayObject;Ap.PREFER_ENV===Ed.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=function(){return i.createVertexArrayOES()},t.bindVertexArray=function(t){return i.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return i.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(2!==e.webGLVersion){var r=t.getExtension("ANGLE_instanced_arrays");r?(t.vertexAttribDivisor=function(t,e){return r.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,i,n,s){return r.drawElementsInstancedANGLE(t,e,i,n,s)},t.drawArraysInstanced=function(t,e,i,n){return r.drawArraysInstancedANGLE(t,e,i,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},t.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var i=this.gl,r=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={},n=!0);var s=r[e.program.id]||this.initGeometryVao(t,e,n);this._activeGeometry=t,this._activeVao!==s&&(this._activeVao=s,this.hasVao?i.bindVertexArray(s):this.activateVao(t,e.program)),this.updateBuffers()},t.prototype.reset=function(){this.unbind()},t.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,i=0;i<t.buffers.length;i++){var r=t.buffers[i];e.update(r)}},t.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},t.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var s in i)r[s]&&n.push(s,r[s].location);return n.join("-")},t.prototype.initGeometryVao=function(t,e,i){void 0===i&&(i=!0);var r=this.gl,n=this.CONTEXT_UID,s=this.renderer.buffer,o=e.program;o.glPrograms[n]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,o);var a=this.getSignature(t,o),h=t.glVertexArrayObjects[this.CONTEXT_UID],u=h[a];if(u)return h[o.id]=u,u;var l=t.buffers,c=t.attributes,f={},d={};for(var p in l)f[p]=0,d[p]=0;for(var p in c)!c[p].size&&o.attributeData[p]?c[p].size=o.attributeData[p].size:c[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),f[c[p].buffer]+=c[p].size*Mv[c[p].type];for(var p in c){var m=c[p],v=m.size;void 0===m.stride&&(f[m.buffer]===v*Mv[m.type]?m.stride=0:m.stride=f[m.buffer]),void 0===m.start&&(m.start=d[m.buffer],d[m.buffer]+=v*Mv[m.type])}u=r.createVertexArray(),r.bindVertexArray(u);for(var y=0;y<l.length;y++){var g=l[y];s.bind(g),i&&g._glBuffers[n].refCount++}return this.activateVao(t,o),this._activeVao=u,h[o.id]=u,h[a]=u,u},t.prototype.disposeGeometry=function(t,e){var i;if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var r=t.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,s=t.buffers,o=null===(i=this.renderer)||void 0===i?void 0:i.buffer;if(t.disposeRunner.remove(this),r){if(o)for(var a=0;a<s.length;a++){var h=s[a]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,0!==h.refCount||e||o.dispose(s[a],e))}if(!e)for(var u in r)if("g"===u[0]){var l=r[u];this._activeVao===l&&this.unbind(),n.deleteVertexArray(l)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t)},t.prototype.activateVao=function(t,e){var i=this.gl,r=this.CONTEXT_UID,n=this.renderer.buffer,s=t.buffers,o=t.attributes;t.indexBuffer&&n.bind(t.indexBuffer);var a=null;for(var h in o){var u=o[h],l=s[u.buffer],c=l._glBuffers[r];if(e.attributeData[h]){a!==c&&(n.bind(l),a=c);var f=e.attributeData[h].location;if(i.enableVertexAttribArray(f),i.vertexAttribPointer(f,u.size,u.type||i.FLOAT,u.normalized,u.stride,u.start),u.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");i.vertexAttribDivisor(f,1)}}}},t.prototype.draw=function(t,e,i,r){var n=this.gl,s=this._activeGeometry;if(s.indexBuffer){var o=s.indexBuffer.data.BYTES_PER_ELEMENT,a=2===o?n.UNSIGNED_SHORT:n.UNSIGNED_INT;2===o||4===o&&this.canUseUInt32ElementIndex?s.instanced?n.drawElementsInstanced(t,e||s.indexBuffer.data.length,a,(i||0)*o,r||1):n.drawElements(t,e||s.indexBuffer.data.length,a,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else s.instanced?n.drawArraysInstanced(t,i,e||s.getSize(),r||1):n.drawArrays(t,i,e||s.getSize());return this},t.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},t.prototype.destroy=function(){this.renderer=null},t}(),Fv=function(){function t(t){void 0===t&&(t=null),this.type=tp.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Ap.FILTER_MULTISAMPLE,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}return Object.defineProperty(t.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=tp.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},t.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function Lv(t,e,i){var r=t.createShader(e);return t.shaderSource(r,i),t.compileShader(r),r}function kv(t,e){var i=t.getShaderSource(e).split("\n").map(function(t,e){return e+": "+t}),r=t.getShaderInfoLog(e),n=r.split("\n"),s={},o=n.map(function(t){return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(t){return!(!t||s[t])&&(s[t]=!0,!0)}),a=[""];o.forEach(function(t){i[t-1]="%c"+i[t-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var h=i.join("\n");a[0]=h,console.error(r),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function Nv(t){for(var e=new Array(t),i=0;i<e.length;i++)e[i]=!1;return e}function Bv(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return Nv(2*e);case"bvec3":return Nv(3*e);case"bvec4":return Nv(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Uv,zv={},Vv=zv;function Gv(){if(!Uv){Uv=Jd.MEDIUM;var t=function(){if(Vv===zv||Vv&&Vv.isContextLost()){var t=Ap.ADAPTER.createCanvas(),e=void 0;Ap.PREFER_ENV>=Ed.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),Vv=e}return Vv}();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);Uv=e.precision?Jd.HIGH:Jd.MEDIUM}}return Uv}function jv(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===Jd.HIGH&&i!==Jd.HIGH&&(r=Jd.MEDIUM),"precision "+r+" float;\n"+t}return i!==Jd.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Hv={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Xv(t){return Hv[t]}var Wv=null,Yv={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function qv(t,e){if(!Wv){var i=Object.keys(Yv);Wv={};for(var r=0;r<i.length;++r){var n=i[r];Wv[t[n]]=Yv[n]}}return Wv[e]}var Zv=[{test:function(t){return"float"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n if(uv["'+t+'"] !== ud["'+t+'"].value)\n {\n ud["'+t+'"].value = uv["'+t+'"]\n gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n }\n '}},{test:function(t,e){return!("sampler2D"!==t.type&&"samplerCube"!==t.type&&"sampler2DArray"!==t.type||1!==t.size||t.isArray||null!=e&&void 0===e.castToBaseTexture)},code:function(t){return't = syncData.textureCount++;\n\n renderer.texture.bind(uv["'+t+'"], t);\n\n if(ud["'+t+'"].value !== t)\n {\n ud["'+t+'"].value = t;\n gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a},code:function(t){return'\n gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n '},codeUbo:function(t){return"\n var "+t+"_matrix = uv."+t+".toArray(true);\n\n data[offset] = "+t+"_matrix[0];\n data[offset+1] = "+t+"_matrix[1];\n data[offset+2] = "+t+"_matrix[2];\n \n data[offset + 4] = "+t+"_matrix[3];\n data[offset + 5] = "+t+"_matrix[4];\n data[offset + 6] = "+t+"_matrix[5];\n \n data[offset + 8] = "+t+"_matrix[6];\n data[offset + 9] = "+t+"_matrix[7];\n data[offset + 10] = "+t+"_matrix[8];\n "}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n }'},codeUbo:function(t){return"\n v = uv."+t+";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n "}},{test:function(t){return"vec2"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n }\n '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n }'},codeUbo:function(t){return"\n v = uv."+t+";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n "}},{test:function(t){return"vec4"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n }'}}],Kv={float:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }",vec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",int:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",ivec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",ivec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",ivec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",uint:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }",uvec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }",uvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",uvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }",bvec2:"\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",bvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",bvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",samplerCube:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",sampler2DArray:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }"},Qv={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var Jv,$v=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function ty(t){for(var e="",i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+="if(test == "+i+".0){}");return e}var ey=0,iy={},ry=function(){function t(e,i,r){void 0===r&&(r="pixi-shader"),this.id=ey++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=i||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(r=r.replace(/\s+/g,"-"),iy[r]?(iy[r]++,r+="-"+iy[r]):iy[r]=1,this.vertexSrc="#define SHADER_NAME "+r+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+r+"\n"+this.fragmentSrc,this.vertexSrc=jv(this.vertexSrc,Ap.PRECISION_VERTEX,Jd.HIGH),this.fragmentSrc=jv(this.fragmentSrc,Ap.PRECISION_FRAGMENT,Gv())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),t.from=function(e,i,r){var n=e+i,s=Qp[n];return s||(Qp[n]=s=new t(e,i,r)),s},t}(),ny=function(){function t(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof xv?e:new xv(e):new xv({}),this.disposeRunner=new hm("disposeShader")}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var i in e.uniforms){var r=e.uniforms[i];if(r.group&&this.checkUniformExists(t,r))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,i,r){return new t(ry.from(e,i),r)},t}(),sy=function(){function t(){this.data=0,this.blendMode=Cd.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(t){!!(32&this.data)!==t&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==Cd.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},t.for2d=function(){var e=new t;return e.depthTest=!1,e.blend=!0,e},t}(),oy=function(t){function e(i,r,n){var s=this,o=ry.from(i||e.defaultVertexSrc,r||e.defaultFragmentSrc);return(s=t.call(this,o,n)||this).padding=0,s.resolution=Ap.FILTER_RESOLUTION,s.multisample=Ap.FILTER_MULTISAMPLE,s.enabled=!0,s.autoFit=!0,s.state=new sy,s}return Bm(e,t),e.prototype.apply=function(t,e,i,r,n){t.applyFilter(this,e,i,r)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(ny),ay=new Sm,hy=function(){function t(t,e){this._texture=t,this.mapCoord=new Sm,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var i=this.mapCoord,r=0;r<t.length;r+=2){var n=t[r],s=t[r+1];e[r]=n*i.a+s*i.c+i.tx,e[r+1]=n*i.b+s*i.d+i.ty}return e},t.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var r=e.orig,n=e.trim;n&&(ay.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(ay));var s=e.baseTexture,o=this.uClampFrame,a=this.clampMargin/s.resolution,h=this.clampOffset;return o[0]=(e._frame.x+a+h)/s.width,o[1]=(e._frame.y+a+h)/s.height,o[2]=(e._frame.x+e._frame.width-a+h)/s.width,o[3]=(e._frame.y+e._frame.height-a+h)/s.height,this.uClampOffset[0]=h/s.realWidth,this.uClampOffset[1]=h/s.realHeight,this.isSimple=e._frame.width===s.width&&e._frame.height===s.height&&0===e.rotate,!0},t}(),uy=function(t){function e(e,i,r){var n=this,s=null;return"string"!=typeof e&&void 0===i&&void 0===r&&(s=e,e=void 0,i=void 0,r=void 0),(n=t.call(this,e||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n",i||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n",r)||this).maskSprite=s,n.maskMatrix=new Sm,n}return Bm(e,t),Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,e,i,r){var n=this._maskSprite,s=n._texture;s.valid&&(s.uvMatrix||(s.uvMatrix=new hy(s,0)),s.uvMatrix.update(),this.uniforms.npmAlpha=s.baseTexture.alphaMode?0:1,this.uniforms.mask=s,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(s.uvMatrix.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=s.uvMatrix.uClampFrame,t.applyFilter(this,e,i,r))},e}(oy),ly=function(){function t(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return t.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},t.prototype.push=function(t,e){var i=e;if(!i.isMaskData){var r=this.maskDataPool.pop()||new Fv;r.pooled=!0,r.maskObject=e,i=r}var n=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(n),i._colorMask=n?n._colorMask:15,i.autoDetect&&this.detect(i),i._target=t,i.type!==tp.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case tp.SCISSOR:this.renderer.scissor.push(i);break;case tp.STENCIL:this.renderer.stencil.push(i);break;case tp.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case tp.COLOR:this.pushColorMask(i)}i.type===tp.SPRITE&&this.maskStack.push(i)},t.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case tp.SCISSOR:this.renderer.scissor.pop(e);break;case tp.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case tp.SPRITE:this.popSpriteMask(e);break;case tp.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){var i=this.maskStack[this.maskStack.length-1];i.type===tp.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},t.prototype.detect=function(t){var e=t.maskObject;e?e.isSprite?t.type=tp.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=tp.SCISSOR:t.type=tp.STENCIL:t.type=tp.COLOR},t.prototype.pushSpriteMask=function(t){var e,i,r=t.maskObject,n=t._target,s=t._filters;s||(s=this.alphaMaskPool[this.alphaMaskIndex])||(s=this.alphaMaskPool[this.alphaMaskIndex]=[new uy]);var o,a,h=this.renderer,u=h.renderTexture;if(u.current){var l=u.current;o=t.resolution||l.resolution,a=null!==(e=t.multisample)&&void 0!==e?e:l.multisample}else o=t.resolution||h.resolution,a=null!==(i=t.multisample)&&void 0!==i?i:h.multisample;s[0].resolution=o,s[0].multisample=a,s[0].maskSprite=r;var c=n.filterArea;n.filterArea=r.getBounds(!0),h.filter.push(n,s),n.filterArea=c,t._filters||this.alphaMaskIndex++},t.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},t.prototype.pushColorMask=function(t){var e=t._colorMask,i=t._colorMask=e&t.colorMask;i!==e&&this.renderer.gl.colorMask(!!(1&i),!!(2&i),!!(4&i),!!(8&i))},t.prototype.popColorMask=function(t){var e=t._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask(!!(1&i),!!(2&i),!!(4&i),!!(8&i))},t.prototype.destroy=function(){this.renderer=null},t}(),cy=function(){function t(t){this.renderer=t,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var r=this.getStackLength();r!==i&&(0===r?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),fy=new Sm,dy=[],py=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=Ap.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return Bm(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var e;if(!t._scissorRectLocal){var i=t._scissorRect,r=t.maskObject,n=this.renderer,s=n.renderTexture,o=r.getBounds(!0,null!==(e=dy.pop())&&void 0!==e?e:new bm);this.roundFrameToPixels(o,s.current?s.current.resolution:n.resolution,s.sourceFrame,s.destinationFrame,n.projection.transform),i&&o.fit(i),t._scissorRectLocal=o}},e.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,i=t.b,r=t.c,n=t.d;return(Math.abs(i)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)},e.prototype.testScissor=function(t){var i=t.maskObject;if(!i.isFastRect||!i.isFastRect())return!1;if(e.isMatrixRotated(i.worldTransform))return!1;if(e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var r=t._scissorRectLocal;return r.width>0&&r.height>0},e.prototype.roundFrameToPixels=function(t,i,r,n,s){e.isMatrixRotated(s)||((s=s?fy.copyFrom(s):fy.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.renderer.filter.transformAABB(s,t),t.fit(n),t.x=Math.round(t.x*i),t.y=Math.round(t.y*i),t.width=Math.round(t.width*i),t.height=Math.round(t.height*i))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;t&&dy.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},e}(cy),my=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=Ap.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return Bm(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,i=this.renderer.gl,r=t._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;var n=t._colorMask;0!==n&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,r,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==n&&(t._colorMask=n,i.colorMask(!!(1&n),!!(2&n),!!(4&n),!!(8&n))),this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{var i=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,r=i?i._colorMask:15;0!==r&&(i._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==r&&(i._colorMask=r,e.colorMask(!!(1&r),!!(2&r),!!(4&r),!!(8&r))),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(cy),vy=function(){function t(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Sm,this.transform=null}return t.prototype.update=function(t,e,i,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,r),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(t,e,i,r){var n=this.projectionMatrix,s=r?-1:1;n.identity(),n.a=1/e.width*2,n.d=s*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-s-e.y*n.d},t.prototype.setTransform=function(t){},t.prototype.destroy=function(){this.renderer=null},t}(),yy=new bm,gy=new bm,by=function(){function t(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new bm,this.destinationFrame=new bm,this.viewportFrame=new bm}return t.prototype.bind=function(t,e,i){void 0===t&&(t=null);var r,n,s,o=this.renderer;this.current=t,t?(s=(r=t.baseTexture).resolution,e||(yy.width=t.frame.width,yy.height=t.frame.height,e=yy),i||(gy.x=t.frame.x,gy.y=t.frame.y,gy.width=e.width,gy.height=e.height,i=gy),n=r.framebuffer):(s=o.resolution,e||(yy.width=o.screen.width,yy.height=o.screen.height,e=yy),i||((i=yy).width=e.width,i.height=e.height));var a=this.viewportFrame;a.x=i.x*s,a.y=i.y*s,a.width=i.width*s,a.height=i.height*s,t||(a.y=o.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(i,e,s,!n),t?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},t.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor;var i=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,n=i.width!==r.width||i.height!==r.height;if(n){var s=this.viewportFrame,o=s.x,a=s.y,h=s.width,u=s.height;o=Math.round(o),a=Math.round(a),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,a,h,u)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),n&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function xy(t,e,i,r,n){i.buffer.update(n)}var _y={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},Ey={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function wy(t,e){if(!t.autoManage)return{size:0,syncFunc:xy};for(var i=function(t,e){var i=[];for(var r in t)e[r]&&i.push(e[r]);return i.sort(function(t,e){return t.index-e.index}),i}(t.uniforms,e),r=function(t){for(var e=t.map(function(t){return{data:t,offset:0,dataLen:0,dirty:0}}),i=0,r=0,n=0,s=0;s<e.length;s++){var o=e[s];if(i=Ey[o.data.type],o.data.size>1&&(i=Math.max(i,16)*o.data.size),o.dataLen=i,r%i!==0&&r<16){var a=r%i%16;r+=a,n+=a}r+i>16?(n=16*Math.ceil(n/16),o.offset=n,n+=i,r=i):(o.offset=n,r+=i,n+=i)}return{uboElements:e,size:n=16*Math.ceil(n/16)}}(i),n=r.uboElements,s=r.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a<n.length;a++){for(var h=n[a],u=t.uniforms[h.data.name],l=h.data.name,c=!1,f=0;f<Zv.length;f++){var d=Zv[f];if(d.codeUbo&&d.test(h.data,u)){o.push("offset = "+h.offset/4+";",Zv[f].codeUbo(h.data.name,u)),c=!0;break}}if(!c)if(h.data.size>1){var p=Xv(h.data.type),m=Math.max(Ey[h.data.type]/16,1),v=p/m,y=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+h.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+h.data.size*m+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+y+";\n }\n\n ")}else{var g=_y[h.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+h.offset/4+";\n "+g+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}var Ty=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function Sy(t,e){var i=Lv(t,t.VERTEX_SHADER,e.vertexSrc),r=Lv(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();if(t.attachShader(n,i),t.attachShader(n,r),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function(t,e,i,r){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(i,t.COMPILE_STATUS)||kv(t,i),t.getShaderParameter(r,t.COMPILE_STATUS)||kv(t,r),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,i,r),e.attributeData=function(t,e){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;n<r;n++){var s=e.getActiveAttrib(t,n);if(0!==s.name.indexOf("gl_")){var o=qv(e,s.type),a={type:o,name:s.name,size:Xv(o),location:e.getAttribLocation(t,s.name)};i[s.name]=a}}return i}(n,t),e.uniformData=function(t,e){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<r;n++){var s=e.getActiveUniform(t,n),o=s.name.replace(/\[.*?\]$/,""),a=!!s.name.match(/\[.*?\]$/),h=qv(e,s.type);i[o]={name:o,index:n,type:h,size:s.size,isArray:a,value:Bv(h,s.size)}}return i}(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var s=Object.keys(e.attributeData);s.sort(function(t,e){return t>e?1:-1});for(var o=0;o<s.length;o++)e.attributeData[s[o]].location=o,t.bindAttribLocation(n,o,s[o]);t.linkProgram(n)}t.deleteShader(i),t.deleteShader(r);var a={};for(var o in e.uniformData){var h=e.uniformData[o];a[o]={location:t.getUniformLocation(n,o),value:Bv(h.type,h.size)}}return new Ty(n,a)}var Ay=0,Oy={textureCount:0,uboCount:0},Cy=function(){function t(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Ay++}return t.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof Jv)return Jv;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");Jv=!0===t({a:"b"},"a","b")}catch(t){Jv=!1}return Jv}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},t.prototype.contextChange=function(t){this.gl=t,this.reset()},t.prototype.bind=function(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;var i=t.program,r=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(r.program)),e||(Oy.textureCount=0,Oy.uboCount=0,this.syncUniformGroup(t.uniformGroup,Oy)),r},t.prototype.setUniforms=function(t){var e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)},t.prototype.syncUniformGroup=function(t,e){var i=this.getGlProgram();t.static&&t.dirtyId===i.uniformDirtyGroups[t.id]||(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))},t.prototype.syncUniforms=function(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)},t.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){var i,r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var n in t.uniforms){var s=e[n];if(s){for(var o=t.uniforms[n],a=!1,h=0;h<Zv.length;h++)if(Zv[h].test(s,o)){r.push(Zv[h].code(n,o)),a=!0;break}if(!a){var u=(1!==s.size||s.isArray?Qv:Kv)[s.type].replace("location",'ud["'+n+'"].location');r.push('\n cu = ud["'+n+'"];\n cv = cu.value;\n v = uv["'+n+'"];\n '+u+";")}}else(null===(i=t.uniforms[n])||void 0===i?void 0:i.group)&&(t.uniforms[n].ubo?r.push("\n renderer.shader.syncUniformBufferGroup(uv."+n+", '"+n+"');\n "):r.push("\n renderer.shader.syncUniformGroup(uv."+n+", syncData);\n "))}return new Function("ud","uv","renderer","syncData",r.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},t.prototype.syncUniformBufferGroup=function(t,e){var i=this.getGlProgram();if(!t.static||0!==t.dirtyId||!i.uniformGroups[t.id]){t.dirtyId=0;var r=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),r(i.uniformData,t.uniforms,this.renderer,Oy,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])},t.prototype.createSyncBufferGroup=function(t,e,i){var r=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var n=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,r.uniformBlockBinding(e.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;var s=this.getSignature(t,this.shader.program.uniformData,"ubo"),o=this._uboCache[s];if(o||(o=this._uboCache[s]=wy(t,this.shader.program.uniformData)),t.autoManage){var a=new Float32Array(o.size/4);t.buffer.update(a)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]},t.prototype.getSignature=function(t,e,i){var r=t.uniforms,n=[i+"-"];for(var s in r)n.push(s),e[s]&&n.push(e[s].type);return n.join("-")},t.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},t.prototype.generateProgram=function(t){var e=this.gl,i=t.program,r=Sy(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=r,r},t.prototype.reset=function(){this.program=null,this.shader=null},t.prototype.disposeShader=function(t){this.shader===t&&(this.shader=null)},t.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},t}();var Iy=function(){function t(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=Cd.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new sy,this.defaultState.blend=!0}return t.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[Cd.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.ADD]=[t.ONE,t.ONE],e[Cd.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.NONE]=[0,0],e[Cd.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[Cd.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Cd.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[Cd.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[Cd.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[Cd.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[Cd.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[Cd.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[Cd.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[Cd.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[Cd.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},t.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,i=0;e;)1&e&&this.map[i].call(this,!!(t.data&1<<i)),e>>=1,i++;this.stateId=t.data}for(i=0;i<this.checks.length;i++)this.checks[i](this,t)},t.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},t.prototype.setBlend=function(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},t.prototype.setOffset=function(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},t.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},t.prototype.setDepthMask=function(t){this.gl.depthMask(t)},t.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},t.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},t.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],i=this.gl;2===e.length?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},t.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},t.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},t.prototype.updateCheck=function(t,e){var i=this.checks.indexOf(t);e&&-1===i?this.checks.push(t):e||-1===i||this.checks.splice(i,1)},t.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},t.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},t.prototype.destroy=function(){this.gl=null},t}(),Ry=function(){function t(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Ap.GC_MAX_IDLE,this.checkCountMax=Ap.GC_MAX_CHECK_COUNT,this.mode=Ap.GC_MODE}return t.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==Kd.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;r<e.length;r++){var n=e[r];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){var s=0;for(r=0;r<e.length;r++)null!==e[r]&&(e[s++]=e[r]);e.length=s}},t.prototype.unload=function(t){var e=this.renderer.texture,i=t._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(var r=t.children.length-1;r>=0;r--)this.unload(t.children[r])},t.prototype.destroy=function(){this.renderer=null},t}();var Py=function(){return function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=kd.UNSIGNED_BYTE,this.internalFormat=Md.RGBA,this.samplerType=0}}(),My=function(){function t(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new jm,this.hasIntegerTextures=!1}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){var e,i,r,n,s,o,a,h,u,l,c,f,d,p,m,v,y,g,b,x,_,E,w;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?((e={})[kd.UNSIGNED_BYTE]=((i={})[Md.RGBA]=t.RGBA8,i[Md.RGB]=t.RGB8,i[Md.RG]=t.RG8,i[Md.RED]=t.R8,i[Md.RGBA_INTEGER]=t.RGBA8UI,i[Md.RGB_INTEGER]=t.RGB8UI,i[Md.RG_INTEGER]=t.RG8UI,i[Md.RED_INTEGER]=t.R8UI,i[Md.ALPHA]=t.ALPHA,i[Md.LUMINANCE]=t.LUMINANCE,i[Md.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,i),e[kd.BYTE]=((r={})[Md.RGBA]=t.RGBA8_SNORM,r[Md.RGB]=t.RGB8_SNORM,r[Md.RG]=t.RG8_SNORM,r[Md.RED]=t.R8_SNORM,r[Md.RGBA_INTEGER]=t.RGBA8I,r[Md.RGB_INTEGER]=t.RGB8I,r[Md.RG_INTEGER]=t.RG8I,r[Md.RED_INTEGER]=t.R8I,r),e[kd.UNSIGNED_SHORT]=((n={})[Md.RGBA_INTEGER]=t.RGBA16UI,n[Md.RGB_INTEGER]=t.RGB16UI,n[Md.RG_INTEGER]=t.RG16UI,n[Md.RED_INTEGER]=t.R16UI,n[Md.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,n),e[kd.SHORT]=((s={})[Md.RGBA_INTEGER]=t.RGBA16I,s[Md.RGB_INTEGER]=t.RGB16I,s[Md.RG_INTEGER]=t.RG16I,s[Md.RED_INTEGER]=t.R16I,s),e[kd.UNSIGNED_INT]=((o={})[Md.RGBA_INTEGER]=t.RGBA32UI,o[Md.RGB_INTEGER]=t.RGB32UI,o[Md.RG_INTEGER]=t.RG32UI,o[Md.RED_INTEGER]=t.R32UI,o[Md.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,o),e[kd.INT]=((a={})[Md.RGBA_INTEGER]=t.RGBA32I,a[Md.RGB_INTEGER]=t.RGB32I,a[Md.RG_INTEGER]=t.RG32I,a[Md.RED_INTEGER]=t.R32I,a),e[kd.FLOAT]=((h={})[Md.RGBA]=t.RGBA32F,h[Md.RGB]=t.RGB32F,h[Md.RG]=t.RG32F,h[Md.RED]=t.R32F,h[Md.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,h),e[kd.HALF_FLOAT]=((u={})[Md.RGBA]=t.RGBA16F,u[Md.RGB]=t.RGB16F,u[Md.RG]=t.RG16F,u[Md.RED]=t.R16F,u),e[kd.UNSIGNED_SHORT_5_6_5]=((l={})[Md.RGB]=t.RGB565,l),e[kd.UNSIGNED_SHORT_4_4_4_4]=((c={})[Md.RGBA]=t.RGBA4,c),e[kd.UNSIGNED_SHORT_5_5_5_1]=((f={})[Md.RGBA]=t.RGB5_A1,f),e[kd.UNSIGNED_INT_2_10_10_10_REV]=((d={})[Md.RGBA]=t.RGB10_A2,d[Md.RGBA_INTEGER]=t.RGB10_A2UI,d),e[kd.UNSIGNED_INT_10F_11F_11F_REV]=((p={})[Md.RGB]=t.R11F_G11F_B10F,p),e[kd.UNSIGNED_INT_5_9_9_9_REV]=((m={})[Md.RGB]=t.RGB9_E5,m),e[kd.UNSIGNED_INT_24_8]=((v={})[Md.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,v),e[kd.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[Md.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,y),w=e):((g={})[kd.UNSIGNED_BYTE]=((b={})[Md.RGBA]=t.RGBA,b[Md.RGB]=t.RGB,b[Md.ALPHA]=t.ALPHA,b[Md.LUMINANCE]=t.LUMINANCE,b[Md.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,b),g[kd.UNSIGNED_SHORT_5_6_5]=((x={})[Md.RGB]=t.RGB,x),g[kd.UNSIGNED_SHORT_4_4_4_4]=((_={})[Md.RGBA]=t.RGBA,_),g[kd.UNSIGNED_SHORT_5_5_5_1]=((E={})[Md.RGBA]=t.RGBA,E),w=g),w}(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i<e;i++)this.boundTextures[i]=null;this.emptyTextures={};var r=new Py(t.createTexture());t.bindTexture(t.TEXTURE_2D,r.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=r,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Py(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(i=0;i<this.boundTextures.length;i++)this.bind(null,i)},t.prototype.bind=function(t,e){void 0===e&&(e=0);var i=this.gl;if((t=null==t?void 0:t.castToBaseTexture())&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var r=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,r.texture)),r.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)):r.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null},t.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},t.prototype.unbind=function(t){var e=this.gl,i=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var r=0;r<i.length;r++)i[r]===this.unknownTexture&&this.bind(null,r)}for(r=0;r<i.length;r++)i[r]===t&&(this.currentLocation!==r&&(e.activeTexture(e.TEXTURE0+r),this.currentLocation=r),e.bindTexture(t.target,this.emptyTextures[t.target].texture),i[r]=null)},t.prototype.ensureSamplerType=function(t){var e=this,i=e.boundTextures,r=e.hasIntegerTextures,n=e.CONTEXT_UID;if(r)for(var s=t-1;s>=0;--s){var o=i[s];if(o)o._glTextures[n].samplerType!==Bd.FLOAT&&this.renderer.texture.unbind(o)}},t.prototype.initTexture=function(t){var e=new Py(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},t.prototype.initTextureType=function(t,e){var i,r;e.internalFormat=null!==(r=null===(i=this.internalFormats[t.type])||void 0===i?void 0:i[t.format])&&void 0!==r?r:t.format,2===this.webGLVersion&&t.type===kd.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},t.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e))e.samplerType!==Bd.FLOAT&&(this.hasIntegerTextures=!0);else{var r=t.realWidth,n=t.realHeight,s=i.gl;(e.width!==r||e.height!==n||e.dirtyId<0)&&(e.width=r,e.height=n,s.texImage2D(t.target,0,e.internalFormat,r,n,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},t.prototype.destroyTexture=function(t,e){var i=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var r=this.managedTextures.indexOf(t);-1!==r&&Hp(this.managedTextures,r,1)}},t.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==Hd.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=Gd.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},t.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&t.mipmap!==Hd.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===zd.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===zd.LINEAR){var n=Math.min(t.anisotropicLevel,i.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===zd.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===zd.LINEAR?i.LINEAR:i.NEAREST)},t.prototype.destroy=function(){this.renderer=null},t}(),Dy={__proto__:null,FilterSystem:Tv,BatchSystem:Av,ContextSystem:Cv,FramebufferSystem:Pv,GeometrySystem:Dv,MaskSystem:ly,ScissorSystem:py,StencilSystem:my,ProjectionSystem:vy,RenderTextureSystem:by,ShaderSystem:Cy,StateSystem:Iy,TextureGCSystem:Ry,TextureSystem:My},Fy=new Sm,Ly=function(t){function e(e,i){void 0===e&&(e=Td.UNKNOWN);var r=t.call(this)||this;return i=Object.assign({},Ap.RENDER_OPTIONS,i),r.options=i,r.type=e,r.screen=new bm(0,0,i.width,i.height),r.view=i.view||Ap.ADAPTER.createCanvas(),r.resolution=i.resolution||Ap.RESOLUTION,r.useContextAlpha=i.useContextAlpha,r.autoDensity=!!i.autoDensity,r.preserveDrawingBuffer=i.preserveDrawingBuffer,r.clearBeforeRender=i.clearBeforeRender,r._backgroundColor=0,r._backgroundColorRgba=[0,0,0,1],r._backgroundColorString="#000000",r.backgroundColor=i.backgroundColor||r._backgroundColor,r.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&(Zp("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),r.useContextAlpha=i.transparent,r.backgroundAlpha=i.transparent?0:1),r._lastObjectRendered=null,r.plugins={},r}return Bm(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var i=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=i,this.screen.height=r,this.autoDensity&&(this.view.style.width=i+"px",this.view.style.height=r+"px"),this.emit("resize",i,r)},e.prototype.generateTexture=function(t,e,i,r){void 0===e&&(e={}),"number"==typeof e&&(Zp("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:i,region:r});var n=e.region,s=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i}(e,["region"]);0===(r=n||t.getLocalBounds(null,!0)).width&&(r.width=1),0===r.height&&(r.height=1);var o=av.create(Um({width:r.width,height:r.height},s));return Fy.tx=-r.x,Fy.ty=-r.y,this.render(t,{renderTexture:o,clear:!1,transform:Fy,skipUpdateTransform:!!t.parent}),o},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var i=this;i.plugins=null,i.type=Td.UNKNOWN,i.view=null,i.screen=null,i._tempDisplayObjectParent=null,i.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=kp(t),Lp(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(Op.default),ky=function(){return function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}(),Ny=function(){function t(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(t){var e=this.gl,i=this.CONTEXT_UID,r=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,r.buffer)},t.prototype.bindBufferBase=function(t,e){var i=this.gl,r=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var n=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,n.buffer)}},t.prototype.bindBufferRange=function(t,e,i){var r=this.gl,n=this.CONTEXT_UID;i=i||0;var s=t._glBuffers[n]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,e||0,s.buffer,256*i,256)},t.prototype.update=function(t){var e=this.gl,i=this.CONTEXT_UID,r=t._glBuffers[i];if(t._updateID!==r.updateID)if(r.updateID=t._updateID,e.bindBuffer(t.type,r.buffer),r.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;r.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i<e.length;i++)this.dispose(this.managedBuffers[e[i]],t)},t.prototype.createGLBuffer=function(t){var e=this.CONTEXT_UID,i=this.gl;return t._glBuffers[e]=new ky(i.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]},t}(),By=function(t){function e(i){var r=t.call(this,Td.WEBGL,i)||this;return i=r.options,r.gl=null,r.CONTEXT_UID=0,r.runners={destroy:new hm("destroy"),contextChange:new hm("contextChange"),reset:new hm("reset"),update:new hm("update"),postrender:new hm("postrender"),prerender:new hm("prerender"),resize:new hm("resize")},r.runners.contextChange.add(r),r.globalUniforms=new xv({projectionMatrix:new Sm},!0),r.addSystem(ly,"mask").addSystem(Cv,"context").addSystem(Iy,"state").addSystem(Cy,"shader").addSystem(My,"texture").addSystem(Ny,"buffer").addSystem(Dv,"geometry").addSystem(Pv,"framebuffer").addSystem(py,"scissor").addSystem(my,"stencil").addSystem(vy,"projection").addSystem(Ry,"textureGC").addSystem(Tv,"filter").addSystem(by,"renderTexture").addSystem(Av,"batch"),r.initPlugins(e.__plugins),r.multisample=void 0,i.context?r.context.initFromContext(i.context):r.context.initFromOptions({alpha:!!r.useContextAlpha,antialias:i.antialias,premultipliedAlpha:r.useContextAlpha&&"notMultiplied"!==r.useContextAlpha,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:r.options.powerPreference}),r.renderingToScreen=!0,function(t){var e;if(!Mp){if(Ap.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var i=["\n %c %c %c PixiJS "+Dp+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,i)}else globalThis.console&&globalThis.console.log("PixiJS "+Dp+" - "+t+" - http://www.pixijs.com/");Mp=!0}}(2===r.context.webGLVersion?"WebGL 2":"WebGL 1"),r.resize(r.options.width,r.options.height),r}return Bm(e,t),e.create=function(t){if(void 0===Pp&&(Pp=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:Ap.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Ap.ADAPTER.getWebGLRenderingContext())return!1;var e=Ap.ADAPTER.createCanvas(),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Pp)return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t,e=this.gl;if(1===this.context.webGLVersion){var i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}t>=np.HIGH?this.multisample=np.HIGH:t>=np.MEDIUM?this.multisample=np.MEDIUM:t>=np.LOW?this.multisample=np.LOW:this.multisample=np.NONE},e.prototype.addSystem=function(t,e){var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e){var i,r,n,s;if(e&&(e instanceof av?(Zp("6.0.0","Renderer#render arguments changed, use options instead."),i=e,r=arguments[2],n=arguments[3],s=arguments[4]):(i=e.renderTexture,r=e.clear,n=e.transform,s=e.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(i||(this._lastObjectRendered=t),!s){var o=t.enableTempParent();t.updateTransform(),t.disableTempParent(o)}this.renderTexture.bind(i),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(e,i,r,n){void 0===i&&(i={});var s=t.prototype.generateTexture.call(this,e,i,r,n);return this.framebuffer.blit(),s},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var i in this.runners.destroy.emit(),this.runners)this.runners[i].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return Zp("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,e){Zp("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),am.add({name:t,type:em.RendererPlugin,ref:e})},e.__plugins={},e}(Ly);am.handleByMap(em.RendererPlugin,By.__plugins);!function(){function t(t){Zp("6.1.0","System class is deprecated, implemement ISystem interface instead."),this.renderer=t}t.prototype.destroy=function(){this.renderer=null}}();var Uy=function(){return function(){this.texArray=null,this.blend=0,this.type=Rd.TRIANGLES,this.start=0,this.size=0,this.data=null}}(),zy=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},t}(),Vy=function(){function t(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(t){return this[t+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},t}(),Gy=function(t){function e(e){var i=t.call(this,e)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=sy.for2d(),i.size=4*Ap.SPRITE_BATCH_SIZE,i._vertexCount=0,i._indexCount=0,i._bufferedElements=[],i._bufferedTextures=[],i._bufferSize=0,i._shader=null,i._packedGeometries=[],i._packedGeometryPoolSize=2,i._flushId=0,i._aBuffers={},i._iBuffers={},i.MAX_TEXTURES=1,i.renderer.on("prerender",i.onPrerender,i),e.runners.contextChange.add(i),i._dcIndex=0,i._aIndex=0,i._iIndex=0,i._attributeBuffer=null,i._indexBuffer=null,i._tempBoundTextures=[],i}return Bm(e,t),e.prototype.contextChange=function(){var t=this.renderer.gl;Ap.PREFER_ENV===Ed.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),Ap.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var i=e.createShader(e.FRAGMENT_SHADER);;){var r=$v.replace(/%forloop%/gi,ty(t));if(e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,i=e._textureArrayPool,r=this.size/4,n=Math.floor(r/this.MAX_TEXTURES)+1;t.length<r;)t.push(new Uy);for(;i.length<n;)i.push(new zy);for(var s=0;s<this.MAX_TEXTURES;s++)this._tempBoundTextures[s]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,i=this.MAX_TEXTURES,r=e._textureArrayPool,n=this.renderer.batch,s=this._tempBoundTextures,o=this.renderer.textureGC.count,a=++jm._globalBatch,h=0,u=r[0],l=0;n.copyBoundTextures(s,i);for(var c=0;c<this._bufferSize;++c){var f=t[c];t[c]=null,f._batchEnabled!==a&&(u.count>=i&&(n.boundArray(u,s,a,i),this.buildDrawCalls(u,l,c),l=c,u=r[++h],++a),f._batchEnabled=a,f.touched=o,u.elements[u.count++]=f)}u.count>0&&(n.boundArray(u,s,a,i),this.buildDrawCalls(u,l,this._bufferSize),++h,++a);for(c=0;c<s.length;c++)s[c]=null;jm._globalBatch=a},e.prototype.buildDrawCalls=function(t,i,r){var n=this,s=n._bufferedElements,o=n._attributeBuffer,a=n._indexBuffer,h=n.vertexSize,u=e._drawCallPool,l=this._dcIndex,c=this._aIndex,f=this._iIndex,d=u[l];d.start=this._iIndex,d.texArray=t;for(var p=i;p<r;++p){var m=s[p],v=m._texture.baseTexture,y=Bp[v.alphaMode?1:0][m.blendMode];s[p]=null,i<p&&d.blend!==y&&(d.size=f-d.start,i=p,(d=u[++l]).texArray=t,d.start=f),this.packInterleavedGeometry(m,o,a,c,f),c+=m.vertexData.length/2*h,f+=m.indices.length,d.blend=y}i<r&&(d.size=f-d.start,++l),this._dcIndex=l,this._aIndex=c,this._iIndex=f},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,i=0;i<t.count;i++)e.bind(t.elements[i],t.ids[i]),t.elements[i]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,e=t._packedGeometries,i=t._attributeBuffer,r=t._indexBuffer;Ap.CAN_UPLOAD_SAME_BUFFER?(e[this._flushId]._buffer.update(i.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(i.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,i=this.renderer,r=i.gl,n=i.state,s=e._drawCallPool,o=null,a=0;a<t;a++){var h=s[a],u=h.texArray,l=h.type,c=h.size,f=h.start,d=h.blend;o!==u&&(o=u,this.bindAndClearTexArray(u)),this.state.blendMode=d,n.set(this.state),r.drawElements(l,c,r.UNSIGNED_SHORT,2*f)}},e.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),Ap.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=Vp(Math.ceil(t/8)),i=jp(e),r=8*e;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);var n=this._aBuffers[r];return n||(this._aBuffers[r]=n=new Vy(r*this.vertexSize*4)),n},e.prototype.getIndexBuffer=function(t){var e=Vp(Math.ceil(t/12)),i=jp(e),r=12*e;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);var n=this._iBuffers[i];return n||(this._iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.packInterleavedGeometry=function(t,e,i,r,n){for(var s=e.uint32View,o=e.float32View,a=r/this.vertexSize,h=t.uvs,u=t.indices,l=t.vertexData,c=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),d=f<1&&t._texture.baseTexture.alphaMode?Up(t._tintRGB,f):t._tintRGB+(255*f<<24),p=0;p<l.length;p+=2)o[r++]=l[p],o[r++]=l[p+1],o[r++]=h[p],o[r++]=h[p+1],s[r++]=d,o[r++]=c;for(p=0;p<u.length;p++)i[n++]=a+u[p]},e._drawCallPool=[],e._textureArrayPool=[],e}(Sv),jy=function(){function t(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=i;this.defaultGroupCache[t]=xv.from({uSamplers:e},!0);var r=this.fragTemplate;r=(r=r.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new ry(this.vertexSrc,r)}var n={tint:new Float32Array([1,1,1,1]),translationMatrix:new Sm,default:this.defaultGroupCache[t]};return new ny(this.programCache[t],n)},t.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var i=0;i<t;i++)i>0&&(e+="\nelse "),i<t-1&&(e+="if(vTextureId < "+i+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+i+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"},t}(),Hy=function(t){function e(e){void 0===e&&(e=!1);var i=t.call(this)||this;return i._buffer=new cv(null,e,!1),i._indexBuffer=new cv(null,e,!0),i.addAttribute("aVertexPosition",i._buffer,2,!1,kd.FLOAT).addAttribute("aTextureCoord",i._buffer,2,!1,kd.FLOAT).addAttribute("aColor",i._buffer,4,!0,kd.UNSIGNED_BYTE).addAttribute("aTextureId",i._buffer,1,!0,kd.FLOAT).addIndex(i._indexBuffer),i}return Bm(e,t),e}(vv),Xy="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",Wy="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n",Yy=function(){function t(){}return t.create=function(t){var e=Object.assign({vertex:Xy,fragment:Wy,geometryClass:Hy,vertexSize:6},t),i=e.vertex,r=e.fragment,n=e.vertexSize,s=e.geometryClass;return function(t){function e(e){var o=t.call(this,e)||this;return o.shaderGenerator=new jy(i,r),o.geometryClass=s,o.vertexSize=n,o}return Bm(e,t),e}(Gy)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return Xy},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return Wy},enumerable:!1,configurable:!0}),t}().create();Object.assign(Yy,{extension:{name:"batch",type:em.RendererPlugin}});var qy={},Zy=function(t){Object.defineProperty(qy,t,{get:function(){return Zp("6.0.0","PIXI.systems."+t+" has moved to PIXI."+t),$m[t]}})};for(Ky in $m)Zy(Ky);var Ky,Qy={},Jy=function(t){Object.defineProperty(Qy,t,{get:function(){return Zp("6.0.0","PIXI.resources."+t+" has moved to PIXI."+t),Dy[t]}})};for(Ky in Dy)Jy(Ky);Ap.SORTABLE_CHILDREN=!1;var $y=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?bm.EMPTY:((t=t||new bm(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var i=t.a,r=t.b,n=t.c,s=t.d,o=t.tx,a=t.ty,h=i*e.x+n*e.y+o,u=r*e.x+s*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,u),this.maxY=Math.max(this.maxY,u)},t.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,s=t[0],o=t[1];e=s<e?s:e,i=o<i?o:i,r=s>r?s:r,n=o>n?o:n,e=(s=t[2])<e?s:e,i=(o=t[3])<i?o:i,r=s>r?s:r,n=o>n?o:n,e=(s=t[4])<e?s:e,i=(o=t[5])<i?o:i,r=s>r?s:r,n=o>n?o:n,e=(s=t[6])<e?s:e,i=(o=t[7])<i?o:i,r=s>r?s:r,n=o>n?o:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},t.prototype.addFrame=function(t,e,i,r,n){this.addFrameMatrix(t.worldTransform,e,i,r,n)},t.prototype.addFrameMatrix=function(t,e,i,r,n){var s=t.a,o=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,f=this.minY,d=this.maxX,p=this.maxY,m=s*e+a*i+u,v=o*e+h*i+l;c=m<c?m:c,f=v<f?v:f,d=m>d?m:d,p=v>p?v:p,c=(m=s*r+a*i+u)<c?m:c,f=(v=o*r+h*i+l)<f?v:f,d=m>d?m:d,p=v>p?v:p,c=(m=s*e+a*n+u)<c?m:c,f=(v=o*e+h*n+l)<f?v:f,d=m>d?m:d,p=v>p?v:p,c=(m=s*r+a*n+u)<c?m:c,f=(v=o*r+h*n+l)<f?v:f,d=m>d?m:d,p=v>p?v:p,this.minX=c,this.minY=f,this.maxX=d,this.maxY=p},t.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,s=this.maxX,o=this.maxY,a=e;a<i;a+=2){var h=t[a],u=t[a+1];r=h<r?h:r,n=u<n?u:n,s=h>s?h:s,o=u>o?u:o}this.minX=r,this.minY=n,this.maxX=s,this.maxY=o},t.prototype.addVertices=function(t,e,i,r){this.addVerticesMatrix(t.worldTransform,e,i,r)},t.prototype.addVerticesMatrix=function(t,e,i,r,n,s){void 0===n&&(n=0),void 0===s&&(s=n);for(var o=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,f=this.minX,d=this.minY,p=this.maxX,m=this.maxY,v=i;v<r;v+=2){var y=e[v],g=e[v+1],b=o*y+h*g+l,x=u*g+a*y+c;f=Math.min(f,b-n),p=Math.max(p,b+n),d=Math.min(d,x-s),m=Math.max(m,x+s)}this.minX=f,this.minY=d,this.maxX=p,this.maxY=m},t.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,s=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=n&&r<=s){var o=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<o?i:o,this.minY=r<a?r:a,this.maxX=n>h?n:h,this.maxY=s>u?s:u}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,s=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=n&&r<=s){var o=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<o?i:o,this.minY=r<a?r:a,this.maxX=n>h?n:h,this.maxY=s>u?s:u}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,i,r,n,s){t-=n,e-=s,i+=n,r+=s,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>r?this.maxY:r},t}(),tg=function(t,e){return tg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},tg(t,e)};function eg(t,e){function i(){this.constructor=t}tg(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ig=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new Fm,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new $y,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return eg(e,t),e.mixin=function(t){for(var i=Object.keys(t),r=0;r<i.length;++r){var n=i[r];Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new bm),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new bm),t=this._localBoundsRect),this._localBounds||(this._localBounds=new $y);var e=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var r=this._bounds,n=this._boundsID;this._bounds=this._localBounds;var s=this.getBounds(!1,t);return this.parent=i,this.transform=e,this._bounds=r,this._bounds.updateID+=this._boundsID-n,s},e.prototype.toGlobal=function(t,e,i){return void 0===i&&(i=!1),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,i,r){return e&&(t=e.toGlobal(t,i,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,i,r,n,s,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===r&&(r=1),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=i||1,this.scale.y=r||1,this.rotation=n,this.skew.x=s,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new rg),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*mm},set:function(t){this.transform.rotation=t*vm},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){var e;if(this._mask)(e=this._mask.isMaskData?this._mask.maskObject:this._mask)&&(e._maskRefCount--,0===e._maskRefCount&&(e.renderable=!0,e.isMask=!1));if(this._mask=t,this._mask)(e=this._mask.isMaskData?this._mask.maskObject:this._mask)&&(0===e._maskRefCount&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++)}},enumerable:!1,configurable:!0}),e}(Op.default),rg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return eg(e,t),e}(ig);function ng(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}ig.prototype.displayObjectUpdateTransform=ig.prototype.updateTransform;var sg=function(t){function e(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=Ap.SORTABLE_CHILDREN,e.sortDirty=!1,e}return eg(e,t),e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];if(e.length>1)for(var r=0;r<e.length;r++)this.addChild(e[r]);else{var n=e[0];n.parent&&n.parent.removeChild(n),n.parent=this,this.sortDirty=!0,n.transform._parentID=-1,this.children.push(n),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this)}return e[0]},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i<r?i:r)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Hp(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];if(e.length>1)for(var r=0;r<e.length;r++)this.removeChild(e[r]);else{var n=e[0],s=this.children.indexOf(n);if(-1===s)return null;n.parent=null,n.transform._parentID=-1,Hp(this.children,s,1),this._boundsID++,this.onChildrenChange(s),n.emit("removed",this),this.emit("childRemoved",n,this,s)}return e[0]},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,Hp(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var i,r=t,n=e-r;if(n>0&&n<=e){i=this.children.splice(r,n);for(var s=0;s<i.length;++s)i[s].parent=null,i[s].transform&&(i[s].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(s=0;s<i.length;++s)i[s].emit("removed",this),this.emit("childRemoved",i[s],this,s);return i}if(0===n&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,i=this.children.length;e<i;++e){var r=this.children[e];r._lastSortedIndex=e,t||0===r.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(ng),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var i=this.children[t];i.visible&&i.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var i=e._mask.isMaskData?e._mask.maskObject:e._mask;i?(i.calculateBounds(),this._bounds.addBoundsMask(e._bounds,i._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(e,i){void 0===i&&(i=!1);var r=t.prototype.getLocalBounds.call(this,e);if(!i)for(var n=0,s=this.children.length;n<s;++n){var o=this.children[n];o.visible&&o.updateTransform()}return r},e.prototype._calculateBounds=function(){},e.prototype._renderWithCulling=function(t){var i=t.renderTexture.sourceFrame;if(i.width>0&&i.height>0){var r,n;if(this.cullArea?(r=this.cullArea,n=this.worldTransform):this._render!==e.prototype._render&&(r=this.getBounds(!0)),r&&i.intersects(r,n))this._render(t);else if(this.cullArea)return;for(var s=0,o=this.children.length;s<o;++s){var a=this.children[s],h=a.cullable;a.cullable=h||!this.cullArea,a.render(t),a.cullable=h}}},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var e=0,i=this.children.length;e<i;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){var e=this.filters,i=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var r=0;r<e.length;r++)e[r].enabled&&this._enabledFilters.push(e[r])}var n=e&&this._enabledFilters&&this._enabledFilters.length||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==tp.NONE));if(n&&t.batch.flush(),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),i&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);r=0;for(var s=this.children.length;r<s;++r)this.children[r].render(t)}n&&t.batch.flush(),i&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var i="boolean"==typeof e?e:e&&e.children,r=this.removeChildren(0,this.children.length);if(i)for(var n=0;n<r.length;++n)r[n].destroy(e)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},enumerable:!1,configurable:!0}),e}(ig);sg.prototype.containerUpdateTransform=sg.prototype.updateTransform;var og=function(){function t(){}return t.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame(function(){return e.resize()}))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,i;if(e.cancelResize(),e._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else{var r=e._resizeTo;t=r.clientWidth,i=r.clientHeight}e.renderer.resize(t,i)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},t.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},t.extension=em.Application,t}(),ag=function(){function t(e){var i=this;this.stage=new sg,e=Object.assign({forceCanvas:!1},e),this.renderer=function(t){return By.create(t)}(e),t._plugins.forEach(function(t){t.init.call(i,e)})}return t.registerPlugin=function(t){Zp("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),am.add({type:em.Application,ref:t})},t.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(t.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e,i){var r=this,n=t._plugins.slice(0);n.reverse(),n.forEach(function(t){t.destroy.call(r)}),this.stage.destroy(i),this.stage=null,this.renderer.destroy(e),this.renderer=null},t._plugins=[],t}();am.handleByList(em.Application,ag._plugins),am.add(og);var hg=class{constructor(){f(this,"interactive"),f(this,"type"),f(this,"active"),this.type="null",this.active=!1,this.interactive=!1}},ug=1e-6;function lg(t,e,i){const r=isNaN(e)?-1/0:e,n=isNaN(i)?1/0:i,s=Math.min(r,n),o=Math.max(r,n);return Math.min(Math.max(t,s),o)}var cg=Math.PI/180,fg=180/Math.PI;function dg(t){return Math.atan2(-t.y,-t.x)+Math.PI}function pg(t,e){return Math.abs(t-e)<ug||t===1/0&&e===1/0||t===-1/0&&e===-1/0}function mg(t){return isNaN(t)||Math.abs(t)<ug}var vg,yg,gg,bg,xg=class t extends qn.Vector2{subtract(t){return this.x-=t.x,this.y-=t.y,this}toViewCoordinate(t,e){return this.x=(this.x+1)/2*t,this.y=(1-(this.y+1)/2)*e,this}clone(){return new t(this.x,this.y)}distanceTo(t){const e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)}scaleByCenter(e,i=new t){const r=(new t).subtractVectors(i,this).multiply(e);return(new t).subtractVectors(i,r)}round(t=0){const e=Math.pow(10,t);return this.x=Math.round(this.x*e)/e,this.y=Math.round(this.y*e)/e,this}},_g=class t{constructor(t=new xg,e=new xg){f(this,"start",new xg),f(this,"end",new xg),this.start.copyFrom(t),this.end.copyFrom(e)}set(t,e){return this.start.copyFrom(t),this.end.copyFrom(e),this}copyFrom(t){return this.start.copyFrom(t.start),this.end.copyFrom(t.end),this}direction(){return(new xg).subtractVectors(this.end,this.start).normalize()}getCenter(t=new xg){return t.addVectors(this.start,this.end).multiply(.5)}delta(t=new xg){return t.subtractVectors(this.end,this.start)}distanceSq(){return this.start.distanceSquared(this.end)}distance(){return this.start.distance(this.end)}at(t,e=new xg){return this.delta(e).multiply(t).add(this.start)}closestPointToPointParameter(t,e){const i=new xg,r=new xg;i.subtractVectors(t,this.start),r.subtractVectors(this.end,this.start);const n=r.dot(r);let s=r.dot(i)/n;return e&&(s=lg(s,0,1)),s}closestPointToPoint(t,e,i=new xg){const r=this.closestPointToPointParameter(t,e);return this.delta(i).multiply(r).add(this.start)}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new t).copyFrom(this)}length(){return(new xg).subtractVectors(this.end,this.start).length()}crossWithLine(t){const e=this.delta(),i=t.delta(),r=(new xg).subtractVectors(t.start,this.start),n=(new xg).subtractVectors(t.end,this.start),s=(new xg).subtractVectors(this.start,t.start),o=(new xg).subtractVectors(this.end,t.start),a=r.cross(e),h=n.cross(e),u=s.cross(i),l=o.cross(i);return a*h<0&&u*l<0}},Eg=class t{constructor(t=new xg(1/0,1/0),e=new xg(-1/0,-1/0)){f(this,"corners",[]),f(this,"min",new xg(1/0,1/0)),f(this,"max",new xg(-1/0,-1/0)),this.min=t.clone(),this.max=e.clone(),this.isEmpty()?this.corners=[]:this.corners=[t.clone(),new xg(e.x,t.y),e.clone(),new xg(t.x,e.y)]}set(t,e){return this.min.copyFrom(t),this.max.copyFrom(e),this.corners=[t.clone(),new xg(e.x,t.y),e.clone(),new xg(t.x,e.y)],this}setFromVec2Array(t){return this.min=(new xg).copyFrom(t[0]),this.max=(new xg).copyFrom(t[0]),t.forEach(t=>{this.min.min(t),this.max.max(t),this.corners.push(t.clone())}),this}setFromVec2ArrayWithOutCorners(t){return this.min=(new xg).copyFrom(t[0]),this.max=(new xg).copyFrom(t[0]),t.forEach(t=>{this.min=this.min.min(t),this.max=this.max.max(t)}),this.corners.push(new xg(this.min.x,this.min.y)),this.corners.push(new xg(this.min.x,this.max.y)),this.corners.push(new xg(this.max.x,this.max.y)),this.corners.push(new xg(this.max.x,this.min.y)),this}setFromCenterAndSize(t,e){const i=(new xg).copyFrom(e).multiply(.5);return this.min.copyFrom(t).subtract(i),this.max.copyFrom(t).add(i),this.corners=[this.min.clone(),new xg(this.max.x,this.min.y),this.max.clone(),new xg(this.min.x,this.max.y)],this}clone(){return(new t).copyFrom(this)}copyFrom(t){return this.corners=[],this.min.copyFrom(t.min),this.max.copyFrom(t.max),t.corners.forEach(t=>{this.corners.push(t.clone())}),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this.corners=[],this}isEmpty(){return this.max.x<=this.min.x||this.max.y<=this.min.y}getCorners(){const t=[];return this.corners.forEach(e=>{t.push(e.clone())}),t}getCenter(t=new xg){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiply(.5)}getSize(t=new xg){return this.isEmpty()?t.set(0,0):t.subtractVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.subtract(t),this.max.add(t),this}expandByScalar(t){return this.min.add(-t),this.max.add(t),this}containsPoint(t,e=!0){if(e)return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y);if(this.isEmpty())return!1;for(let e=0;e<this.corners.length;e++){const i=this.corners[e],r=this.corners[(e+1)%4],n=new xg(r.x-i.x,r.y-i.y),s=new xg(t.x-i.x,t.y-i.y);if(n.cross(s)<0)return!1}return!0}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e=new xg){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}clampPoint(t,e=new xg){return e.copyFrom(t).clamp(this.min,this.max)}distanceToPoint(t){return(new xg).copyFrom(t).clamp(this.min,this.max).subtract(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.min.x>this.max.x||this.min.y>this.max.y?this.makeEmpty():this}union(t){return this.min.min(t.min),this.max.max(t.max),this.corners=[this.min.clone(),new xg(this.max.x,this.min.y),this.max.clone(),new xg(this.min.x,this.max.y)],this}translate(t){return this.min.add(t),this.max.add(t),this.corners.forEach(e=>{e.add(t)}),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}intersectsBox(t,e=!0){if(e)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);if(!this.isEmpty())for(let e=0;e<this.corners.length;e++){const i=new _g(this.corners[e],this.corners[(e+1)%4]);if(t.containsPoint(this.corners[e],!1))return!0;for(let e=0;e<t.corners.length;e++){const r=new _g(t.corners[e],t.corners[(e+1)%4]);if(this.containsPoint(t.corners[e],!1))return!0;if(i.crossWithLine(r))return!0}}for(let e=0;e<t.corners.length;e++){const i=this.containsPoint(t.corners[e],!1),r=t.containsPoint(this.corners[e],!1);if(i||r)return!0}return!1}},wg=class t{constructor(t=new xg,e=0){f(this,"center"),f(this,"radius"),this.center=t.clone(),this.radius=e}set(t,e){return this.center=(new xg).copyFrom(t),this.radius=e,this}clone(){return(new t).copy(this)}copy(t){return this.center.copyFrom(t.center),this.radius=t.radius,this}makeEmpty(){return this.center=new xg,this.radius=0,this}isEmpty(){return 0===this.radius}getCenter(t=new xg){return t.copyFrom(this.center),t}getRadius(){return this.radius}expandByPoint(t){return this.radius=this.center.distanceTo(t),this}expandByScalar(t){return this.radius+=t,this}containsPoint(t){return this.center.distanceTo(t)<this.radius}containsBox(t){for(let e=0;e<4;e++)if(!this.containsPoint(t.corners[e]))return!1;return!0}intersectsBox(t){for(let e=0;e<4;e++)if(this.containsPoint(t.corners[e]))return!0;return!1}distanceToPoint(t){return this.center.distanceTo(t)-this.radius}},Tg=class extends qn.Quaternion{},Sg=class t extends qn.Vector3{clone(){return new t(this.x,this.y,this.z)}setFromMatrixColumn(t,e){return this.set(...t.elements.slice(4*e))}applyEuler(t,e){return this.applyQuaternion((new Tg).setFromEuler(t))}applyQuaternion(e,i=new t){const{x:r,y:n,z:s,w:o}=e,{x:a,y:h,z:u}=this.subtract(i),l=o*a+n*u-s*h,c=o*h+s*a-r*u,f=o*u+r*h-n*a,d=-r*a-n*h-s*u;return this.x=l*o+d*-r+c*-s-f*-n+i.x,this.y=c*o+d*-n+f*-r-l*-s+i.y,this.z=f*o+d*-s+l*-n-c*-r+i.z,this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}applyMatrix(e,i=new t){const r=e.elements,{x:n,y:s,z:o}=this.subtract(i);let a=1/(r[3]*n+r[7]*s+r[11]*o+r[15]);return a=isNaN(a)?1:a,this.x=(r[0]*n+r[4]*s+r[8]*o+r[12])*a+i.x,this.y=(r[1]*n+r[5]*s+r[9]*o+r[13])*a+i.y,this.z=(r[2]*n+r[6]*s+r[10]*o+r[14])*a+i.z,this}},Ag=class t extends qn.Matrix4{static fromArray(e,i=0){return(new t).setFromArray(e,i)}clone(){const 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])}compose(t,e,i,r=Sg.ZERO){const n=this.elements,{x:s,y:o,z:a,w:h}=e,u=-r.x,l=-r.y,c=-r.z,f=s+s,d=o+o,p=a+a,m=s*f,v=s*d,y=s*p,g=o*d,b=o*p,x=a*p,_=h*f,E=h*d,w=h*p,{x:T,y:S,z:A}=i;return n[0]=(1-(g+x))*T,n[1]=(v+w)*T,n[2]=(y-E)*T,n[3]=0,n[4]=(v-w)*S,n[5]=(1-(m+x))*S,n[6]=(b+_)*S,n[7]=0,n[8]=(y+E)*A,n[9]=(b-_)*A,n[10]=(1-(m+g))*A,n[11]=0,n[12]=u*n[0]+l*n[4]+c*n[8]-u+t.x,n[13]=u*n[1]+l*n[5]+c*n[9]-l+t.y,n[14]=u*n[2]+l*n[6]+c*n[10]-c+t.z,this}extractRotation(t){const e=new Sg,i=t.elements,r=this.elements,n=1/e.setFromMatrixColumn(t,0).length(),s=1/e.setFromMatrixColumn(t,1).length(),o=1/e.setFromMatrixColumn(t,2).length();return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=0,r[4]=i[4]*s,r[5]=i[5]*s,r[6]=i[6]*s,r[7]=0,r[8]=i[8]*o,r[9]=i[9]*o,r[10]=i[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,n=t.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(r),h=Math.sin(r),u=Math.cos(n),l=Math.sin(n);if(t.order===qn.EulerOrder.XYZ){const t=s*u,i=s*l,r=o*u,n=o*l;e[0]=a*u,e[4]=-a*l,e[8]=h,e[1]=i+r*h,e[5]=t-n*h,e[9]=-o*a,e[2]=n-t*h,e[6]=r+i*h,e[10]=s*a}else if(t.order===qn.EulerOrder.YXZ){const t=a*u,i=a*l,r=h*u,n=h*l;e[0]=t+n*o,e[4]=r*o-i,e[8]=s*h,e[1]=s*l,e[5]=s*u,e[9]=-o,e[2]=i*o-r,e[6]=n+t*o,e[10]=s*a}else if(t.order===qn.EulerOrder.ZXY){const t=a*u,i=a*l,r=h*u,n=h*l;e[0]=t-n*o,e[4]=-s*l,e[8]=r+i*o,e[1]=i+r*o,e[5]=s*u,e[9]=n-t*o,e[2]=-s*h,e[6]=o,e[10]=s*a}else if(t.order===qn.EulerOrder.ZYX){const t=s*u,i=s*l,r=o*u,n=o*l;e[0]=a*u,e[4]=r*h-i,e[8]=t*h+n,e[1]=a*l,e[5]=n*h+t,e[9]=i*h-r,e[2]=-h,e[6]=o*a,e[10]=s*a}else if(t.order===qn.EulerOrder.YZX){const t=s*a,i=s*h,r=o*a,n=o*h;e[0]=a*u,e[4]=n-t*l,e[8]=r*l+i,e[1]=l,e[5]=s*u,e[9]=-o*u,e[2]=-h*u,e[6]=i*l+r,e[10]=t-n*l}else if(t.order===qn.EulerOrder.XZY){const t=s*a,i=s*h,r=o*a,n=o*h;e[0]=a*u,e[4]=-l,e[8]=h*u,e[1]=t*l+n,e[5]=s*u,e[9]=i*l-r,e[2]=r*l-i,e[6]=o*u,e[10]=n*l+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}setPosition(t){return this.elements[12]=t.x,this.elements[13]=t.y,this.elements[14]=t.z,this}},Og=class extends qn.Euler{constructor(t=0,e=0,i=0,r=qn.EulerOrder.XYZ){super(t,e,i,r)}getInvertMatrixByEuler(){return(new Ag).makeRotationFromEuler(this).invert()}toDegreeVector3(t){return t?t.set(this.x*fg,this.y*fg,this.z*fg):new Sg(this.x*fg,this.y*fg,this.z*fg)}setFromDegreeVector3(t,e){return this.set(t.x*cg,t.y*cg,t.z*cg,e??this.order)}},Cg=class{constructor(t=new Sg,e=new Sg){f(this,"start"),f(this,"end"),this.start=t.clone(),this.end=e.clone()}closestPointToPointParameter(t,e=!1){const i=(new Sg).subtractVectors(t,this.start),r=(new Sg).subtractVectors(this.end,this.start),n=r.dot(r);let s=r.dot(i)/n;return e&&(s=lg(s,0,1)),s}closestPointToPoint(t,e=!1){const i=this.closestPointToPointParameter(t,e);return this.delta().multiply(i).add(this.start)}delta(){return(new Sg).subtractVectors(this.end,this.start)}},Ig=class t{constructor(t=0,e=new Sg(0,0,1)){f(this,"distance"),f(this,"normal");const i=e.length();0===i&&(this.normal=new Sg(0,0,1)),this.distance=t/(i??1),this.normal=e.normalize()}static set(e,i){return new t(e,i)}set(t,e){const i=e.length();return 0===i&&(this.normal=new Sg(0,0,1)),this.distance=t/i,this.normal=e.normalize(),this}static copy(e){return new t(e.distance,e.normal.clone())}copy(t){return this.distance=t.distance,this.normal.copyFrom(t.normal),this}static setFromNormalAndCoplanarPoint(e,i){const r=-e.dot(i);return new t(r,i)}setFromNormalAndCoplanarPoint(t,e){return this.normal.copyFrom(e),this.distance=-t.dot(this.normal),this}clone(){return new t(this.distance,this.normal.clone())}distanceToPoint(t){return this.normal.dot(t)+this.distance}},Rg=class t extends qn.Ray{constructor(t=new Sg,e=new Sg(1,0,0)){super(t,e),f(this,"origin"),f(this,"direction"),this.origin=t.clone(),this.direction=e.clone()}clone(){return new t(this.origin,this.direction)}rayCastPlane(t,e){const i=this.distanceToPlane(t);return isNaN(i)||this.at(i),i}at(t){return this.direction.clone().normalize().multiply(t).add(this.origin)}distanceToPlane(t){const e=t.normal.dot(this.direction);if(mg(e))return mg(t.distanceToPoint(this.origin))?0:NaN;const i=(-this.origin.dot(t.normal)-t.distance)/e;return i>0?i:NaN}},Pg=class{constructor(t=new Rg){f(this,"ray"),this.ray=t.clone()}setFromCamera(t,e){const i=e.position,r=new Sg(t.x,t.y,.5).applyMatrix(e.inverseViewProjectMatrix).subtract(i).normalize();return this.ray.set(i,r),this}rayCastPlane(t){const e=new Sg,i=this.ray.rayCastPlane(t,e);if(!isNaN(i))return{distance:i,point:this.ray.at(i)}}},Mg=.01,Dg=2,Fg=37375,Lg=6,kg=3,Ng=15425024,Bg=16777215,Ug=.17,zg=16777215,Vg=.78,Gg=1,jg=16711680,Hg=1,Xg=1.5,Wg=16777215,Yg=0,qg=1,Zg=.3,Kg=4,Qg=8,Jg=16711680,$g=1,tb=0,eb=.17,ib=16711680,rb=.15,nb=class extends hg{constructor(t){super(),f(this,"defaultInteractive",!0),f(this,"interactive",!0),f(this,"lastPoint",new xg),f(this,"SDKUtils"),this.SDKUtils=t,this.type="control"}initialize(){}preparationAction(){}cancelPreparation(){}refreshResults(){}preAction(){}action(t){const{metaKey:e,ctrlKey:i,shiftKey:r}=t;if(0===t.buttons){const{deltaX:n,deltaY:s}=t,o=new xg(n,s);e||i?(o.y=lg(o.y,-10,10),this.dolly(o.y)):(o.x=r&&0!==o.y?Math.sqrt(o.x**2+o.y**2)*o.y/Math.abs(o.y):o.x,o.y=r?0:o.y,this.pan(o.multiply(-1)))}}endAction(){}interruption(){return this.type}actionKey(){}endActionKey(){}dolly(t){const e=-t*Mg;this.SDKUtils.pageZoom(e)}pan(t){this.SDKUtils.pageMove(t)}getRenderObjects(){return[]}};(yg=vg||(vg={})).MITER="miter",yg.BEVEL="bevel",yg.ROUND="round",(bg=gg||(gg={})).BUTT="butt",bg.ROUND="round",bg.SQUARE="square";var sb={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}},ob=function(){function t(){this.color=16777215,this.alpha=1,this.texture=ov.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=ov.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),ab=function(t,e){return ab=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},ab(t,e)};function hb(t,e){function i(){this.constructor=t}ab(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function ub(t,e){var i,r;void 0===e&&(e=!1);var n=t.length;if(!(n<6)){for(var s=0,o=0,a=t[n-2],h=t[n-1];o<n;o+=2){var u=t[o],l=t[o+1];s+=(u-a)*(l+h),a=u,h=l}if(!e&&s>0||e&&s<=0){var c=n/2;for(o=c+c%2;o<n;o+=2){var f=n-o-2,d=n-o-1,p=o,m=o+1;i=[t[p],t[f]],t[f]=i[0],t[p]=i[1],r=[t[m],t[d]],t[d]=r[0],t[m]=r[1]}}}}var lb={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,r=t.holes,n=e.points,s=e.indices;if(i.length>=6){ub(i,!1);for(var o=[],a=0;a<r.length;a++){var h=r[a];ub(h.points,!0),o.push(i.length/2),i=i.concat(h.points)}var u=(0,Cp.default)(i,o,2);if(!u)return;var l=n.length/2;for(a=0;a<u.length;a+=3)s.push(u[a]+l),s.push(u[a+1]+l),s.push(u[a+2]+l);for(a=0;a<i.length;a++)n.push(i[a])}}},cb={build:function(t){var e,i,r,n,s,o,a=t.points;if(t.type===um.CIRC){var h=t.shape;e=h.x,i=h.y,s=o=h.radius,r=n=0}else if(t.type===um.ELIP){var u=t.shape;e=u.x,i=u.y,s=u.width,o=u.height,r=n=0}else{var l=t.shape,c=l.width/2,f=l.height/2;e=l.x+c,i=l.y+f,r=c-(s=o=Math.max(0,Math.min(l.radius,Math.min(c,f)))),n=f-o}if(s>=0&&o>=0&&r>=0&&n>=0){var d=Math.ceil(2.3*Math.sqrt(s+o)),p=8*d+(r?4:0)+(n?4:0);if(a.length=p,0!==p){if(0===d)return a.length=8,a[0]=a[6]=e+r,a[1]=a[3]=i+n,a[2]=a[4]=e-r,void(a[5]=a[7]=i-n);var m=0,v=4*d+(r?2:0)+2,y=v,g=p,b=e+(S=r+s),x=e-S,_=i+(A=n);if(a[m++]=b,a[m++]=_,a[--v]=_,a[--v]=x,n){var E=i-A;a[y++]=x,a[y++]=E,a[--g]=E,a[--g]=b}for(var w=1;w<d;w++){var T=Math.PI/2*(w/d);b=e+(S=r+Math.cos(T)*s),x=e-S,_=i+(A=n+Math.sin(T)*o),E=i-A;a[m++]=b,a[m++]=_,a[--v]=_,a[--v]=x,a[y++]=x,a[y++]=E,a[--g]=E,a[--g]=b}var S,A;b=e+(S=r),x=e-S,_=i+(A=n+o),E=i-A;a[m++]=b,a[m++]=_,a[--g]=E,a[--g]=b,r&&(a[m++]=x,a[m++]=_,a[--g]=E,a[--g]=x)}}else a.length=0},triangulate:function(t,e){var i=t.points,r=e.points,n=e.indices;if(0!==i.length){var s,o,a=r.length/2,h=a;if(t.type!==um.RREC){var u=t.shape;s=u.x,o=u.y}else{var l=t.shape;s=l.x+l.width/2,o=l.y+l.height/2}var c=t.matrix;r.push(t.matrix?c.a*s+c.c*o+c.tx:s,t.matrix?c.b*s+c.d*o+c.ty:o),a++,r.push(i[0],i[1]);for(var f=2;f<i.length;f+=2)r.push(i[f],i[f+1]),n.push(a++,h,a);n.push(h+1,h,a)}}};function fb(t,e,i){return t+(e-t)*i}function db(t,e,i,r,n,s,o){void 0===o&&(o=[]);for(var a=o,h=0,u=0,l=0,c=0,f=0,d=0,p=0,m=0;p<=20;++p)h=fb(t,i,m=p/20),u=fb(e,r,m),l=fb(i,n,m),c=fb(r,s,m),f=fb(h,l,m),d=fb(u,c,m),0===p&&a[a.length-2]===f&&a[a.length-1]===d||a.push(f,d);return a}var pb={build:function(t){if(Mb.nextRoundedRectBehavior)cb.build(t);else{var e=t.shape,i=t.points,r=e.x,n=e.y,s=e.width,o=e.height,a=Math.max(0,Math.min(e.radius,Math.min(s,o)/2));i.length=0,a?(db(r,n+a,r,n,r+a,n,i),db(r+s-a,n,r+s,n,r+s,n+a,i),db(r+s,n+o-a,r+s,n+o,r+s-a,n+o,i),db(r+a,n+o,r,n+o,r,n+o-a,i)):i.push(r,n,r+s,n,r+s,n+o,r,n+o)}},triangulate:function(t,e){if(Mb.nextRoundedRectBehavior)cb.triangulate(t,e);else{for(var i=t.points,r=e.points,n=e.indices,s=r.length/2,o=(0,Cp.default)(i,null,2),a=0,h=o.length;a<h;a+=3)n.push(o[a]+s),n.push(o[a+1]+s),n.push(o[a+2]+s);for(a=0,h=i.length;a<h;a++)r.push(i[a],i[++a])}}};function mb(t,e,i,r,n,s,o,a){var h,u;o?(h=r,u=-i):(h=-r,u=i);var l=t-i*n+h,c=e-r*n+u,f=t+i*s+h,d=e+r*s+u;return a.push(l,c),a.push(f,d),2}function vb(t,e,i,r,n,s,o,a){var h=i-t,u=r-e,l=Math.atan2(h,u),c=Math.atan2(n-t,s-e);a&&l<c?l+=2*Math.PI:!a&&l>c&&(c+=2*Math.PI);var f=l,d=c-l,p=Math.abs(d),m=Math.sqrt(h*h+u*u),v=1+(15*p*Math.sqrt(m)/Math.PI|0),y=d/v;if(f+=y,a){o.push(t,e),o.push(i,r);for(var g=1,b=f;g<v;g++,b+=y)o.push(t,e),o.push(t+Math.sin(b)*m,e+Math.cos(b)*m);o.push(t,e),o.push(n,s)}else{o.push(i,r),o.push(t,e);for(g=1,b=f;g<v;g++,b+=y)o.push(t+Math.sin(b)*m,e+Math.cos(b)*m),o.push(t,e);o.push(n,s),o.push(t,e)}return 2*v}function yb(t,e){t.lineStyle.native?function(t,e){var i=0,r=t.shape,n=t.points||r.points,s=r.type!==um.POLY||r.closeStroke;if(0!==n.length){var o=e.points,a=e.indices,h=n.length/2,u=o.length/2,l=u;for(o.push(n[0],n[1]),i=1;i<h;i++)o.push(n[2*i],n[2*i+1]),a.push(l,l+1),l++;s&&a.push(l,u)}}(t,e):function(t,e){var i=t.shape,r=t.points||i.points.slice(),n=e.closePointEps;if(0!==r.length){var s=t.lineStyle,o=new ym(r[0],r[1]),a=new ym(r[r.length-2],r[r.length-1]),h=i.type!==um.POLY||i.closeStroke,u=Math.abs(o.x-a.x)<n&&Math.abs(o.y-a.y)<n;if(h){r=r.slice(),u&&(r.pop(),r.pop(),a.set(r[r.length-2],r[r.length-1]));var l=.5*(o.x+a.x),c=.5*(a.y+o.y);r.unshift(l,c),r.push(l,c)}var f=e.points,d=r.length/2,p=r.length,m=f.length/2,v=s.width/2,y=v*v,g=s.miterLimit*s.miterLimit,b=r[0],x=r[1],_=r[2],E=r[3],w=0,T=0,S=-(x-E),A=b-_,O=0,C=0,I=Math.sqrt(S*S+A*A);S/=I,A/=I,S*=v,A*=v;var R=s.alignment,P=2*(1-R),M=2*R;h||(s.cap===gg.ROUND?p+=vb(b-S*(P-M)*.5,x-A*(P-M)*.5,b-S*P,x-A*P,b+S*M,x+A*M,f,!0)+2:s.cap===gg.SQUARE&&(p+=mb(b,x,S,A,P,M,!0,f))),f.push(b-S*P,x-A*P),f.push(b+S*M,x+A*M);for(var D=1;D<d-1;++D){b=r[2*(D-1)],x=r[2*(D-1)+1],_=r[2*D],E=r[2*D+1],w=r[2*(D+1)],T=r[2*(D+1)+1],S=-(x-E),A=b-_,S/=I=Math.sqrt(S*S+A*A),A/=I,S*=v,A*=v,O=-(E-T),C=_-w,O/=I=Math.sqrt(O*O+C*C),C/=I,O*=v,C*=v;var F=_-b,L=x-E,k=_-w,N=T-E,B=F*k+L*N,U=L*k-N*F,z=U<0;if(Math.abs(U)<.001*Math.abs(B))f.push(_-S*P,E-A*P),f.push(_+S*M,E+A*M),B>=0&&(s.join===vg.ROUND?p+=vb(_,E,_-S*P,E-A*P,_-O*P,E-C*P,f,!1)+4:p+=2,f.push(_-O*M,E-C*M),f.push(_+O*P,E+C*P));else{var V=(-S+b)*(-A+E)-(-S+_)*(-A+x),G=(-O+w)*(-C+E)-(-O+_)*(-C+T),j=(F*G-k*V)/U,H=(N*V-L*G)/U,X=(j-_)*(j-_)+(H-E)*(H-E),W=_+(j-_)*P,Y=E+(H-E)*P,q=_-(j-_)*M,Z=E-(H-E)*M,K=z?P:M;X<=Math.min(F*F+L*L,k*k+N*N)+K*K*y?s.join===vg.BEVEL||X/y>g?(z?(f.push(W,Y),f.push(_+S*M,E+A*M),f.push(W,Y),f.push(_+O*M,E+C*M)):(f.push(_-S*P,E-A*P),f.push(q,Z),f.push(_-O*P,E-C*P),f.push(q,Z)),p+=2):s.join===vg.ROUND?z?(f.push(W,Y),f.push(_+S*M,E+A*M),p+=vb(_,E,_+S*M,E+A*M,_+O*M,E+C*M,f,!0)+4,f.push(W,Y),f.push(_+O*M,E+C*M)):(f.push(_-S*P,E-A*P),f.push(q,Z),p+=vb(_,E,_-S*P,E-A*P,_-O*P,E-C*P,f,!1)+4,f.push(_-O*P,E-C*P),f.push(q,Z)):(f.push(W,Y),f.push(q,Z)):(f.push(_-S*P,E-A*P),f.push(_+S*M,E+A*M),s.join===vg.ROUND?p+=z?vb(_,E,_+S*M,E+A*M,_+O*M,E+C*M,f,!0)+2:vb(_,E,_-S*P,E-A*P,_-O*P,E-C*P,f,!1)+2:s.join===vg.MITER&&X/y<=g&&(z?(f.push(q,Z),f.push(q,Z)):(f.push(W,Y),f.push(W,Y)),p+=2),f.push(_-O*P,E-C*P),f.push(_+O*M,E+C*M),p+=2)}}b=r[2*(d-2)],x=r[2*(d-2)+1],_=r[2*(d-1)],S=-(x-(E=r[2*(d-1)+1])),A=b-_,S/=I=Math.sqrt(S*S+A*A),A/=I,S*=v,A*=v,f.push(_-S*P,E-A*P),f.push(_+S*M,E+A*M),h||(s.cap===gg.ROUND?p+=vb(_-S*(P-M)*.5,E-A*(P-M)*.5,_-S*P,E-A*P,_+S*M,E+A*M,f,!1)+2:s.cap===gg.SQUARE&&(p+=mb(_,E,S,A,P,M,!1,f)));var Q=e.indices,J=sb.epsilon*sb.epsilon;for(D=m;D<p+m-2;++D)b=f[2*D],x=f[2*D+1],_=f[2*(D+1)],E=f[2*(D+1)+1],w=f[2*(D+2)],T=f[2*(D+2)+1],Math.abs(b*(E-T)+_*(T-x)+w*(x-E))<J||Q.push(D,D+1,D+2)}}(t,e)}var gb,bb=function(){function t(){}return t.curveTo=function(t,e,i,r,n,s){var o=s[s.length-2],a=s[s.length-1]-e,h=o-t,u=r-e,l=i-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===n)return s[s.length-2]===t&&s[s.length-1]===e||s.push(t,e),null;var f=a*a+h*h,d=u*u+l*l,p=a*u+h*l,m=n*Math.sqrt(f)/c,v=n*Math.sqrt(d)/c,y=m*p/f,g=v*p/d,b=m*l+v*h,x=m*u+v*a,_=h*(v+y),E=a*(v+y),w=l*(m+g),T=u*(m+g);return{cx:b+t,cy:x+e,radius:n,startAngle:Math.atan2(E-x,_-b),endAngle:Math.atan2(T-x,w-b),anticlockwise:h*u>l*a}},t.arc=function(t,e,i,r,n,s,o,a,h){for(var u=o-s,l=sb._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pm)),c=u/(2*l),f=2*c,d=Math.cos(c),p=Math.sin(c),m=l-1,v=m%1/m,y=0;y<=m;++y){var g=c+s+f*(y+v*y),b=Math.cos(g),x=-Math.sin(g);h.push((d*b+p*x)*n+i,(d*-x+p*b)*n+r)}},t}(),xb=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s,o,a){for(var h=0,u=0,l=0,c=0,f=0,d=0,p=0,m=0,v=0,y=0,g=0,b=t,x=e,_=1;_<=10;++_)y=b-(m=(p=(d=(f=1-(u=_/10))*f)*f)*t+3*d*u*i+3*f*(l=u*u)*n+(c=l*u)*o),g=x-(v=p*e+3*d*u*r+3*f*l*s+c*a),b=m,x=v,h+=Math.sqrt(y*y+g*g);return h},t.curveTo=function(e,i,r,n,s,o,a){var h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=sb._segmentsCount(t.curveLength(h,u,e,i,r,n,s,o)),c=0,f=0,d=0,p=0,m=0;a.push(h,u);for(var v=1,y=0;v<=l;++v)d=(f=(c=1-(y=v/l))*c)*c,m=(p=y*y)*y,a.push(d*h+3*f*y*e+3*c*p*r+m*s,d*u+3*f*y*i+3*c*p*n+m*o)},t}(),_b=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s){var o=t-2*i+n,a=e-2*r+s,h=2*i-2*t,u=2*r-2*e,l=4*(o*o+a*a),c=4*(o*h+a*u),f=h*h+u*u,d=2*Math.sqrt(l+c+f),p=Math.sqrt(l),m=2*l*p,v=2*Math.sqrt(f),y=c/p;return(m*d+p*c*(d-v)+(4*f*l-c*c)*Math.log((2*p+y+d)/(y+v)))/(4*m)},t.curveTo=function(e,i,r,n,s){for(var o=s[s.length-2],a=s[s.length-1],h=sb._segmentsCount(t.curveLength(o,a,e,i,r,n)),u=0,l=0,c=1;c<=h;++c){var f=c/h;u=o+(e-o)*f,l=a+(i-a)*f,s.push(u+(e+(r-e)*f-u)*f,l+(i+(n-i)*f-l)*f)}},t}(),Eb=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),wb=((gb={})[um.POLY]=lb,gb[um.CIRC]=cb,gb[um.ELIP]=cb,gb[um.RECT]={build:function(t){var e=t.shape,i=e.x,r=e.y,n=e.width,s=e.height,o=t.points;o.length=0,o.push(i,r,i+n,r,i+n,r+s,i,r+s)},triangulate:function(t,e){var i=t.points,r=e.points,n=r.length/2;r.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},gb[um.RREC]=pb,gb),Tb=[],Sb=[],Ab=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),Ob=new ym,Cb=function(t){function e(){var e=t.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new $y,e.boundsDirty=-1,e}return hb(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Sb.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),Tb.push(e)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null);var n=new Ab(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new Ab(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,i=0;i<e.length;++i){var r=e[i];if(r.fillStyle.visible&&(r.shape&&(r.matrix?r.matrix.applyInverse(t,Ob):Ob.copyFrom(t),r.shape.contains(Ob.x,Ob.y)))){var n=!1;if(r.holes)for(var s=0;s<r.holes.length;s++){if(r.holes[s].shape.contains(Ob.x,Ob.y)){n=!0;break}}if(!n)return!0}}return!1},e.prototype.updateBatches=function(){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var t=this.uvs,e=this.graphicsData,i=null,r=null;this.batches.length>0&&(r=(i=this.batches[this.batches.length-1]).style);for(var n=this.shapeIndex;n<e.length;n++){this.shapeIndex++;var s=e[n],o=s.fillStyle,a=s.lineStyle;wb[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix),(o.visible||a.visible)&&this.processHoles(s.holes);for(var h=0;h<2;h++){var u=0===h?o:a;if(u.visible){var l=u.texture.baseTexture,c=this.indices.length,f=this.points.length/2;l.wrapMode=Gd.REPEAT,0===h?this.processFill(s):this.processLine(s);var d=this.points.length/2-f;0!==d&&(i&&!this._compareStyles(r,u)&&(i.end(c,f),i=null),i||((i=Tb.pop()||new Eb).begin(u,c,f),this.batches.push(i),r=u),this.addUvs(this.points,t,u.texture,f,d,u.matrix))}}}var p=this.indices.length,m=this.points.length/2;if(i&&i.end(p,m),0!==this.batches.length){var v=m>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&v===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=v?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var i=this.graphicsData[t],r=i.fillStyle,n=i.lineStyle;if(r&&!r.texture.baseTexture.valid)return!1;if(n&&!n.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,i=t.length;e<i;e++)for(var r=t[e],n=0;n<r.size;n++){var s=r.start+n;this.indicesUint16[s]=this.indicesUint16[s]-r.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,i=0;i<t.length;i++)if(t[i].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++jm._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),Sb.push(this.drawCalls[e]);this.drawCalls.length=0;var i=this.colors,r=this.textureIds,n=Sb.pop();n||((n=new Uy).texArray=new zy),n.texArray.count=0,n.start=0,n.size=0,n.type=Rd.TRIANGLES;var s=0,o=null,a=0,h=!1,u=Rd.TRIANGLES,l=0;this.drawCalls.push(n);for(e=0;e<this.batches.length;e++){var c=this.batches[e],f=c.style,d=f.texture.baseTexture;h!==!!f.native&&(u=(h=!!f.native)?Rd.LINES:Rd.TRIANGLES,o=null,s=8,t++),o!==d&&(o=d,d._batchEnabled!==t&&(8===s&&(t++,s=0,n.size>0&&((n=Sb.pop())||((n=new Uy).texArray=new zy),this.drawCalls.push(n)),n.start=l,n.size=0,n.texArray.count=0,n.type=u),d.touched=1,d._batchEnabled=t,d._batchLocation=s,d.wrapMode=Gd.REPEAT,n.texArray.elements[n.texArray.count++]=d,s++)),n.size+=c.size,l+=c.size,a=d._batchLocation,this.addColors(i,f.color,f.alpha,c.attribSize,c.attribStart),this.addTextureIds(r,a,c.attribSize,c.attribStart)}jm._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,n=new ArrayBuffer(3*t.length*4),s=new Float32Array(n),o=new Uint32Array(n),a=0,h=0;h<t.length/2;h++)s[a++]=t[2*h],s[a++]=t[2*h+1],s[a++]=e[2*h],s[a++]=e[2*h+1],o[a++]=i[h],s[a++]=r[h];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?lb.triangulate(t,this):wb[t.type].triangulate(t,this)},e.prototype.processLine=function(t){yb(t,this);for(var e=0;e<t.holes.length;e++)yb(t.holes[e],this)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var i=t[e];wb[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,e){for(var i=0;i<t.length/2;i++){var r=t[2*i],n=t[2*i+1];t[2*i]=e.a*r+e.c*n+e.tx,t[2*i+1]=e.b*r+e.d*n+e.ty}},e.prototype.addColors=function(t,e,i,r,n){void 0===n&&(n=0);var s=Up((e>>16)+(65280&e)+((255&e)<<16),i);t.length=Math.max(t.length,n+r);for(var o=0;o<r;o++)t[n+o]=s},e.prototype.addTextureIds=function(t,e,i,r){void 0===r&&(r=0),t.length=Math.max(t.length,r+i);for(var n=0;n<i;n++)t[r+n]=e},e.prototype.addUvs=function(t,e,i,r,n,s){void 0===s&&(s=null);for(var o=0,a=e.length,h=i.frame;o<n;){var u=t[2*(r+o)],l=t[2*(r+o)+1];if(s){var c=s.a*u+s.c*l+s.tx;l=s.b*u+s.d*l+s.ty,u=c}o++,e.push(u/h.width,l/h.height)}var f=i.baseTexture;(h.width<f.width||h.height<f.height)&&this.adjustUvs(e,i,a,n)},e.prototype.adjustUvs=function(t,e,i,r){for(var n=e.baseTexture,s=1e-6,o=i+2*r,a=e.frame,h=a.width/n.width,u=a.height/n.height,l=a.x/a.width,c=a.y/a.height,f=Math.floor(t[i]+s),d=Math.floor(t[i+1]+s),p=i+2;p<o;p+=2)f=Math.min(f,Math.floor(t[p]+s)),d=Math.min(d,Math.floor(t[p+1]+s));l-=f,c-=d;for(p=i;p<o;p+=2)t[p]=(t[p]+l)*h,t[p+1]=(t[p+1]+c)*u},e.BATCHABLE_SIZE=100,e}(Hy),Ib=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=gg.BUTT,e.join=vg.MITER,e.miterLimit=10,e}return hb(e,t),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(ob),Rb=new Float32Array(3),Pb={},Mb=function(t){function e(e){void 0===e&&(e=null);var i=t.call(this)||this;return i.shader=null,i.pluginName="batch",i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i._fillStyle=new ob,i._lineStyle=new Ib,i._matrix=null,i._holeMode=!1,i.state=sy.for2d(),i._geometry=e||new Cb,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=Cd.NORMAL,i}return hb(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,e,i,r,n){return void 0===t&&(t=null),void 0===e&&(e=0),void 0===i&&(i=1),void 0===r&&(r=.5),void 0===n&&(n=!1),"number"==typeof t&&(t={width:t,color:e,alpha:i,alignment:r,native:n}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:ov.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:gg.BUTT,join:vg.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var e=t.width>0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Em,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Em,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),_b.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,s){return this._initCurve(),xb.curveTo(t,e,i,r,n,s,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var s=this.currentPath.points,o=bb.curveTo(t,e,i,r,n,s);if(o){var a=o.cx,h=o.cy,u=o.radius,l=o.startAngle,c=o.endAngle,f=o.anticlockwise;this.arc(a,h,u,l,c,f)}return this},e.prototype.arc=function(t,e,i,r,n,s){if(void 0===s&&(s=!1),r===n)return this;if(!s&&n<=r?n+=pm:s&&r<=n&&(r+=pm),0===n-r)return this;var o=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-o),c=Math.abs(u[u.length-1]-a);l<h&&c<h||u.push(o,a)}else this.moveTo(o,a),u=this.currentPath.points;return bb.arc(o,a,t,e,i,r,n,s,u),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:ov.WHITE,color:t,alpha:e})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:ov.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var e=t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new bm(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new wm(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new xm(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new _m(t,e,i,r))},e.prototype.drawPolygon=function(){for(var t,e=arguments,i=[],r=0;r<arguments.length;r++)i[r]=e[r];var n=!0,s=i[0];s.points?(n=s.closeStroke,t=s.points):t=Array.isArray(i[0])?i[0]:i;var o=new Em(t);return o.closeStroke=n,this.drawShape(o),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==um.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var r=0;r<i;r++){var n=t.batches[r],s=n.style.color,o=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),h={vertexData:o,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*n.start,n.size),uvs:a,_batchRGB:Lp(s),_tintRGB:s,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[r]=h}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,i=this.batches.length;e<i;e++){var r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}},e.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),i=this._geometry,r=this.tint,n=this.worldAlpha,s=e.uniforms,o=i.drawCalls;s.translationMatrix=this.transform.worldTransform,s.tint[0]=(r>>16&255)/255*n,s.tint[1]=(r>>8&255)/255*n,s.tint[2]=(255&r)/255*n,s.tint[3]=n,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var a=0,h=o.length;a<h;a++)this._renderDrawCallDirect(t,i.drawCalls[a])},e.prototype._renderDrawCallDirect=function(t,e){for(var i=e.texArray,r=e.type,n=e.size,s=e.start,o=i.count,a=0;a<o;a++)t.texture.bind(i.elements[a],a);t.geometry.draw(r,n,s)},e.prototype._resolveDirectShader=function(t){var e=this.shader,i=this.pluginName;if(!e){if(!Pb[i]){for(var r=t.plugins[i].MAX_TEXTURES,n=new Int32Array(r),s=0;s<r;s++)n[s]=s;var o={tint:new Float32Array([1,1,1,1]),translationMatrix:new Sm,default:xv.from({uSamplers:n},!0)},a=t.plugins[i]._shader.program;Pb[i]=new ny(a,o)}e=Pb[i]}return e},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,i=e.minX,r=e.minY,n=e.maxX,s=e.maxY;this._bounds.addFrame(this.transform,i,r,n,s)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=Lp(this.tint,Rb),e=0;e<this.batches.length;e++){var i=this.batches[e],r=i._batchRGB,n=(t[0]*r[0]*255<<16)+(t[1]*r[1]*255<<8)+(0|t[2]*r[2]*255);i._tintRGB=(n>>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,s=e.d,o=e.tx,a=e.ty,h=this._geometry.points,u=this.vertexData,l=0,c=0;c<h.length;c+=2){var f=h[c],d=h[c+1];u[l++]=i*f+n*d+o,u[l++]=s*d+r*f+a}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},e.nextRoundedRectBehavior=!1,e._TEMP_POINT=new ym,e}(sg),Db=class extends hg{constructor(t){super(),f(this,"interactive",!0),f(this,"result",{type:"null",box:new Eg}),f(this,"selectedItemIds",[]),f(this,"cursorPoint",new xg),f(this,"startPoint",new xg),f(this,"graphics",new Mb),f(this,"SDKUtils"),f(this,"clearResult",!1),f(this,"type"),this.SDKUtils=t,this.type="selector"}initialize(){}actionKey(){}endActionKey(){}getRenderObjects(){return this.clearResult?(this.result={type:"null",box:new Eg},this.clearResult=!1,[]):(this.refreshResults(),[this.graphics])}cancelPreparation(){this.result.type="null",this.SDKUtils.clearPreSelectedItem()}preparationAction(t){this.result.box=new Eg;const e=new xg(t.offsetX,t.offsetY);this.selectedItemIds=this.hitTest(e);const i=this.selectedItemIds[0]??"";return i.length&&!this.SDKUtils.isItemSelected(i)?this.SDKUtils.addPreSelectedItem(i):this.SDKUtils.clearPreSelectedItem(),this.type}preAction(t){if(this.SDKUtils.clearPreSelectedItem(),1===t.buttons)return t.shiftKey||this.SDKUtils.clearSelectedItems(),0===this.selectedItemIds.length?(this.startPoint=new xg(t.clientX,t.clientY),this.cursorPoint=new xg(t.offsetX,t.offsetY),this.active=!0,this.type):(this.SDKUtils.addSelectedItems([this.selectedItemIds[0]]),this.clearResult=!0,"transform")}action(t){const e=(new xg).addVectors(this.cursorPoint,(new xg).subtractVectors(new xg(t.clientX,t.clientY),this.startPoint)),i=(new xg).subtractVectors(this.cursorPoint,e),r=(new xg).addVectors(this.cursorPoint,e).multiply(.5);i.x=Math.abs(i.x),i.y=Math.abs(i.y);const n=(new Eg).setFromCenterAndSize(r,i);this.result.type="region",this.result.box=n,this.SDKUtils.clearSelectedItems();const s=this.SDKUtils.data?.items?.filter(t=>this.SDKUtils.getItemEditEnable(t.id)),o=[];s?.forEach(t=>{n.intersectsBox(this.SDKUtils.getViewBoxById(t.id),!1)&&o.push(t.id)}),this.SDKUtils.addSelectedItems(o)}endAction(){this.active=!1,this.result.type="null"}interruption(){this.active=!1,this.result.type="null"}hitTest(t){const e=this.SDKUtils.getCurrentComposition();if(!e||null===e.items)return[];const{x:i,y:r}=this.SDKUtils.getViewportByViewPoint(t),n={ray:new Rg,regions:[]};try{n.regions=e.hitTest(i,r,!0),n.ray=e.getHitTestRay(i,r)}catch(t){console.warn(t)}return this.reorderHitTestResult(n,e).filter(t=>"extra-camera"!==t&&this.SDKUtils.getItemEditEnable(t))}reorderHitTestResult(t,e){if(0===t.regions.length||!e)return[];const{ray:i}=t,r=t.regions.reverse(),n=[];return r.forEach(t=>{let r;const s=(t,e)=>{for(const i of t){if(i.id===e&&(r=i),r)return;s(i.children,e)}};if(s(e.items,t.id),void 0===r)return;const o="rootItem"===t.compContent?.name?r.id:t.compContent.id,a=i.origin.clone().distance(t.position.clone());if((r.type===qi.ItemType.mesh||r.content&&"renderer"in r.content&&r.content.renderer&&"occlusion"in r.content.renderer&&r.content.renderer.occlusion)&&n.length>0){let t=!0;n.forEach((e,i)=>{if(t)return a<=e[1]?(n.splice(i,0,[o,a]),void(t=!1)):void(i===n.length-1&&n.push([o,a]))})}else n.push([o,a])}),n.map(t=>t[0])}refreshResults(){const{box:t}=this.result;this.graphics.clear();const e=this.SDKUtils.getPreSelectedItem(),i=this.SDKUtils.getViewBoxById(e?.id??"");if(i?.isEmpty()||(this.graphics.lineStyle(kg,Ng),this.graphics.drawBox(i)),!t.isEmpty()&&"region"===this.result.type)this.graphics.lineStyle(Gg,zg,Vg),this.graphics.drawBox(t),this.graphics.beginFill(Bg,Ug),this.graphics.fillBox(t),this.graphics.endFill()}},Fb=class extends hg{constructor(t,e){super(),f(this,"type"),f(this,"interactive",!0),f(this,"wireframe"),f(this,"cursorResult",{type:"normal",angle:0}),f(this,"cursorPoint",new xg),f(this,"lastPoint",new xg),f(this,"rotationAngle",0),f(this,"active",!1),f(this,"enableAdsorption",!0),f(this,"scaleParam"),f(this,"activeType","null"),f(this,"lastWorldPosition",new Sg),f(this,"SDKUtils"),f(this,"adsorptionGizmo"),f(this,"graphics",new Mb),this.type="transform",this.SDKUtils=t,this.adsorptionGizmo=e,this.wireframe={edges:[],anchor:new xg,scaleCorners:[],rotationCorners:[],interactive:!0,cornerEnable:!0,directionEnable:!0,box:new Eg,totalBox:new Eg,childrenBoxes:[],activeType:"null",interactiveDirection:new xg,scaleCorner:new xg,scaleEdgeCorners:[]}}initialize(){}actionKey(){}endActionKey(){}getRenderObjects(){return this.refreshRenderObject(),[this.graphics]}cancelPreparation(){this.active=!1,this.wireframe.activeType="null"}preAction(t,e=!1){if(this.active=1===t.buttons,this.lastPoint=new xg(t.clientX,t.clientY),this.cursorPoint=new xg(t.offsetX,t.offsetY),1===t.buttons)return this.active=!0,"null"===this.wireframe.activeType&&(this.wireframe.activeType="translation"),this.initInteractionPlane(this.cursorPoint),this.lastWorldPosition=this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(this.cursorPoint)??new Sg,this.activeType=e?"null":this.activeType,this.type}preparationAction(t){const e=new xg(t.offsetX,t.offsetY),i=this.wireframe;this.refreshTransformType(e);const{interactiveDirection:r}=i;return this.refreshCursorResult(this.activeType,dg(r)),this.active="null"!==this.activeType,this.active?this.type:void 0}action(t){this.active||(this.active=!0,this.refreshWireframeBySelectedItems(),this.wireframe.activeType="translation",this.lastPoint.set(t.clientX,t.clientY),this.cursorPoint.set(t.offsetX,t.offsetY),this.initInteractionPlane(this.cursorPoint),this.lastWorldPosition=this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(this.cursorPoint)??new Sg);const e=new xg(t.clientX,t.clientY),i=(new xg).subtractVectors(e,this.lastPoint);if(!this.wireframe.interactive)return;const r=this.SDKUtils.getSelectedItems(),{anchor:n,activeType:s,interactiveDirection:o}=this.wireframe;let a=0;switch(s){case"rotation":{const t=n.clone(),e=new Sg,s=function(t,e,i=Math.round){if(Number.isInteger(t))return t;const r=Math.pow(10,e);return i(t*r)/r}(function(t,e){const i=Math.min(Math.max(t.dot(e)/t.length()/e.length(),-1),1);let r=Math.acos(i);return r=t.x*e.y-t.y*e.x>0?r:-r,r}((new xg).subtractVectors(this.cursorPoint,t),(new xg).subtractVectors(this.cursorPoint.add(i),t))*fg,3);e.z=s,this.rotationAngle+=s,a=dg(o)+this.rotationAngle*cg,r.forEach(t=>{this.SDKUtils.rotateItem(t.id,e)});break}case"translation":{const t=i.clone();if(this.enableAdsorption){Xt(this.SDKUtils.data);const e=this.SDKUtils.data.items.map(t=>!r.find(e=>e.id===t.id)&&0===r.filter(e=>t.parentId&&t.parentId===e.id).length&&this.SDKUtils.getItemEditEnable(t.id)?this.SDKUtils.getViewBoxById(t.id):new Eg).filter(t=>!t.isEmpty()),i=new xg(this.adsorptionGizmo.absorptionResult.x??0,this.adsorptionGizmo.absorptionResult.y??0);this.adsorptionGizmo.boxTranslationAdsorption(t,this.wireframe.box,e);const n=new xg(this.adsorptionGizmo.absorptionResult.x??0,this.adsorptionGizmo.absorptionResult.y??0);t.add(i).subtract(n)}const e=this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(this.cursorPoint.add(t));if(e){const t=e.clone().subtract(this.lastWorldPosition).divide(this.SDKUtils.data.property.zoom);r.forEach(e=>{e.type!==qi.ItemType.camera&&this.SDKUtils.moveItem(e.id,t)}),this.lastWorldPosition.copyFrom(e)}break}case"scale":{this.cursorPoint.add(i);const t=this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(this.cursorPoint);if(i.length()&&t&&this.scaleParam){const{corner:e,center:i,shift:n,lastScalar:o}=this.scaleParam,a=this.SDKUtils.getSelectedItems()[0]??void 0,h=this.SDKUtils.getItemTransformById(a?.id??""),u=(new Ag).extractRotation(h.matrix).invert(),l=(new Sg).subtractVectors(e,i).applyMatrix(u),c=l.clone().multiply(o),f=t.subtract(n).subtract(i).applyMatrix(u),d=new Sg(1,1,1);if("scale"===s){const t=function(t){let e,i=0;return t.forEach((t,r)=>{if(0===r)e=Math.abs(t);else{const n=Math.abs(t);e<n&&(e=n,i=r)}}),i}([pg(l.x,0)?1:Math.abs(f.x/l.x),pg(l.y,0)?1:Math.abs(f.y/l.y)]),e=f.toArray()[t],i=c.toArray()[t];if(pg(o.x,o.y)&&pg(o.z,o.x)){const t=pg(i,0)?1:Math.abs(e/i);d.set(t,t,t)}else if(0===t){d.x=pg(i,0)?1:Math.abs(e/i);const t=l.y*e/l.x;d.y=pg(c.y,0)?1:t/c.y;const r=l.z*e/l.x;d.z=pg(c.z,0)?1:r/c.z}else if(1===t){d.y=pg(i,0)?1:Math.abs(e/i);const t=l.x*e/l.y;d.x=pg(c.x,0)?1:t/c.x;const r=l.z*e/l.y;d.z=pg(c.z,0)?1:r/c.z}else{d.z=pg(i,0)?1:Math.abs(e/i);const t=l.x*e/l.z;d.x=pg(c.x,0)?1:t/c.x;const r=l.y*e/l.z;d.y=pg(c.y,0)?1:r/c.y}}this.scaleParam.lastScalar.multiply(d),r.forEach(t=>{this.SDKUtils.scaleItem(t.id,d)})}a=dg(o);break}}this.refreshCursorResult(s,a),this.lastPoint.copyFrom(e)}endAction(t){this.active=!1;const e=new xg(t.clientX,t.clientY),i=(new xg).subtractVectors(e,this.lastPoint);this.cursorPoint.add(i);const r=this.wireframe;this.refreshTransformType(this.cursorPoint);const{activeType:n,interactiveDirection:s}=r;this.refreshCursorResult(n,dg(s)),this.adsorptionGizmo.clearAbsorptionResult(),this.rotationAngle=0,this.cursorPoint=new xg,this.lastPoint=new xg}interruption(){this.active=!1,this.cursorResult.type="normal",this.adsorptionGizmo.clearAbsorptionResult()}refreshCursorResult(t,e=0){switch(t){case"scale":this.cursorResult={type:"scale",angle:(e+Math.PI/4)*fg};break;case"rotation":this.cursorResult={type:"rotation",angle:(e+Math.PI/4)*fg};break;case"translation":case"null":this.cursorResult={type:"normal",angle:0}}}refreshResults(){const t=this.wireframe.activeType;this.refreshWireframeBySelectedItems(),t!==this.wireframe.activeType&&this.refreshCursorResult(this.wireframe.activeType),this.wireframe.box.isEmpty()&&this.adsorptionGizmo.clearAbsorptionResult()}initInteractionPlane(t){const e=this.SDKUtils.getSelectedItems();switch(this.wireframe.activeType){case"scale":{const i=1==e.length?e[0]:void 0;let r,n;if(i){const t=this.SDKUtils.getItemTransformById(i.id);r=(new Sg).setFromMatrixPosition(t.matrix),n=(new Og).setFromQuaternion((new Tg).setFromRotationMatrix(t.matrix))}if(this.SDKUtils.interactionUtils.initInteractionPlane(r,n),["scale"].includes(this.wireframe.activeType)){if(this.scaleParam={shift:new Sg,center:new Sg,corner:new Sg,lastScalar:new Sg(1,1,1)},this.scaleParam.center=r,["scale"].includes(this.wireframe.activeType)&&this.wireframe.scaleCorner)this.scaleParam.corner=this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(this.wireframe.scaleCorner)??new Sg;else if(this.wireframe.scaleEdgeCorners){const t=this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(this.wireframe.scaleEdgeCorners[0])??new Sg,e=this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(this.wireframe.scaleEdgeCorners[1])??new Sg,i=t.applyEuler(n??new Og,this.scaleParam.center),r=e.applyEuler(n??new Og,this.scaleParam.center),s=new Cg(i,r).closestPointToPoint(this.scaleParam.center);this.scaleParam.corner=s.applyMatrix((n??new Og).getInvertMatrixByEuler(),this.scaleParam.center)}this.scaleParam.shift=(this.SDKUtils.interactionUtils.getWorldPositionByViewPoint(t)??new Sg).subtract(this.scaleParam.corner)}break}case"translation":case"rotation":this.SDKUtils.interactionUtils.initInteractionPlane()}}refreshRenderObject(){if(this.graphics.clear(),!this.wireframe.box.isEmpty()){this.graphics.lineStyle(Xg,jg,Hg),this.wireframe.edges.forEach(t=>{this.graphics.drawLine(t)});const t=t=>{t.corners.forEach((e,i)=>{const r=new _g(e,t.corners[(i+1)%4]);this.graphics.drawLine(r)})};this.wireframe.childrenBoxes.forEach(e=>{t(e)}),this.wireframe.cornerEnable&&(this.graphics.beginFill(Wg),this.graphics.lineStyle(qg,Yg,Zg),this.wireframe.scaleCorners.forEach(t=>{this.graphics.drawCircle(t.center.x,t.center.y,t.radius)}),this.graphics.endFill())}}refreshTransformType(t){this.activeType="null";let e=!0;if(this.wireframe.interactiveDirection=new xg,this.wireframe.scaleCorner=void 0,this.wireframe.scaleEdgeCorners=void 0,this.wireframe.cornerEnable&&e&&this.wireframe.totalBox.containsPoint(t)){for(let i=0;i<4;i++){if(this.wireframe.scaleCorners[i].containsPoint(t)){e=!1,this.activeType="scale",this.wireframe.activeType="scale",this.wireframe.scaleCorner=this.wireframe.scaleCorners[i].center.clone(),this.wireframe.interactiveDirection.copyFrom(this.wireframe.scaleCorners[i].center).subtract(this.wireframe.box.getCenter());break}}e&&this.wireframe.box.containsPoint(t,!1)&&(e=!1,this.activeType="translation",this.wireframe.activeType="translation");for(let i=0;i<4;i++){if(this.wireframe.rotationCorners[i].containsPoint(t)&&e){e=!1,this.activeType="rotation",this.wireframe.activeType="rotation",this.wireframe.interactiveDirection.copyFrom(this.wireframe.rotationCorners[i].center).subtract(this.wireframe.box.getCenter());break}}}}refreshWireframeBySelectedItems(){const t=this.SDKUtils.getSelectedItems(),e=new Eg;if(this.wireframe.edges=[],this.wireframe.scaleCorners=[],this.wireframe.childrenBoxes=[],this.wireframe.rotationCorners=[],t.length>1)t.forEach(t=>{if(this.SDKUtils.getItemShow(t.id)){const i=this.SDKUtils.getViewBoxById(t.id);e.union(i),this.wireframe.childrenBoxes.push((new Eg).copyFrom(i).expandByScalar(1))}}),this.wireframe.anchor=e.getCenter(),this.wireframe.interactive=!0;else if(1===t.length){const i=t[0];if(this.SDKUtils.getItemShow(i.id)){const t=this.SDKUtils.getViewBoxById(i.id);e.copyFrom(t),this.wireframe.anchor=e.getCenter(),this.wireframe.interactive=i.type!==qi.ItemType.mesh&&this.SDKUtils.getItemEditEnable(i.id)}}const i=e.isEmpty(),r=i?0:1,n=i?0:16;this.wireframe.activeType=t.length?this.wireframe.activeType:"null",this.wireframe.box.copyFrom(e).expandByScalar(r),this.wireframe.totalBox.copyFrom(e).expandByScalar(n);const s=this.wireframe.box.corners;s.forEach((t,e)=>{this.wireframe.edges.push(new _g((new xg).copyFrom(t),(new xg).copyFrom(s[(e+1)%4])))}),this.wireframe.box.corners.forEach(t=>{this.wireframe.scaleCorners.push(new wg(t,Kg));const e=(new xg).subtractVectors(t,this.wireframe.box.getCenter()),i=(new xg).copyFrom(this.wireframe.box.getCenter()).add((new xg).copyFrom(e).normalize().multiply(e.length()+Qg-Kg));this.wireframe.rotationCorners.push(new wg(i,Qg))})}setAdsorptionEnabled(t){this.enableAdsorption=t}},Lb=class extends hg{constructor(){super(),f(this,"interactive",!1),f(this,"results",[]),f(this,"graphics",new Mb),f(this,"absorptionResult",{}),this.type="adsorption"}initialize(){}preparationAction(){}getCursorState(){}preAction(){}action(){}cancelPreparation(){}actionKey(){}endActionKey(){}endAction(){}interruption(){}boxTranslationAdsorption(t,e,i,r=!0,n=!0){if(this.results=[],e.isEmpty())return;const s=new xg(this.absorptionResult?.x??0,this.absorptionResult?.y??0).add(t),o=e.clone().translate(s),a=o.getCenter();this.absorptionResult={},i.forEach(t=>{if(t.isEmpty())return;t.corners.forEach(t=>{o.corners.forEach(e=>{this.getPointAbsorption(e,t,r,n)}),this.getPointAbsorption(a,t,r,n)});const e=t.getCenter();this.getPointAbsorption(a,e,r,n),o.corners.forEach(t=>{this.getPointAbsorption(t,e,r,n)})})}pointTranslationAdsorption(t,e,i,r=!0,n=!0){this.results=[];const s=new xg(this.absorptionResult?.x??0,this.absorptionResult?.y??0).add(t),o=e.clone().add(s);this.absorptionResult={},i.forEach(t=>{this.getPointAbsorption(o,t,r,n)})}getPointAbsorption(t,e,i=!0,r=!0){i&&Math.abs(t.x-e.x)<Lg&&this.refreshPointAbsorptionResult(t,e,"x"),r&&Math.abs(t.y-e.y)<Lg&&this.refreshPointAbsorptionResult(t,e,"y")}refreshPointAbsorptionResult(t,e,i){const r=t[i]-e[i],n="x"===i?"xPoints":"yPoints";if(this.absorptionResult&&void 0===this.absorptionResult[i])this.absorptionResult[i]=r,this.absorptionResult[n]=[{point:t,targets:[e]}];else if(Math.abs(r)-Math.abs(this.absorptionResult[i]??0)<=.005)if(Math.abs(Math.abs(r)-Math.abs(this.absorptionResult[i]??0))<.05&&r*(this.absorptionResult[i]??0)>0)if(void 0===this.absorptionResult[n])this.absorptionResult[i]=r,this.absorptionResult[n]=[{point:t,targets:[e]}];else{const i=this.absorptionResult[n].filter(e=>e.point.equals(t));void 0===i||0===i.length?this.absorptionResult[n]?.push({point:t,targets:[e]}):i[0]?.targets.push(e)}else this.absorptionResult[i]=r,this.absorptionResult[n]=[{point:t,targets:[e]}]}refreshResults(){if(void 0===this.absorptionResult)return;const{x:t,y:e,xPoints:i,yPoints:r}=this.absorptionResult,n=new xg(t??0,e??0);void 0!==t&&void 0!==i&&i.forEach(t=>{const e=t.point.clone().subtract(n),i=e.clone(),r=e.clone();t.targets.forEach(t=>{i.x=t.x,i.y=Math.min(i.y,t.y),r.x=t.x,r.y=Math.max(r.y,t.y)}),this.results.push(new _g(i,r))}),void 0!==e&&void 0!==r&&r.forEach(t=>{const e=t.point.clone().subtract(n),i=e.clone(),r=e.clone();t.targets.forEach(t=>{i.y=t.y,i.x=Math.min(i.x,t.x),r.y=t.y,r.x=Math.max(r.x,t.x)}),this.results.push(new _g(i,r))})}refreshRenderObject(){this.graphics.clear(),this.results.forEach(t=>{this.graphics.lineStyle(Dg,Fg),this.graphics.drawLine(t)})}getRenderObjects(){return this.refreshResults(),this.refreshRenderObject(),[this.graphics]}clearAbsorptionResult(){this.results=[],this.absorptionResult={}}};var kb=function(t){var e=this.constructor;return this.then(function(i){return e.resolve(t()).then(function(){return i})},function(i){return e.resolve(t()).then(function(){return e.reject(i)})})};var Nb=function(t){return new this(function(e,i){if(!t||void 0===t.length)return i(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var n=r.length;function s(t,i){if(i&&("object"==typeof i||"function"==typeof i)){var o=i.then;if("function"==typeof o)return void o.call(i,function(e){s(t,e)},function(i){r[t]={status:"rejected",reason:i},0===--n&&e(r)})}r[t]={status:"fulfilled",value:i},0===--n&&e(r)}for(var o=0;o<r.length;o++)s(o,r[o])})};function Bb(t,e){this.name="AggregateError",this.errors=t,this.message=e||""}Bb.prototype=Error.prototype;var Ub=function(t){var e=this;return new e(function(i,r){if(!t||void 0===t.length)return r(new TypeError("Promise.any accepts an array"));var n=Array.prototype.slice.call(t);if(0===n.length)return r();for(var s=[],o=0;o<n.length;o++)try{e.resolve(n[o]).then(i).catch(function(t){s.push(t),s.length===n.length&&r(new Bb(s,"All promises were rejected"))})}catch(t){r(t)}})},zb=setTimeout;function Vb(t){return Boolean(t&&void 0!==t.length)}function Gb(){}function jb(t){if(!(this instanceof jb))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Zb(t,this)}function Hb(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,jb._immediateFn(function(){var i=1===t._state?e.onFulfilled:e.onRejected;if(null!==i){var r;try{r=i(t._value)}catch(t){return void Wb(e.promise,t)}Xb(e.promise,r)}else(1===t._state?Xb:Wb)(e.promise,t._value)})):t._deferreds.push(e)}function Xb(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var i=e.then;if(e instanceof jb)return t._state=3,t._value=e,void Yb(t);if("function"==typeof i)return void Zb((r=i,n=e,function(){r.apply(n,arguments)}),t)}t._state=1,t._value=e,Yb(t)}catch(e){Wb(t,e)}var r,n}function Wb(t,e){t._state=2,t._value=e,Yb(t)}function Yb(t){2===t._state&&0===t._deferreds.length&&jb._immediateFn(function(){t._handled||jb._unhandledRejectionFn(t._value)});for(var e=0,i=t._deferreds.length;e<i;e++)Hb(t,t._deferreds[e]);t._deferreds=null}function qb(t,e,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=i}function Zb(t,e){var i=!1;try{t(function(t){i||(i=!0,Xb(e,t))},function(t){i||(i=!0,Wb(e,t))})}catch(t){if(i)return;i=!0,Wb(e,t)}}jb.prototype.catch=function(t){return this.then(null,t)},jb.prototype.then=function(t,e){var i=new this.constructor(Gb);return Hb(this,new qb(t,e,i)),i},jb.prototype.finally=kb,jb.all=function(t){return new jb(function(e,i){if(!Vb(t))return i(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var n=r.length;function s(t,o){try{if(o&&("object"==typeof o||"function"==typeof o)){var a=o.then;if("function"==typeof a)return void a.call(o,function(e){s(t,e)},i)}r[t]=o,0===--n&&e(r)}catch(t){i(t)}}for(var o=0;o<r.length;o++)s(o,r[o])})},jb.any=Ub,jb.allSettled=Nb,jb.resolve=function(t){return t&&"object"==typeof t&&t.constructor===jb?t:new jb(function(e){e(t)})},jb.reject=function(t){return new jb(function(e,i){i(t)})},jb.race=function(t){return new jb(function(e,i){if(!Vb(t))return i(new TypeError("Promise.race accepts an array"));for(var r=0,n=t.length;r<n;r++)jb.resolve(t[r]).then(e,i)})},jb._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){zb(t,0)},jb._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var Kb=jb,Qb=c(dt(),1);"undefined"==typeof globalThis&&("undefined"!=typeof self?self.globalThis=self:"undefined"!=typeof global&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=Kb),Object.assign||(Object.assign=Qb.default);var Jb;Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),globalThis.performance&&globalThis.performance.now||(Jb=Date.now(),globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-Jb});var $b,tx,ex=Date.now(),ix=["ms","moz","webkit","o"];for(tx=0;tx<ix.length&&!globalThis.requestAnimationFrame;++tx)$b=ix[tx],globalThis.requestAnimationFrame=globalThis[$b+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[$b+"CancelAnimationFrame"]||globalThis[$b+"CancelRequestAnimationFrame"];globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+ex-e;return i<0&&(i=0),ex=e,globalThis.self.setTimeout(function(){ex=Date.now(),t(performance.now())},i)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);var rx=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new ym,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),nx=function(t,e){return nx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},nx(t,e)};var sx=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),ox=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!==(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!==(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!==(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),ax=function(){function t(){this._tempPoint=new ym}return t.prototype.recursiveFindHit=function(t,e,i,r,n){var s;if(!e||!e.visible)return!1;var o=t.data.global,a=!1,h=n=e.interactive||n,u=!0;if(e.hitArea)r&&(e.worldTransform.applyInverse(o,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(r=!1,u=!1)),h=!1;else if(e._mask&&r){var l=e._mask.isMaskData?e._mask.maskObject:e._mask;l&&!(null===(s=l.containsPoint)||void 0===s?void 0:s.call(l,o))&&(r=!1)}if(u&&e.interactiveChildren&&e.children)for(var c=e.children,f=c.length-1;f>=0;f--){var d=c[f],p=this.recursiveFindHit(t,d,i,r,h);if(p){if(!d.parent)continue;h=!1,p&&(t.target&&(r=!1),a=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(a=!0),e.interactive&&(a&&!t.target&&(t.target=e),i&&i(t,e,!!a))),a},t.prototype.findHit=function(t,e,i,r){this.recursiveFindHit(t,e,i,r,!1)},t}(),hx={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};ig.mixin(hx);var ux={target:null,data:{global:null}},lx=function(t){function e(e,i){var r=t.call(this)||this;return i=i||{},r.renderer=e,r.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,r.interactionFrequency=i.interactionFrequency||10,r.mouse=new rx,r.mouse.identifier=1,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[1]=r.mouse,r.interactionDataPool=[],r.eventData=new sx,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!("PointerEvent"in globalThis),r.supportsTouchEvents="ontouchstart"in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:"inherit",pointer:"pointer"},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new ax,r._tempDisplayObject=new rg,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=void 0===i.useSystemTicker||i.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return function(t,e){function i(){this.constructor=t}nx(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return ux.target=null,ux.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(ux,e,null,!0),ux.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(fm.system.add(this.tickerUpdate,this,nm.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(fm.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement)if(this._didMove)this._didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var i=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){t=t||"default";var e=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(e=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var i=this.cursorStyles[t];if(i)switch(typeof i){case"string":e&&(this.interactionDOMElement.style.cursor=i);break;case"function":i(t);break;case"object":e&&Object.assign(this.interactionDOMElement.style,i)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,i){i.stopPropagationHint&&t!==i.stopsPropagatingAt||(i.currentTarget=t,i.type=e,t.emit(e,i),t[e]&&t[e](i))},e.prototype.delayDispatchEvent=function(t,e,i){this.delayedEvents.push({displayObject:t,eventString:e,eventData:i})},e.prototype.mapPositionToPoint=function(t,e,i){var r;r=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var n=1/this.resolution;t.x=(e-r.left)*(this.interactionDOMElement.width/r.width)*n,t.y=(i-r.top)*(this.interactionDOMElement.height/r.height)*n},e.prototype.processInteractive=function(t,e,i,r){var n=this.search.findHit(t,e,i,r),s=this.delayedEvents;if(!s.length)return n;t.stopPropagationHint=!1;var o=s.length;this.delayedEvents=[];for(var a=0;a<o;a++){var h=s[a],u=h.displayObject,l=h.eventString,c=h.eventData;c.stopsPropagatingAt===u&&(c.stopPropagationHint=!0),this.dispatchEvent(u,l,c)}return n},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;r<i;r++){var n=e[r],s=this.getInteractionDataForPointerId(n),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);if(o.data.originalEvent=t,this.processInteractive(o,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",o),"touch"===n.pointerType)this.emit("touchstart",o);else if("mouse"===n.pointerType||"pen"===n.pointerType){var a=2===n.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,i){var r=t.data,n=t.data.identifier;if(i)if(e.trackedPointers[n]||(e.trackedPointers[n]=new ox(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===r.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===r.pointerType||"pen"===r.pointerType){var s=2===r.button;s?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,s?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,i){var r=this.normalizeToPointerData(t),n=r.length,s=t.target;t.composedPath&&t.composedPath().length>0&&(s=t.composedPath()[0]);for(var o=s!==this.interactionDOMElement?"outside":"",a=0;a<n;a++){var h=r[a],u=this.getInteractionDataForPointerId(h),l=this.configureInteractionEventForDOMEvent(this.eventData,h,u);if(l.data.originalEvent=t,this.processInteractive(l,this.lastObjectRendered,i,e||!o),this.emit(e?"pointercancel":"pointerup"+o,l),"mouse"===h.pointerType||"pen"===h.pointerType){var c=2===h.button;this.emit(c?"rightup"+o:"mouseup"+o,l)}else"touch"===h.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,l),this.releaseInteractionDataForPointerId(h.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var i=t.data,r=t.data.identifier;void 0!==e.trackedPointers[r]&&(delete e.trackedPointers[r],this.dispatchEvent(e,"pointercancel",t),"touch"===i.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,i){var r=t.data,n=t.data.identifier,s=e.trackedPointers[n],o="touch"===r.pointerType,a="mouse"===r.pointerType||"pen"===r.pointerType,h=!1;if(a){var u=2===r.button,l=ox.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,f=void 0!==s&&s.flags&c;i?(this.dispatchEvent(e,u?"rightup":"mouseup",t),f&&(this.dispatchEvent(e,u?"rightclick":"click",t),h=!0)):f&&this.dispatchEvent(e,u?"rightupoutside":"mouseupoutside",t),s&&(u?s.rightDown=!1:s.leftDown=!1)}i?(this.dispatchEvent(e,"pointerup",t),o&&this.dispatchEvent(e,"touchend",t),s&&(a&&!h||this.dispatchEvent(e,"pointertap",t),o&&(this.dispatchEvent(e,"tap",t),s.over=!1))):s&&(this.dispatchEvent(e,"pointerupoutside",t),o&&this.dispatchEvent(e,"touchendoutside",t)),s&&s.none&&delete e.trackedPointers[n]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this._didMove=!0,this.cursor=null);for(var i=e.length,r=0;r<i;r++){var n=e[r],s=this.getInteractionDataForPointerId(n),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);o.data.originalEvent=t,this.processInteractive(o,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",o),"touch"===n.pointerType&&this.emit("touchmove",o),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",o)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,i){var r=t.data,n="touch"===r.pointerType,s="mouse"===r.pointerType||"pen"===r.pointerType;s&&this.processPointerOverOut(t,e,i),this.moveWhenInside&&!i||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),s&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var i=this.getInteractionDataForPointerId(e),r=this.configureInteractionEventForDOMEvent(this.eventData,e,i);r.data.originalEvent=e,this.processInteractive(r,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",r),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",r):this.releaseInteractionDataForPointerId(i.identifier)}},e.prototype.processPointerOverOut=function(t,e,i){var r=t.data,n=t.data.identifier,s="mouse"===r.pointerType||"pen"===r.pointerType,o=e.trackedPointers[n];i&&!o&&(o=e.trackedPointers[n]=new ox(n)),void 0!==o&&(i&&this.mouseOverRenderer?(o.over||(o.over=!0,this.delayDispatchEvent(e,"pointerover",t),s&&this.delayDispatchEvent(e,"mouseover",t)),s&&null===this.cursor&&(this.cursor=e.cursor)):o.over&&(o.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),s&&this.dispatchEvent(e,"mouseout",t),o.none&&delete e.trackedPointers[n]))},e.prototype.onPointerOver=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0],i=this.getInteractionDataForPointerId(e),r=this.configureInteractionEventForDOMEvent(this.eventData,e,i);r.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",r),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",r)}},e.prototype.getInteractionDataForPointerId=function(t){var e,i=t.pointerId;return 1===i||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[i]?e=this.activeInteractionData[i]:((e=this.interactionDataPool.pop()||new rx).identifier=i,this.activeInteractionData[i]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,i){return t.data=i,this.mapPositionToPoint(i.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=i.global.x,e.globalY=i.global.y),i.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var i=0,r=t.changedTouches.length;i<r;i++){var n=t.changedTouches[i];void 0===n.button&&(n.button=t.touches.length?1:0),void 0===n.buttons&&(n.buttons=t.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,e.push(n)}else if(globalThis.MouseEvent&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof globalThis.PointerEvent))e.push(t);else{var s=t;void 0===s.isPrimary&&(s.isPrimary=!0),void 0===s.width&&(s.width=1),void 0===s.height&&(s.height=1),void 0===s.tiltX&&(s.tiltX=0),void 0===s.tiltY&&(s.tiltY=0),void 0===s.pointerType&&(s.pointerType="mouse"),void 0===s.pointerId&&(s.pointerId=1),void 0===s.pressure&&(s.pressure=.5),void 0===s.twist&&(s.twist=0),void 0===s.tangentialPressure&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}return e},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e.extension={name:"interaction",type:[em.RendererPlugin,em.CanvasRendererPlugin]},e}(Op.default),cx=function(){function t(t,e,i){void 0===e&&(e=!1),this._fn=t,this._once=e,this._thisArg=i,this._next=this._prev=this._owner=null}return t.prototype.detach=function(){return null!==this._owner&&(this._owner.detach(this),!0)},t}();function fx(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var dx,px=function(){function t(){this._head=this._tail=void 0}return t.prototype.handlers=function(t){void 0===t&&(t=!1);var e=this._head;if(t)return!!e;for(var i=[];e;)i.push(e),e=e._next;return i},t.prototype.has=function(t){if(!(t instanceof cx))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return t._owner===this},t.prototype.dispatch=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];var r=this._head;if(!r)return!1;for(;r;)r._once&&this.detach(r),r._fn.apply(r._thisArg,e),r=r._next;return!0},t.prototype.add=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return fx(this,new cx(t,!1,e))},t.prototype.once=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return fx(this,new cx(t,!0,e))},t.prototype.detach=function(t){if(!(t instanceof cx))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this},t.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this},t}();function mx(t,e){e=e||{};for(var i={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},r=i.parser[e.strictMode?"strict":"loose"].exec(t),n={},s=14;s--;)n[i.key[s]]=r[s]||"";return n[i.q.name]={},n[i.key[12]].replace(i.q.parser,function(t,e,r){e&&(n[i.q.name][e]=r)}),n}var vx=null;function yx(){}function gx(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function bx(t){return t.toString().replace("object ","")}var xx,_x,Ex,wx,Tx,Sx=function(){function t(e,i,r){if(this._dequeue=yx,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,"string"!=typeof e||"string"!=typeof i)throw new Error("Both name and url are required for constructing a resource.");r=r||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===i.indexOf("data:")),this.name=e,this.url=i,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===r.crossOrigin?"anonymous":r.crossOrigin,this.timeout=r.timeout||0,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=yx,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new px,this.onProgress=new px,this.onComplete=new px,this.onAfterMiddleware=new px}return t.setExtensionLoadType=function(e,i){gx(t._loadTypeMap,e,i)},t.setExtensionXhrType=function(e,i){gx(t._xhrTypeMap,e,i)},Object.defineProperty(t.prototype,"isDataUrl",{get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isComplete",{get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),t.prototype.complete=function(){this._clearEvents(),this._finish()},t.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},t.prototype.load=function(e){var i=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout(function(){return e(i)},1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:void 0===dx&&(dx=!(!globalThis.XDomainRequest||"withCredentials"in new XMLHttpRequest)),dx&&this.crossOrigin?this._loadXdr():this._loadXhr()}},t.prototype._hasFlag=function(t){return 0!==(this._flags&t)},t.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},t.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},t.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},t.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==globalThis.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==globalThis.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(t,this.url[i],Array.isArray(e)?e[i]:e));else{e=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(e)?e[0]:e))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},t.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;"use-credentials"===this.crossOrigin&&(e.withCredentials=!0),e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},t.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new globalThis.XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){return t.send()},1)},t.prototype._createSource=function(t,e,i){i||(i=t+"/"+this._getExtension(e));var r=document.createElement("source");return r.src=e,r.type=i,r},t.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},t.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},t.prototype._onTimeout=function(){this.abort("Load timed out.")},t.prototype._xhrOnError=function(){var t=this.xhr;this.abort(bx(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},t.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(bx(t)+" Request timed out.")},t.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(bx(t)+" Request was aborted by the user.")},t.prototype._xhrOnLoad=function(){var e=this.xhr,i="",r=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(i=e.responseText),0===r&&(i.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var s=document.createElement("div");s.innerHTML=i,this.data=s}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,vx||(vx=document.createElement("a")),vx.href=t;var i=mx(vx.href,{strictMode:!0}),r=!i.port&&""===e.port||i.port===e.port,n=i.protocol?i.protocol+":":"";return i.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),s=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,s)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}();function Ax(){}function Ox(t){return function(){for(var e=arguments,i=[],r=0;r<arguments.length;r++)i[r]=e[r];if(null===t)throw new Error("Callback was already called.");var n=t;t=null,n.apply(this,i)}}xx=Sx||(Sx={}),(_x=xx.STATUS_FLAGS||(xx.STATUS_FLAGS={}))[_x.NONE=0]="NONE",_x[_x.DATA_URL=1]="DATA_URL",_x[_x.COMPLETE=2]="COMPLETE",_x[_x.LOADING=4]="LOADING",(Ex=xx.TYPE||(xx.TYPE={}))[Ex.UNKNOWN=0]="UNKNOWN",Ex[Ex.JSON=1]="JSON",Ex[Ex.XML=2]="XML",Ex[Ex.IMAGE=3]="IMAGE",Ex[Ex.AUDIO=4]="AUDIO",Ex[Ex.VIDEO=5]="VIDEO",Ex[Ex.TEXT=6]="TEXT",(wx=xx.LOAD_TYPE||(xx.LOAD_TYPE={}))[wx.XHR=1]="XHR",wx[wx.IMAGE=2]="IMAGE",wx[wx.AUDIO=3]="AUDIO",wx[wx.VIDEO=4]="VIDEO",(Tx=xx.XHR_RESPONSE_TYPE||(xx.XHR_RESPONSE_TYPE={})).DEFAULT="text",Tx.BUFFER="arraybuffer",Tx.BLOB="blob",Tx.DOCUMENT="document",Tx.JSON="json",Tx.TEXT="text",xx._loadTypeMap={gif:xx.LOAD_TYPE.IMAGE,png:xx.LOAD_TYPE.IMAGE,bmp:xx.LOAD_TYPE.IMAGE,jpg:xx.LOAD_TYPE.IMAGE,jpeg:xx.LOAD_TYPE.IMAGE,tif:xx.LOAD_TYPE.IMAGE,tiff:xx.LOAD_TYPE.IMAGE,webp:xx.LOAD_TYPE.IMAGE,tga:xx.LOAD_TYPE.IMAGE,avif:xx.LOAD_TYPE.IMAGE,svg:xx.LOAD_TYPE.IMAGE,"svg+xml":xx.LOAD_TYPE.IMAGE,mp3:xx.LOAD_TYPE.AUDIO,ogg:xx.LOAD_TYPE.AUDIO,wav:xx.LOAD_TYPE.AUDIO,mp4:xx.LOAD_TYPE.VIDEO,webm:xx.LOAD_TYPE.VIDEO},xx._xhrTypeMap={xhtml:xx.XHR_RESPONSE_TYPE.DOCUMENT,html:xx.XHR_RESPONSE_TYPE.DOCUMENT,htm:xx.XHR_RESPONSE_TYPE.DOCUMENT,xml:xx.XHR_RESPONSE_TYPE.DOCUMENT,tmx:xx.XHR_RESPONSE_TYPE.DOCUMENT,svg:xx.XHR_RESPONSE_TYPE.DOCUMENT,tsx:xx.XHR_RESPONSE_TYPE.DOCUMENT,gif:xx.XHR_RESPONSE_TYPE.BLOB,png:xx.XHR_RESPONSE_TYPE.BLOB,bmp:xx.XHR_RESPONSE_TYPE.BLOB,jpg:xx.XHR_RESPONSE_TYPE.BLOB,jpeg:xx.XHR_RESPONSE_TYPE.BLOB,tif:xx.XHR_RESPONSE_TYPE.BLOB,tiff:xx.XHR_RESPONSE_TYPE.BLOB,webp:xx.XHR_RESPONSE_TYPE.BLOB,tga:xx.XHR_RESPONSE_TYPE.BLOB,avif:xx.XHR_RESPONSE_TYPE.BLOB,json:xx.XHR_RESPONSE_TYPE.JSON,text:xx.XHR_RESPONSE_TYPE.TEXT,txt:xx.XHR_RESPONSE_TYPE.TEXT,ttf:xx.XHR_RESPONSE_TYPE.BUFFER,otf:xx.XHR_RESPONSE_TYPE.BUFFER},xx.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";var Cx=function(){return function(t,e){this.data=t,this.callback=e}}(),Ix=function(){function t(t,e){var i=this;if(void 0===e&&(e=1),this.workers=0,this.saturated=Ax,this.unsaturated=Ax,this.empty=Ax,this.drain=Ax,this.error=Ax,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(t,e,r){if(r&&"function"!=typeof r)throw new Error("task callback must be a function");if(i.started=!0,null==t&&i.idle())setTimeout(function(){return i.drain()},1);else{var n=new Cx(t,"function"==typeof r?r:Ax);e?i._tasks.unshift(n):i._tasks.push(n),setTimeout(i.process,1)}},this.process=function(){for(;!i.paused&&i.workers<i.concurrency&&i._tasks.length;){var t=i._tasks.shift();0===i._tasks.length&&i.empty(),i.workers+=1,i.workers===i.concurrency&&i.saturated(),i._worker(t.data,Ox(i._next(t)))}},this._worker=t,0===e)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return t.prototype._next=function(t){var e=this;return function(){for(var i=arguments,r=[],n=0;n<arguments.length;n++)r[n]=i[n];e.workers-=1,t.callback.apply(t,r),null!=r[0]&&e.error(r[0],t.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},t.prototype.push=function(t,e){this._insert(t,!1,e)},t.prototype.kill=function(){this.workers=0,this.drain=Ax,this.started=!1,this._tasks=[]},t.prototype.unshift=function(t,e){this._insert(t,!0,e)},t.prototype.length=function(){return this._tasks.length},t.prototype.running=function(){return this.workers},t.prototype.idle=function(){return this._tasks.length+this.workers===0},t.prototype.pause=function(){!0!==this.paused&&(this.paused=!0)},t.prototype.resume=function(){if(!1!==this.paused){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},t.eachSeries=function(t,e,i,r){var n=0,s=t.length;!function o(a){a||n===s?i&&i(a):r?setTimeout(function(){e(t[n++],o)},1):e(t[n++],o)}()},t.queue=function(e,i){return new t(e,i)},t}(),Rx=/(#[\w-]+)?$/,Px=function(){function t(e,i){var r=this;void 0===e&&(e=""),void 0===i&&(i=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return r._loadResource(t,e)},this.resources={},this.baseUrl=e,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return r._loadResource(t,e)},this._queue=Ix.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new px,this.onError=new px,this.onLoad=new px,this.onStart=new px,this.onComplete=new px;for(var n=0;n<t._plugins.length;++n){var s=t._plugins[n],o=s.pre,a=s.use;o&&this.pre(o),a&&this.use(a)}this._protected=!1}return t.prototype._add=function(t,e,i,r){if(this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new Sx(t,e,i),"function"==typeof r&&this.resources[t].onAfterMiddleware.once(r),this.loading){for(var n=i.parentResource,s=[],o=0;o<n.children.length;++o)n.children[o].isComplete||s.push(n.children[o]);var a=n.progressChunk*(s.length+1)/(s.length+2);n.children.push(this.resources[t]),n.progressChunk=a;for(o=0;o<s.length;++o)s[o].progressChunk=a;this.resources[t].progressChunk=a}return this._queue.push(this.resources[t]),this},t.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},t.prototype.use=function(t){return this._afterMiddleware.push(t),this},t.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},t.prototype.load=function(t){if(Zp("6.5.0","@pixi/loaders is being replaced with @pixi/assets in the next major release."),"function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,i=0;i<this._queue._tasks.length;++i)this._queue._tasks[i].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},Object.defineProperty(t.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!1,configurable:!0}),t.prototype._prepareUrl=function(t){var e,i=mx(t,{strictMode:!0});if(e=i.protocol||!i.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var r=Rx.exec(e)[0];-1!==(e=e.slice(0,e.length-r.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=r}return e},t.prototype._loadResource=function(t,e){var i=this;t._dequeue=e,Ix.eachSeries(this._beforeMiddleware,function(e,r){e.call(i,t,function(){r(t.isComplete?{}:null)})},function(){t.isComplete?i._onLoad(t):(t._onLoadBinding=t.onComplete.once(i._onLoad,i),t.load())},!0)},t.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},t.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},t.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),Ix.eachSeries(this._afterMiddleware,function(i,r){i.call(e,t,r)},function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()},!0)},t.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(t,"shared",{get:function(){var e=t._shared;return e||((e=new t)._protected=!0,t._shared=e),e},enumerable:!1,configurable:!0}),t.registerPlugin=function(e){return Zp("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),am.add({type:em.Loader,ref:e}),t},t._plugins=[],t}();am.handleByList(em.Loader,Px._plugins),Px.prototype.add=function(t,e,i,r){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);return this}if("object"==typeof t&&(i=t,r=e||i.callback||i.onComplete,e=i.url,t=i.name||i.key||i.url),"string"!=typeof e&&(r=i,i=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");return"function"==typeof i&&(r=i,i=null),this._add(t,e,i,r)};var Mx=function(){function t(){}return t.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?Px.shared:new Px},t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.extension=em.Application,t}(),Dx=function(){function t(){}return t.add=function(){Sx.setExtensionLoadType("svg",Sx.LOAD_TYPE.XHR),Sx.setExtensionXhrType("svg",Sx.XHR_RESPONSE_TYPE.TEXT)},t.use=function(t,e){if(!t.data||t.type!==Sx.TYPE.IMAGE&&"svg"!==t.extension)e();else{var i=t.data,r=t.url,n=t.name,s=t.metadata;ov.fromLoader(i,r,n,s).then(function(i){t.texture=i,e()}).catch(e)}},t.extension=em.Loader,t}();function Fx(t,e){if(t.data){if(t.xhr&&t.xhrType===Sx.XHR_RESPONSE_TYPE.BLOB)if(self.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var i=globalThis.URL||globalThis.webkitURL,r=i.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=r,t.type=Sx.TYPE.IMAGE,void(t.data.onload=function(){i.revokeObjectURL(r),t.data.onload=null,e()})}}else{var n=t.xhr.getResponseHeader("content-type");if(n&&0===n.indexOf("image"))return t.data=new Image,t.data.src="data:"+n+";base64,"+function(t){for(var e="",i=0;i<t.length;){for(var r=[0,0,0],n=[0,0,0,0],s=0;s<r.length;++s)i<t.length?r[s]=255&t.charCodeAt(i++):r[s]=0;switch(n[0]=r[0]>>2,n[1]=(3&r[0])<<4|r[1]>>4,n[2]=(15&r[1])<<2|r[2]>>6,n[3]=63&r[2],i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(s=0;s<n.length;++s)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n[s])}return e}(t.xhr.responseText),t.type=Sx.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}var Lx=function(){function t(){}return t.extension=em.Loader,t.use=Fx,t}();am.add(Dx,Lx);var kx=function(t,e){return kx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},kx(t,e)};var Nx,Bx,Ux=new ym,zx=new Uint16Array([0,1,2,0,2,3]),Vx=function(t){function e(e){var i=t.call(this)||this;return i._anchor=new Tm(i._onAnchorUpdate,i,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=Cd.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=e||ov.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=zx,i.pluginName="batch",i.isSprite=!0,i._roundPixels=Ap.ROUND_PIXELS,i}return function(t,e){function i(){this.constructor=t}kx(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Xp(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Xp(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,s=e.d,o=e.tx,a=e.ty,h=this.vertexData,u=t.trim,l=t.orig,c=this._anchor,f=0,d=0,p=0,m=0;if(u?(f=(d=u.x-c._x*l.width)+u.width,p=(m=u.y-c._y*l.height)+u.height):(f=(d=-c._x*l.width)+l.width,p=(m=-c._y*l.height)+l.height),h[0]=i*d+n*m+o,h[1]=s*m+r*d+a,h[2]=i*f+n*m+o,h[3]=s*m+r*f+a,h[4]=i*f+n*p+o,h[5]=s*p+r*f+a,h[6]=i*d+n*p+o,h[7]=s*p+r*d+a,this._roundPixels)for(var v=Ap.RESOLUTION,y=0;y<h.length;++y)h[y]=Math.round((h[y]*v|0)/v)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,r=this._anchor,n=this.transform.worldTransform,s=n.a,o=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=-r._x*i.width,f=c+i.width,d=-r._y*i.height,p=d+i.height;e[0]=s*c+a*d+u,e[1]=h*d+o*c+l,e[2]=s*f+a*d+u,e[3]=h*d+o*f+l,e[4]=s*f+a*p+u,e[5]=h*p+o*f+l,e[6]=s*c+a*p+u,e[7]=h*p+o*c+l},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._localBounds||(this._localBounds=new $y),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new bm),e=this._localBoundsRect),this._localBounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Ux);var e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x,n=0;return Ux.x>=r&&Ux.x<r+e&&(n=-i*this.anchor.y,Ux.y>=n&&Ux.y<n+i)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null},e.from=function(t,i){return new e(t instanceof ov?t:ov.from(t,i))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=Xp(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=Xp(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||ov.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(sg),Gx=function(t,e){return Gx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Gx(t,e)};(Bx=Nx||(Nx={}))[Bx.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",Bx[Bx.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL";var jx={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Nx.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Hx=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Xx=function(){function t(t){this.styleID=0,this.reset(),qx(this,t,t)}return t.prototype.clone=function(){var e={};return qx(e,this,jx),new t(e)},t.prototype.reset=function(){qx(this,jx,jx)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=Yx(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=Yx(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=Yx(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var i=e.length-1;i>=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&Hx.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function Wx(t){return"number"==typeof t?kp(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Yx(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=Wx(t[e]);return t}return Wx(t)}function qx(t,e,i){for(var r in i)Array.isArray(e[r])?t[r]=e[r].slice():t[r]=e[r]}var Zx={willReadFrequently:!0},Kx=function(){function t(t,e,i,r,n,s,o,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}return t.measureText=function(e,i,r,n){void 0===n&&(n=t._canvas),r=null==r?i.wordWrap:r;var s=i.toFontString(),o=t.measureFont(s);0===o.fontSize&&(o.fontSize=i.fontSize,o.ascent=i.fontSize);var a=n.getContext("2d",Zx);a.font=s;for(var h=(r?t.wordWrap(e,i,n):e).split(/(?:\r\n|\r|\n)/),u=new Array(h.length),l=0,c=0;c<h.length;c++){var f=a.measureText(h[c]).width+(h[c].length-1)*i.letterSpacing;u[c]=f,l=Math.max(l,f)}var d=l+i.strokeThickness;i.dropShadow&&(d+=i.dropShadowDistance);var p=i.lineHeight||o.fontSize+i.strokeThickness,m=Math.max(p,o.fontSize+i.strokeThickness)+(h.length-1)*(p+i.leading);return i.dropShadow&&(m+=i.dropShadowDistance),new t(e,i,d,m,h,u,p+i.leading,l,o)},t.wordWrap=function(e,i,r){void 0===r&&(r=t._canvas);for(var n=r.getContext("2d",Zx),s=0,o="",a="",h=Object.create(null),u=i.letterSpacing,l=i.whiteSpace,c=t.collapseSpaces(l),f=t.collapseNewlines(l),d=!c,p=i.wordWrapWidth+u,m=t.tokenize(e),v=0;v<m.length;v++){var y=m[v];if(t.isNewline(y)){if(!f){a+=t.addLine(o),d=!c,o="",s=0;continue}y=" "}if(c){var g=t.isBreakingSpace(y),b=t.isBreakingSpace(o[o.length-1]);if(g&&b)continue}var x=t.getFromCache(y,u,h,n);if(x>p)if(""!==o&&(a+=t.addLine(o),o="",s=0),t.canBreakWords(y,i.breakWords))for(var _=t.wordWrapSplit(y),E=0;E<_.length;E++){for(var w=_[E],T=1;_[E+T];){var S=_[E+T],A=w[w.length-1];if(t.canBreakChars(A,S,y,E,i.breakWords))break;w+=S,T++}E+=w.length-1;var O=t.getFromCache(w,u,h,n);O+s>p&&(a+=t.addLine(o),d=!1,o="",s=0),o+=w,s+=O}else{o.length>0&&(a+=t.addLine(o),o="",s=0);var C=v===m.length-1;a+=t.addLine(y,!C),d=!1,o="",s=0}else x+s>p&&(d=!1,a+=t.addLine(o),o="",s=0),(o.length>0||!t.isBreakingSpace(y)||d)&&(o+=y,s+=x)}return a+=t.addLine(o,!1)},t.addLine=function(e,i){return void 0===i&&(i=!0),e=t.trimRight(e),e=i?e+"\n":e},t.getFromCache=function(t,e,i,r){var n=i[t];if("number"!=typeof n){var s=t.length*e;n=r.measureText(t).width+s,i[t]=n}return n},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var i=e.length-1;i>=0;i--){var r=e[i];if(!t.isBreakingSpace(r))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,i){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var i=[],r="";if("string"!=typeof e)return i;for(var n=0;n<e.length;n++){var s=e[n],o=e[n+1];t.isBreakingSpace(s,o)||t.isNewline(s)?(""!==r&&(i.push(r),r=""),i.push(s)):r+=s}return""!==r&&i.push(r),i},t.canBreakWords=function(t,e){return e},t.canBreakChars=function(t,e,i,r,n){return!0},t.wordWrapSplit=function(t){return t.split("")},t.measureFont=function(e){if(t._fonts[e])return t._fonts[e];var i={ascent:0,descent:0,fontSize:0},r=t._canvas,n=t._context;n.font=e;var s=t.METRICS_STRING+t.BASELINE_SYMBOL,o=Math.ceil(n.measureText(s).width),a=Math.ceil(n.measureText(t.BASELINE_SYMBOL).width),h=Math.ceil(t.HEIGHT_MULTIPLIER*a);a=a*t.BASELINE_MULTIPLIER|0,r.width=o,r.height=h,n.fillStyle="#f00",n.fillRect(0,0,o,h),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(s,0,a);var u=n.getImageData(0,0,o,h).data,l=u.length,c=4*o,f=0,d=0,p=!1;for(f=0;f<a;++f){for(var m=0;m<c;m+=4)if(255!==u[d+m]){p=!0;break}if(p)break;d+=c}for(i.ascent=a-f,d=l-c,p=!1,f=h;f>a;--f){for(m=0;m<c;m+=4)if(255!==u[d+m]){p=!0;break}if(p)break;d-=c}return i.descent=f-a,i.fontSize=i.ascent+i.descent,t._fonts[e]=i,i},t.clearMetrics=function(e){void 0===e&&(e=""),e?delete t._fonts[e]:t._fonts={}},Object.defineProperty(t,"_canvas",{get:function(){if(!t.__canvas){var e=void 0;try{var i=new OffscreenCanvas(0,0),r=i.getContext("2d",Zx);if(r&&r.measureText)return t.__canvas=i,i;e=Ap.ADAPTER.createCanvas()}catch(t){e=Ap.ADAPTER.createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(t,"_context",{get:function(){return t.__context||(t.__context=t._canvas.getContext("2d",Zx)),t.__context},enumerable:!1,configurable:!0}),t}();Kx._fonts={},Kx.METRICS_STRING="|ÉqÅ",Kx.BASELINE_SYMBOL="M",Kx.BASELINE_MULTIPLIER=1.4,Kx.HEIGHT_MULTIPLIER=2,Kx._newlines=[10,13],Kx._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Qx={texture:!0,children:!1,baseTexture:!0};!function(t){function e(e,i,r){var n=this,s=!1;r||(r=Ap.ADAPTER.createCanvas(),s=!0),r.width=3,r.height=3;var o=ov.from(r);return o.orig=new bm,o.trim=new bm,(n=t.call(this,o)||this)._ownCanvas=s,n.canvas=r,n.context=r.getContext("2d",{willReadFrequently:!0}),n._resolution=Ap.RESOLUTION,n._autoResolution=!0,n._text=null,n._style=null,n._styleListener=null,n._font="",n.text=e,n.style=i,n.localStyleID=-1,n}(function(t,e){function i(){this.constructor=t}Gx(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(e,t),e.prototype.updateText=function(t){var i=this._style;if(this.localStyleID!==i.styleID&&(this.dirty=!0,this.localStyleID=i.styleID),this.dirty||!t){this._font=this._style.toFontString();var r,n,s=this.context,o=Kx.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=o.width,h=o.height,u=o.lines,l=o.lineHeight,c=o.lineWidths,f=o.maxLineWidth,d=o.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+2*i.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,h)+2*i.padding)*this._resolution),s.scale(this._resolution,this._resolution),s.clearRect(0,0,this.canvas.width,this.canvas.height),s.font=this._font,s.lineWidth=i.strokeThickness,s.textBaseline=i.textBaseline,s.lineJoin=i.lineJoin,s.miterLimit=i.miterLimit;for(var p=i.dropShadow?2:1,m=0;m<p;++m){var v=i.dropShadow&&0===m,y=v?Math.ceil(Math.max(1,h)+2*i.padding):0,g=y*this._resolution;if(v){s.fillStyle="black",s.strokeStyle="black";var b=i.dropShadowColor,x=Lp("number"==typeof b?b:Np(b)),_=i.dropShadowBlur*this._resolution,E=i.dropShadowDistance*this._resolution;s.shadowColor="rgba("+255*x[0]+","+255*x[1]+","+255*x[2]+","+i.dropShadowAlpha+")",s.shadowBlur=_,s.shadowOffsetX=Math.cos(i.dropShadowAngle)*E,s.shadowOffsetY=Math.sin(i.dropShadowAngle)*E+g}else s.fillStyle=this._generateFillStyle(i,u,o),s.strokeStyle=i.stroke,s.shadowColor="black",s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0;var w=(l-d.fontSize)/2;(!e.nextLineHeightBehavior||l-d.fontSize<0)&&(w=0);for(var T=0;T<u.length;T++)r=i.strokeThickness/2,n=i.strokeThickness/2+T*l+d.ascent+w,"right"===i.align?r+=f-c[T]:"center"===i.align&&(r+=(f-c[T])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(u[T],r+i.padding,n+i.padding-y,!0),i.fill&&this.drawLetterSpacing(u[T],r+i.padding,n+i.padding-y)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,i,r,n){void 0===n&&(n=!1);var s=this._style.letterSpacing,o=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(0===s||o)return o&&(this.context.letterSpacing=s,this.context.textLetterSpacing=s),void(n?this.context.strokeText(t,i,r):this.context.fillText(t,i,r));for(var a=i,h=Array.from?Array.from(t):t.split(""),u=this.context.measureText(t).width,l=0,c=0;c<h.length;++c){var f=h[c];n?this.context.strokeText(f,a,r):this.context.fillText(f,a,r);for(var d="",p=c+1;p<h.length;++p)d+=h[p];a+=u-(l=this.context.measureText(d).width)+s,u=l}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=function(t){var e,i,r,n=t.width,s=t.height,o=t.getContext("2d",{willReadFrequently:!0}),a=o.getImageData(0,0,n,s).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(i=e/4%n,r=~~(e/4/n),null===u.top&&(u.top=r),(null===u.left||i<u.left)&&(u.left=i),(null===u.right||u.right<i)&&(u.right=i+1),(null===u.bottom||u.bottom<r)&&(u.bottom=r));return null!==u.top&&(n=u.right-u.left,s=u.bottom-u.top+1,l=o.getImageData(u.left,u.top,n,s)),{height:s,width:n,data:l}}(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var i=this._texture,r=this._style,n=r.trim?0:r.padding,s=i.baseTexture;i.trim.width=i._frame.width=t.width/this._resolution,i.trim.height=i._frame.height=t.height/this._resolution,i.trim.x=-n,i.trim.y=-n,i.orig.width=i._frame.width-2*n,i.orig.height=i._frame.height-2*n,this._onTextureUpdate(),s.setRealSize(t.width,t.height,this._resolution),i.updateUvs(),this.dirty=!1},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},e.prototype.updateTransform=function(){this.updateText(!0),t.prototype.updateTransform.call(this)},e.prototype.getBounds=function(e,i){return this.updateText(!0),-1===this._textureID&&(e=!1),t.prototype.getBounds.call(this,e,i)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,e,i){var r,n=t.fill;if(!Array.isArray(n))return n;if(1===n.length)return n[0];var s=t.dropShadow?t.dropShadowDistance:0,o=t.padding||0,a=this.canvas.width/this._resolution-s-2*o,h=this.canvas.height/this._resolution-s-2*o,u=n.slice(),l=t.fillGradientStops.slice();if(!l.length)for(var c=u.length+1,f=1;f<c;++f)l.push(f/c);if(u.unshift(n[0]),l.unshift(0),u.push(n[n.length-1]),l.push(1),t.fillGradientType===Nx.LINEAR_VERTICAL){r=this.context.createLinearGradient(a/2,o,a/2,h+o);var d=i.fontProperties.fontSize+t.strokeThickness;for(f=0;f<e.length;f++){var p=i.lineHeight*(f-1)+d,m=i.lineHeight*f,v=m;f>0&&p>m&&(v=(m+p)/2);var y=m+d,g=i.lineHeight*(f+1),b=y;f+1<e.length&&g<y&&(b=(y+g)/2);for(var x=(b-v)/h,_=0;_<u.length;_++){var E=0;E="number"==typeof l[_]?l[_]:_/u.length;var w=Math.min(1,Math.max(0,v/h+E*x));w=Number(w.toFixed(5)),r.addColorStop(w,u[_])}}}else{r=this.context.createLinearGradient(o,h/2,a+o,h/2);var T=u.length+1,S=1;for(f=0;f<u.length;f++){var A=void 0;A="number"==typeof l[f]?l[f]:S/T,r.addColorStop(A,u[f]),S++}}return r},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},Qx,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=Xp(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=Xp(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof Xx?t:new Xx(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e.experimentalLetterSpacing=!1}(Vx);Mp=!0,By.registerPlugin("interaction",lx),By.registerPlugin("batch",Yy),ag.registerPlugin(dm),ag.registerPlugin(Mx),Mb.prototype.drawBox=function(t){const e=t.getCorners();this.beginFill();for(let t=0;t<4;t++)this.moveTo(e[t].x,e[t].y),this.lineTo(e[(t+1)%4].x,e[(t+1)%4].y);this.endFill()},Mb.prototype.fillBox=function(t){const e=t.getSize();this.drawRect(t.min.x,t.min.y,e.x,e.y)},Mb.prototype.drawLine=function(t){if(this.beginFill(),t instanceof _g)this.moveTo(t.start.x,t.start.y),this.lineTo(t.end.x,t.end.y);else for(let e=0;e<t.length-1;e++)this.moveTo(t[e].x,t[e].y),this.lineTo(t[e+1].x,t[e+1].y);this.endFill()};var Jx=class extends hg{constructor(t){super(),f(this,"safeAreaPreview",!1),f(this,"interactive",!1),f(this,"box",new Eg),f(this,"graphics",new Mb),f(this,"SDkUtils"),this.SDkUtils=t,this.type="preference"}initialize(){throw new Error("Method not implemented.")}preparationAction(){}preAction(){}action(){}endAction(){}interruption(){}actionKey(){}endActionKey(){}cancelPreparation(){}refreshResults(){this.box=new Eg;const{data:t,container:e}=this.SDkUtils;if(t&&e){const{zoom:i}=t.property,{offsetWidth:r,offsetHeight:n}=e,s=new xg(r,n).multiply(i),o=this.SDkUtils.getViewportLeftTopPosition().add(s.clone().divide(2));this.box=(new Eg).setFromCenterAndSize(o,s)}}setSafeAreaPreviewEnabled(t){this.safeAreaPreview=t}refreshRenderObjects(){this.graphics=new Mb;const{offsetWidth:t,offsetHeight:e}=this.SDkUtils.container.parentElement,i=new Eg(new xg(0,0),new xg(t,this.box.min.y)),r=new Eg(new xg(0,this.box.min.y),new xg(this.box.min.x,e)),n=new Eg(new xg(this.box.min.x,this.box.max.y),new xg(t,e)),s=new Eg(new xg(this.box.max.x,this.box.min.y),new xg(t,this.box.max.y));if(this.graphics.beginFill(tb,eb),this.graphics.fillBox(i),this.graphics.fillBox(r),this.graphics.fillBox(n),this.graphics.fillBox(s),this.graphics.endFill(),this.safeAreaPreview){Xt(this.SDkUtils.data,"You must call SDK#run() first");const{viewProperties:t,activeData:e}=this.SDkUtils.data,i=t[e.view??-1];if(i){const{size:t,safeArea:e}=i,[r,n,s,o]=e.size,a=this.box.getSize(),h=r/t[1]*a.y,u=s/t[0]*a.x,l=o/t[0]*a.x,c=n/t[1]*a.y,{min:f,max:d}=this.box;this.graphics.beginFill(ib,rb);const p=new Eg(f,new xg(d.x,f.y+h)),m=new Eg(new xg(f.x,f.y+h),new xg(f.x+u,d.y)),v=new Eg(new xg(d.x-l,f.y+h),new xg(d.x,d.y)),y=new Eg(new xg(f.x+u,d.y-c),new xg(d.x-l,d.y));this.graphics.fillBox(p),this.graphics.fillBox(m),this.graphics.fillBox(v),this.graphics.fillBox(y),this.graphics.endFill()}}this.graphics.lineStyle($g,Jg),this.graphics.drawBox(this.box)}getRenderObjects(){return this.refreshRenderObjects(),[this.graphics]}},$x=class{constructor(t){f(this,"wireframeApplication"),f(this,"gizmos",[]),f(this,"activeGizmo"),f(this,"selectorGizmo"),f(this,"transformGizmo"),f(this,"controlGizmo"),f(this,"preferenceGizmo"),f(this,"spaceClickTime"),f(this,"spaceEmit",!1),f(this,"isPlaying",!1),f(this,"clickButtons",0),f(this,"clickTime",0),f(this,"firstClick",!0),f(this,"dblclickTimeSpan",500),this.gizmos=[];const{width:e,height:i}=t.getBoundingClientRect();this.wireframeApplication=new ag({backgroundAlpha:0,width:e,height:i,resolution:1,antialias:!0}),this.wireframeApplication.view.style.position="absolute",this.wireframeApplication.view.id="wireframeApplicationCanvas",t.appendChild(this.wireframeApplication.view),this.wireframeApplication.stage.sortableChildren=!0,this.registerViewEvent()}refresh(){this.gizmos.forEach(t=>{t.refreshResults()})}render(){this.refresh(),this.wireframeApplication.stage.removeChildren();const t=(this.isPlaying?[this.preferenceGizmo]:this.gizmos).flatMap(t=>t.getRenderObjects());this.wireframeApplication.stage.addChild(...t),this.wireframeApplication.render()}init(t){this.controlGizmo=new nb(t),this.selectorGizmo=new Db(t);const e=new Lb;this.transformGizmo=new Fb(t,e),this.preferenceGizmo=new Jx(t),this.gizmos.push(this.transformGizmo,this.selectorGizmo,this.controlGizmo,this.preferenceGizmo,e),this.initEvents()}initEvents(){this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp)}registerViewEvent(){this.wireframeApplication.view.onmousedown=t=>{this.onMouseDown(t)},this.wireframeApplication.view.onmousemove=t=>{0===t.buttons&&this.onMouseMove(t)},this.wireframeApplication.view.onmouseout=()=>{this.selectorGizmo?.cancelPreparation(),this.render()},this.wireframeApplication.view.onwheel=t=>{this.onWheel(t)}}onMouseDown(t){if(this.clickButtons=t.buttons,this.firstClick=!!this.firstClick&&Date.now()-this.clickTime<this.dblclickTimeSpan,this.firstClick){this.gizmos.forEach(e=>{if(e.interactive)if(void 0===this.activeGizmo){const i=e.preparationAction(t);this.activeGizmo=this.gizmos.find(t=>t.type===i)}else e.cancelPreparation()}),this.activeGizmo=void 0;const e=this.selectorGizmo?.preAction(t);this.activeGizmo=this.gizmos.find(t=>t.type===(e??"null")),this.firstClick=!1}else{void 0===this.activeGizmo&&this.gizmos.forEach(e=>{if(!e.interactive||this.activeGizmo)return;const i=e.preparationAction(t);this.activeGizmo=this.gizmos.find(t=>t.type===i)});const e=this.activeGizmo?.preAction(t);"selector"!==e&&this.selectorGizmo&&(this.selectorGizmo.clearResult=!0),this.activeGizmo=this.gizmos.find(t=>t.type===e),this.clickTime=Date.now(),this.firstClick=!0}this.render(),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)}onMouseMove(t){0!==t.buttons?this.activeGizmo?.action(t):this.spaceEmit||(this.activeGizmo=void 0,this.gizmos.forEach(e=>{if(e.interactive)if(void 0===this.activeGizmo){const i=e.preparationAction(t);"selector"!==i&&this.selectorGizmo&&(this.selectorGizmo.clearResult=!0),this.activeGizmo=this.gizmos.find(t=>t.type===i)}else e.cancelPreparation()})),this.render()}onWheel(t){t.preventDefault(),this.selectorGizmo&&(this.selectorGizmo.clearResult=!0),this.controlGizmo?.action(t)}onMouseUp(t){const e=this.activeGizmo?.endAction(t);this.activeGizmo=this.gizmos.find(t=>t.type===e),void 0===this.activeGizmo&&1===this.clickButtons&&this.gizmos.forEach(e=>{if(e.interactive)if(void 0===this.activeGizmo){const i=e.preparationAction(t);this.activeGizmo=this.gizmos.find(t=>t.type===i)}else e.cancelPreparation()}),this.clickButtons=0,this.render(),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)}onKeyDown(t){if("space"!==t.code.toLocaleLowerCase()||this.activeGizmo?.active)this.gizmos.forEach(e=>{e.actionKey(t)});else{if(this.spaceEmit)return;void 0===this.spaceClickTime?this.spaceClickTime=Date.now():Date.now()-this.spaceClickTime>300&&(this.spaceEmit=!0,this.activeGizmo=this.controlGizmo,this.activeGizmo?.actionKey(t))}this.render()}onKeyUp(t){this.gizmos.forEach(e=>{e.endActionKey(t)}),"space"===t.code.toLocaleLowerCase()&&(this.spaceClickTime=void 0,this.spaceEmit=!1),this.render()}setAdsorptionEnabled(t){this.transformGizmo?.setAdsorptionEnabled(t)}setSafeAreaPreviewEnabled(t){this.preferenceGizmo?.setSafeAreaPreviewEnabled(t)}};var t_=class{constructor(t){f(this,"plane",new Ig),f(this,"ray",new Rg),f(this,"viewportParam",{width:0,height:0,viewWidth:0,viewHeight:0,panelWidth:0,panelHeight:0,scale:1,ratio:1,translation:new xg,rulerWidth:0}),f(this,"cameraParam",{position:new Sg,rotation:new Sg,focusPosition:new Sg,focusRotation:new Sg,viewProjectionMatrix:new Ag,inverseViewProjectionMatrix:new Ag}),f(this,"SDKUtils"),this.SDKUtils=t}refreshViewParam(){Xt(this.SDKUtils.data,"You must run SDK first");const t=new xg(this.SDKUtils.container.offsetWidth,this.SDKUtils.container.offsetHeight),{zoom:e,translation:i}=this.SDKUtils.data?.property;this.viewportParam.width=t.x,this.viewportParam.height=t.y,this.viewportParam.viewWidth=t.x,this.viewportParam.viewHeight=t.y,this.viewportParam.panelWidth=t.x,this.viewportParam.panelHeight=t.y,this.viewportParam.scale=e,this.viewportParam.ratio=1,this.viewportParam.translation=i.clone().divide(e),this.viewportParam.rulerWidth=0}refreshCameraParam(){const{player:t}=this.SDKUtils,e=t?.getCompositions()?.[0]?.camera;if(e){const t=Ag.fromArray(e.getViewProjectionMatrix().toArray()),i=Ag.fromArray(e.getViewMatrix().toArray()).invert(),r=new Tg;i.decompose(this.cameraParam.position,r,new Sg),this.cameraParam.rotation=(new Og).setFromQuaternion(r).toDegreeVector3(),this.cameraParam.focusPosition=new Sg(...this.cameraParam.position.toVector2().toArray(),this.cameraParam.position.z>0?0:2*this.cameraParam.position.z),this.cameraParam.focusPosition.applyEuler((new Og).setFromDegreeVector3(this.cameraParam.rotation.clone()),this.cameraParam.position),this.cameraParam.focusRotation=(new Og).setFromQuaternion(r.invert()).toDegreeVector3(),this.cameraParam.viewProjectionMatrix=t,this.cameraParam.inverseViewProjectionMatrix=Ag.fromArray(e.getInverseViewProjectionMatrix().toArray())}}initInteractionPlane(t,e){t??(t=this.cameraParam.focusPosition),e??(e=(new Og).setFromDegreeVector3(this.cameraParam.rotation));const i=new Sg(0,0,1).applyEuler(e);this.plane.setFromNormalAndCoplanarPoint(t,i)}getWorldSizeByViewSize(t,e=!0,i){const r=e||!i?(new Og).setFromDegreeVector3(this.cameraParam.rotation):(new Og).setFromQuaternion((new Tg).setFromRotationMatrix(this.SDKUtils.getItemTransformById(i.id).matrix)),n=i?(new Sg).setFromMatrixPosition(this.SDKUtils.getItemTransformById(i.id).matrix):this.cameraParam.focusPosition,s=this.projectPoint(n.clone()),o=this.getWorldPositionByViewPoint(s.add(t));if(!o)return console.warn("size is out of bounds."),new Sg(0,0,0);const a=(new Og).setFromQuaternion((new Tg).setFromEuler(r).invert());return(e||!i?o.applyEuler(a,n):o).subtract(n)}projectPoint(t){const{panelWidth:e,panelHeight:i,scale:r}=this.viewportParam,n=this.SDKUtils.getViewportLeftTopPosition();return(new xg).copyFrom(t.applyMatrix(this.cameraParam.viewProjectionMatrix).toVector2()).toViewCoordinate(e*r,i*r).add(n)}getWorldPositionByViewPoint(t){const{position:e,inverseViewProjectionMatrix:i}=this.cameraParam,r=this.getViewPositionByScreenPosition(t),n=(new Pg).setFromCamera(r,{position:e,inverseViewProjectMatrix:i}).rayCastPlane(this.plane);return n?.point}getViewPositionByScreenPosition(t){const{panelWidth:e,panelHeight:i,rulerWidth:r}=this.viewportParam;return new xg((t.x-r)/e*2-1,-(t.y-r)/i*2+1)}getScreenSizeByPixelSize(t){const e=this.viewportParam.width/this.viewportParam.viewWidth,i=t.clone();return i.multiply(e||1),i}getPixelSizeByScreenSize(t){const e=this.viewportParam.viewWidth/this.viewportParam.width,i=t.clone();return i.multiply(e||1),i}},e_=class{constructor(t,e,i,r){f(this,"player"),f(this,"data"),f(this,"container"),f(this,"emitter"),f(this,"interactionUtils"),this.player=t,this.data=r,this.container=e,this.emitter=i}init(t){this.data=t,this.interactionUtils=new t_(this)}getCurrentComposition(){return this.player.getCompositions()[0]}isItemSelected(t){return!!this.data?.activeData.selectedItems?.find(e=>e===t)}getItemEditEnable(t){const e=this.getViewItemById(t);if(!e||!this.data)return!1;const i=this.data.time,{duration:r,delay:n,endBehavior:s}=e;return i>=n&&(i<n+r||s===qi.EndBehavior.restart)}getItemShow(t){const e=this.getViewItemById(t);if(!e||!this.data)return!1;const i=this.data.time,{duration:r,delay:n,endBehavior:s}=e;return i>=n&&(i<n+r||s===qi.EndBehavior.restart||s===qi.EndBehavior.freeze)}addSelectedItems(t){var e;Xt(this.data,"You must call SDK#run() first"),(e=this.data.activeData).selectedItems??(e.selectedItems=[]),t.forEach(t=>{var e,i;e=this.data?.activeData.selectedItems??[],i=t,e.includes(i)||e.push(i)}),this.emitter.emit("selectedItemChange",t)}clearSelectedItems(){this.data&&(this.data.activeData.selectedItems=[],this.emitter.emit("selectedItemChange",[]))}getSelectedItems(){const t=this.data?.activeData.selectedItems;return this.data?.items.filter(e=>t?.find(t=>t===e.id))??[]}addPreSelectedItem(t){Xt(this.data,"You must call SDK#run() first"),this.data.activeData.preSelectedItem=t,this.emitter.emit("preSelectedItemChange",t)}clearPreSelectedItem(){Xt(this.data,"You must call SDK#run() first"),this.data.activeData.preSelectedItem=void 0,this.emitter.emit("preSelectedItemChange",void 0)}getPreSelectedItem(){Xt(this.data,"You must call SDK#run() first");const t=this.data.activeData.preSelectedItem;return t?this.getViewItemById(t):void 0}getViewItemById(t){return this.data?.items.find(e=>e.id===t)}async loadScene(t){this.player.destroyCurrentCompositions();const e=this.data?.viewProperties[t];if(!e||!this.data)return void console.warn(`This page does not have ${t} view property.`);const{scene:i,size:[r,n]}=e,s=this.container.parentElement?.offsetWidth??300,o=this.container.parentElement?.offsetHeight??300;let a=o,h=a/n*r;h>s&&(a=s/h*o,h=s),this.container.style.width=`${h}px`,this.container.style.height=`${a}px`,this.data.activeData={view:t,selectedItems:[],preSelectedItem:void 0},this.player.resize();const u=JSON.parse(JSON.stringify(i)),l=await this.player.loadScene(u,{autoplay:!1});this.player.gotoAndStop(this.data.time),this.interactionUtils.refreshViewParam(),this.interactionUtils.refreshCameraParam(),this.data.items=[],this.addViewItemsByItems(this.data.items,l.items),this.emitter.emit("pageDataChange",this.data)}refreshPageTime(t){Xt(this.data,"You must call SDK#run() first"),this.data.time=t}pageZoom(t){var e;Xt(this.data,"You must call SDK#run() first");const{zoom:i}=this.data.property;(e=this.data.property).zoom??(e.zoom=1);const r=lg(t,-.1,.1),n=lg(i+r,.3,10);this.data.property.zoom=n,this.container.style.scale=`${n}`,this.emitter.emit("zoomChange",n)}setPageZoom(t){Xt(this.data,"You must call SDK#run() first");const e=lg(t,.3,10);this.data.property.zoom=e,this.container.style.scale=`${e}`,this.emitter.emit("zoomChange",t)}refreshInteractionParam(){this.interactionUtils.refreshViewParam(),this.interactionUtils.refreshCameraParam()}pageMove(t){var e;Xt(this.data,"You must call SDK#run() first"),(e=this.data.property).translation??(e.translation=new xg);const{x:i,y:r}=this.data.property.translation.add(t);this.refreshInteractionParam(),this.container.style.translate=`${i}px ${r}px`,this.emitter.emit("pageDataChange",this.data)}rotateItem(t,e){const i=this.player.getCompositions()[0],r=i?.items.filter(e=>e.id===t)?.[0];r&&(r.rotate(...e.toArray()),this.transformSceneItem(t,"rotation",e.toArray()),this.refreshViewItem(t),this.emitter.emit("itemPropertyChange",{id:t,property:"rotation"}))}moveItem(t,e){const i=this.player.getCompositions()[0],r=i?.items.filter(e=>e.id===t)?.[0];if(r){const i=(new Ag).copyFrom(r.transform.getParentMatrix()??new Ag);i.setPosition(new Sg);const n=e.clone().applyMatrix(i.invert());r.translate(...n.toArray()),this.transformSceneItem(t,"position",n.toArray()),this.refreshViewItem(t),this.emitter.emit("itemPropertyChange",{id:t,property:"translation"})}}scaleItem(t,e){const i=this.player.getCompositions()[0],r=i?.items.filter(e=>e.id===t)?.[0];r&&(r.scale(...e.toArray()),this.transformSceneItem(t,"scale",e.toArray()),this.refreshViewItem(t),this.emitter.emit("itemPropertyChange",{id:t,property:"scale"}))}getItemTransformById(t){const e={matrix:new Ag,parentMatrix:new Ag},i=this.player.getCompositions()[0]?.items.find(e=>e.id===t);if(void 0!==i?.transform){i.transform.updateLocalMatrix();const t=Ag.fromArray(i.composition?.transform.getWorldMatrix().elements??[]).invert();e.matrix=t.clone().multiply(Ag.fromArray(i.transform.getWorldMatrix().elements)),e.parentMatrix=t.clone().multiply(Ag.fromArray(i.transform.parentTransform?.getWorldMatrix().elements??(new Ag).toArray()))}return e}addViewItemsByItems(t,e,i){const r=e=>{e.forEach(e=>{t.find(t=>t.id===e.id)||t.push(this.createViewItemByPlayerItem(e,i))})};for(const i of e)r([i]),this.addViewItemsByItems(t,i.children,i.id)}createViewItemByPlayerItem(t,e){Xt(this.data,"You must call SDK#run() first");const{transform:i,composition:r}=t;i.updateLocalMatrix();const n=(new Ag).copyFrom(r?.transform.getWorldMatrix()??(new Ag).identity()).invert().multiply(i.getWorldMatrix()),s=new Sg,o=new Tg,a=new Sg;n.decompose(s,o,a);const h=(new Og).setFromQuaternion(o).toDegreeVector3();h.x=Number.isNaN(h.x)?0:h.x,h.y=Number.isNaN(h.y)?0:h.y,h.z=Number.isNaN(h.z)?0:h.z;const u={position:s.toArray(),rotation:h.toArray(),scale:a.toArray(),keyPropertyEditing:!1};switch(t.type){case qi.ItemType.sprite:{const e=this.getActiveScene()?.scene;if(e){e.components.filter(e=>e.item.id===t.id).forEach(t=>{if(u.keyPropertyEditing||!("renderer"in t))return;const i=e.textures?.find(e=>e.id===t.renderer.texture.id);if(i&&"source"in i&&i.source){const t=e?.images.find(t=>t.id===i.source.id);u.keyPropertyEditing=!!t?.template;const r=t?.url??"";r&&Object.assign(u,{image:r})}})}break}case qi.ItemType.text:case qi.ItemType.richtext:{const e=this.getActiveScene()?.scene;if(u.keyPropertyEditing=!0,e){e.components.filter(e=>e.item.id===t.id).forEach(t=>{if(![qi.DataType.TextComponent,qi.DataType.RichTextComponent].includes(t.dataType))return;const{textAlign:e,textColor:i,text:r,fontWeight:n,fontFamily:s}=t.options;Object.assign(u,{alignment:e,color:i,weight:n,text:r,font:s})})}break}}return{id:t.id,name:t.name,parentId:t.parentId??e,children:[],type:t.type,duration:t.duration,delay:t.start,endBehavior:t.endBehavior,property:u}}getViewBoxById(t){const e=new Eg,i=this.player.getCompositions()[0]?.items.find(e=>e.id===t),r=this.player.getCompositions()[0]?.items.filter(e=>e.parentId===t);return i&&r?this.getViewBoxByPlayerItem(i,r):e}getViewBoxByPlayerItem(t,e){const i=new Eg;switch(t.type){case qi.ItemType.sprite:case qi.ItemType.plugin:case qi.ItemType.video:case qi.ItemType.richtext:case qi.ItemType.text:case qi.ItemType.shape:{const{transform:r,composition:n}=t;r.updateLocalMatrix();const{size:s}=r,o=(new Ag).copyFrom(n?.transform.getWorldMatrix()??new Ag).invert().multiply(r.getWorldMatrix()),{x:a,y:h}=s.clone().divide(2),u=new Sg(a,h,0).applyMatrix(o),l=new Sg(a,-h,0).applyMatrix(o),c=new Sg(-a,-h,0).applyMatrix(o),f=new Sg(-a,h,0).applyMatrix(o),d=this.interactionUtils.projectPoint(u).round(2),p=this.interactionUtils.projectPoint(l).round(2),m=this.interactionUtils.projectPoint(c).round(2),v=this.interactionUtils.projectPoint(f).round(2);i.setFromVec2Array([d,p,m,v]);const y=e?.map(t=>this.getViewBoxById(t.id));y&&y.map(t=>i.union(t));break}case qi.ItemType.null:{const t=e?.map(t=>this.getViewBoxById(t.id));t&&t.map(t=>i.union(t));break}}return i}getViewBoxByHeadlessPlayerItem(t,e,i){const r=new Eg,{transform:n,composition:s}=t;switch(t.type){case qi.ItemType.sprite:case qi.ItemType.plugin:case qi.ItemType.video:case qi.ItemType.richtext:case qi.ItemType.text:case qi.ItemType.shape:{n.updateLocalMatrix();const{size:t}=n,o=(new Ag).copyFrom(s?.transform.getWorldMatrix()??new Ag).invert().multiply(n.getWorldMatrix()),{x:a,y:h}=t.clone().divide(2),u=new Sg(a,h,0).applyMatrix(o),l=new Sg(a,-h,0).applyMatrix(o),c=new Sg(-a,-h,0).applyMatrix(o),f=new Sg(-a,h,0).applyMatrix(o),d=i(u).round(2),p=i(l).round(2),m=i(c).round(2),v=i(f).round(2);r.setFromVec2Array([d,p,m,v]);const y=e?.map(t=>{const e=s?.items.filter(e=>e.parentId===t.id)??[];return this.getViewBoxByHeadlessPlayerItem(t,e,i)});y&&y.map(t=>r.union(t));break}case qi.ItemType.null:{const t=e?.map(t=>{const e=s?.items.filter(e=>e.parentId===t.id)??[];return this.getViewBoxByHeadlessPlayerItem(t,e,i)});t&&t.map(t=>r.union(t));break}}return r}getViewportLeftTopPosition(){if(!this.data)return new xg;const{zoom:t,translation:e}=this.data.property,{offsetWidth:i,offsetHeight:r}=this.container.parentElement,{offsetWidth:n,offsetHeight:s}=this.container,o=new xg(i,r),a=new xg(n,s).multiply(t);return o.clone().divide(2).subtract(a.clone().divide(2)).add(e)}getContainerPosition(){const{offsetWidth:t,offsetHeight:e}=this.container.parentElement;return new xg(t/2,e/2).add(this.data?.property.translation??new xg)}getViewportByViewPoint(t){if(!this.data)return t;const{zoom:e}=this.data.property,{offsetWidth:i,offsetHeight:r}=this.container,n=new xg(i,r).multiply(e),s=this.getViewportLeftTopPosition(),o=t.clone().subtract(s);return new xg(o.x/n.x*2-1,1-o.y/n.y*2)}getActiveScene(){return this.data?.viewProperties[this.data?.activeData.view??-1]}async changeItemProperty(t){Xt(this.data,"You must call SDK#run() first");const e=this.getViewItemById(t.itemId),i=this.player.getCompositions()[0]?.items.find(e=>e.id===t.itemId);if(e&&i)if(t.propertyName in e.property){switch(t.propertyName){case"alignment":[qi.TextAlignment.left,qi.TextAlignment.middle,qi.TextAlignment.right].includes(t.propertyValue)&&i.getComponent(Sl).setTextAlign(t.propertyValue);break;case"color":Array.isArray(t.propertyValue)&&4===t.propertyValue.length&&i.getComponent(Sl).setColor(t.propertyValue);break;case"font":if("string"==typeof t.propertyValue){const e=t.propertyValue.split("/"),r=e[e.length-1]?.split(".")[0],n=this.player.getAssetManager()[0];await n.processFontURL([{fontURL:t.propertyValue,fontFamily:r}]),r&&i.getComponent(Sl).setFontFamily(r)}break;case"text":"string"==typeof t.propertyValue&&i.getComponent(Sl).setText(t.propertyValue);break;case"weight":[qi.TextWeight.normal,qi.TextWeight.bold,qi.TextWeight.lighter].includes(t.propertyValue)&&i.getComponent(Sl).setFontWeight(t.propertyValue);break;case"image":"string"==typeof t.propertyValue&&i.getComponent(Lu).setTexture(await an.fromImage(t.propertyValue,this.player.renderer.engine));break;case"position":if(Array.isArray(t.propertyValue)&&3===t.propertyValue.length){const r=t.propertyValue.map((t,i)=>t-(e.property.position[i]??0));i.translate(...r)}break;case"rotation":if(Array.isArray(t.propertyValue)&&3===t.propertyValue.length){const r=t.propertyValue.map((t,i)=>t-(e.property.rotation[i]??0));i.rotate(...r)}break;case"scale":if(Array.isArray(t.propertyValue)&&3===t.propertyValue.length){const r=t.propertyValue.map(t=>0===t||null===t?1:t),n=e.property.scale.map(t=>t||1),s=r.map((t,e)=>t/n[e]);i.scale(...s)}}this.changeViewItemProperty(t),this.player.gotoAndStop(this.data.time),this.refreshViewItem(t.itemId)}else console.warn(`Item does not have property ${t.propertyName}.`);else console.warn(`Id ${t.itemId} is not a item id.`)}changeViewItemProperty(t){Xt(this.data,"You must call SDK#run() first"),this.data.viewProperties.forEach((e,i)=>{if(!this.data?.property.sync&&i!==this.data?.activeData.view)return;const{scene:r}=e;switch(t.propertyName){case"position":case"rotation":if(Array.isArray(t.propertyValue)&&3===t.propertyValue.length){const e=this.data.items.find(e=>e.id===t.itemId),i=e?.property[t.propertyName],n=t.propertyValue.map((t,e)=>t-(i?.[e]??0));this.changeSceneItemProperty(r,{...t,propertyValue:n})}break;case"scale":if(Array.isArray(t.propertyValue)&&3===t.propertyValue.length){const e=this.data.items.find(e=>e.id===t.itemId),i=e?.property[t.propertyName],n=t.propertyValue.map((t,e)=>t/(i?.[e]??0));this.changeSceneItemProperty(r,{...t,propertyValue:n})}break;default:this.changeSceneItemProperty(r,t)}})}changeSceneItemProperty(t,e){switch(e.propertyName){case"alignment":if([qi.TextAlignment.left,qi.TextAlignment.middle,qi.TextAlignment.right].includes(e.propertyValue)){const i=t.components.find(t=>t.item.id===e.itemId&&[qi.DataType.TextComponent,qi.DataType.RichTextComponent].includes(t.dataType));i?.options&&"textAlign"in i.options&&(i.options.textAlign=e.propertyValue)}break;case"color":if(Array.isArray(e.propertyValue)&&4===e.propertyValue.length){const i=t.components.find(t=>t.item.id===e.itemId&&[qi.DataType.TextComponent,qi.DataType.RichTextComponent].includes(t.dataType));i?.options&&(i.options.textColor=[...e.propertyValue])}break;case"font":if("string"==typeof e.propertyValue){const i=e.propertyValue.split("/"),r=i[i.length-1]?.split(".")[0],n=t.fonts?.find(t=>"family"in t&&t.family===r||"fontFamily"in t&&t.fontFamily===r);!n&&t.fonts&&r&&t.fonts.push({fontFamily:r,fontURL:e.propertyValue});const s=t.components.find(t=>t.item.id===e.itemId&&[qi.DataType.TextComponent,qi.DataType.RichTextComponent].includes(t.dataType));s?.options&&(s.options.fontFamily=r)}break;case"text":if("string"==typeof e.propertyValue){const i=t.components.find(t=>t.item.id===e.itemId&&[qi.DataType.TextComponent,qi.DataType.RichTextComponent].includes(t.dataType));i?.options&&(i.options.text=e.propertyValue)}break;case"weight":if("string"==typeof e.propertyValue){const i=t.components.find(t=>t.item.id===e.itemId&&[qi.DataType.TextComponent,qi.DataType.RichTextComponent].includes(t.dataType));i?.options&&(i.options.fontWeight=e.propertyValue)}break;case"image":if("string"==typeof e.propertyValue){t.components.filter(t=>t.item.id===e.itemId).forEach(i=>{if(!("renderer"in i))return;const r=t.textures?.find(t=>t.id===i.renderer.texture.id);if(r&&"source"in r&&r.source){const i=t?.images.find(t=>t.id===r.source.id);i?.url&&i?.webp&&(i.url=e.propertyValue,i.webp=e.propertyValue)}})}break;case"position":if(Array.isArray(e.propertyValue)&&3===e.propertyValue.length){const i=t.items.find(t=>t.id===e.itemId);i?.transform&&(i.transform.position.x+=e.propertyValue[0],i.transform.position.y+=e.propertyValue[1],i.transform.position.z+=e.propertyValue[2])}break;case"rotation":if(Array.isArray(e.propertyValue)&&3===e.propertyValue.length){const i=t.items.find(t=>t.id===e.itemId);i?.transform&&(i.transform.eulerHint.x+=e.propertyValue[0],i.transform.eulerHint.y+=e.propertyValue[1],i.transform.eulerHint.z+=e.propertyValue[2])}break;case"scale":if(Array.isArray(e.propertyValue)&&3===e.propertyValue.length){const i=t.items.find(t=>t.id===e.itemId);i?.transform&&(i.transform.scale.x*=e.propertyValue[0],i.transform.scale.y*=e.propertyValue[1],i.transform.scale.z*=e.propertyValue[2])}}}transformSceneItem(t,e,i){Xt(this.data,"You must call SDK#run() first"),this.data.viewProperties.forEach((r,n)=>{if(!this.data?.property.sync&&n!==this.data?.activeData.view)return;const{scene:s}=r;switch(e){case"position":if(Array.isArray(i)&&3===i.length){const e=s.items.find(e=>e.id===t);e?.transform&&(e.transform.position.x+=i[0],e.transform.position.y+=i[1],e.transform.position.z+=i[2])}break;case"rotation":if(Array.isArray(i)&&3===i.length){const e=s.items.find(e=>e.id===t);e?.transform&&(e.transform.eulerHint.x+=i[0],e.transform.eulerHint.y+=i[1],e.transform.eulerHint.z+=i[2])}break;case"scale":if(Array.isArray(i)&&3===i.length){const e=s.items.find(e=>e.id===t);e?.transform&&(e.transform.scale.x*=i[0],e.transform.scale.y*=i[1],e.transform.scale.z*=i[2])}}})}refreshViewItem(t){Xt(this.data,"You must call SDK#run() first");const e=this.data.items.findIndex(e=>e.id===t);if(e<0)return void console.log(`item ${t} is not existed.`);const i=this.data.items[e],r=this.getPlayerItemById(t);r&&i&&(this.data.items[e]=this.createViewItemByPlayerItem(r,i.parentId))}getPlayerItemById(t){return this.player.getCompositions()[0]?.items.find(e=>e.id===t)}async keepSceneSafe(t,e,i,r,n){const s=JSON.parse(JSON.stringify(e));await t.loadScene(s,{reusable:!0,autoplay:!1}),t.gotoAndStop(i);const o=t.getCompositions()[0];if(o){const t=(t,e,i)=>{const{z:r}=i.transform.getWorldPosition(),{x:n,y:s}=o.camera.getInverseVPRatio(r);i.transform.translate(2*t*n/f,-2*e*s/d,0)},i=t=>{const e=(new Ag).copyFrom(o.camera.getViewProjectionMatrix());return(new xg).copyFrom(t.applyMatrix(e).toVector2()).toViewCoordinate(...r)},[s,a]=r,{size:[h,u,l,c]}=n,f=s-l-c,d=a-h-u,p=[f/s,d/a],m=[(l-c)/2,(h-u)/2],v=o.items.filter(t=>t.name.includes("k-")),y=(new Eg).setFromCenterAndSize(new xg(s,a).divide(2).add(new xg(...m)),new xg(f,d));v.forEach(r=>{const n=o.items.filter(t=>t.parentId===r.id),s=r.transform.position.clone(),a=r.transform.scale.clone();r.scale(...p,1),t(...m,r),r.transform.updateLocalMatrix();const h=this.getViewBoxByHeadlessPlayerItem(r,n,i);if(!y.containsBox(h)){const{min:e,max:i}=h,{min:n,max:s}=y,o=[0,0];o[0]+=e.x<n.x?n.x-e.x:0,o[0]+=i.x>s.x?s.x-i.x:0,o[1]+=e.y<n.y?n.y-e.y:0,o[1]+=i.y>s.y?s.y-i.y:0,t(...o,r),r.transform.updateLocalMatrix()}const u=r.transform.position.clone(),l=r.transform.scale.clone(),c=u.subtract(s).toArray(),f=l.divide(a).toArray();this.changeSceneItemProperty(e,{itemId:r.id,type:r.type,propertyName:"position",propertyValue:c}),this.changeSceneItemProperty(e,{itemId:r.id,type:r.type,propertyName:"scale",propertyValue:f})})}return e}},i_=c(pt(),1);function r_(t,e="asserts failed"){if(!t)throw new Error(e)}function n_(t,e,...i){const r=e.reduce((t,e)=>t?`${t} ${e}`:e,""),n="color: #108ee9;";switch(t){case"error":console.error(`%c[${r}]`,n,...i);break;case"info":console.info(`%c[${r}]`,n,...i);break;case"debug":console.debug(`%c[${r}]`,n,...i);break;case"warn":console.warn(`%c[${r}]`,n,...i);break;default:console.log(`%c[${r}]`,n,...i)}}var s_,o_,a_="APNG",h_="MP4",u_="GIF",l_="AlphaMaskVideo",c_=class{constructor(t){f(this,"sampleRate"),f(this,"duration"),f(this,"channels");const{sampleRate:e=44100,duration:i=1,channels:r=2}=t??{};this.sampleRate=e,this.duration=i,this.channels=r}getBuffer(){const t=this.sampleRate*this.duration*this.channels*2,e=44+t,i=new ArrayBuffer(e),r=new DataView(i);let n=0;const s=t=>{for(let e=0;e<t.length;e++)r.setUint8(n++,t.charCodeAt(e))},o=t=>{r.setUint32(n,t,!0),n+=4},a=t=>{r.setUint16(n,t,!0),n+=2};s("RIFF"),o(e-8),s("WAVE"),s("fmt "),o(16),a(1),a(this.channels),o(this.sampleRate),o(this.sampleRate*this.channels*2),a(2*this.channels),a(16),s("data"),o(t);for(let e=0;e<t;e++)r.setUint8(n++,0);return new Uint8Array(i)}};(o_=s_||(s_={})).LOAD="LOAD",o_.EXEC="EXEC",o_.FFPROBE="FFPROBE",o_.WRITE_FILE="WRITE_FILE",o_.READ_FILE="READ_FILE",o_.DELETE_FILE="DELETE_FILE",o_.RENAME="RENAME",o_.CREATE_DIR="CREATE_DIR",o_.LIST_DIR="LIST_DIR",o_.DELETE_DIR="DELETE_DIR",o_.ERROR="ERROR",o_.DOWNLOAD="DOWNLOAD",o_.PROGRESS="PROGRESS",o_.LOG="LOG",o_.MOUNT="MOUNT",o_.UNMOUNT="UNMOUNT";var f_,d_,p_,m_,v_,y_,g_,b_,x_,__=(()=>{let t=0;return()=>t++})(),E_=(new Error("unknown message type"),new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first")),w_=new Error("called FFmpeg.terminate()"),T_=(new Error("failed to import ffmpeg-core.js"),{}),S_=class{constructor(){m(this,f_,null),m(this,d_,{}),m(this,p_,{}),m(this,m_,[]),m(this,v_,[]),f(this,"loaded",!1),m(this,y_,()=>{p(this,f_)&&(p(this,f_).onmessage=({data:{id:t,type:e,data:i}})=>{switch(e){case s_.LOAD:this.loaded=!0,p(this,d_)[t](i);break;case s_.MOUNT:case s_.UNMOUNT:case s_.EXEC:case s_.FFPROBE:case s_.WRITE_FILE:case s_.READ_FILE:case s_.DELETE_FILE:case s_.RENAME:case s_.CREATE_DIR:case s_.LIST_DIR:case s_.DELETE_DIR:p(this,d_)[t](i);break;case s_.LOG:p(this,m_).forEach(t=>t(i));break;case s_.PROGRESS:p(this,v_).forEach(t=>t(i));break;case s_.ERROR:p(this,p_)[t](i)}delete p(this,d_)[t],delete p(this,p_)[t]})}),m(this,g_,({type:t,data:e},i=[],r)=>p(this,f_)?new Promise((n,s)=>{const o=__();p(this,f_)&&p(this,f_).postMessage({id:o,type:t,data:e},i),p(this,d_)[o]=n,p(this,p_)[o]=s,r?.addEventListener("abort",()=>{s(new DOMException(`Message # ${o} was aborted`,"AbortError"))},{once:!0})}):Promise.reject(E_)),f(this,"load",({classWorkerURL:t,...e}={},{signal:i}={})=>(p(this,f_)||(v(this,f_,t?new Worker(new URL(t,T_.url),{type:"module"}):new Worker(new URL("./worker.js",T_.url),{type:"module"})),p(this,y_).call(this)),p(this,g_).call(this,{type:s_.LOAD,data:e},void 0,i))),f(this,"exec",(t,e=-1,{signal:i}={})=>p(this,g_).call(this,{type:s_.EXEC,data:{args:t,timeout:e}},void 0,i)),f(this,"ffprobe",(t,e=-1,{signal:i}={})=>p(this,g_).call(this,{type:s_.FFPROBE,data:{args:t,timeout:e}},void 0,i)),f(this,"terminate",()=>{const t=Object.keys(p(this,p_));for(const e of t)p(this,p_)[e](w_),delete p(this,p_)[e],delete p(this,d_)[e];p(this,f_)&&(p(this,f_).terminate(),v(this,f_,null),this.loaded=!1)}),f(this,"writeFile",(t,e,{signal:i}={})=>{const r=[];return e instanceof Uint8Array&&r.push(e.buffer),p(this,g_).call(this,{type:s_.WRITE_FILE,data:{path:t,data:e}},r,i)}),f(this,"mount",(t,e,i)=>p(this,g_).call(this,{type:s_.MOUNT,data:{fsType:t,options:e,mountPoint:i}},[])),f(this,"unmount",t=>p(this,g_).call(this,{type:s_.UNMOUNT,data:{mountPoint:t}},[])),f(this,"readFile",(t,e="binary",{signal:i}={})=>p(this,g_).call(this,{type:s_.READ_FILE,data:{path:t,encoding:e}},void 0,i)),f(this,"deleteFile",(t,{signal:e}={})=>p(this,g_).call(this,{type:s_.DELETE_FILE,data:{path:t}},void 0,e)),f(this,"rename",(t,e,{signal:i}={})=>p(this,g_).call(this,{type:s_.RENAME,data:{oldPath:t,newPath:e}},void 0,i)),f(this,"createDir",(t,{signal:e}={})=>p(this,g_).call(this,{type:s_.CREATE_DIR,data:{path:t}},void 0,e)),f(this,"listDir",(t,{signal:e}={})=>p(this,g_).call(this,{type:s_.LIST_DIR,data:{path:t}},void 0,e)),f(this,"deleteDir",(t,{signal:e}={})=>p(this,g_).call(this,{type:s_.DELETE_DIR,data:{path:t}},void 0,e))}on(t,e){"log"===t?p(this,m_).push(e):"progress"===t&&p(this,v_).push(e)}off(t,e){"log"===t?v(this,m_,p(this,m_).filter(t=>t!==e)):"progress"===t&&v(this,v_,p(this,v_).filter(t=>t!==e))}};f_=new WeakMap,d_=new WeakMap,p_=new WeakMap,m_=new WeakMap,v_=new WeakMap,y_=new WeakMap,g_=new WeakMap,(x_=b_||(b_={})).MEMFS="MEMFS",x_.NODEFS="NODEFS",x_.NODERAWFS="NODERAWFS",x_.IDBFS="IDBFS",x_.WORKERFS="WORKERFS",x_.PROXYFS="PROXYFS";var A_=new Error("failed to get response body reader"),O_=new Error("failed to complete download"),C_=async(t,e,i=!1,r)=>{const n=i?await(async(t,e)=>{const i=await fetch(t);let r;try{const n=parseInt(i.headers.get("Content-Length")||"-1"),s=i.body?.getReader();if(!s)throw A_;const o=[];let a=0;for(;;){const{done:i,value:r}=await s.read(),h=r?r.length:0;if(i){if(-1!=n&&n!==a)throw O_;e&&e({url:t,total:n,received:a,delta:h,done:i});break}o.push(r),a+=h,e&&e({url:t,total:n,received:a,delta:h,done:i})}const h=new Uint8Array(a);let u=0;for(const t of o)h.set(t,u),u+=t.length;r=h.buffer}catch(n){console.log("failed to send download progress event: ",n),r=await i.arrayBuffer(),e&&e({url:t,total:r.byteLength,received:r.byteLength,delta:0,done:!0})}return r})(t,r):await(await fetch(t)).arrayBuffer(),s=new Blob([n],{type:e});return URL.createObjectURL(s)},I_={SCRIPT:"https://gw.alipayobjects.com/os/gltf-asset/99531561844014/img2webp.js",WASM:"https://mdn.alipayobjects.com/mars/uri/file/as/0.0.4/wasm/img2webp/img2webp.wasm"},R_={CLASSWORKER:"https://mdn.alipayobjects.com/rms/uri/file/as/ffmpeg/core/0.12.10/dist/worker.js",DEFAULT:{CORE:"https://gw.alipayobjects.com/os/lib/ffmpeg/core/0.12.10/dist/esm/ffmpeg-core.js",WASM:"https://gw.alipayobjects.com/os/lib/ffmpeg/core/0.12.10/dist/esm/ffmpeg-core.wasm"},MT:{CORE:"https://gw.alipayobjects.com/os/lib/ffmpeg/core-mt/0.12.10/dist/esm/ffmpeg-core.js",WASM:"https://gw.alipayobjects.com/os/lib/ffmpeg/core-mt/0.12.10/dist/esm/ffmpeg-core.wasm",WORKER:"https://gw.alipayobjects.com/os/lib/ffmpeg/core-mt/0.12.10/dist/esm/ffmpeg-core.worker.js"}};function P_(t,e,i,r){const n=e.getContext("2d");r_(n),n.clearRect(0,0,e.width,e.height),i&&(n.save(),n.fillStyle=i,n.fillRect(0,0,e.width,e.height),n.restore()),r&&n.drawImage(r,0,0,r.width,r.height,0,0,e.width,e.height),n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)}function M_(t){window.requestAnimationFrame(t)}async function D_(){return new Promise(async(t,e)=>{try{await function(t,e={}){return new Promise((i,r)=>{const n=document.querySelector(`script[src="${t}"]`);if(n)return"true"===n.dataset.loaded?void i(n):(n.addEventListener("load",()=>{i(n)}),void n.addEventListener("error",()=>{r(new Error(`Script already failed: ${t}`))}));const s=document.createElement("script");s.src=t,s.async=!0,Object.keys(e).forEach(t=>{s.setAttribute(t,e[t]??"")}),s.onload=()=>{s.dataset.loaded="true",i(s)},s.onerror=()=>{r(new Error(`Failed to load script: ${t}`))},document.head.appendChild(s)})}(I_.SCRIPT,{crossOrigin:"anonymous"});const e={locateFile:(t,e)=>t.endsWith("createWebPCore.wasm")?I_.WASM:e+t};t(await window.createWebPCore(e))}catch(t){e(t)}})}var F_,L_,k_,N_,B_,U_,z_,V_,G_,j_,H_,X_=["@vvfx/sdk","ExportVideo"],W_=class extends Tu{constructor(t){super(),f(this,"mediaType"),f(this,"extraCanvas"),f(this,"_canceled",!1),f(this,"_player"),f(this,"_currentItem"),m(this,F_),m(this,L_),m(this,k_),m(this,N_),m(this,B_,[]),m(this,U_),m(this,z_),m(this,V_,0),m(this,G_,0),m(this,j_,0),m(this,H_,0);const{mediaType:e,extraCanvas:i,autoDispose:r,loggerInTranscoding:n}=t;this.mediaType=e,this.extraCanvas=i??void 0,n_("log",[...X_,"ready"],"starting"),this.loadHelper(e,n),this.on("ready",()=>{n_("log",[...X_,"ready"],"success")}),this.on("finish",()=>{this.player?.pause(),this.onResetProgress(),!0===r&&this.dispose()}),this.on("error",t=>{n_("error",[...X_,"error"],t)})}get canceled(){return this._canceled}get player(){return this._player}get config(){const t=this.player?.getCompositions()??[],e=t?.[0],i=e?.name??(new Date).getTime().toString(),r=e?.getDuration()??0,n=e?.startTime??0,s=this._currentItem?.time,o=this._currentItem?.fps??60,a=this._currentItem?.backgroundColor??"#000000";return{name:i,startTime:n,oldTotalTime:r,newTotalTime:s,audioEnable:this._currentItem?.audioEnable??!0,fps:o,backgroundColor:a,loop:this._currentItem?.loop??!0}}get progress(){if(0===p(this,V_)||0===p(this,j_))return 0;const t=p(this,G_),e=Math.min(p(this,H_)/p(this,j_),1);return Math.min((t+e)/p(this,V_),1)}async loadHelper(t,e){try{const i="WebP"===t&&!p(this,k_),r=(t===h_||t===a_||t===u_||t===l_)&&!p(this,L_);i&&v(this,k_,await D_()),r&&(v(this,L_,await async function(t){const{log:e}=t,i=new S_;e&&i.on("log",({message:t})=>{console.log(t)});const r=window.SharedArrayBuffer,n={classWorkerURL:await C_(R_.CLASSWORKER,"text/javascript"),coreURL:"",wasmURL:""};return r?(n.coreURL=await C_(R_.MT.CORE,"text/javascript"),n.wasmURL=await C_(R_.MT.WASM,"application/wasm"),n.workerURL=await C_(R_.MT.WORKER,"text/javascript")):(n.coreURL=await C_(R_.DEFAULT.CORE,"text/javascript"),n.wasmURL=await C_(R_.DEFAULT.WASM,"application/wasm")),await i.load(n),i}({log:e})),this.config.audioEnable&&(v(this,z_,"audio.wav"),this.getWavAudio(p(this,z_)))),this.emit("ready",t)}catch(t){n_("error",[...X_,"loadHelper"],t),this.emit("error",new Error("load helper error"))}}onResetProgress(){v(this,V_,0),v(this,G_,0),v(this,j_,0),v(this,H_,0)}forwardPlayerTime(t,e=!1){Xt(this.player);const{oldTotalTime:i,startTime:r}=this.config;Xt(i);const n=1e3*i-1e3*i%15;return t=Math.min(t,n/1e3),e?this.player.gotoAndPlay(t-r):this.player.gotoAndStop(t-r),t}getWavAudio(t){v(this,U_,new c_),p(this,L_)?p(this,L_).writeFile(t,p(this,U_).getBuffer()):n_("log",[...X_,"getWavAudio"],"ffmpegCore is not ready")}async getImagesZip(t,e,i){const r=new i_.default,n=r.folder(t);return Xt(n),e.forEach((t,e)=>{n.file(t,i[e])}),r.generateAsync({type:"arraybuffer"})}getWebP(t){Xt(p(this,k_));const e=Math.round(1e3/this.config.fps/1),i="out.webp",r=`${t.join(` -d ${e} `)} -d ${e} -o ${i} -loop ${this.config.loop?0:1}`.split(" "),n=p(this,k_).cwrap("main","string",["number","number"]),[s,o]=function(t,e){const i=t._malloc(e.length*Uint32Array.BYTES_PER_ELEMENT);return e.forEach((e,r)=>{const n=t._malloc(e.length+1);t.writeAsciiToMemory(e,n),t.setValue(i+Uint32Array.BYTES_PER_ELEMENT*r,n,"i32")}),[e.length,i]}(p(this,k_),r);r_(s&&o,"getWebP has error"),n(s,o);const a=p(this,k_).FS.readFile(i);return t.forEach(t=>{p(this,k_)?.FS.unlink(t)}),a}async getAPNG(t){Xt(p(this,L_));const e="export.apng";return await p(this,L_).exec(["-framerate",`${this.config.fps}`,"-start_number","1","-i",`image-%4d.${t}`,"-plays",this.config.loop?"0":"1","-y",e]),e}async getGIF(t){Xt(p(this,L_));const e="export.gif";return await p(this,L_).exec(["-framerate",`${this.config.fps}`,"-start_number","1","-i",`image-%4d.${t}`,"-loop",this.config.loop?"0":"-1","-vf","scale=-1:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse","-y",e]),e}async getMP4(t,e){Xt(p(this,L_));const i="export.mp4";let r;const n=e?",setpts=PTS/"+Math.round(t/e*100)/100:"",s=e??t;return await p(this,L_).exec(["-framerate",String(this.config.fps),"-start_number",String(1),"-i","image-%4d.jpeg","-c:v","libx264","-crf","23","-pix_fmt","yuv420p","-vf",`pad=ceil(iw/2)*2:ceil(ih/2)*2${n}`,"-y",i]),p(this,z_)&&(r="export-with-audio.mp4",await p(this,L_).exec(["-i",i,"-i",p(this,z_),"-c:v","copy","-c:a","aac","-t",`${s}`,"-y",r])),r&&p(this,L_).deleteFile(i).catch(t=>{console.log("deleteFile error",t)}),r??i}async getAlphaMaskVideo(t,e){Xt(p(this,L_));const i="export.mp4",r=e?",setpts=PTS/"+Math.round(t/e*100)/100:"";return await p(this,L_).exec(["-framerate",String(this.config.fps),"-start_number",String(1),"-i","image-%4d.jpeg","-c:v","libx264","-crf","23","-pix_fmt","yuv420p","-vf",`pad=ceil(iw/2)*2:ceil(ih/2)*2${r}`,"-y",i]),i}async getVideoByType(t,e,i,r){Xt(p(this,L_));const n="APNG"===this.mediaType,s="GIF"===this.mediaType,o="AlphaMaskVideo"===this.mediaType,a="MP4"===this.mediaType;let h="";try{n&&(h=await this.getAPNG(e)),s&&(h=await this.getGIF(e)),a&&(h=await this.getMP4(i,r)),o&&(h=await this.getAlphaMaskVideo(i,r))}catch(t){throw t}finally{for(const e of t)p(this,L_).deleteFile(e).catch(t=>{console.log("deleteFile error",t)})}let u=null;try{Xt(h);const t=await p(this,L_).readFile(h);u="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t)}finally{p(this,L_).deleteFile(h).catch(t=>{console.log("deleteFile error",t)})}return u}onRecordWebM(t){const e=new MediaRecorder(t.captureStream(this.config.fps),{mimeType:"video/webm;codecs=vp9"});v(this,N_,e),p(this,N_).start(0);const i=[];p(this,N_).ondataavailable=t=>{t.data.size>0&&i.push(t.data)},v(this,B_,i)}async onExportImageFrame(t){try{if(this.canceled)return n_("log",[...X_,"onExportImageFrame"],"canceled"),void this.emit("done",!1);const{totalFrames:r,index:n,canvas:s,imageFileNames:o,imageBuffers:a,startTime:h,oldTotalTime:u,newTotalTime:l}=t;Xt(this.player),Xt(p(this,F_)),v(this,j_,r),v(this,H_,n),this.emit("progress",this.progress),n>1&&this.forwardPlayerTime(n/this.config.fps+h);const c="MP4"===this.mediaType?"jpeg":"WebP"===this.mediaType?"webp":"png";P_(p(this,F_),s,this.config.backgroundColor);let f=s;"AlphaMaskVideo"===this.mediaType&&(Xt(this.extraCanvas),function(t,e){e.width=2*t.width,e.height=t.height;const i=t.getContext("2d");if(!i)throw new Error("inputCtx is null");const r=e.getContext("2d");if(!r)throw new Error("ctx is null");r.clearRect(0,0,e.width,e.height);const n=i.getImageData(0,0,t.width,t.height),s=i.getImageData(0,0,t.width,t.height),o=n.data;for(let t=0;t<o.length;t+=4){const e=Math.max(0,(o[t+3]??0)-5)/250*255;e<=0?(o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=255):(o[t]=(o[t]??0)*e/255,o[t+1]=(o[t+1]??0)*e/255,o[t+2]=(o[t+2]??0)*e/255,o[t+3]=255)}r.putImageData(n,0,0);const a=s.data;for(let t=0;t<a.length;t+=4){const e=Math.max(0,(a[t+3]??0)-5)/250*255;a[t]=e,a[t+1]=e,a[t+2]=e,a[t+3]=255}r.putImageData(s,t.width,0)}(s,this.extraCanvas),f=this.extraCanvas);const d=await async function(t,e,i){return new Promise((r,n)=>{t.toBlob(t=>{t?r(t.arrayBuffer()):n("toBlob failed")},e,i)})}(f,`image/${c}`,1),m=`image-${e=n,i=4,String(e).padStart(i,"0")}.${c}`;"Images"===this.mediaType?a.push(d):"WebP"===this.mediaType?(Xt(p(this,k_)),p(this,k_).FS.writeFile(m,new Uint8Array(d))):(Xt(p(this,L_)),await p(this,L_).writeFile(m,new Uint8Array(d))),o.push(m);if(n===r){await new Promise(t=>{window.requestAnimationFrame(t)});let t=null;"Images"===this.mediaType?t=await this.getImagesZip(this.config.name,o,a):"WebP"===this.mediaType?t=this.getWebP(o):["MP4","APNG","GIF","AlphaMaskVideo"].includes(this.mediaType)&&(t=await this.getVideoByType(o,c,u,l)??null),t&&(n_("log",[...X_,"done"],"success"),this.emit("done",!0,t))}else M_(()=>{if(this.canceled)return n_("log",[...X_,"onExportImageFrame"],"canceled"),void this.emit("done",!1);this.onExportImageFrame({totalFrames:r,index:n+1,canvas:s,imageFileNames:o,imageBuffers:a,startTime:h,oldTotalTime:u,newTotalTime:l})})}catch(t){n_("log",[...X_,"done"],"failed",t),this.emit("done",!1),this.emit("error",t)}var e,i}async onExportWebMFrame(t){try{if(this.canceled)return n_("log",[...X_,"onExportWebMFrame"],"canceled"),void this.emit("done",!1);Xt(this.player),Xt(p(this,F_));const{totalFrames:e,index:i,canvas:r}=t;if(v(this,j_,e),v(this,H_,i),this.emit("progress",this.progress),P_(p(this,F_),r,this.config.backgroundColor),1===i&&(this.player.play(),this.onRecordWebM(r)),i<e)M_(()=>{if(this.canceled)return n_("log",[...X_,"onExportWebMFrame"],"canceled"),void this.emit("done",!1);this.onExportWebMFrame({totalFrames:e,index:i+1,canvas:r})});else{p(this,N_)?.stop();const t=new Blob(p(this,B_),{type:"video/webm"}),e=await t.arrayBuffer();n_("log",[...X_,"done"],"success"),this.emit("done",!0,e)}}catch(t){n_("log",[...X_,"done"],"failed",t),this.emit("done",!1)}}async runTask(t){try{if(this.canceled)return n_("log",[...X_,"runTask"],"canceled"),void this.emit("done",!1);Xt(this.player),Xt(p(this,F_));const{size:e,totalFrames:i,startTime:r,containerCanvas:n}=t,{oldTotalTime:s,newTotalTime:o}=this.config,[a,h]=e;if(p(this,F_).width=a,p(this,F_).height=h,n.width=a,n.height=h,this.player.resize(),v(this,j_,i),v(this,H_,0),this.emit("progress",this.progress),["MP4","APNG","Images","WebP","GIF","AlphaMaskVideo"].includes(this.mediaType)){const t={totalFrames:i,index:1,canvas:n,imageFileNames:[],imageBuffers:[],startTime:r,oldTotalTime:s,newTotalTime:o};await this.onExportImageFrame(t)}else if("WebM"===this.mediaType){const t={totalFrames:i,index:1,canvas:n};await this.onExportWebMFrame(t)}}catch(t){console.log("runTask error",t),this.emit("done",!1)}}onCancel(){this.canceled||(this._canceled=!0,n_("log",[...X_,"cancel"],"export canceled"),this.emit("done",!1),this.emit("finish"))}async onExport(t){try{if(r_(t.length>0,"options is required"),this._canceled=!1,!p(this,F_)){const t=document.createElement("canvas");t.dataset.key="player-canvas",v(this,F_,t)}this._player||(this._player=new rd({canvas:p(this,F_),pixelRatio:1,transparentBackground:!0,renderOptions:{willCaptureImage:!0}}),this._player.on("rendererror",t=>{n_("error",[...X_,"player","rendererror"],t),this.emit("error",t)}),this._player.on("webglcontextlost",t=>{n_("error",[...X_,"player","webglcontextlost"],t),this.emit("error",t)}));let e=null;e??(e=document.querySelector('canvas[data-key="container-canvas"]')),e??(e=document.createElement("canvas")),e.dataset.key="container-canvas",e.style.display="none",v(this,V_,t.length),v(this,G_,0),v(this,j_,0),v(this,H_,0),this.emit("progress",this.progress);for(const[i,r]of t.entries()){if(this.canceled){n_("log",[...X_,"export"],"canceled");break}this._currentItem=r;const{size:t,scene:n}=r;await new Promise(async s=>{try{if(!this._player)throw new Error("player not found");n_("log",[...X_,"export"],"start",r),this._player.destroyCurrentCompositions(),await this._player.loadScene(n,{env:"editor",autoplay:!1});const o=this.config.oldTotalTime;n_("log",[...X_,"duration"],o);const a=0;this._player.pause();const h=Math.round(o*this.config.fps);v(this,G_,i),v(this,j_,h),v(this,H_,0),this.emit("progress",this.progress);const u=()=>{console.log("onDone",i),this.off("done",u),v(this,H_,p(this,j_)),this.emit("progress",this.progress),s()};this.on("done",u);const l={size:t,totalFrames:h,startTime:a,containerCanvas:e};await this.runTask(l)}catch(t){console.log(` the ${i} export is error`,t),s()}})}}catch(t){this.emit("error",t)}n_("log",[...X_,"finish"],"success"),v(this,G_,p(this,V_)),v(this,H_,p(this,j_)),this.emit("progress",this.progress),this.emit("finish")}dispose(){this.onResetProgress(),this.player?.dispose(),this._player=void 0,p(this,F_)?.remove(),v(this,F_,void 0),p(this,N_)&&"inactive"!==p(this,N_).state&&p(this,N_).stop(),v(this,N_,void 0),v(this,B_,[]),p(this,L_)&&p(this,z_)&&(p(this,L_).deleteFile?.(p(this,z_)).catch(t=>{console.log("deleteFile error",t)}),p(this,L_).terminate(),v(this,L_,void 0)),p(this,k_)&&(p(this,k_).FS.quit(),v(this,k_,void 0)),v(this,U_,void 0)}};async function Y_(t,e,i,r){const[n,s]=e,o=JSON.parse(JSON.stringify(i));await t.loadScene(o,{reusable:!0,autoplay:!1}),t.gotoAndStop(r);const a=document.createElement("canvas");a.width=n,a.height=s;const h=a.getContext("2d");h&&(h.fillStyle="rgba(255, 255, 255, 1)",h.fillRect(0,0,n,s),function(t,e,i,r,n,s,o,a,h){2===arguments.length&&(i=r=0,n=t.canvas.width,s=t.canvas.height);o="number"==typeof o?lg(o,0,1):.5,a="number"==typeof a?lg(a,0,1):.5,h??(h={left:0,top:0,width:e instanceof HTMLVideoElement?e.videoWidth:e.width,height:e instanceof HTMLVideoElement?e.videoHeight:e.height});const u=h.width,l=h.height,c=Math.min(n/u,s/l);let f=u*c,d=l*c,p=1;f<n&&(p=n/f);Math.abs(p-1)<1e-14&&d<s&&(p=s/d);f*=p,d*=p;const m=Math.max(u/(f/n),0),v=Math.max(l/(d/s),0),y=Math.min((u-m)*o,u),g=Math.min((l-v)*a,l);t.drawImage(e,y+h.left,g+h.top,m,v,i,r,n,s)}(h,t.canvas,0,0,n,s,.5,.5));return a.toDataURL("image/png")}F_=new WeakMap,L_=new WeakMap,k_=new WeakMap,N_=new WeakMap,B_=new WeakMap,U_=new WeakMap,z_=new WeakMap,V_=new WeakMap,G_=new WeakMap,j_=new WeakMap,H_=new WeakMap;var q_,Z_={DEFAULT:"default",EXPORTING:"exporting",SUCCESS:"success",ERROR:"error"},K_=class{constructor(t){f(this,"_eventEmitter",new Tu),f(this,"_pageData"),f(this,"_screenShotContainer"),f(this,"_screenShotPlayer"),f(this,"_SDKUtils"),f(this,"_ExportVideo"),f(this,"_gestureHandler"),f(this,"_playerContainer"),f(this,"_isExportReady",!1),f(this,"_exportStatus",Z_.DEFAULT),f(this,"player"),f(this,"on",this._eventEmitter.on);const e=[t.offsetWidth,t.offsetHeight],i=document.createElement("div");i.id="player-container",i.style.width=`${e[0]}px`,i.style.height=`${e[1]}px`,i.style.position="absolute",i.style.backgroundRepeat="no-repeat",i.style.backgroundPosition="center center",t.appendChild(i),this._playerContainer=i,this.player=new rd({container:i,interactive:!0,pixelRatio:window.devicePixelRatio||1}),this._gestureHandler=new $x(t),this._gestureHandler.registerViewEvent(),this.player.on("update",t=>{Xt(this._pageData,"You must call SDK#run() first");const e=this.player.getCompositions()[0]?.time;this._pageData.playing&&(void 0!==e?(this._pageData.time===e&&this.player.pause(),this._pageData.time=e,this._SDKUtils.refreshPageTime(e)):(this._pageData.time=this.player.getCompositions()[0]?.getDuration()??2,this._SDKUtils.refreshPageTime(this._pageData.time),this.player.pause()),t.playing||(this._pageData.playing=!1)),this._eventEmitter.emit("progress",{duration:this.player.getCompositions()[0]?.getDuration()??2,time:this._pageData.time,end:this.player.getCompositions()[0]?.isDestroyed??!1,paused:this._pageData.playing})}),this._screenShotContainer=document.createElement("canvas"),this._screenShotPlayer=new rd({canvas:this._screenShotContainer,manualRender:!0,renderOptions:{willCaptureImage:!0}}),this._eventEmitter.on("pageDataChange",t=>{this._pageData=t,this._gestureHandler.refresh(),this._gestureHandler.render()}),this._eventEmitter.on("zoomChange",t=>{Xt(this._pageData,"You must call SDK#run() first"),this._pageData.property.zoom=t,this._SDKUtils.refreshInteractionParam(),this._gestureHandler.refresh(),this._gestureHandler.render()}),this._eventEmitter.on("selectedItemChange",t=>{Xt(this._pageData,"You must call SDK#run() first"),this._pageData.activeData.selectedItems=[...t],this._gestureHandler.refresh(),this._gestureHandler.render()}),this._eventEmitter.on("preSelectedItemChange",t=>{Xt(this._pageData,"You must call SDK#run() first"),this._pageData.activeData.preSelectedItem=t,this._gestureHandler.refresh(),this._gestureHandler.render()}),this._SDKUtils=new e_(this.player,i,this._eventEmitter,this.pageData),this._ExportVideo=new W_({mediaType:"MP4"}),this._ExportVideo.on("ready",()=>{this._isExportReady=!0,this._exportStatus===Z_.EXPORTING&&this.exportAllVideos()})}get pageData(){return this._pageData}get exportStatus(){return this._exportStatus}get exportVideoCanceled(){return this._ExportVideo.canceled}dispose(){this.player?.dispose(),this._screenShotPlayer?.dispose(),this._pageData=void 0,this._playerContainer.remove(),this._ExportVideo.dispose()}async getInitParam(t){const e=JSON.parse(JSON.stringify(t));if("string"==typeof e.scene)try{const t=await fetch(e.scene,{headers:{"Content-Type":"application/json",Accept:"application/json"}});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}, statusText: ${t.statusText}`);const i=await t.json();return{...e,scene:i}}catch(t){throw new Error(`Failed to fetch scene data from ${e.scene}: ${t instanceof Error?t.message:String(t)}`)}return{...e,scene:e.scene}}async initSDK(t){const{scene:e,viewParams:i,options:r}=t,n=[];for(let r=0;r<i.length;r++){const s=i[r];if(!s)continue;let o=JSON.parse(JSON.stringify(e));const a=o.compositions.find(t=>t.id===o.compositionId)??o.compositions[0];Xt(a);const[h,u]=s.size;a.previewSize=[h,u];const l=a.duration??0;this._screenShotContainer.width=h,this._screenShotContainer.height=u,this._screenShotPlayer.destroyCurrentCompositions(),this._screenShotPlayer.resize();const c=await Y_(this._screenShotPlayer,s.size,o,l);t.keepSafe&&(this._screenShotContainer.width=h,this._screenShotContainer.height=u,this._screenShotPlayer.destroyCurrentCompositions(),this._screenShotPlayer.resize(),o=await this._SDKUtils.keepSceneSafe(this._screenShotPlayer,o,l,[h,u],s.safeArea)),n.push({...s,id:r,scene:o,thumbnail:c})}const s=n[0]?.scene;if(!s)return void console.warn("SDK need a view property at least.");const o={...r,zoom:1,translation:new xg,sync:!1};this._pageData={time:0,property:o,activeData:{selectedItems:[]},items:[],viewProperties:n,playing:!1},this._SDKUtils.init(this._pageData),this._gestureHandler.init(this._SDKUtils),await this._SDKUtils.loadScene(0)}async run(t){const e=await this.getInitParam(t);await this.initSDK(e),this._eventEmitter.emit("pageDataChange",this.getPageData())}getPageData(){return JSON.parse(JSON.stringify(this._pageData))}getActiveItems(){return Xt(this._pageData,"You must call SDK#run() first"),this._pageData.activeData.selectedItems}setPreSelectedItem(t){Xt(this._pageData,"You must call SDK#run() first"),this._pageData.activeData.preSelectedItem=t}getPreSelectedItem(){return Xt(this._pageData,"You must call SDK#run() first"),this._pageData.activeData.preSelectedItem??""}setSelectedItems(t){this._SDKUtils.clearPreSelectedItem(),this._SDKUtils.clearSelectedItems(),this._SDKUtils.addSelectedItems([...t])}getItemProperty(t){Xt(this._pageData,"You must call SDK#run() first");const e=this._pageData.items.find(e=>e.id===t.itemId);if(e&&e.type===t.type)return{type:e.type,property:e.property}}getItemPropertyValue(t){Xt(this._pageData,"You must call SDK#run() first");const e=this.getItemProperty(t)?.property?.[t.propertyName];return e}setItemPropertyValue(t){Xt(this._pageData,"You must call SDK#run() first"),this._SDKUtils.changeItemProperty(t)}async generateScreenShot(t){Xt(this._pageData,"You must call SDK#run() first");const e=this.pageData?.viewProperties?.[t];if(!e)return"";const{scene:i,size:[r,n]}=e,s=i.compositionId,o=i.compositions.find(t=>t.id===s),a=o?.duration??0;this._screenShotContainer.width=r,this._screenShotContainer.height=n,this._screenShotPlayer.destroyCurrentCompositions(),this._screenShotPlayer.resize();const h=JSON.parse(JSON.stringify(i));return await Y_(this._screenShotPlayer,[300,400],h,a)}async switchScene(t){if(Xt(this._pageData,"You must call SDK#run() first"),t===this._pageData.activeData.view)return;this._pageData.viewProperties[t]?(this._pageData.activeData={view:t,selectedItems:[],preSelectedItem:void 0},await this._SDKUtils.loadScene(t)):console.warn("target scene does not exist."),this._eventEmitter.emit("pageDataChange",this.getPageData())}getConfig(){return Xt(this._pageData,"You must call SDK#run() first"),{safeAreaPreview:this._pageData.property.safeAreaPreview,zoom:this._pageData.property.zoom,adsorption:this._pageData.property.adsorption}}setConfig(t){Xt(this._pageData,"You must call SDK#run() first");const{adsorption:e,safeAreaPreview:i,zoom:r}=this._pageData.property;this._pageData.property={...this._pageData.property,...t},this._pageData.property.zoom!==r&&this._SDKUtils.setPageZoom(this._pageData.property.zoom),e!==t.adsorption&&this._gestureHandler.setAdsorptionEnabled(t.adsorption),i!==t.safeAreaPreview&&this._gestureHandler.setSafeAreaPreviewEnabled(t.safeAreaPreview),this._gestureHandler.refresh(),this._gestureHandler.render()}setPlayProgress(t){Xt(this._pageData,"You must call SDK#run() first");const e=(this.player.getCompositions()[0]?.getDuration()??2)*t/100;this._pageData.time=e,this._pageData.playing?this.player.gotoAndPlay(e):this.player.gotoAndStop(e)}getViewItems(){return this.getPageData()?.items??[]}setPlayState(t){Xt(this._pageData,"You must call SDK#run() first");const e="play"===t;this._pageData.playing!==e&&(this._pageData.playing=e,this._gestureHandler.isPlaying=e,e?this.player.gotoAndPlay(this._pageData.time):this.player.gotoAndStop(this._pageData.time),this._gestureHandler.refresh(),this._gestureHandler.render())}getViewThumbnail(){return Xt(this._pageData,"You must call SDK#run() first"),this._pageData.viewProperties.map(t=>({id:t.id,thumbnail:t.thumbnail}))}async exportAllVideos(){if(Xt(this.pageData,"You must call SDK#run() first"),!this._isExportReady)return this._exportStatus=Z_.EXPORTING,this._eventEmitter.emit("exportingChange",this._exportStatus),Promise.reject(new Error("export is not ready"));this._exportStatus=Z_.EXPORTING,this._eventEmitter.emit("exportingChange",this._exportStatus);const t=Date.now(),e=this.pageData.viewProperties.map(t=>{const{size:e,scene:i,export:{time:r,audioEnable:n}}=t;return{size:e,scene:i,time:r,audioEnable:n}});return new Promise((i,r)=>{this._ExportVideo.onExport(e),this._ExportVideo.on("progress",t=>{this._eventEmitter.emit("exportingChange",this._exportStatus,t)}),this._ExportVideo.on("done",(t,e)=>{e&&function(t,e,i="application/octet-stream"){const r=new Blob(Array.isArray(t)?t:[t],{type:i}),n=URL.createObjectURL(r),s=document.createElement("a");s.href=n,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(n)}(e,`${Date.now()}.mp4`,"video/mp4")}),this._ExportVideo.on("finish",()=>{this.exportVideoCanceled||(this._exportStatus=Z_.SUCCESS),this._eventEmitter.emit("exportingChange",this._exportStatus),console.log("[导出时间共计]",(Date.now()-t)/1e3,"s"),i()}),this._ExportVideo.on("error",t=>{this._exportStatus=Z_.ERROR,this._eventEmitter.emit("exportingChange",this._exportStatus),r(t)})})}cancelExportAllVideos(){this._exportStatus=Z_.ERROR,this._ExportVideo.onCancel()}};return q_=mt,l(i({},"__esModule",{value:!0}),q_)})();
2
+ /*! Bundled license information:
3
+
4
+ punycode/punycode.js:
5
+ (*! https://mths.be/punycode v1.4.1 by @mathias *)
6
+
7
+ object-assign/index.js:
8
+ (*
9
+ object-assign
10
+ (c) Sindre Sorhus
11
+ @license MIT
12
+ *)
13
+
14
+ jszip/dist/jszip.min.js:
15
+ (*!
16
+
17
+ JSZip v3.10.1 - A JavaScript class for generating and reading zip files
18
+ <http://stuartk.com/jszip>
19
+
20
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
21
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
22
+
23
+ JSZip uses the library pako released under the MIT license :
24
+ https://github.com/nodeca/pako/blob/main/LICENSE
25
+ *)
26
+
27
+ @galacean/effects/dist/index.mjs:
28
+ (*!
29
+ * Name: @galacean/effects
30
+ * Description: Galacean Effects runtime player for the web
31
+ * Author: Ant Group CO., Ltd.
32
+ * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
33
+ * Version: v2.5.3
34
+ *)
35
+
36
+ @galacean/effects-plugin-rich-text/dist/index.mjs:
37
+ (*!
38
+ * Name: @galacean/effects-plugin-rich-text
39
+ * Description: Galacean Effects player rich text plugin
40
+ * Author: Ant Group CO., Ltd.
41
+ * Contributors: 云垣
42
+ * Version: v2.5.3
43
+ *)
44
+
45
+ @pixi/constants/dist/esm/constants.mjs:
46
+ (*!
47
+ * @pixi/constants - v6.5.10
48
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
49
+ *
50
+ * @pixi/constants is licensed under the MIT License.
51
+ * http://www.opensource.org/licenses/mit-license
52
+ *)
53
+
54
+ @pixi/settings/dist/esm/settings.mjs:
55
+ (*!
56
+ * @pixi/settings - v6.5.10
57
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
58
+ *
59
+ * @pixi/settings is licensed under the MIT License.
60
+ * http://www.opensource.org/licenses/mit-license
61
+ *)
62
+
63
+ @pixi/utils/dist/esm/utils.mjs:
64
+ (*!
65
+ * @pixi/utils - v6.5.10
66
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
67
+ *
68
+ * @pixi/utils is licensed under the MIT License.
69
+ * http://www.opensource.org/licenses/mit-license
70
+ *)
71
+
72
+ @pixi/extensions/dist/esm/extensions.mjs:
73
+ (*!
74
+ * @pixi/extensions - v6.5.10
75
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
76
+ *
77
+ * @pixi/extensions is licensed under the MIT License.
78
+ * http://www.opensource.org/licenses/mit-license
79
+ *)
80
+ (*! *****************************************************************************
81
+ Copyright (c) Microsoft Corporation.
82
+
83
+ Permission to use, copy, modify, and/or distribute this software for any
84
+ purpose with or without fee is hereby granted.
85
+
86
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
87
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
88
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
89
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
90
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
91
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
92
+ PERFORMANCE OF THIS SOFTWARE.
93
+ ***************************************************************************** *)
94
+
95
+ @pixi/runner/dist/esm/runner.mjs:
96
+ (*!
97
+ * @pixi/runner - v6.5.10
98
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
99
+ *
100
+ * @pixi/runner is licensed under the MIT License.
101
+ * http://www.opensource.org/licenses/mit-license
102
+ *)
103
+
104
+ @pixi/ticker/dist/esm/ticker.mjs:
105
+ (*!
106
+ * @pixi/ticker - v6.5.10
107
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
108
+ *
109
+ * @pixi/ticker is licensed under the MIT License.
110
+ * http://www.opensource.org/licenses/mit-license
111
+ *)
112
+
113
+ @pixi/math/dist/esm/math.mjs:
114
+ (*!
115
+ * @pixi/math - v6.5.10
116
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
117
+ *
118
+ * @pixi/math is licensed under the MIT License.
119
+ * http://www.opensource.org/licenses/mit-license
120
+ *)
121
+
122
+ @pixi/core/dist/esm/core.mjs:
123
+ (*!
124
+ * @pixi/core - v6.5.10
125
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
126
+ *
127
+ * @pixi/core is licensed under the MIT License.
128
+ * http://www.opensource.org/licenses/mit-license
129
+ *)
130
+ (*! *****************************************************************************
131
+ Copyright (c) Microsoft Corporation.
132
+
133
+ Permission to use, copy, modify, and/or distribute this software for any
134
+ purpose with or without fee is hereby granted.
135
+
136
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
137
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
138
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
139
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
140
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
141
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
142
+ PERFORMANCE OF THIS SOFTWARE.
143
+ ***************************************************************************** *)
144
+
145
+ @pixi/display/dist/esm/display.mjs:
146
+ (*!
147
+ * @pixi/display - v6.5.10
148
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
149
+ *
150
+ * @pixi/display is licensed under the MIT License.
151
+ * http://www.opensource.org/licenses/mit-license
152
+ *)
153
+ (*! *****************************************************************************
154
+ Copyright (c) Microsoft Corporation.
155
+
156
+ Permission to use, copy, modify, and/or distribute this software for any
157
+ purpose with or without fee is hereby granted.
158
+
159
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
160
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
161
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
162
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
163
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
164
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
165
+ PERFORMANCE OF THIS SOFTWARE.
166
+ ***************************************************************************** *)
167
+
168
+ @pixi/app/dist/esm/app.mjs:
169
+ (*!
170
+ * @pixi/app - v6.5.10
171
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
172
+ *
173
+ * @pixi/app is licensed under the MIT License.
174
+ * http://www.opensource.org/licenses/mit-license
175
+ *)
176
+
177
+ @pixi/graphics/dist/esm/graphics.mjs:
178
+ (*!
179
+ * @pixi/graphics - v6.5.10
180
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
181
+ *
182
+ * @pixi/graphics is licensed under the MIT License.
183
+ * http://www.opensource.org/licenses/mit-license
184
+ *)
185
+ (*! *****************************************************************************
186
+ Copyright (c) Microsoft Corporation.
187
+
188
+ Permission to use, copy, modify, and/or distribute this software for any
189
+ purpose with or without fee is hereby granted.
190
+
191
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
192
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
193
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
194
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
195
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
196
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
197
+ PERFORMANCE OF THIS SOFTWARE.
198
+ ***************************************************************************** *)
199
+
200
+ @pixi/polyfill/dist/esm/polyfill.mjs:
201
+ (*!
202
+ * @pixi/polyfill - v6.5.10
203
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
204
+ *
205
+ * @pixi/polyfill is licensed under the MIT License.
206
+ * http://www.opensource.org/licenses/mit-license
207
+ *)
208
+
209
+ @pixi/interaction/dist/esm/interaction.mjs:
210
+ (*!
211
+ * @pixi/interaction - v6.5.10
212
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
213
+ *
214
+ * @pixi/interaction is licensed under the MIT License.
215
+ * http://www.opensource.org/licenses/mit-license
216
+ *)
217
+ (*! *****************************************************************************
218
+ Copyright (c) Microsoft Corporation.
219
+
220
+ Permission to use, copy, modify, and/or distribute this software for any
221
+ purpose with or without fee is hereby granted.
222
+
223
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
224
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
225
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
226
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
227
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
228
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
229
+ PERFORMANCE OF THIS SOFTWARE.
230
+ ***************************************************************************** *)
231
+
232
+ @pixi/loaders/dist/esm/loaders.mjs:
233
+ (*!
234
+ * @pixi/loaders - v6.5.10
235
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
236
+ *
237
+ * @pixi/loaders is licensed under the MIT License.
238
+ * http://www.opensource.org/licenses/mit-license
239
+ *)
240
+
241
+ @pixi/sprite/dist/esm/sprite.mjs:
242
+ (*!
243
+ * @pixi/sprite - v6.5.10
244
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
245
+ *
246
+ * @pixi/sprite is licensed under the MIT License.
247
+ * http://www.opensource.org/licenses/mit-license
248
+ *)
249
+ (*! *****************************************************************************
250
+ Copyright (c) Microsoft Corporation.
251
+
252
+ Permission to use, copy, modify, and/or distribute this software for any
253
+ purpose with or without fee is hereby granted.
254
+
255
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
256
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
257
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
258
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
259
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
260
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
261
+ PERFORMANCE OF THIS SOFTWARE.
262
+ ***************************************************************************** *)
263
+
264
+ @pixi/text/dist/esm/text.mjs:
265
+ (*!
266
+ * @pixi/text - v6.5.10
267
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
268
+ *
269
+ * @pixi/text is licensed under the MIT License.
270
+ * http://www.opensource.org/licenses/mit-license
271
+ *)
272
+ (*! *****************************************************************************
273
+ Copyright (c) Microsoft Corporation.
274
+
275
+ Permission to use, copy, modify, and/or distribute this software for any
276
+ purpose with or without fee is hereby granted.
277
+
278
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
279
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
280
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
281
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
282
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
283
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
284
+ PERFORMANCE OF THIS SOFTWARE.
285
+ ***************************************************************************** *)
286
+ */