@quick-threejs/reactive 0.1.31 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.module-BmmoQ8ZO.js +35 -0
- package/dist/{app.module-BbeIDure.mjs → app.module-WohiJuEI.mjs} +1847 -1737
- package/dist/common/interfaces/loader.interface.d.ts +3 -2
- package/dist/core/app/app.module.d.ts +8 -4
- package/dist/core/app/app.service.d.ts +1 -1
- package/dist/core/app/app.util.d.ts +2 -2
- package/dist/core/app/renderer/renderer.controller.d.ts +3 -3
- package/dist/core/app/timer/timer.controller.d.ts +2 -2
- package/dist/core/app/world/world.controller.d.ts +7 -0
- package/dist/core/app/world/world.module.d.ts +5 -1
- package/dist/core/register/loader/loader.module.d.ts +1 -0
- package/dist/core/register/loader/loader.service.d.ts +2 -0
- package/dist/core/register/register.module.d.ts +6 -5
- package/dist/core/register/register.service.d.ts +1 -0
- package/dist/main.js +3 -3
- package/dist/main.mjs +688 -678
- package/dist/worker.js +1 -1
- package/dist/worker.mjs +31 -27
- package/package.json +1 -1
- package/dist/app.module-BaIoj4QA.js +0 -34
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";var Ti=Object.defineProperty;var Mi=(t,e,r)=>e in t?Ti(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var p=(t,e,r)=>Mi(t,typeof e!="symbol"?e+"":e,r);const E=require("three");var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ri(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Fr={};/*! *****************************************************************************
|
|
2
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */var Lr;function $i(){if(Lr)return Fr;Lr=1;var t;return function(e){(function(r){var n=typeof globalThis=="object"?globalThis:typeof zr=="object"?zr:typeof self=="object"?self:typeof this=="object"?this:u(),i=s(e);typeof n.Reflect<"u"&&(i=s(n.Reflect,i)),r(i,n),typeof n.Reflect>"u"&&(n.Reflect=e);function s(c,l){return function(h,v){Object.defineProperty(c,h,{configurable:!0,writable:!0,value:v}),l&&l(h,v)}}function o(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return o()||a()}})(function(r,n){var i=Object.prototype.hasOwnProperty,s=typeof Symbol=="function",o=s&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=s&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",c={__proto__:[]}instanceof Array,l=!u&&!c,h={create:u?function(){return jt(Object.create(null))}:c?function(){return jt({__proto__:null})}:function(){return jt({})},has:l?function(f,d){return i.call(f,d)}:function(f,d){return d in f},get:l?function(f,d){return i.call(f,d)?f[d]:void 0}:function(f,d){return f[d]}},v=Object.getPrototypeOf(Function),w=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Pi(),L=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Si(),M=typeof WeakMap=="function"?WeakMap:Ci(),D=s?Symbol.for("@reflect-metadata:registry"):void 0,y=bi(),C=wi(y);function P(f,d,m,S){if(F(m)){if(!Rr(f))throw new TypeError;if(!$r(d))throw new TypeError;return ne(f,d)}else{if(!Rr(f))throw new TypeError;if(!K(d))throw new TypeError;if(!K(S)&&!F(S)&&!ke(S))throw new TypeError;return ke(S)&&(S=void 0),m=ue(m),Z(f,d,m,S)}}r("decorate",P);function $(f,d){function m(S,A){if(!K(S))throw new TypeError;if(!F(A)&&!_i(A))throw new TypeError;ce(f,d,S,A)}return m}r("metadata",$);function g(f,d,m,S){if(!K(m))throw new TypeError;return F(S)||(S=ue(S)),ce(f,d,m,S)}r("defineMetadata",g);function b(f,d,m){if(!K(d))throw new TypeError;return F(m)||(m=ue(m)),Q(f,d,m)}r("hasMetadata",b);function k(f,d,m){if(!K(d))throw new TypeError;return F(m)||(m=ue(m)),he(f,d,m)}r("hasOwnMetadata",k);function H(f,d,m){if(!K(d))throw new TypeError;return F(m)||(m=ue(m)),ot(f,d,m)}r("getMetadata",H);function _(f,d,m){if(!K(d))throw new TypeError;return F(m)||(m=ue(m)),De(f,d,m)}r("getOwnMetadata",_);function x(f,d){if(!K(f))throw new TypeError;return F(d)||(d=ue(d)),Ae(f,d)}r("getMetadataKeys",x);function z(f,d){if(!K(f))throw new TypeError;return F(d)||(d=ue(d)),Or(f,d)}r("getOwnMetadataKeys",z);function q(f,d,m){if(!K(d))throw new TypeError;if(F(m)||(m=ue(m)),!K(d))throw new TypeError;F(m)||(m=ue(m));var S=Be(d,m,!1);return F(S)?!1:S.OrdinaryDeleteMetadata(f,d,m)}r("deleteMetadata",q);function ne(f,d){for(var m=f.length-1;m>=0;--m){var S=f[m],A=S(d);if(!F(A)&&!ke(A)){if(!$r(A))throw new TypeError;d=A}}return d}function Z(f,d,m,S){for(var A=f.length-1;A>=0;--A){var ee=f[A],J=ee(d,m,S);if(!F(J)&&!ke(J)){if(!K(J))throw new TypeError;S=J}}return S}function Q(f,d,m){var S=he(f,d,m);if(S)return!0;var A=$t(d);return ke(A)?!1:Q(f,A,m)}function he(f,d,m){var S=Be(d,m,!1);return F(S)?!1:Mr(S.OrdinaryHasOwnMetadata(f,d,m))}function ot(f,d,m){var S=he(f,d,m);if(S)return De(f,d,m);var A=$t(d);if(!ke(A))return ot(f,A,m)}function De(f,d,m){var S=Be(d,m,!1);if(!F(S))return S.OrdinaryGetOwnMetadata(f,d,m)}function ce(f,d,m,S){var A=Be(m,S,!0);A.OrdinaryDefineOwnMetadata(f,d,m,S)}function Ae(f,d){var m=Or(f,d),S=$t(f);if(S===null)return m;var A=Ae(S,d);if(A.length<=0)return m;if(m.length<=0)return A;for(var ee=new L,J=[],W=0,O=m;W<O.length;W++){var T=O[W],R=ee.has(T);R||(ee.add(T),J.push(T))}for(var j=0,N=A;j<N.length;j++){var T=N[j],R=ee.has(T);R||(ee.add(T),J.push(T))}return J}function Or(f,d){var m=Be(f,d,!1);return m?m.OrdinaryOwnMetadataKeys(f,d):[]}function Tr(f){if(f===null)return 1;switch(typeof f){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return f===null?1:6;default:return 6}}function F(f){return f===void 0}function ke(f){return f===null}function di(f){return typeof f=="symbol"}function K(f){return typeof f=="object"?f!==null:typeof f=="function"}function pi(f,d){switch(Tr(f)){case 0:return f;case 1:return f;case 2:return f;case 3:return f;case 4:return f;case 5:return f}var m="string",S=jr(f,o);if(S!==void 0){var A=S.call(f,m);if(K(A))throw new TypeError;return A}return vi(f)}function vi(f,d){var m,S;{var A=f.toString;if(at(A)){var S=A.call(f);if(!K(S))return S}var m=f.valueOf;if(at(m)){var S=m.call(f);if(!K(S))return S}}throw new TypeError}function Mr(f){return!!f}function mi(f){return""+f}function ue(f){var d=pi(f);return di(d)?d:mi(d)}function Rr(f){return Array.isArray?Array.isArray(f):f instanceof Object?f instanceof Array:Object.prototype.toString.call(f)==="[object Array]"}function at(f){return typeof f=="function"}function $r(f){return typeof f=="function"}function _i(f){switch(Tr(f)){case 3:return!0;case 4:return!0;default:return!1}}function Rt(f,d){return f===d||f!==f&&d!==d}function jr(f,d){var m=f[d];if(m!=null){if(!at(m))throw new TypeError;return m}}function xr(f){var d=jr(f,a);if(!at(d))throw new TypeError;var m=d.call(f);if(!K(m))throw new TypeError;return m}function Dr(f){return f.value}function Ar(f){var d=f.next();return d.done?!1:d}function kr(f){var d=f.return;d&&d.call(f)}function $t(f){var d=Object.getPrototypeOf(f);if(typeof f!="function"||f===v||d!==v)return d;var m=f.prototype,S=m&&Object.getPrototypeOf(m);if(S==null||S===Object.prototype)return d;var A=S.constructor;return typeof A!="function"||A===f?d:A}function yi(){var f;!F(D)&&typeof n.Reflect<"u"&&!(D in n.Reflect)&&typeof n.Reflect.defineMetadata=="function"&&(f=gi(n.Reflect));var d,m,S,A=new M,ee={registerProvider:J,getProvider:O,setProvider:R};return ee;function J(j){if(!Object.isExtensible(ee))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case f===j:break;case F(d):d=j;break;case d===j:break;case F(m):m=j;break;case m===j:break;default:S===void 0&&(S=new L),S.add(j);break}}function W(j,N){if(!F(d)){if(d.isProviderFor(j,N))return d;if(!F(m)){if(m.isProviderFor(j,N))return d;if(!F(S))for(var V=xr(S);;){var G=Ar(V);if(!G)return;var ae=Dr(G);if(ae.isProviderFor(j,N))return kr(V),ae}}}if(!F(f)&&f.isProviderFor(j,N))return f}function O(j,N){var V=A.get(j),G;return F(V)||(G=V.get(N)),F(G)&&(G=W(j,N),F(G)||(F(V)&&(V=new w,A.set(j,V)),V.set(N,G))),G}function T(j){if(F(j))throw new TypeError;return d===j||m===j||!F(S)&&S.has(j)}function R(j,N,V){if(!T(V))throw new Error("Metadata provider not registered.");var G=O(j,N);if(G!==V){if(!F(G))return!1;var ae=A.get(j);F(ae)&&(ae=new w,A.set(j,ae)),ae.set(N,V)}return!0}}function bi(){var f;return!F(D)&&K(n.Reflect)&&Object.isExtensible(n.Reflect)&&(f=n.Reflect[D]),F(f)&&(f=yi()),!F(D)&&K(n.Reflect)&&Object.isExtensible(n.Reflect)&&Object.defineProperty(n.Reflect,D,{enumerable:!1,configurable:!1,writable:!1,value:f}),f}function wi(f){var d=new M,m={isProviderFor:function(T,R){var j=d.get(T);return F(j)?!1:j.has(R)},OrdinaryDefineOwnMetadata:J,OrdinaryHasOwnMetadata:A,OrdinaryGetOwnMetadata:ee,OrdinaryOwnMetadataKeys:W,OrdinaryDeleteMetadata:O};return y.registerProvider(m),m;function S(T,R,j){var N=d.get(T),V=!1;if(F(N)){if(!j)return;N=new w,d.set(T,N),V=!0}var G=N.get(R);if(F(G)){if(!j)return;if(G=new w,N.set(R,G),!f.setProvider(T,R,m))throw N.delete(R),V&&d.delete(T),new Error("Wrong provider for target.")}return G}function A(T,R,j){var N=S(R,j,!1);return F(N)?!1:Mr(N.has(T))}function ee(T,R,j){var N=S(R,j,!1);if(!F(N))return N.get(T)}function J(T,R,j,N){var V=S(j,N,!0);V.set(T,R)}function W(T,R){var j=[],N=S(T,R,!1);if(F(N))return j;for(var V=N.keys(),G=xr(V),ae=0;;){var Ir=Ar(G);if(!Ir)return j.length=ae,j;var Ei=Dr(Ir);try{j[ae]=Ei}catch(Oi){try{kr(G)}finally{throw Oi}}ae++}}function O(T,R,j){var N=S(R,j,!1);if(F(N)||!N.delete(T))return!1;if(N.size===0){var V=d.get(R);F(V)||(V.delete(j),V.size===0&&d.delete(V))}return!0}}function gi(f){var d=f.defineMetadata,m=f.hasOwnMetadata,S=f.getOwnMetadata,A=f.getOwnMetadataKeys,ee=f.deleteMetadata,J=new M,W={isProviderFor:function(O,T){var R=J.get(O);return!F(R)&&R.has(T)?!0:A(O,T).length?(F(R)&&(R=new L,J.set(O,R)),R.add(T),!0):!1},OrdinaryDefineOwnMetadata:d,OrdinaryHasOwnMetadata:m,OrdinaryGetOwnMetadata:S,OrdinaryOwnMetadataKeys:A,OrdinaryDeleteMetadata:ee};return W}function Be(f,d,m){var S=y.getProvider(f,d);if(!F(S))return S;if(m){if(y.setProvider(f,d,C))return C;throw new Error("Illegal state.")}}function Pi(){var f={},d=[],m=function(){function W(O,T,R){this._index=0,this._keys=O,this._values=T,this._selector=R}return W.prototype["@@iterator"]=function(){return this},W.prototype[a]=function(){return this},W.prototype.next=function(){var O=this._index;if(O>=0&&O<this._keys.length){var T=this._selector(this._keys[O],this._values[O]);return O+1>=this._keys.length?(this._index=-1,this._keys=d,this._values=d):this._index++,{value:T,done:!1}}return{value:void 0,done:!0}},W.prototype.throw=function(O){throw this._index>=0&&(this._index=-1,this._keys=d,this._values=d),O},W.prototype.return=function(O){return this._index>=0&&(this._index=-1,this._keys=d,this._values=d),{value:O,done:!0}},W}(),S=function(){function W(){this._keys=[],this._values=[],this._cacheKey=f,this._cacheIndex=-2}return Object.defineProperty(W.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),W.prototype.has=function(O){return this._find(O,!1)>=0},W.prototype.get=function(O){var T=this._find(O,!1);return T>=0?this._values[T]:void 0},W.prototype.set=function(O,T){var R=this._find(O,!0);return this._values[R]=T,this},W.prototype.delete=function(O){var T=this._find(O,!1);if(T>=0){for(var R=this._keys.length,j=T+1;j<R;j++)this._keys[j-1]=this._keys[j],this._values[j-1]=this._values[j];return this._keys.length--,this._values.length--,Rt(O,this._cacheKey)&&(this._cacheKey=f,this._cacheIndex=-2),!0}return!1},W.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=f,this._cacheIndex=-2},W.prototype.keys=function(){return new m(this._keys,this._values,A)},W.prototype.values=function(){return new m(this._keys,this._values,ee)},W.prototype.entries=function(){return new m(this._keys,this._values,J)},W.prototype["@@iterator"]=function(){return this.entries()},W.prototype[a]=function(){return this.entries()},W.prototype._find=function(O,T){if(!Rt(this._cacheKey,O)){this._cacheIndex=-1;for(var R=0;R<this._keys.length;R++)if(Rt(this._keys[R],O)){this._cacheIndex=R;break}}return this._cacheIndex<0&&T&&(this._cacheIndex=this._keys.length,this._keys.push(O),this._values.push(void 0)),this._cacheIndex},W}();return S;function A(W,O){return W}function ee(W,O){return O}function J(W,O){return[W,O]}}function Si(){var f=function(){function d(){this._map=new w}return Object.defineProperty(d.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),d.prototype.has=function(m){return this._map.has(m)},d.prototype.add=function(m){return this._map.set(m,m),this},d.prototype.delete=function(m){return this._map.delete(m)},d.prototype.clear=function(){this._map.clear()},d.prototype.keys=function(){return this._map.keys()},d.prototype.values=function(){return this._map.keys()},d.prototype.entries=function(){return this._map.entries()},d.prototype["@@iterator"]=function(){return this.keys()},d.prototype[a]=function(){return this.keys()},d}();return f}function Ci(){var f=16,d=h.create(),m=S();return function(){function O(){this._key=S()}return O.prototype.has=function(T){var R=A(T,!1);return R!==void 0?h.has(R,this._key):!1},O.prototype.get=function(T){var R=A(T,!1);return R!==void 0?h.get(R,this._key):void 0},O.prototype.set=function(T,R){var j=A(T,!0);return j[this._key]=R,this},O.prototype.delete=function(T){var R=A(T,!1);return R!==void 0?delete R[this._key]:!1},O.prototype.clear=function(){this._key=S()},O}();function S(){var O;do O="@@WeakMap@@"+W();while(h.has(d,O));return d[O]=!0,O}function A(O,T){if(!i.call(O,m)){if(!T)return;Object.defineProperty(O,m,{value:h.create()})}return O[m]}function ee(O,T){for(var R=0;R<T;++R)O[R]=Math.random()*255|0;return O}function J(O){if(typeof Uint8Array=="function"){var T=new Uint8Array(O);return typeof crypto<"u"?crypto.getRandomValues(T):typeof msCrypto<"u"?msCrypto.getRandomValues(T):ee(T,O),T}return ee(new Array(O),O)}function W(){var O=J(f);O[6]=O[6]&79|64,O[8]=O[8]&191|128;for(var T="",R=0;R<f;++R){var j=O[R];(R===4||R===6||R===8)&&(T+="-"),j<16&&(T+="0"),T+=j.toString(16).toLowerCase()}return T}}function jt(f){return f.__=void 0,delete f.__,f}})}(t||(t={})),Fr}$i();var Yt;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Yt||(Yt={}));const te=Yt;/*! *****************************************************************************
|
|
15
|
+
Copyright (c) Microsoft Corporation.
|
|
16
|
+
|
|
17
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
18
|
+
purpose with or without fee is hereby granted.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
21
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
22
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
23
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
24
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
25
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
27
|
+
***************************************************************************** */var Zt=function(t,e){return Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Zt(t,e)};function mr(t,e){Zt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function ji(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,[])).next())})}function xi(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ct(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _t(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Te(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_t(arguments[e]));return t}var Gt="injectionTokens";function Di(t){var e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(Gt,t)||{};return Object.keys(r).forEach(function(n){e[+n]=r[n]}),e}function Ai(t,e){return function(r,n,i){var s=Reflect.getOwnMetadata(Gt,r)||{};s[i]=t,Reflect.defineMetadata(Gt,s,r)}}function xn(t){return!!t.useClass}function Qt(t){return!!t.useFactory}var Dn=function(){function t(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return t.prototype.createProxy=function(e){var r=this,n={},i=!1,s,o=function(){return i||(s=e(r.wrap()),i=!0),s};return new Proxy(n,this.createHandler(o))},t.prototype.createHandler=function(e){var r={},n=function(i){r[i]=function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];s[0]=e();var a=Reflect[i];return a.apply(void 0,Te(s))}};return this.reflectMethods.forEach(n),r},t}();function Ie(t){return typeof t=="string"||typeof t=="symbol"}function ki(t){return typeof t=="object"&&"token"in t&&"multiple"in t}function Wr(t){return typeof t=="object"&&"token"in t&&"transform"in t}function Ii(t){return typeof t=="function"||t instanceof Dn}function dt(t){return!!t.useToken}function pt(t){return t.useValue!=null}function zi(t){return xn(t)||pt(t)||dt(t)||Qt(t)}var _r=function(){function t(){this._registryMap=new Map}return t.prototype.entries=function(){return this._registryMap.entries()},t.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},t.prototype.get=function(e){this.ensure(e);var r=this._registryMap.get(e);return r[r.length-1]||null},t.prototype.set=function(e,r){this.ensure(e),this._registryMap.get(e).push(r)},t.prototype.setAll=function(e,r){this._registryMap.set(e,r)},t.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},t.prototype.clear=function(){this._registryMap.clear()},t.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},t}(),Fi=function(t){mr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(_r),Nr=function(){function t(){this.scopedResolutions=new Map}return t}();function Li(t,e){if(t===null)return"at position #"+e;var r=t.split(",")[e].trim();return'"'+r+'" at position #'+e}function Wi(t,e,r){return r===void 0&&(r=" "),Te([t],e.message.split(`
|
|
28
|
+
`).map(function(n){return r+n})).join(`
|
|
29
|
+
`)}function Ni(t,e,r){var n=_t(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2),i=n[1],s=i===void 0?null:i,o=Li(s,e);return Wi("Cannot inject the dependency "+o+' of "'+t.name+'" constructor. Reason:',r)}function Hi(t){if(typeof t.dispose!="function")return!1;var e=t.dispose;return!(e.length>0)}var qi=function(t){mr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(_r),Ui=function(t){mr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(_r),Vi=function(){function t(){this.preResolution=new qi,this.postResolution=new Ui}return t}(),An=new Map,Bi=function(){function t(e){this.parent=e,this._registry=new Fi,this.interceptors=new Vi,this.disposed=!1,this.disposables=new Set}return t.prototype.register=function(e,r,n){n===void 0&&(n={lifecycle:te.Transient}),this.ensureNotDisposed();var i;if(zi(r)?i=r:i={useClass:r},dt(i))for(var s=[e],o=i;o!=null;){var a=o.useToken;if(s.includes(a))throw new Error("Token registration cycle detected! "+Te(s,[a]).join(" -> "));s.push(a);var u=this._registry.get(a);u&&dt(u.provider)?o=u.provider:o=null}if((n.lifecycle===te.Singleton||n.lifecycle==te.ContainerScoped||n.lifecycle==te.ResolutionScoped)&&(pt(i)||Qt(i)))throw new Error('Cannot use lifecycle "'+te[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:i,options:n}),this},t.prototype.registerType=function(e,r){return this.ensureNotDisposed(),Ie(r)?this.register(e,{useToken:r}):this.register(e,{useClass:r})},t.prototype.registerInstance=function(e,r){return this.ensureNotDisposed(),this.register(e,{useValue:r})},t.prototype.registerSingleton=function(e,r){if(this.ensureNotDisposed(),Ie(e)){if(Ie(r))return this.register(e,{useToken:r},{lifecycle:te.Singleton});if(r)return this.register(e,{useClass:r},{lifecycle:te.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=e;return r&&!Ie(r)&&(n=r),this.register(e,{useClass:n},{lifecycle:te.Singleton})},t.prototype.resolve=function(e,r){r===void 0&&(r=new Nr),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Ie(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),n){var i=this.resolveRegistration(n,r);return this.executePostResolutionInterceptor(e,i,"Single"),i}if(Ii(e)){var i=this.construct(e,r);return this.executePostResolutionInterceptor(e,i,"Single"),i}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},t.prototype.executePreResolutionInterceptor=function(e,r){var n,i;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var o=ct(this.interceptors.preResolution.getAll(e)),a=o.next();!a.done;a=o.next()){var u=a.value;u.options.frequency!="Once"&&s.push(u),u.callback(e,r)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(e,s)}},t.prototype.executePostResolutionInterceptor=function(e,r,n){var i,s;if(this.interceptors.postResolution.has(e)){var o=[];try{for(var a=ct(this.interceptors.postResolution.getAll(e)),u=a.next();!u.done;u=a.next()){var c=u.value;c.options.frequency!="Once"&&o.push(c),c.callback(e,r,n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(e,o)}},t.prototype.resolveRegistration=function(e,r){if(this.ensureNotDisposed(),e.options.lifecycle===te.ResolutionScoped&&r.scopedResolutions.has(e))return r.scopedResolutions.get(e);var n=e.options.lifecycle===te.Singleton,i=e.options.lifecycle===te.ContainerScoped,s=n||i,o;return pt(e.provider)?o=e.provider.useValue:dt(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,r)):this.resolve(e.provider.useToken,r):xn(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,r)):this.construct(e.provider.useClass,r):Qt(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,r),e.options.lifecycle===te.ResolutionScoped&&r.scopedResolutions.set(e,o),o},t.prototype.resolveAll=function(e,r){var n=this;r===void 0&&(r=new Nr),this.ensureNotDisposed();var i=this.getAllRegistrations(e);if(!i&&Ie(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),i){var s=i.map(function(a){return n.resolveRegistration(a,r)});return this.executePostResolutionInterceptor(e,s,"All"),s}var o=[this.construct(e,r)];return this.executePostResolutionInterceptor(e,o,"All"),o},t.prototype.isRegistered=function(e,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(e)||r&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},t.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},t.prototype.clearInstances=function(){var e,r;this.ensureNotDisposed();try{for(var n=ct(this._registry.entries()),i=n.next();!i.done;i=n.next()){var s=_t(i.value,2),o=s[0],a=s[1];this._registry.setAll(o,a.filter(function(u){return!pt(u.provider)}).map(function(u){return u.instance=void 0,u}))}}catch(u){e={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.createChildContainer=function(){var e,r;this.ensureNotDisposed();var n=new t(this);try{for(var i=ct(this._registry.entries()),s=i.next();!s.done;s=i.next()){var o=_t(s.value,2),a=o[0],u=o[1];u.some(function(c){var l=c.options;return l.lifecycle===te.ContainerScoped})&&n._registry.setAll(a,u.map(function(c){return c.options.lifecycle===te.ContainerScoped?{provider:c.provider,options:c.options}:c}))}}catch(c){e={error:c}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},t.prototype.beforeResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:r,options:n})},t.prototype.afterResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:r,options:n})},t.prototype.dispose=function(){return ji(this,void 0,void 0,function(){var e;return xi(this,function(r){switch(r.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(n){var i=n.dispose();i&&e.push(i)}),[4,Promise.all(e)];case 1:return r.sent(),[2]}})})},t.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},t.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},t.prototype.construct=function(e,r){var n=this;if(e instanceof Dn)return e.createProxy(function(s){return n.resolve(s,r)});var i=function(){var s=An.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var o=s.map(n.resolveParams(r,e));return new(e.bind.apply(e,Te([void 0],o)))}();return Hi(i)&&this.disposables.add(i),i},t.prototype.resolveParams=function(e,r){var n=this;return function(i,s){var o,a,u;try{return ki(i)?Wr(i)?i.multiple?(o=n.resolve(i.transform)).transform.apply(o,Te([n.resolveAll(i.token)],i.transformArgs)):(a=n.resolve(i.transform)).transform.apply(a,Te([n.resolve(i.token,e)],i.transformArgs)):i.multiple?n.resolveAll(i.token):n.resolve(i.token,e):Wr(i)?(u=n.resolve(i.transform,e)).transform.apply(u,Te([n.resolve(i.token,e)],i.transformArgs)):n.resolve(i,e)}catch(c){throw new Error(Ni(r,s,c))}}},t.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},t}(),yr=new Bi;function I(t){return Ai(t)}function kn(){return function(t){An.set(t,Di(t))}}function Y(){return function(t){kn()(t),yr.registerSingleton(t)}}function Ot(t,e){return function(r){kn()(r),yr.register(r,r,{lifecycle:t})}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);const Yi=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],br=["contextmenu","resize","mousedown","mousemove","mouseup","pointerdown","pointermove","pointercancel","pointerup","touchstart","touchmove","touchend","wheel","keydown"];var yt=(t=>(t[t.PERSPECTIVE=0]="PERSPECTIVE",t[t.ORTHOGRAPHIC=1]="ORTHOGRAPHIC",t))(yt||{});class In{constructor(){p(this,"contextmenu$$");p(this,"resize$$");p(this,"mousedown$$");p(this,"mousemove$$");p(this,"mouseup$$");p(this,"pointerdown$$");p(this,"pointermove$$");p(this,"pointercancel$$");p(this,"pointerup$$");p(this,"touchstart$$");p(this,"touchmove$$");p(this,"touchend$$");p(this,"wheel$$");p(this,"keydown$$")}}class zn extends In{constructor(){super(...arguments);p(this,"contextmenu$");p(this,"resize$");p(this,"mousedown$");p(this,"mousemove$");p(this,"mouseup$");p(this,"pointerdown$");p(this,"pointermove$");p(this,"pointercancel$");p(this,"pointerup$");p(this,"touchstart$");p(this,"touchmove$");p(this,"touchend$");p(this,"wheel$");p(this,"keydown$")}}class Fn extends zn{constructor(){super(...arguments);p(this,"contextmenu");p(this,"resize");p(this,"mousedown");p(this,"mousemove");p(this,"mouseup");p(this,"pointerdown");p(this,"pointermove");p(this,"pointercancel");p(this,"pointerup");p(this,"touchstart");p(this,"touchmove");p(this,"touchend");p(this,"wheel");p(this,"keydown")}}class Ln{constructor(){p(this,"contextmenu$");p(this,"resize$");p(this,"mousedown$");p(this,"mousemove$");p(this,"mouseup$");p(this,"pointerdown$");p(this,"pointermove$");p(this,"pointercancel$");p(this,"pointerup$");p(this,"touchstart$");p(this,"touchmove$");p(this,"touchend$");p(this,"wheel$");p(this,"keydown$");p(this,"contextmenu");p(this,"resize");p(this,"mousedown");p(this,"mousemove");p(this,"mouseup");p(this,"pointerdown");p(this,"pointermove");p(this,"pointercancel");p(this,"pointerup");p(this,"touchstart");p(this,"touchmove");p(this,"touchend");p(this,"wheel");p(this,"keydown")}}class Zi{constructor(){p(this,"contextmenu$");p(this,"resize$");p(this,"mousedown$");p(this,"mousemove$");p(this,"mouseup$");p(this,"pointerdown$");p(this,"pointermove$");p(this,"pointercancel$");p(this,"pointerup$");p(this,"touchstart$");p(this,"touchmove$");p(this,"touchend$");p(this,"wheel$");p(this,"keydown$")}}const Gi="CONTAINER",Wn="LOADER_SERIALIZED_LOAD";var Kt=function(t,e){return Kt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Kt(t,e)};function rt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Qi(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function Nn(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Fe(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ye(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Me(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function ze(t){return this instanceof ze?(this.v=t,this):new ze(t)}function Ki(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(w){return function(L){return Promise.resolve(L).then(w,h)}}function a(w,L){n[w]&&(i[w]=function(M){return new Promise(function(D,y){s.push([w,M,D,y])>1||u(w,M)})},L&&(i[w]=L(i[w])))}function u(w,L){try{c(n[w](L))}catch(M){v(s[0][3],M)}}function c(w){w.value instanceof ze?Promise.resolve(w.value.v).then(l,h):v(s[0][2],w)}function l(w){u("next",w)}function h(w){u("throw",w)}function v(w,L){w(L),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Ji(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Fe=="function"?Fe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,u){o=t[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(c){s({value:c,done:a})},o)}}function B(t){return typeof t=="function"}function Hn(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var xt=Hn(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
30
|
+
`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
31
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function Jt(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var nt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Fe(o),u=a.next();!u.done;u=a.next()){var c=u.value;c.remove(this)}}catch(M){e={error:M}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(B(l))try{l()}catch(M){s=M instanceof xt?M.errors:[M]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var v=Fe(h),w=v.next();!w.done;w=v.next()){var L=w.value;try{Hr(L)}catch(M){s=s??[],M instanceof xt?s=Me(Me([],ye(s)),ye(M.errors)):s.push(M)}}}catch(M){n={error:M}}finally{try{w&&!w.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}if(s)throw new xt(s)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Hr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&Jt(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&Jt(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),qn=nt.EMPTY;function Un(t){return t instanceof nt||t&&"closed"in t&&B(t.remove)&&B(t.add)&&B(t.unsubscribe)}function Hr(t){B(t)?t():t.unsubscribe()}var Vn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Bn={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Me([t,e],ye(r)))},clearTimeout:function(t){var e=Bn.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Yn(t){Bn.setTimeout(function(){throw t})}function qr(){}function vt(t){t()}var wr=function(t){rt(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Un(r)&&r.add(n)):n.destination=rs,n}return e.create=function(r,n,i){return new Xe(r,n,i)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(nt),Xi=Function.prototype.bind;function Dt(t,e){return Xi.call(t,e)}var es=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){ut(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){ut(n)}else ut(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){ut(r)}},t}(),Xe=function(t){rt(e,t);function e(r,n,i){var s=t.call(this)||this,o;if(B(r)||!r)o={next:r??void 0,error:n??void 0,complete:i??void 0};else{var a;s&&Vn.useDeprecatedNextContext?(a=Object.create(r),a.unsubscribe=function(){return s.unsubscribe()},o={next:r.next&&Dt(r.next,a),error:r.error&&Dt(r.error,a),complete:r.complete&&Dt(r.complete,a)}):o=r}return s.destination=new es(o),s}return e}(wr);function ut(t){Yn(t)}function ts(t){throw t}var rs={closed:!0,next:qr,error:ts,complete:qr},gr=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Zn(t){return t}function ns(t){return t.length===0?Zn:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var le=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,s=ss(e)?e:new Xe(e,r,n);return vt(function(){var o=i,a=o.operator,u=o.source;s.add(a?a.call(s,u):u?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Ur(r),new r(function(i,s){var o=new Xe({next:function(a){try{e(a)}catch(u){s(u),o.unsubscribe()}},error:s,complete:i});n.subscribe(o)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[gr]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return ns(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Ur(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t}();function Ur(t){var e;return(e=t??Vn.Promise)!==null&&e!==void 0?e:Promise}function is(t){return t&&B(t.next)&&B(t.error)&&B(t.complete)}function ss(t){return t&&t instanceof wr||is(t)&&Un(t)}function os(t){return B(t==null?void 0:t.lift)}function Ve(t){return function(e){if(os(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Le(t,e,r,n,i){return new as(t,e,r,n,i)}var as=function(t){rt(e,t);function e(r,n,i,s,o,a){var u=t.call(this,r)||this;return u.onFinalize=o,u.shouldUnsubscribe=a,u._next=n?function(c){try{n(c)}catch(l){r.error(l)}}:t.prototype._next,u._error=s?function(c){try{s(c)}catch(l){r.error(l)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(wr),cs={now:function(){return performance.now()},delegate:void 0},Xt={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=Xt.delegate;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);var i=e(function(s){r=void 0,t(s)});return new nt(function(){return r==null?void 0:r(i)})},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return requestAnimationFrame.apply(void 0,Me([],ye(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,Me([],ye(t)))},delegate:void 0};function us(t){return t?Gn(t):ls}function Gn(t){return new le(function(e){var r=t||cs,n=r.now(),i=0,s=function(){e.closed||(i=Xt.requestAnimationFrame(function(o){i=0;var a=r.now();e.next({timestamp:t?a:o,elapsed:a-n}),s()}))};return s(),function(){i&&Xt.cancelAnimationFrame(i)}})}var ls=Gn(),hs=Hn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Re=function(t){rt(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Vr(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new hs},e.prototype.next=function(r){var n=this;vt(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Fe(n.currentObservers),a=o.next();!a.done;a=o.next()){var u=a.value;u.next(r)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;vt(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;vt(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?qn:(this.currentObservers=null,a.push(r),new nt(function(){n.currentObservers=null,Jt(a,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,s=n.thrownError,o=n.isStopped;i?r.error(s):o&&r.complete()},e.prototype.asObservable=function(){var r=new le;return r.source=this,r},e.create=function(r,n){return new Vr(r,n)},e}(le),Vr=function(t){rt(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:qn},e}(Re),Qn=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function fs(t){return B(t==null?void 0:t.then)}function ds(t){return B(t[gr])}function ps(t){return Symbol.asyncIterator&&B(t==null?void 0:t[Symbol.asyncIterator])}function vs(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ms(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var _s=ms();function ys(t){return B(t==null?void 0:t[_s])}function bs(t){return Ki(this,arguments,function(){var r,n,i,s;return Nn(this,function(o){switch(o.label){case 0:r=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,ze(r.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,ze(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,ze(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function ws(t){return B(t==null?void 0:t.getReader)}function it(t){if(t instanceof le)return t;if(t!=null){if(ds(t))return gs(t);if(Qn(t))return Ps(t);if(fs(t))return Ss(t);if(ps(t))return Kn(t);if(ys(t))return Cs(t);if(ws(t))return Es(t)}throw vs(t)}function gs(t){return new le(function(e){var r=t[gr]();if(B(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ps(t){return new le(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Ss(t){return new le(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,Yn)})}function Cs(t){return new le(function(e){var r,n;try{for(var i=Fe(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){r={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}function Kn(t){return new le(function(e){Os(t,e).catch(function(r){return e.error(r)})})}function Es(t){return Kn(bs(t))}function Os(t,e){var r,n,i,s;return Qi(this,void 0,void 0,function(){var o,a;return Nn(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=Ji(t),u.label=1;case 1:return[4,r.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=u.sent(),i={error:a},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function We(t,e){return Ve(function(r,n){var i=0;r.subscribe(Le(n,function(s){n.next(t.call(e,s,i++))}))})}var Ts=Array.isArray;function Ms(t,e){return Ts(e)?t.apply(void 0,Me([],ye(e))):t(e)}function Rs(t){return We(function(e){return Ms(t,e)})}function $s(t,e,r,n,i,s,o,a){var u=[],c=0,l=0,h=!1,v=function(){h&&!u.length&&!c&&e.complete()},w=function(M){return c<n?L(M):u.push(M)},L=function(M){c++;var D=!1;it(r(M,l++)).subscribe(Le(e,function(y){e.next(y)},function(){D=!0},void 0,function(){if(D)try{c--;for(var y=function(){var C=u.shift();o||L(C)};u.length&&c<n;)y();v()}catch(C){e.error(C)}}))};return t.subscribe(Le(e,w,function(){h=!0,v()})),function(){}}function Jn(t,e,r){return r===void 0&&(r=1/0),B(e)?Jn(function(n,i){return We(function(s,o){return e(n,s,i,o)})(it(t(n,i)))},r):(typeof e=="number"&&(r=e),Ve(function(n,i){return $s(n,i,t,r)}))}var js=["addListener","removeListener"],xs=["addEventListener","removeEventListener"],Ds=["on","off"];function bt(t,e,r,n){if(B(r)&&(n=r,r=void 0),n)return bt(t,e,r).pipe(Rs(n));var i=ye(Is(t)?xs.map(function(a){return function(u){return t[a](e,u,r)}}):As(t)?js.map(Br(t,e)):ks(t)?Ds.map(Br(t,e)):[],2),s=i[0],o=i[1];if(!s&&Qn(t))return Jn(function(a){return bt(a,e,r)})(it(t));if(!s)throw new TypeError("Invalid event target");return new le(function(a){var u=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return a.next(1<c.length?c:c[0])};return s(u),function(){return o(u)}})}function Br(t,e){return function(r){return function(n){return t[r](e,n)}}}function As(t){return B(t.addListener)&&B(t.removeListener)}function ks(t){return B(t.on)&&B(t.off)}function Is(t){return B(t.addEventListener)&&B(t.removeEventListener)}function _e(t,e){return Ve(function(r,n){var i=0;r.subscribe(Le(n,function(s){return t.call(e,s,i++)&&n.next(s)}))})}function Ne(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new Re}:e,n=t.resetOnError,i=n===void 0?!0:n,s=t.resetOnComplete,o=s===void 0?!0:s,a=t.resetOnRefCountZero,u=a===void 0?!0:a;return function(c){var l,h,v,w=0,L=!1,M=!1,D=function(){h==null||h.unsubscribe(),h=void 0},y=function(){D(),l=v=void 0,L=M=!1},C=function(){var P=l;y(),P==null||P.unsubscribe()};return Ve(function(P,$){w++,!M&&!L&&D();var g=v=v??r();$.add(function(){w--,w===0&&!M&&!L&&(h=At(C,u))}),g.subscribe($),!l&&w>0&&(l=new Xe({next:function(b){return g.next(b)},error:function(b){M=!0,D(),h=At(y,i,b),g.error(b)},complete:function(){L=!0,D(),h=At(y,o),g.complete()}}),it(P).subscribe(l))})(c)}}function At(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(e===!0){t();return}if(e!==!1){var i=new Xe({next:function(){i.unsubscribe(),t()}});return it(e.apply(void 0,Me([],ye(r)))).subscribe(i)}}function zs(t,e){return e===void 0&&(e=!1),Ve(function(r,n){var i=0;r.subscribe(Le(n,function(s){var o=t(s,i++);(o||e)&&n.next(s),!o&&n.complete()}))})}function Fs(t,e,r){var n=B(t)||e||r?{next:t,error:e,complete:r}:t;return n?Ve(function(i,s){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(Le(s,function(u){var c;(c=n.next)===null||c===void 0||c.call(n,u),s.next(u)},function(){var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),s.complete()},function(u){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),s.error(u)},function(){var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Zn}var ge={},fe={},Pe={},Yr;function Xn(){if(Yr)return Pe;Yr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.DefaultSerializer=Pe.extendSerializer=void 0;function t(n,i){const s=n.deserialize.bind(n),o=n.serialize.bind(n);return{deserialize(a){return i.deserialize(a,s)},serialize(a){return i.serialize(a,o)}}}Pe.extendSerializer=t;const e={deserialize(n){return Object.assign(Error(n.message),{name:n.name,stack:n.stack})},serialize(n){return{__error_marker:"$$error",message:n.message,name:n.name,stack:n.stack}}},r=n=>n&&typeof n=="object"&&"__error_marker"in n&&n.__error_marker==="$$error";return Pe.DefaultSerializer={deserialize(n){return r(n)?e.deserialize(n):n},serialize(n){return n instanceof Error?e.serialize(n):n}},Pe}var Zr;function et(){if(Zr)return fe;Zr=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.serialize=fe.deserialize=fe.registerSerializer=void 0;const t=Xn();let e=t.DefaultSerializer;function r(s){e=t.extendSerializer(e,s)}fe.registerSerializer=r;function n(s){return e.deserialize(s)}fe.deserialize=n;function i(s){return e.serialize(s)}return fe.serialize=i,fe}var kt={},de={},Se={},Gr;function Ls(){if(Gr)return Se;Gr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.getBundleURL=Se.getBaseURL=void 0;let t;function e(){return t||(t=r()),t}Se.getBundleURL=e;function r(){try{throw new Error}catch(i){const s=(""+i.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(s)return n(s[0])}return"/"}function n(i){return(""+i).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}return Se.getBaseURL=n,Se}var Qr;function ei(){if(Qr)return de;Qr=1,Object.defineProperty(de,"__esModule",{value:!0}),de.isWorkerRuntime=de.getWorkerImplementation=de.defaultPoolSize=void 0;const t=Ls();de.defaultPoolSize=typeof navigator<"u"&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const e=a=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(a);function r(a){const u=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(u)}function n(){if(typeof Worker>"u")return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class a extends Worker{constructor(l,h){var v,w;typeof l=="string"&&h&&h._baseURL?l=new URL(l,h._baseURL):typeof l=="string"&&!e(l)&&t.getBundleURL().match(/^file:\/\//i)&&(l=new URL(l,t.getBundleURL().replace(/\/[^\/]+$/,"/")),(!((v=h==null?void 0:h.CORSWorkaround)!==null&&v!==void 0)||v)&&(l=r(`importScripts(${JSON.stringify(l)});`))),typeof l=="string"&&e(l)&&(!((w=h==null?void 0:h.CORSWorkaround)!==null&&w!==void 0)||w)&&(l=r(`importScripts(${JSON.stringify(l)});`)),super(l,h)}}class u extends a{constructor(l,h){const v=window.URL.createObjectURL(l);super(v,h)}static fromText(l,h){const v=new window.Blob([l],{type:"text/javascript"});return new u(v,h)}}return{blob:u,default:a}}let i;function s(){return i||(i=n()),i}de.getWorkerImplementation=s;function o(){const a=typeof self<"u"&&typeof Window<"u"&&self instanceof Window;return!!(typeof self<"u"&&self.postMessage&&!a)}return de.isWorkerRuntime=o,de}var Ce={},lt={exports:{}},It,Kr;function Ws(){if(Kr)return It;Kr=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;It=function(l,h){h=h||{};var v=typeof l;if(v==="string"&&l.length>0)return o(l);if(v==="number"&&isFinite(l))return h.long?u(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(h){var v=parseFloat(h[1]),w=(h[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return v*s;case"weeks":case"week":case"w":return v*i;case"days":case"day":case"d":return v*n;case"hours":case"hour":case"hrs":case"hr":case"h":return v*r;case"minutes":case"minute":case"mins":case"min":case"m":return v*e;case"seconds":case"second":case"secs":case"sec":case"s":return v*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function a(l){var h=Math.abs(l);return h>=n?Math.round(l/n)+"d":h>=r?Math.round(l/r)+"h":h>=e?Math.round(l/e)+"m":h>=t?Math.round(l/t)+"s":l+"ms"}function u(l){var h=Math.abs(l);return h>=n?c(l,h,n,"day"):h>=r?c(l,h,r,"hour"):h>=e?c(l,h,e,"minute"):h>=t?c(l,h,t,"second"):l+" ms"}function c(l,h,v,w){var L=h>=v*1.5;return Math.round(l/v)+" "+w+(L?"s":"")}return It}var zt,Jr;function Ns(){if(Jr)return zt;Jr=1;function t(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=s,n.enabled=a,n.humanize=Ws(),n.destroy=l,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function r(h){let v=0;for(let w=0;w<h.length;w++)v=(v<<5)-v+h.charCodeAt(w),v|=0;return n.colors[Math.abs(v)%n.colors.length]}n.selectColor=r;function n(h){let v,w=null,L,M;function D(...y){if(!D.enabled)return;const C=D,P=Number(new Date),$=P-(v||P);C.diff=$,C.prev=v,C.curr=P,v=P,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let g=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(k,H)=>{if(k==="%%")return"%";g++;const _=n.formatters[H];if(typeof _=="function"){const x=y[g];k=_.call(C,x),y.splice(g,1),g--}return k}),n.formatArgs.call(C,y),(C.log||n.log).apply(C,y)}return D.namespace=h,D.useColors=n.useColors(),D.color=n.selectColor(h),D.extend=i,D.destroy=n.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(L!==n.namespaces&&(L=n.namespaces,M=n.enabled(h)),M),set:y=>{w=y}}),typeof n.init=="function"&&n.init(D),D}function i(h,v){const w=n(this.namespace+(typeof v>"u"?":":v)+h);return w.log=this.log,w}function s(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let v;const w=(typeof h=="string"?h:"").split(/[\s,]+/),L=w.length;for(v=0;v<L;v++)w[v]&&(h=w[v].replace(/\*/g,".*?"),h[0]==="-"?n.skips.push(new RegExp("^"+h.slice(1)+"$")):n.names.push(new RegExp("^"+h+"$")))}function o(){const h=[...n.names.map(u),...n.skips.map(u).map(v=>"-"+v)].join(",");return n.enable(""),h}function a(h){if(h[h.length-1]==="*")return!0;let v,w;for(v=0,w=n.skips.length;v<w;v++)if(n.skips[v].test(h))return!1;for(v=0,w=n.names.length;v<w;v++)if(n.names[v].test(h))return!0;return!1}function u(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function c(h){return h instanceof Error?h.stack||h.message:h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}return zt=t,zt}var Xr;function Pr(){return Xr||(Xr=1,function(t,e){e.formatArgs=n,e.save=i,e.load=s,e.useColors=r,e.storage=o(),e.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;u.splice(1,0,c,"color: inherit");let l=0,h=0;u[0].replace(/%[a-zA-Z%]/g,v=>{v!=="%%"&&(l++,v==="%c"&&(h=l))}),u.splice(h,0,c)}e.log=console.debug||console.log||(()=>{});function i(u){try{u?e.storage.setItem("debug",u):e.storage.removeItem("debug")}catch{}}function s(){let u;try{u=e.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=process.env.DEBUG),u}function o(){try{return localStorage}catch{}}t.exports=Ns()(e);const{formatters:a}=t.exports;a.j=function(u){try{return JSON.stringify(u)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}(lt,lt.exports)),lt.exports}var Hs=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};class Tt{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch(e=>this._baseObserver.error(e))}error(e){this._baseObserver.error(e)}schedule(e){const r=Promise.all(this._pendingPromises),n=[],i=o=>n.push(o),s=Promise.resolve().then(()=>Hs(this,void 0,void 0,function*(){yield r,yield e(i),this._pendingPromises.delete(s);for(const o of n)this._baseObserver.next(o)})).catch(o=>{this._pendingPromises.delete(s),this._baseObserver.error(o)});this._pendingPromises.add(s)}}const ti=()=>typeof Symbol=="function",st=t=>ti()&&!!Symbol[t],Sr=t=>st(t)?Symbol[t]:"@@"+t;st("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const qs=Sr("iterator"),er=Sr("observable"),ri=Sr("species");function wt(t,e){const r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ye(t){let e=t.constructor;return e!==void 0&&(e=e[ri],e===null&&(e=void 0)),e!==void 0?e:re}function Us(t){return t instanceof re}function He(t){He.log?He.log(t):setTimeout(()=>{throw t},0)}function mt(t){Promise.resolve().then(()=>{try{t()}catch(e){He(e)}})}function ni(t){const e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{const r=wt(e,"unsubscribe");r&&r.call(e)}}catch(r){He(r)}}function tr(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function Vs(t){const e=t._queue;if(e){t._queue=void 0,t._state="ready";for(const r of e)if(ii(t,r.type,r.value),t._state==="closed")break}}function ii(t,e,r){t._state="running";const n=t._observer;try{const i=n?wt(n,e):void 0;switch(e){case"next":i&&i.call(n,r);break;case"error":if(tr(t),i)i.call(n,r);else throw r;break;case"complete":tr(t),i&&i.call(n);break}}catch(i){He(i)}t._state==="closed"?ni(t):t._state==="running"&&(t._state="ready")}function Ft(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue=t._queue||[],t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],mt(()=>Vs(t));return}ii(t,e,r)}}class Bs{constructor(e,r){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const n=new Ys(this);try{this._cleanup=r.call(void 0,n)}catch(i){n.error(i)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(tr(this),ni(this))}}class Ys{constructor(e){this._subscription=e}get closed(){return this._subscription._state==="closed"}next(e){Ft(this._subscription,"next",e)}error(e){Ft(this._subscription,"error",e)}complete(){Ft(this._subscription,"complete")}}class re{constructor(e){if(!(this instanceof re))throw new TypeError("Observable cannot be called as a function");if(typeof e!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,r,n){return(typeof e!="object"||e===null)&&(e={next:e,error:r,complete:n}),new Bs(e,this._subscriber)}pipe(e,...r){let n=this;for(const i of[e,...r])n=i(n);return n}tap(e,r,n){const i=typeof e!="object"||e===null?{next:e,error:r,complete:n}:e;return new re(s=>this.subscribe({next(o){i.next&&i.next(o),s.next(o)},error(o){i.error&&i.error(o),s.error(o)},complete(){i.complete&&i.complete(),s.complete()},start(o){i.start&&i.start(o)}}))}forEach(e){return new Promise((r,n)=>{if(typeof e!="function"){n(new TypeError(e+" is not a function"));return}function i(){s.unsubscribe(),r(void 0)}const s=this.subscribe({next(o){try{e(o,i)}catch(a){n(a),s.unsubscribe()}},error(o){n(o)},complete(){r(void 0)}})})}map(e){if(typeof e!="function")throw new TypeError(e+" is not a function");const r=Ye(this);return new r(n=>this.subscribe({next(i){let s=i;try{s=e(i)}catch(o){return n.error(o)}n.next(s)},error(i){n.error(i)},complete(){n.complete()}}))}filter(e){if(typeof e!="function")throw new TypeError(e+" is not a function");const r=Ye(this);return new r(n=>this.subscribe({next(i){try{if(!e(i))return}catch(s){return n.error(s)}n.next(i)},error(i){n.error(i)},complete(){n.complete()}}))}reduce(e,r){if(typeof e!="function")throw new TypeError(e+" is not a function");const n=Ye(this),i=arguments.length>1;let s=!1,o=r;return new n(a=>this.subscribe({next(u){const c=!s;if(s=!0,!c||i)try{o=e(o,u)}catch(l){return a.error(l)}else o=u},error(u){a.error(u)},complete(){if(!s&&!i)return a.error(new TypeError("Cannot reduce an empty sequence"));a.next(o),a.complete()}}))}concat(...e){const r=Ye(this);return new r(n=>{let i,s=0;function o(a){i=a.subscribe({next(u){n.next(u)},error(u){n.error(u)},complete(){s===e.length?(i=void 0,n.complete()):o(r.from(e[s++]))}})}return o(this),()=>{i&&(i.unsubscribe(),i=void 0)}})}flatMap(e){if(typeof e!="function")throw new TypeError(e+" is not a function");const r=Ye(this);return new r(n=>{const i=[],s=this.subscribe({next(a){let u;if(e)try{u=e(a)}catch(l){return n.error(l)}else u=a;const c=r.from(u).subscribe({next(l){n.next(l)},error(l){n.error(l)},complete(){const l=i.indexOf(c);l>=0&&i.splice(l,1),o()}});i.push(c)},error(a){n.error(a)},complete(){o()}});function o(){s.closed&&i.length===0&&n.complete()}return()=>{i.forEach(a=>a.unsubscribe()),s.unsubscribe()}})}[er](){return this}static from(e){const r=typeof this=="function"?this:re;if(e==null)throw new TypeError(e+" is not an object");const n=wt(e,er);if(n){const i=n.call(e);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Us(i)&&i.constructor===r?i:new r(s=>i.subscribe(s))}if(st("iterator")){const i=wt(e,qs);if(i)return new r(s=>{mt(()=>{if(!s.closed){for(const o of i.call(e))if(s.next(o),s.closed)return;s.complete()}})})}if(Array.isArray(e))return new r(i=>{mt(()=>{if(!i.closed){for(const s of e)if(i.next(s),i.closed)return;i.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){const r=typeof this=="function"?this:re;return new r(n=>{mt(()=>{if(!n.closed){for(const i of e)if(n.next(i),n.closed)return;n.complete()}})})}static get[ri](){return this}}ti()&&Object.defineProperty(re,Symbol("extensions"),{value:{symbol:er,hostReportError:He},configurable:!0});function xe(t){typeof t=="function"?t():t&&typeof t.unsubscribe=="function"&&t.unsubscribe()}var Zs=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};function Gs(t){return e=>new re(r=>{const n=new Tt(r),i=e.subscribe({complete(){n.complete()},error(s){n.error(s)},next(s){n.schedule(o=>Zs(this,void 0,void 0,function*(){(yield t(s))&&o(s)}))}});return()=>xe(i)})}function Qs(t){return t&&st("asyncIterator")&&t[Symbol.asyncIterator]}function Ks(t){return t&&st("iterator")&&t[Symbol.iterator]}var Js=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},Xs=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,u){o=t[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(c){s({value:c,done:a})},o)}};function eo(t){return e=>new re(r=>{const n=new Tt(r),i=e.subscribe({complete(){n.complete()},error(s){n.error(s)},next(s){n.schedule(o=>Js(this,void 0,void 0,function*(){var a,u;const c=yield t(s);if(Ks(c)||Qs(c))try{for(var l=Xs(c),h;h=yield l.next(),!h.done;){const v=h.value;o(v)}}catch(v){a={error:v}}finally{try{h&&!h.done&&(u=l.return)&&(yield u.call(l))}finally{if(a)throw a.error}}else c.map(v=>o(v))}))}});return()=>xe(i)})}function to(t){return new re(e=>{let r=0;const n=setInterval(()=>{e.next(r++)},t);return()=>clearInterval(n)})}var ro=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};function no(t){return e=>new re(r=>{const n=new Tt(r),i=e.subscribe({complete(){n.complete()},error(s){n.error(s)},next(s){n.schedule(o=>ro(this,void 0,void 0,function*(){const a=yield t(s);o(a)}))}});return()=>xe(i)})}function io(...t){return t.length===0?re.from([]):new re(e=>{let r=0;const n=t.map(s=>s.subscribe({error(o){e.error(o),i()},next(o){e.next(o)},complete(){++r===t.length&&(e.complete(),i())}})),i=()=>{n.forEach(s=>xe(s))};return i})}class si extends re{constructor(){super(e=>(this._observers.add(e),()=>this._observers.delete(e))),this._observers=new Set}next(e){for(const r of this._observers)r.next(e)}error(e){for(const r of this._observers)r.error(e)}complete(){for(const e of this._observers)e.complete()}}function so(t){const e=new si;let r,n=0;return new re(i=>{r||(r=t.subscribe(e));const s=e.subscribe(i);return n++,()=>{n--,s.unsubscribe(),n===0&&(xe(r),r=void 0)}})}var oo=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};function ao(t,e){return r=>new re(n=>{let i,s=0;const o=new Tt(n),a=r.subscribe({complete(){o.complete()},error(u){o.error(u)},next(u){o.schedule(c=>oo(this,void 0,void 0,function*(){i=yield t(s===0?typeof e>"u"?u:e:i,u,s++),c(i)}))}});return()=>xe(a)})}const co=Object.freeze(Object.defineProperty({__proto__:null,Observable:re,Subject:si,filter:Gs,flatMap:eo,interval:to,map:no,merge:io,multicast:so,scan:ao,unsubscribe:xe},Symbol.toStringTag,{value:"Module"})),Mt=Ri(co);var Ze={},en;function uo(){if(en)return Ze;en=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.allSettled=void 0;function t(e){return Promise.all(e.map(r=>{const n=o=>({status:"fulfilled",value:o}),i=o=>({status:"rejected",reason:o}),s=Promise.resolve(r);try{return s.then(n,i)}catch(o){return Promise.reject(o)}}))}return Ze.allSettled=t,Ze}var Lt={},tn;function lo(){return tn||(tn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PoolEventType=void 0,function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(t.PoolEventType||(t.PoolEventType={}))}(Lt)),Lt}var Ge={},oe={},rn;function Cr(){return rn||(rn=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.$worker=oe.$transferable=oe.$terminate=oe.$events=oe.$errors=void 0,oe.$errors=Symbol("thread.errors"),oe.$events=Symbol("thread.events"),oe.$terminate=Symbol("thread.terminate"),oe.$transferable=Symbol("thread.transferable"),oe.$worker=Symbol("thread.worker")),oe}var nn;function oi(){if(nn)return Ge;nn=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.Thread=void 0;const t=Cr();function e(r){throw Error(r)}return Ge.Thread={errors(r){return r[t.$errors]||e("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},events(r){return r[t.$events]||e("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},terminate(r){return r[t.$terminate]()}},Ge}var sn;function ho(){return sn||(sn=1,function(t){var e=Ce&&Ce.__awaiter||function(y,C,P,$){function g(b){return b instanceof P?b:new P(function(k){k(b)})}return new(P||(P=Promise))(function(b,k){function H(z){try{x($.next(z))}catch(q){k(q)}}function _(z){try{x($.throw(z))}catch(q){k(q)}}function x(z){z.done?b(z.value):g(z.value).then(H,_)}x(($=$.apply(y,C||[])).next())})},r=Ce&&Ce.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.Thread=t.PoolEventType=void 0;const n=r(Pr()),i=Mt,s=uo(),o=ei(),a=lo();Object.defineProperty(t,"PoolEventType",{enumerable:!0,get:function(){return a.PoolEventType}});const u=oi();Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return u.Thread}});let c=1;function l(y){const C=[];for(let P=0;P<y;P++)C.push(P);return C}function h(y){return new Promise(C=>setTimeout(C,y))}function v(y,C){return y.reduce((P,$)=>[...P,...C($)],[])}function w(y){return y.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function L(y,C){return l(C).map(()=>({init:y(),runningTasks:[]}))}class M{constructor(C,P){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const $=typeof P=="number"?{size:P}:P||{},{size:g=o.defaultPoolSize}=$;this.debug=n.default(`threads:pool:${w($.name||String(c++))}`),this.options=$,this.workers=L(C,g),this.eventObservable=i.multicast(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map(b=>b.init)).then(()=>this.eventSubject.next({type:a.PoolEventType.initialized,size:this.workers.length}),b=>{this.debug("Error while initializing pool worker:",b),this.eventSubject.error(b),this.initErrors.push(b)})}findIdlingWorker(){const{concurrency:C=1}=this.options;return this.workers.find(P=>P.runningTasks.length<C)}runPoolTask(C,P){return e(this,void 0,void 0,function*(){const $=this.workers.indexOf(C)+1;this.debug(`Running task #${P.id} on worker #${$}...`),this.eventSubject.next({type:a.PoolEventType.taskStart,taskID:P.id,workerID:$});try{const g=yield P.run(yield C.init);this.debug(`Task #${P.id} completed successfully`),this.eventSubject.next({type:a.PoolEventType.taskCompleted,returnValue:g,taskID:P.id,workerID:$})}catch(g){this.debug(`Task #${P.id} failed`),this.eventSubject.next({type:a.PoolEventType.taskFailed,taskID:P.id,error:g,workerID:$})}})}run(C,P){return e(this,void 0,void 0,function*(){const $=e(this,void 0,void 0,function*(){const g=()=>{C.runningTasks=C.runningTasks.filter(b=>b!==$)};yield h(0);try{yield this.runPoolTask(C,P)}finally{g(),this.isClosing||this.scheduleWork()}});C.runningTasks.push($)})}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const C=this.findIdlingWorker();if(!C)return;const P=this.taskQueue.shift();if(!P){this.debug("Task queue is empty"),this.eventSubject.next({type:a.PoolEventType.taskQueueDrained});return}this.run(C,P)}taskCompletion(C){return new Promise((P,$)=>{const g=this.events().subscribe(b=>{b.type===a.PoolEventType.taskCompleted&&b.taskID===C?(g.unsubscribe(),P(b.returnValue)):b.type===a.PoolEventType.taskFailed&&b.taskID===C?(g.unsubscribe(),$(b.error)):b.type===a.PoolEventType.terminated&&(g.unsubscribe(),$(Error("Pool has been terminated before task was run.")))})})}settled(C=!1){return e(this,void 0,void 0,function*(){const P=()=>v(this.workers,b=>b.runningTasks),$=[],g=this.eventObservable.subscribe(b=>{b.type===a.PoolEventType.taskFailed&&$.push(b.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):C&&this.taskQueue.length===0?(yield s.allSettled(P()),$):(yield new Promise((b,k)=>{const H=this.eventObservable.subscribe({next(_){_.type===a.PoolEventType.taskQueueDrained&&(H.unsubscribe(),b(void 0))},error:k})}),yield s.allSettled(P()),g.unsubscribe(),$)})}completed(C=!1){return e(this,void 0,void 0,function*(){const P=this.settled(C),$=new Promise((b,k)=>{const H=this.eventObservable.subscribe({next(_){_.type===a.PoolEventType.taskQueueDrained?(H.unsubscribe(),b(P)):_.type===a.PoolEventType.taskFailed&&(H.unsubscribe(),k(_.error))},error:k})}),g=yield Promise.race([P,$]);if(g.length>0)throw g[0]})}events(){return this.eventObservable}queue(C){const{maxQueuedJobs:P=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const $=this.nextTaskID++,g=this.taskCompletion($);g.catch(k=>{this.debug(`Task #${$} errored:`,k)});const b={id:$,run:C,cancel:()=>{this.taskQueue.indexOf(b)!==-1&&(this.taskQueue=this.taskQueue.filter(k=>k!==b),this.eventSubject.next({type:a.PoolEventType.taskCanceled,taskID:b.id}))},then:g.then.bind(g)};if(this.taskQueue.length>=P)throw Error(`Maximum number of pool tasks queued. Refusing to queue another one.
|
|
32
|
+
This usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.`);return this.debug(`Queueing task #${b.id}...`),this.taskQueue.push(b),this.eventSubject.next({type:a.PoolEventType.taskQueued,taskID:b.id}),this.scheduleWork(),b}terminate(C){return e(this,void 0,void 0,function*(){this.isClosing=!0,C||(yield this.completed(!0)),this.eventSubject.next({type:a.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(P=>e(this,void 0,void 0,function*(){return u.Thread.terminate(yield P.init)})))})}}M.EventType=a.PoolEventType;function D(y,C){return new M(y,C)}D.EventType=a.PoolEventType,t.Pool=D}(Ce)),Ce}var pe={},Qe={},on;function fo(){if(on)return Qe;on=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.createPromiseWithResolver=void 0;const t=()=>{};function e(){let r=!1,n,i=t;return[new Promise(a=>{r?a(n):i=a}),a=>{r=!0,n=a,i(n)}]}return Qe.createPromiseWithResolver=e,Qe}var Wt={},an;function po(){return an||(an=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerEventType=void 0,function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(t.WorkerEventType||(t.WorkerEventType={}))}(Wt)),Wt}var ve={},Ke={},cn;function vo(){if(cn)return Ke;cn=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.ObservablePromise=void 0;const t=Mt,e=()=>{},r=a=>a,n=a=>Promise.resolve().then(a);function i(a){throw a}function s(a){return a&&typeof a.then=="function"}class o extends t.Observable{constructor(u){super(c=>{const l=this,h=Object.assign(Object.assign({},c),{complete(){c.complete(),l.onCompletion()},error(v){c.error(v),l.onError(v)},next(v){c.next(v),l.onNext(v)}});try{return this.initHasRun=!0,u(h)}catch(v){h.error(v)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(u){this.firstValueSet||(this.firstValue=u,this.firstValueSet=!0)}onError(u){this.state="rejected",this.rejection=u;for(const c of this.rejectionCallbacks)n(()=>c(u))}onCompletion(){this.state="fulfilled";for(const u of this.fulfillmentCallbacks)n(()=>u(this.firstValue))}then(u,c){const l=u||r,h=c||i;let v=!1;return new Promise((w,L)=>{const M=y=>{if(!v){v=!0;try{w(h(y))}catch(C){L(C)}}},D=y=>{try{w(l(y))}catch(C){M(C)}};if(this.initHasRun||this.subscribe({error:M}),this.state==="fulfilled")return w(l(this.firstValue));if(this.state==="rejected")return v=!0,w(h(this.rejection));this.fulfillmentCallbacks.push(D),this.rejectionCallbacks.push(M)})}catch(u){return this.then(void 0,u)}finally(u){const c=u||e;return this.then(l=>(c(),l),()=>c())}static from(u){return s(u)?new o(c=>{const l=v=>{c.next(v),c.complete()},h=v=>{c.error(v)};u.then(l,h)}):super.from(u)}}return Ke.ObservablePromise=o,Ke}var Ee={},un;function gt(){if(un)return Ee;un=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.Transfer=Ee.isTransferDescriptor=void 0;const t=Cr();function e(i){return!(!i||typeof i!="object")}function r(i){return i&&typeof i=="object"&&i[t.$transferable]}Ee.isTransferDescriptor=r;function n(i,s){if(!s){if(!e(i))throw Error();s=[i]}return{[t.$transferable]:!0,send:i,transferables:s}}return Ee.Transfer=n,Ee}var Nt={},ln;function ai(){return ln||(ln=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageType=t.MasterMessageType=void 0,function(e){e.cancel="cancel",e.run="run"}(t.MasterMessageType||(t.MasterMessageType={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(t.WorkerMessageType||(t.WorkerMessageType={}))}(Nt)),Nt}var hn;function mo(){if(hn)return ve;hn=1;var t=ve&&ve.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(ve,"__esModule",{value:!0}),ve.createProxyModule=ve.createProxyFunction=void 0;const e=t(Pr()),r=Mt,n=et(),i=vo(),s=gt(),o=ai(),a=e.default("threads:master:messages");let u=1;const c=y=>Array.from(new Set(y)),l=y=>y&&y.type===o.WorkerMessageType.error,h=y=>y&&y.type===o.WorkerMessageType.result,v=y=>y&&y.type===o.WorkerMessageType.running;function w(y,C){return new r.Observable(P=>{let $;const g=b=>{if(a("Message from worker:",b.data),!(!b.data||b.data.uid!==C)){if(v(b.data))$=b.data.resultType;else if(h(b.data))$==="promise"?(typeof b.data.payload<"u"&&P.next(n.deserialize(b.data.payload)),P.complete(),y.removeEventListener("message",g)):(b.data.payload&&P.next(n.deserialize(b.data.payload)),b.data.complete&&(P.complete(),y.removeEventListener("message",g)));else if(l(b.data)){const k=n.deserialize(b.data.error);P.error(k),y.removeEventListener("message",g)}}};return y.addEventListener("message",g),()=>{if($==="observable"||!$){const b={type:o.MasterMessageType.cancel,uid:C};y.postMessage(b)}y.removeEventListener("message",g)}})}function L(y){if(y.length===0)return{args:[],transferables:[]};const C=[],P=[];for(const $ of y)s.isTransferDescriptor($)?(C.push(n.serialize($.send)),P.push(...$.transferables)):C.push(n.serialize($));return{args:C,transferables:P.length===0?P:c(P)}}function M(y,C){return(...P)=>{const $=u++,{args:g,transferables:b}=L(P),k={type:o.MasterMessageType.run,uid:$,method:C,args:g};a("Sending command to run function to worker:",k);try{y.postMessage(k,b)}catch(H){return i.ObservablePromise.from(Promise.reject(H))}return i.ObservablePromise.from(r.multicast(w(y,$)))}}ve.createProxyFunction=M;function D(y,C){const P={};for(const $ of C)P[$]=M(y,$);return P}return ve.createProxyModule=D,ve}var fn;function _o(){if(fn)return pe;fn=1;var t=pe&&pe.__awaiter||function(g,b,k,H){function _(x){return x instanceof k?x:new k(function(z){z(x)})}return new(k||(k=Promise))(function(x,z){function q(Q){try{Z(H.next(Q))}catch(he){z(he)}}function ne(Q){try{Z(H.throw(Q))}catch(he){z(he)}}function Z(Q){Q.done?x(Q.value):_(Q.value).then(q,ne)}Z((H=H.apply(g,b||[])).next())})},e=pe&&pe.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.spawn=void 0;const r=e(Pr()),n=Mt,i=et(),s=fo(),o=Cr(),a=po(),u=mo(),c=r.default("threads:master:messages"),l=r.default("threads:master:spawn"),h=r.default("threads:master:thread-utils"),v=g=>g&&g.type==="init",w=g=>g&&g.type==="uncaughtError",L=typeof process<"u"&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function M(g,b,k){return t(this,void 0,void 0,function*(){let H;const _=new Promise((z,q)=>{H=setTimeout(()=>q(Error(k)),b)}),x=yield Promise.race([g,_]);return clearTimeout(H),x})}function D(g){return new Promise((b,k)=>{const H=_=>{c("Message from worker before finishing initialization:",_.data),v(_.data)?(g.removeEventListener("message",H),b(_.data)):w(_.data)&&(g.removeEventListener("message",H),k(i.deserialize(_.data.error)))};g.addEventListener("message",H)})}function y(g,b){return new n.Observable(k=>{const H=x=>{const z={type:a.WorkerEventType.message,data:x.data};k.next(z)},_=x=>{h("Unhandled promise rejection event in thread:",x);const z={type:a.WorkerEventType.internalError,error:Error(x.reason)};k.next(z)};g.addEventListener("message",H),g.addEventListener("unhandledrejection",_),b.then(()=>{const x={type:a.WorkerEventType.termination};g.removeEventListener("message",H),g.removeEventListener("unhandledrejection",_),k.next(x),k.complete()})})}function C(g){const[b,k]=s.createPromiseWithResolver();return{terminate:()=>t(this,void 0,void 0,function*(){h("Terminating worker"),yield g.terminate(),k()}),termination:b}}function P(g,b,k,H){const _=k.filter(x=>x.type===a.WorkerEventType.internalError).map(x=>x.error);return Object.assign(g,{[o.$errors]:_,[o.$events]:k,[o.$terminate]:H,[o.$worker]:b})}function $(g,b){return t(this,void 0,void 0,function*(){l("Initializing new thread");const k=b&&b.timeout?b.timeout:L,_=(yield M(D(g),k,`Timeout: Did not receive an init message from worker after ${k}ms. Make sure the worker calls expose().`)).exposed,{termination:x,terminate:z}=C(g),q=y(g,x);if(_.type==="function"){const ne=u.createProxyFunction(g);return P(ne,g,q,z)}else if(_.type==="module"){const ne=u.createProxyModule(g,_.methods);return P(ne,g,q,z)}else{const ne=_.type;throw Error(`Worker init message states unexpected type of expose(): ${ne}`)}})}return pe.spawn=$,pe}var dn;function yo(){return dn||(dn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Worker=t.BlobWorker=t.isWorkerRuntime=t.Thread=t.spawn=t.Pool=void 0;const e=ei();Object.defineProperty(t,"isWorkerRuntime",{enumerable:!0,get:function(){return e.isWorkerRuntime}});var r=ho();Object.defineProperty(t,"Pool",{enumerable:!0,get:function(){return r.Pool}});var n=_o();Object.defineProperty(t,"spawn",{enumerable:!0,get:function(){return n.spawn}});var i=oi();Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return i.Thread}}),t.BlobWorker=e.getWorkerImplementation().blob,t.Worker=e.getWorkerImplementation().default}(kt)),kt}var Oe={},Ht,pn;function bo(){return pn||(pn=1,Ht=t=>t?typeof Symbol.observable=="symbol"&&typeof t[Symbol.observable]=="function"?t===t[Symbol.observable]():typeof t["@@observable"]=="function"?t===t["@@observable"]():!1:!1),Ht}var ht={},vn;function wo(){if(vn)return ht;vn=1,Object.defineProperty(ht,"__esModule",{value:!0});const t=function(){const i=typeof self<"u"&&typeof Window<"u"&&self instanceof Window;return!!(typeof self<"u"&&self.postMessage&&!i)},e=function(i,s){self.postMessage(i,s)},r=function(i){const s=a=>{i(a.data)},o=()=>{self.removeEventListener("message",s)};return self.addEventListener("message",s),o};return ht.default={isWorkerRuntime:t,postMessageToMaster:e,subscribeToMasterMessages:r},ht}var mn;function ci(){return mn||(mn=1,function(t){var e=Oe&&Oe.__awaiter||function(_,x,z,q){function ne(Z){return Z instanceof z?Z:new z(function(Q){Q(Z)})}return new(z||(z=Promise))(function(Z,Q){function he(ce){try{De(q.next(ce))}catch(Ae){Q(Ae)}}function ot(ce){try{De(q.throw(ce))}catch(Ae){Q(Ae)}}function De(ce){ce.done?Z(ce.value):ne(ce.value).then(he,ot)}De((q=q.apply(_,x||[])).next())})},r=Oe&&Oe.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.expose=t.isWorkerRuntime=t.Transfer=t.registerSerializer=void 0;const n=r(bo()),i=et(),s=gt(),o=ai(),a=r(wo());var u=et();Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return u.registerSerializer}});var c=gt();Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return c.Transfer}}),t.isWorkerRuntime=a.default.isWorkerRuntime;let l=!1;const h=new Map,v=_=>_&&_.type===o.MasterMessageType.cancel,w=_=>_&&_.type===o.MasterMessageType.run,L=_=>n.default(_)||M(_);function M(_){return _&&typeof _=="object"&&typeof _.subscribe=="function"}function D(_){return s.isTransferDescriptor(_)?{payload:_.send,transferables:_.transferables}:{payload:_,transferables:void 0}}function y(){const _={type:o.WorkerMessageType.init,exposed:{type:"function"}};a.default.postMessageToMaster(_)}function C(_){const x={type:o.WorkerMessageType.init,exposed:{type:"module",methods:_}};a.default.postMessageToMaster(x)}function P(_,x){const{payload:z,transferables:q}=D(x),ne={type:o.WorkerMessageType.error,uid:_,error:i.serialize(z)};a.default.postMessageToMaster(ne,q)}function $(_,x,z){const{payload:q,transferables:ne}=D(z),Z={type:o.WorkerMessageType.result,uid:_,complete:x?!0:void 0,payload:q};a.default.postMessageToMaster(Z,ne)}function g(_,x){const z={type:o.WorkerMessageType.running,uid:_,resultType:x};a.default.postMessageToMaster(z)}function b(_){try{const x={type:o.WorkerMessageType.uncaughtError,error:i.serialize(_)};a.default.postMessageToMaster(x)}catch(x){console.error(`Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.
|
|
33
|
+
Latest error:`,x,`
|
|
34
|
+
Original error:`,_)}}function k(_,x,z){return e(this,void 0,void 0,function*(){let q;try{q=x(...z)}catch(Z){return P(_,Z)}const ne=L(q)?"observable":"promise";if(g(_,ne),L(q)){const Z=q.subscribe(Q=>$(_,!1,i.serialize(Q)),Q=>{P(_,i.serialize(Q)),h.delete(_)},()=>{$(_,!0),h.delete(_)});h.set(_,Z)}else try{const Z=yield q;$(_,!0,i.serialize(Z))}catch(Z){P(_,i.serialize(Z))}})}function H(_){if(!a.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(l)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(l=!0,typeof _=="function")a.default.subscribeToMasterMessages(x=>{w(x)&&!x.method&&k(x.uid,_,x.args.map(i.deserialize))}),y();else if(typeof _=="object"&&_){a.default.subscribeToMasterMessages(z=>{w(z)&&z.method&&k(z.uid,_[z.method],z.args.map(i.deserialize))});const x=Object.keys(_).filter(z=>typeof _[z]=="function");C(x)}else throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${_}`);a.default.subscribeToMasterMessages(x=>{if(v(x)){const z=x.uid,q=h.get(z);q&&(q.unsubscribe(),h.delete(z))}})}t.expose=H,typeof self<"u"&&typeof self.addEventListener=="function"&&a.default.isWorkerRuntime()&&(self.addEventListener("error",_=>{setTimeout(()=>b(_.error||_),250)}),self.addEventListener("unhandledrejection",_=>{const x=_.reason;x&&typeof x.message=="string"&&setTimeout(()=>b(x),250)})),typeof process<"u"&&typeof process.on=="function"&&a.default.isWorkerRuntime()&&(process.on("uncaughtException",_=>{setTimeout(()=>b(_),250)}),process.on("unhandledRejection",_=>{_&&typeof _.message=="string"&&setTimeout(()=>b(_),250)}))}(Oe)),Oe}var _n;function go(){return _n||(_n=1,function(t){var e=ge&&ge.__createBinding||(Object.create?function(a,u,c,l){l===void 0&&(l=c),Object.defineProperty(a,l,{enumerable:!0,get:function(){return u[c]}})}:function(a,u,c,l){l===void 0&&(l=c),a[l]=u[c]}),r=ge&&ge.__exportStar||function(a,u){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&e(u,a,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.DefaultSerializer=t.expose=t.registerSerializer=void 0;var n=et();Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return n.registerSerializer}}),r(yo(),t);var i=ci();Object.defineProperty(t,"expose",{enumerable:!0,get:function(){return i.expose}});var s=Xn();Object.defineProperty(t,"DefaultSerializer",{enumerable:!0,get:function(){return s.DefaultSerializer}});var o=gt();Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return o.Transfer}})}(ge)),ge}var Po=go();const we=jn(Po);we.registerSerializer;const So=we.spawn;we.BlobWorker;we.DefaultSerializer;we.Pool;const Co=we.Thread;we.Transfer;const Eo=we.Worker;var Oo=Object.defineProperty,To=(t,e,r)=>e in t?Oo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,se=(t,e,r)=>To(t,typeof e!="symbol"?e+"":e,r);class Mo extends E.EventDispatcher{constructor(){super(),se(this,"style",{}),se(this,"width",0),se(this,"height",0),se(this,"left",0),se(this,"top",0),this.getRootNode=this.getRootNode.bind(this),this.handleEvent=this.handleEvent.bind(this)}get clientWidth(){return this.width}get clientHeight(){return this.height}setPointerCapture(){}releasePointerCapture(){}getRootNode(){return this}getBoundingClientRect(){return{left:this.left,top:this.top,width:this.width,height:this.height,right:this.left+this.width,bottom:this.top+this.height}}handleEvent(e){if(e.type==="resize"){this.left=e.left??0,this.top=e.top??0,this.width=e.width??0,this.height=e.height??0;return}e.preventDefault=()=>{},e.stopPropagation=()=>{},this.dispatchEvent(e)}focus(){}}const Ro=()=>{try{if(window){if(navigator!=null&&navigator.hardwareConcurrency)return navigator.hardwareConcurrency;throw new Error("Unable to determine the number of cores")}else return require("os").cpus().length}catch(t){return console.error("🛑 Unable to detect available cores",t),2}},$o=()=>Ro()-1,jo="TERMINATE_THREAD_FROM_WORKER";let xo=-1;class Do{constructor(e){se(this,"_handleTerminate"),se(this,"_handleError"),se(this,"_task"),se(this,"id",xo+=1),se(this,"idle",!0),se(this,"worker"),se(this,"thread"),this._handleTerminate=e==null?void 0:e.onTerminate,this._handleError=e==null?void 0:e.onError}_handleMessages(e){var r;e instanceof MessageEvent&&((r=e.data)==null?void 0:r.token)===jo&&this.terminate()}async run(e){var r;try{const{payload:n,options:i}=e;return this.idle=!1,this.worker=new Eo(n.path,{type:"module",...i==null?void 0:i.worker}),this.thread=await So(this.worker,{timeout:1e4,...i==null?void 0:i.spawn}),this._task=e,this.worker.postMessage(n.subject,n.transferSubject),this.worker.addEventListener("message",this._handleMessages.bind(this)),{worker:this.worker,thread:this.thread}}catch(n){(r=this._handleError)==null||r.call(this,n);return}}get task(){return this._task}async terminate(){var e,r,n;(e=this.worker)==null||e.removeEventListener("message",this._handleMessages.bind(this)),this.thread&&await Co.terminate(this.thread),await((r=this.worker)==null?void 0:r.terminate()),this.worker=void 0,this.thread=void 0,this._task=void 0,this.idle=!0,(n=this._handleTerminate)==null||n.call(this)}}class Ao{constructor(e,r,n){se(this,"_workerThreads",[]),se(this,"_tasksQueue",[]),this.maxWorkersCount=e,this.debugMode=r,this.onWorkerThreadRun=n;for(let i=0;i<this.maxWorkersCount;i++)this._workerThreads.push(this._createWorkerThread())}_handleWorkerThreadTerminate(e){this.debugMode&&console.log(`WorkerThread #${e.id} freed`),this.runNext()}_handleWorkerThreadError(e,r){console.error(`Error from worker #${r.id}:`,e),this.runNext()}_createWorkerThread(){const e=new Do({onTerminate:()=>this._handleWorkerThreadTerminate(e),onError:r=>this._handleWorkerThreadError(r,e)});return e}get workerThreads(){return this._workerThreads}get tasksQueue(){return this._tasksQueue}get nextAvailableWorkerThread(){return this._workerThreads.find(e=>e.idle)}getAvailableWorkerThreads(e=!1){return this._workerThreads.filter(r=>e?!r.idle:r.idle)}async runNext(){if(!this.nextAvailableWorkerThread||this._tasksQueue.length===0)return;const e=this._tasksQueue.shift();e&&await this.run(e)}async run(e,r=!1){var n;if(r){const o=this._createWorkerThread();return this.debugMode&&console.log(`Running On Untracked Thread #${o==null?void 0:o.id}. Task:`,e),[await o.run(e),!1]}const i=this.nextAvailableWorkerThread;if(!i)return this._tasksQueue.push(e),this.debugMode&&console.log("Queued Thread Task:",e),[void 0,!0];this.debugMode&&console.log(`Running On Thread #${i==null?void 0:i.id}. Task:`,e);const s=await i.run(e);return(n=this.onWorkerThreadRun)==null||n.call(this,i),[s,!1]}async terminateAll(){this._tasksQueue=[],await Promise.all(this._workerThreads.map(e=>e.terminate()))}}const ko=(t,e)=>new Ao($o(),!!e),Io=t=>t===void 0,zo=t=>typeof t=="boolean",Fo=t=>!!t&&typeof t=="function",Lo=t=>{var e,r;const n=t.toJSON();return JSON.stringify({...n,object:{...n.object,position:["x","y","z"].map(i=>t.position[i]),rotation:["x","y","z","order"].map(i=>t.rotation[i]),children:((r=(e=n==null?void 0:n.object)==null?void 0:e.children)==null?void 0:r.map((i,s)=>({...typeof i=="object"?i:typeof i=="string"?JSON.parse(i):{},position:["x","y","z"].map(o=>{var a;return(a=t.children[s])==null?void 0:a.position[o]}),rotation:["x","y","z","order"].map(o=>{var a;return(a=t.children[s])==null?void 0:a.rotation[o]})})))??[]},isSerialized:!0})},yn=(t,e=new E.ObjectLoader)=>{const r=JSON.parse(t);if(r!=null&&r.metadata&&r.object&&r.isSerialized){const n=e.parse(r);return n.position.set(...r.object.position),n.rotation.set(...r.object.rotation),n.children.map((i,s)=>{i.position.set(...r.object.children[s].position)}),n.children.map((i,s)=>{i.rotation.set(...r.object.children[s].rotation)}),n}return r},ui=(t,e)=>{const r={type:t==null?void 0:t.type};for(const n of e)t[n]!==void 0&&(r[n]=t[n]);return r},rr=(t,e)=>{const r={type:t==null?void 0:t.type};for(const[n,i]of Object.entries(t))e.includes(n)||(r[n]=i);return r};var Wo=Object.defineProperty,No=Object.getOwnPropertyDescriptor,Ho=(t,e,r,n)=>{for(var i=n>1?void 0:n?No(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Wo(e,r,i),i};let tt=class{constructor(){p(this,"_canvas");p(this,"proxyReceiver",new Mo);p(this,"isInitialized",!1)}get canvas(){return this._canvas}set canvas(t){t.style={width:t.width+"",height:t.height+""},this._canvas=t}};tt=Ho([Y()],tt);var qo=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,Vo=(t,e,r,n)=>{for(var i=n>1?void 0:n?Uo(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&qo(e,r,i),i},Bo=(t,e)=>(r,n)=>e(r,n,t);let Pt=class extends Fn{constructor(t){super(),this._service=t;for(const e of br)this[`${e}$$`]=new Re,this[`${e}$`]=this[`${e}$$`].pipe(),this[e]=r=>{this._service.proxyReceiver.handleEvent({...r,type:r.type||e}),this[`${e}$$`].next(r)}}};Pt=Vo([Y(),Bo(0,I(tt))],Pt);var Yo=Object.defineProperty,Zo=Object.getOwnPropertyDescriptor,Go=(t,e,r,n)=>{for(var i=n>1?void 0:n?Zo(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Yo(e,r,i),i};let St=class{constructor(){p(this,"frame",1e3/60);p(this,"initialTime",Date.now());p(this,"currentTime",0);p(this,"deltaTime",0);p(this,"deltaRatio",0);p(this,"elapsedTime",0);p(this,"enabled",!1)}step(){const t=Date.now();this.deltaTime=t-this.currentTime,this.currentTime=t,this.elapsedTime=t-this.initialTime,this.deltaRatio=this.deltaTime/this.frame}};St=Go([Y()],St);var Qo=Object.defineProperty,Ko=Object.getOwnPropertyDescriptor,Jo=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ko(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Qo(e,r,i),i},Xo=(t,e)=>(r,n)=>e(r,n,t);let qe=class{constructor(t){p(this,"_beforeStep$$",new Re);p(this,"_oldElapsed",0);p(this,"beforeStep$",this._beforeStep$$.asObservable());p(this,"step$",us().pipe(Fs(({elapsed:t})=>{var e;this._oldElapsed!==t&&((e=this._beforeStep$$)==null||e.next(rr(this._service,[])),this._oldElapsed=t)}),_e(()=>this._service.enabled),zs(()=>this._service.enabled),We(()=>rr(this._service,[])),Ne()));this._service=t}};qe=Jo([Y(),Xo(0,I(St))],qe);var ea=Object.defineProperty,ta=Object.getOwnPropertyDescriptor,ra=(t,e,r,n)=>{for(var i=n>1?void 0:n?ta(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ea(e,r,i),i},bn=(t,e)=>(r,n)=>e(r,n,t);let nr=class{constructor(t,e){p(this,"_initialAnimationFrameId");p(this,"_subscriptions",[]);this._controller=t,this._service=e,this._subscriptions.push(this._controller.step$.subscribe(this._service.step.bind(this._service)))}init(t){this.enabled(t)}frame(){return this._service.frame}deltaTime(t){return typeof t=="number"&&(this._service.deltaTime=t),this._service.deltaTime}deltaRatio(t){return typeof t=="number"&&(this._service.deltaRatio=t),this._service.deltaRatio}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}dispose(){this._initialAnimationFrameId!==void 0&&cancelAnimationFrame(this._initialAnimationFrameId),this._service.enabled=!1}beforeStep$(){return this._controller.beforeStep$}step$(){return this._controller.step$}};nr=ra([Y(),bn(0,I(qe)),bn(1,I(St))],nr);var na=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,sa=(t,e,r,n)=>{for(var i=n>1?void 0:n?ia(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&na(e,r,i),i};let be=class{constructor(){p(this,"width",0);p(this,"height",0);p(this,"aspect",0);p(this,"pixelRatio",0);p(this,"frustrum",5);p(this,"enabled",!0)}init(t,e){this.height=Number(t.height??this.height),this.width=Number(t.width??this.width),this.aspect=this.width/this.height,this.enabled=e===void 0?!0:!!e}};be=sa([Y()],be);var oa=Object.defineProperty,aa=Object.getOwnPropertyDescriptor,ca=(t,e,r,n)=>{for(var i=n>1?void 0:n?aa(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&oa(e,r,i),i},ua=(t,e)=>(r,n)=>e(r,n,t);let $e=class{constructor(t){p(this,"instance");p(this,"enabled",!0);this._sizesService=t}set aspectRatio(t){var e;this.instance instanceof E.PerspectiveCamera&&(this.instance.aspect=t),(this.instance instanceof E.PerspectiveCamera||this.instance instanceof E.OrthographicCamera)&&((e=this.instance)==null||e.updateProjectionMatrix())}set quaternion(t){var e;(e=this.instance)==null||e.quaternion.copy(t)}set position(t){var e;(e=this.instance)==null||e.position.copy(t)}set rotation(t){var e;(e=this.instance)==null||e.rotation.copy(t)}init(t){if(this.dispose(),t===yt.PERSPECTIVE||t===void 0){this.instance=new E.PerspectiveCamera(70,this._sizesService.width/this._sizesService.height,1e-4,100),this.instance.position.z=8;return}t===yt.ORTHOGRAPHIC&&(this.instance=new E.OrthographicCamera(-this._sizesService.aspect*this._sizesService.frustrum/2,this._sizesService.aspect*this._sizesService.frustrum/2,this._sizesService.frustrum/2,-this._sizesService.frustrum/2,-50,50))}dispose(){this.instance instanceof E.Camera&&((this.instance instanceof E.PerspectiveCamera||this.instance instanceof E.OrthographicCamera)&&this.instance.clearViewOffset(),this.instance.clear(),this.instance=void 0)}};$e=ca([Y(),ua(0,I(be))],$e);var la=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,fa=(t,e,r,n)=>{for(var i=n>1?void 0:n?ha(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&la(e,r,i),i},wn=(t,e)=>(r,n)=>e(r,n,t);let ir=class{constructor(t,e){p(this,"step$");this.timerController=t,this._service=e,this.step$=this.timerController.step$.pipe(_e(()=>this._service.enabled))}};ir=fa([Y(),wn(0,I(qe)),wn(1,I($e))],ir);var da=Object.defineProperty,pa=Object.getOwnPropertyDescriptor,va=(t,e,r,n)=>{for(var i=n>1?void 0:n?pa(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&da(e,r,i),i},qt=(t,e)=>(r,n)=>e(r,n,t);let sr=class{constructor(t,e,r){p(this,"_subscriptions",[]);this._sizesService=t,this._controller=e,this._service=r}init(){this._service.init(),this._subscriptions.push(this._controller.step$.subscribe(()=>{var t;this._service.enabled&&(this._service.aspectRatio=this._sizesService.aspect,(this._service.instance instanceof E.PerspectiveCamera||this._service.instance instanceof E.OrthographicCamera)&&((t=this._service.instance)==null||t.updateProjectionMatrix()))}))}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}aspectRatio(t){return t&&(this._service.aspectRatio=t),this._service.aspectRatio}instance(t){return t&&(this._service.instance=t),this._service.instance}position(t){return t&&(this._service.position=t),this._service.position}quaternion(t){return t&&(this._service.quaternion=t),this._service.quaternion}dispose(){this._subscriptions.forEach(t=>t.unsubscribe()),this._service.dispose()}};sr=va([Y(),qt(0,I(be)),qt(1,I(ir)),qt(2,I($e))],sr);var ma=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var i=n>1?void 0:n?_a(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ma(e,r,i),i};let Ue=class{constructor(){p(this,"scene",new E.Scene);p(this,"enabled",!0)}};Ue=ya([Y()],Ue);var li=Object.defineProperty,ba=Object.getOwnPropertyDescriptor,wa=(t,e,r)=>e in t?li(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ga=(t,e,r,n)=>{for(var i=n>1?void 0:n?ba(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&li(e,r,i),i},Ut=(t,e)=>(r,n)=>e(r,n,t),Pa=(t,e,r)=>wa(t,e+"",r);let je=class{constructor(t,e,r){p(this,"enabled",!0);p(this,"instance");this._worldService=t,this._cameraService=e,this._sizesService=r}setWebGLRenderer(t){this.instance=new E.WebGLRenderer({canvas:t,context:t.getContext("webgl2",{stencil:!0,powerPreference:"high-performance"}),powerPreference:"high-performance",depth:!0,antialias:!0}),this.instance.autoClear=!1,this.instance.setPixelRatio(je.RENDERER_PIXEL_RATIO),this.instance.setClearColor(0,0),this.instance.shadowMap.enabled=!0,this.instance.shadowMap.type=E.PCFSoftShadowMap,this.instance.outputColorSpace=E.SRGBColorSpace,this.instance.toneMapping=E.CineonToneMapping,this.instance.toneMappingExposure=1.75}setSize(t,e){var r;(r=this.instance)==null||r.setSize(t,e)}render(){this.enabled&&this._cameraService.instance instanceof E.Camera&&this.instance instanceof E.WebGLRenderer&&(this.instance.setViewport(0,0,this._sizesService.width,this._sizesService.height),this.instance.render(this._worldService.scene,this._cameraService.instance))}};Pa(je,"RENDERER_PIXEL_RATIO",1);je=ga([Y(),Ut(0,I(Ue)),Ut(1,I($e)),Ut(2,I(be))],je);var Sa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,Ea=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ca(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Sa(e,r,i),i},gn=(t,e)=>(r,n)=>e(r,n,t);let Ct=class{constructor(t,e){p(this,"resize$");this._appController=t,this._service=e,this.resize$=this._appController.resize$$.pipe(_e(()=>this._service.enabled))}};Ct=Ea([Y(),gn(0,I(Pt)),gn(1,I(be))],Ct);var Oa=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ma=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ta(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Oa(e,r,i),i},Vt=(t,e)=>(r,n)=>e(r,n,t);let or=class{constructor(t,e,r){p(this,"step$");p(this,"resize$");this._service=t,this._timerController=e,this._sizesController=r,this.step$=this._timerController.step$.pipe(_e(()=>this._service.enabled)),this.resize$=this._sizesController.resize$.pipe(_e(()=>this._service.enabled))}};or=Ma([Y(),Vt(0,I(je)),Vt(1,I(qe)),Vt(2,I(Ct))],or);var Ra=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,ja=(t,e,r,n)=>{for(var i=n>1?void 0:n?$a(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Ra(e,r,i),i},Pn=(t,e)=>(r,n)=>e(r,n,t);let ar=class{constructor(t,e){this._controller=t,this._service=e}init(t){this._controller.step$.subscribe(()=>this._service.render()),this._controller.resize$.subscribe(e=>this._service.setSize(e.windowWidth,e.windowHeight)),this._service.setWebGLRenderer(t)}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}instance(){return this._service.instance}setSize(t){return this._service.setSize(t.x,t.y)}render(){return this._service.render()}dispose(){var t;(t=this._service.instance)==null||t.dispose(),this._service.instance=void 0}};ar=ja([Y(),Pn(0,I(or)),Pn(1,I(je))],ar);var xa=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,Aa=(t,e,r,n)=>{for(var i=n>1?void 0:n?Da(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&xa(e,r,i),i},Sn=(t,e)=>(r,n)=>e(r,n,t);let cr=class{constructor(t,e){this._controller=t,this._service=e}init(t){this._controller.resize$.subscribe(e=>{this._service.width=e.windowWidth,this._service.height=e.windowHeight,this._service.aspect=e.windowWidth/e.windowHeight}),this._service.init(t)}dispose(){}aspect(t){return typeof t=="number"&&(this._service.aspect=t),this._service.aspect}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}frustrum(t){return typeof t=="number"&&(this._service.frustrum=t),this._service.frustrum}height(t){return typeof t=="number"&&(this._service.height=t),this._service.height}pixelRatio(t){return typeof t=="number"&&(this._service.pixelRatio=t),this._service.pixelRatio}width(t){return typeof t=="number"&&(this._service.width=t),this._service.width}resize$(){return this._controller.resize$}};cr=Aa([Y(),Sn(0,I(Ct)),Sn(1,I(be))],cr);var ka=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,za=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ia(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ka(e,r,i),i},Fa=(t,e)=>(r,n)=>e(r,n,t);let ur=class{constructor(t){p(this,"_beforeRender$$",new Re);p(this,"_afterRender$$",new Re);p(this,"beforeRender$",this._beforeRender$$.pipe(Ne()));p(this,"afterRender$",this._afterRender$$.pipe(Ne()));this._worldService=t,this._worldService.scene.onBeforeRender=()=>this._beforeRender$$.next({}),this._worldService.scene.onAfterRender=()=>this._afterRender$$.next({})}};ur=za([Y(),Fa(0,I(Ue))],ur);var La=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Na=(t,e,r,n)=>{for(var i=n>1?void 0:n?Wa(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&La(e,r,i),i},Cn=(t,e)=>(r,n)=>e(r,n,t);let lr=class{constructor(t,e){this._service=t,this._controller=e}init(){}dispose(){}scene(t){return t instanceof E.Scene&&(this._service.scene=t),this._service.scene}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}getBeforeRender$(){return this._controller.beforeRender$}getAfterRender$(){return this._controller.afterRender$}};lr=Na([Y(),Cn(0,I(Ue)),Cn(1,I(ur))],lr);const En={type:"change"},Er={type:"start"},hi={type:"end"},ft=new E.Ray,On=new E.Plane,Ha=Math.cos(70*E.MathUtils.DEG2RAD),X=new E.Vector3,ie=2*Math.PI,U={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Bt=1e-6;class Tn extends E.Controls{constructor(e,r=null){super(e,r),this.state=U.NONE,this.enabled=!0,this.target=new E.Vector3,this.cursor=new E.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:E.MOUSE.ROTATE,MIDDLE:E.MOUSE.DOLLY,RIGHT:E.MOUSE.PAN},this.touches={ONE:E.TOUCH.ROTATE,TWO:E.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new E.Vector3,this._lastQuaternion=new E.Quaternion,this._lastTargetPosition=new E.Vector3,this._quat=new E.Quaternion().setFromUnitVectors(e.up,new E.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new E.Spherical,this._sphericalDelta=new E.Spherical,this._scale=1,this._panOffset=new E.Vector3,this._rotateStart=new E.Vector2,this._rotateEnd=new E.Vector2,this._rotateDelta=new E.Vector2,this._panStart=new E.Vector2,this._panEnd=new E.Vector2,this._panDelta=new E.Vector2,this._dollyStart=new E.Vector2,this._dollyEnd=new E.Vector2,this._dollyDelta=new E.Vector2,this._dollyDirection=new E.Vector3,this._mouse=new E.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Ua.bind(this),this._onPointerDown=qa.bind(this),this._onPointerUp=Va.bind(this),this._onContextMenu=Ja.bind(this),this._onMouseWheel=Za.bind(this),this._onKeyDown=Ga.bind(this),this._onTouchStart=Qa.bind(this),this._onTouchMove=Ka.bind(this),this._onMouseDown=Ba.bind(this),this._onMouseMove=Ya.bind(this),this._interceptControlDown=Xa.bind(this),this._interceptControlUp=ec.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(En),this.update(),this.state=U.NONE}update(e=null){const r=this.object.position;X.copy(r).sub(this.target),X.applyQuaternion(this._quat),this._spherical.setFromVector3(X),this.autoRotate&&this.state===U.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(n)&&isFinite(i)&&(n<-Math.PI?n+=ie:n>Math.PI&&(n-=ie),i<-Math.PI?i+=ie:i>Math.PI&&(i-=ie),n<=i?this._spherical.theta=Math.max(n,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+i)/2?Math.max(n,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(X.setFromSpherical(this._spherical),X.applyQuaternion(this._quatInverse),r.copy(this.target).add(X),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=X.length();o=this._clampDistance(a*this._scale);const u=a-o;this.object.position.addScaledVector(this._dollyDirection,u),this.object.updateMatrixWorld(),s=!!u}else if(this.object.isOrthographicCamera){const a=new E.Vector3(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const u=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=u!==this.object.zoom;const c=new E.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(ft.origin.copy(this.object.position),ft.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ft.direction))<Ha?this.object.lookAt(this.target):(On.setFromNormalAndCoplanarPoint(this.object.up,this.target),ft.intersectPlane(On,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),o!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,s||this._lastPosition.distanceToSquared(this.object.position)>Bt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Bt||this._lastTargetPosition.distanceToSquared(this.target)>Bt?(this.dispatchEvent(En),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ie/60*this.autoRotateSpeed*e:ie/60/60*this.autoRotateSpeed}_getZoomScale(e){const r=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*r)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,r){X.setFromMatrixColumn(r,0),X.multiplyScalar(-e),this._panOffset.add(X)}_panUp(e,r){this.screenSpacePanning===!0?X.setFromMatrixColumn(r,1):(X.setFromMatrixColumn(r,0),X.crossVectors(this.object.up,X)),X.multiplyScalar(e),this._panOffset.add(X)}_pan(e,r){const n=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;X.copy(i).sub(this.target);let s=X.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/n.clientHeight,this.object.matrix),this._panUp(2*r*s/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(r*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,r){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),i=e-n.left,s=r-n.top,o=n.width,a=n.height;this._mouse.x=i/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const r=this.domElement;this._rotateLeft(ie*this._rotateDelta.x/r.clientHeight),this._rotateUp(ie*this._rotateDelta.y/r.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let r=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),r=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),r=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),r=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),r=!0;break}r&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this._rotateStart.set(n,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this._panStart.set(n,i)}}_handleTouchStartDolly(e){const r=this._getSecondPointerPosition(e),n=e.pageX-r.x,i=e.pageY-r.y,s=Math.sqrt(n*n+i*i);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),s=.5*(e.pageY+n.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const r=this.domElement;this._rotateLeft(ie*this._rotateDelta.x/r.clientHeight),this._rotateUp(ie*this._rotateDelta.y/r.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this._panEnd.set(n,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const r=this._getSecondPointerPosition(e),n=e.pageX-r.x,i=e.pageY-r.y,s=Math.sqrt(n*n+i*i);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+r.x)*.5,a=(e.pageY+r.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let r=0;r<this._pointers.length;r++)if(this._pointers[r]==e.pointerId){this._pointers.splice(r,1);return}}_isTrackingPointer(e){for(let r=0;r<this._pointers.length;r++)if(this._pointers[r]==e.pointerId)return!0;return!1}_trackPointer(e){let r=this._pointerPositions[e.pointerId];r===void 0&&(r=new E.Vector2,this._pointerPositions[e.pointerId]=r),r.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const r=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[r]}_customWheelEvent(e){const r=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(r){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function qa(t){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(t)&&(this._addPointer(t),t.pointerType==="touch"?this._onTouchStart(t):this._onMouseDown(t)))}function Ua(t){this.enabled!==!1&&(t.pointerType==="touch"?this._onTouchMove(t):this._onMouseMove(t))}function Va(t){switch(this._removePointer(t),this._pointers.length){case 0:this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(hi),this.state=U.NONE;break;case 1:const e=this._pointers[0],r=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:r.x,pageY:r.y});break}}function Ba(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case E.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(t),this.state=U.DOLLY;break;case E.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=U.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=U.ROTATE}break;case E.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=U.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=U.PAN}break;default:this.state=U.NONE}this.state!==U.NONE&&this.dispatchEvent(Er)}function Ya(t){switch(this.state){case U.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(t);break;case U.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(t);break;case U.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(t);break}}function Za(t){this.enabled===!1||this.enableZoom===!1||this.state!==U.NONE||(t.preventDefault(),this.dispatchEvent(Er),this._handleMouseWheel(this._customWheelEvent(t)),this.dispatchEvent(hi))}function Ga(t){this.enabled!==!1&&this._handleKeyDown(t)}function Qa(t){switch(this._trackPointer(t),this._pointers.length){case 1:switch(this.touches.ONE){case E.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(t),this.state=U.TOUCH_ROTATE;break;case E.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(t),this.state=U.TOUCH_PAN;break;default:this.state=U.NONE}break;case 2:switch(this.touches.TWO){case E.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(t),this.state=U.TOUCH_DOLLY_PAN;break;case E.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(t),this.state=U.TOUCH_DOLLY_ROTATE;break;default:this.state=U.NONE}break;default:this.state=U.NONE}this.state!==U.NONE&&this.dispatchEvent(Er)}function Ka(t){switch(this._trackPointer(t),this.state){case U.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(t),this.update();break;case U.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(t),this.update();break;case U.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(t),this.update();break;case U.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(t),this.update();break;default:this.state=U.NONE}}function Ja(t){this.enabled!==!1&&t.preventDefault()}function Xa(t){t.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function ec(t){t.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class tc extends E.Loader{constructor(e){super(e)}load(e,r,n,i){const s=this,o=new E.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){const u=s.parse(JSON.parse(a));r&&r(u)},n,i)}parse(e){return new fi(e)}}class fi{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,r=100){const n=[],i=rc(e,r,this.data);for(let s=0,o=i.length;s<o;s++)n.push(...i[s].toShapes());return n}}function rc(t,e,r){const n=Array.from(t),i=e/r.resolution,s=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*i,o=[];let a=0,u=0;for(let c=0;c<n.length;c++){const l=n[c];if(l===`
|
|
35
|
+
`)a=0,u-=s;else{const h=nc(l,i,a,u,r);a+=h.offsetX,o.push(h.path)}}return o}function nc(t,e,r,n,i){const s=i.glyphs[t]||i.glyphs["?"];if(!s){console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");return}const o=new E.ShapePath;let a,u,c,l,h,v,w,L;if(s.o){const M=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let D=0,y=M.length;D<y;)switch(M[D++]){case"m":a=M[D++]*e+r,u=M[D++]*e+n,o.moveTo(a,u);break;case"l":a=M[D++]*e+r,u=M[D++]*e+n,o.lineTo(a,u);break;case"q":c=M[D++]*e+r,l=M[D++]*e+n,h=M[D++]*e+r,v=M[D++]*e+n,o.quadraticCurveTo(h,v,c,l);break;case"b":c=M[D++]*e+r,l=M[D++]*e+n,h=M[D++]*e+r,v=M[D++]*e+n,w=M[D++]*e+r,L=M[D++]*e+n,o.bezierCurveTo(h,v,w,L,c,l);break}}return{offsetX:s.ha*e,path:o}}var ic=Object.defineProperty,sc=Object.getOwnPropertyDescriptor,oc=(t,e,r,n)=>{for(var i=n>1?void 0:n?sc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ic(e,r,i),i},Je=(t,e)=>(r,n)=>e(r,n,t);let hr=class{constructor(t,e,r,n,i){p(this,"enabled",!1);p(this,"cameraControls");p(this,"miniCamera");p(this,"miniCameraControls");p(this,"cameraHelper");p(this,"axesHelper");p(this,"gridHelper");this._appService=t,this._sizesService=e,this._rendererService=r,this._cameraService=n,this._worldService=i}_renderMiniCamera(){var t,e,r,n,i;!this.enabled||!this.miniCamera||((t=this._rendererService.instance)==null||t.setScissorTest(!0),(e=this._rendererService.instance)==null||e.setViewport(this._sizesService.width-this._sizesService.width/3,this._sizesService.height-this._sizesService.height/3,this._sizesService.width/3,this._sizesService.height/3),(r=this._rendererService.instance)==null||r.setScissor(this._sizesService.width-this._sizesService.width/3,this._sizesService.height-this._sizesService.height/3,this._sizesService.width/3,this._sizesService.height/3),(n=this._rendererService.instance)==null||n.render(this._worldService.scene,this.miniCamera),(i=this._rendererService.instance)==null||i.setScissorTest(!1))}initMiniCamera(){this.disposeMiniCamera(),this.enabled&&(this.miniCamera=new E.PerspectiveCamera(75,this._sizesService.width/this._sizesService.height,.1,500),this.miniCamera.position.z=10,this.miniCamera.position.x=-5)}initOrbitControl(){var t;this.cameraControls&&((t=this.cameraControls)==null||t.dispose()),!(!this.enabled||!(this._cameraService.instance instanceof E.Camera))&&this._cameraService.instance instanceof E.Camera&&(this.cameraControls=new Tn(this._cameraService.instance,this._appService.proxyReceiver),this.cameraControls.rotateSpeed=.1,this.cameraControls.enableDamping=!0)}initMiniCameraOrbitControls(){this.miniCameraControls&&this.miniCameraControls.dispose(),!(!this.enabled||!this.miniCamera)&&(this.miniCameraControls=new Tn(this.miniCamera,this._appService.proxyReceiver),this.miniCameraControls.rotateSpeed=.15,this.miniCameraControls.enableDamping=!0)}initCameraHelper(){this.cameraHelper&&this._worldService.scene.remove(this.cameraHelper),!(!this.enabled||!this._cameraService.instance)&&(this.cameraHelper=new E.CameraHelper(this._cameraService.instance),this._worldService.scene.add(this.cameraHelper))}initAxesHelper(t){if(!this.enabled)return;const e=new E.AxesHelper(t);this._worldService.scene.add(e)}initGridHelper(t){if(this.gridHelper&&this._worldService.scene.remove(this.gridHelper),!this.enabled)return;const e=new E.GridHelper(t,t);this._worldService.scene.add(e)}disposeMiniCamera(){this.miniCamera instanceof E.Camera&&(this.miniCamera.clearViewOffset(),this.miniCamera.clear(),this.miniCamera=void 0)}update(){var t,e;(t=this.cameraControls)==null||t.update(),(e=this.miniCameraControls)==null||e.update(),this._renderMiniCamera()}dispose(){var t,e,r,n,i;this.disposeMiniCamera(),(t=this.cameraControls)==null||t.dispose(),this.cameraControls=void 0,(e=this.miniCameraControls)==null||e.dispose(),this.miniCameraControls=void 0,this.cameraHelper&&this._worldService.scene.remove(this.cameraHelper),(r=this.cameraHelper)==null||r.dispose(),this.cameraHelper=void 0,this.axesHelper&&this._worldService.scene.remove(this.axesHelper),(n=this.axesHelper)==null||n.dispose(),this.axesHelper=void 0,this.gridHelper&&this._worldService.scene.remove(this.gridHelper),(i=this.gridHelper)==null||i.dispose(),this.gridHelper=void 0}};hr=oc([Y(),Je(0,I(tt)),Je(1,I(be)),Je(2,I(je)),Je(3,I($e)),Je(4,I(Ue))],hr);var ac=Object.defineProperty,cc=Object.getOwnPropertyDescriptor,uc=(t,e,r,n)=>{for(var i=n>1?void 0:n?cc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ac(e,r,i),i},Mn=(t,e)=>(r,n)=>e(r,n,t);let fr=class{constructor(t,e){p(this,"step$");this.timerController=t,this._service=e,this.step$=this.timerController.step$.pipe(_e(()=>this._service.enabled))}};fr=uc([Y(),Mn(0,I(qe)),Mn(1,I($e))],fr);var lc=Object.defineProperty,hc=Object.getOwnPropertyDescriptor,fc=(t,e,r,n)=>{for(var i=n>1?void 0:n?hc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&lc(e,r,i),i},Rn=(t,e)=>(r,n)=>e(r,n,t);let dr=class{constructor(t,e){p(this,"_subscriptions",[]);this._service=t,this._controller=e}init(t){this._service.enabled=!!t.enableDebug,this._service.enabled&&(t.withMiniCamera&&this._service.initMiniCamera(),t.enableControls&&(this._service.initOrbitControl(),this._service.initMiniCameraOrbitControls()),t.withCameraHelper&&this._service.initCameraHelper(),typeof(t==null?void 0:t.axesSizes)=="number"&&this._service.initAxesHelper(t.axesSizes),typeof(t==null?void 0:t.gridSizes)=="number"&&this._service.initGridHelper(t.gridSizes),this._subscriptions.push(this._controller.step$.subscribe(()=>{this._service.update()})))}enabled(t){return t&&(this._service.enabled=t),this._service.enabled}miniCamera(t){return t&&(this._service.miniCamera=t),this._service.miniCamera}getAxesHelper(){return this._service.axesHelper}getCameraControls(){return this._service.cameraControls}getCameraHelper(){return this._service.cameraHelper}getGridHelper(){return this._service.gridHelper}getMiniCameraControls(){return this._service.miniCameraControls}getStep$(){return this._controller.step$}dispose(){this._service.dispose(),this._subscriptions.forEach(t=>t.unsubscribe())}};dr=fc([Y(),Rn(0,I(hr)),Rn(1,I(fr))],dr);var dc=Object.defineProperty,pc=Object.getOwnPropertyDescriptor,vc=(t,e,r,n)=>{for(var i=n>1?void 0:n?pc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&dc(e,r,i),i};let Et=class{constructor(){p(this,"loadedResources",{});p(this,"toLoadCount",0);p(this,"loadedCount",0)}handleLoad(t){const{source:e,resource:r,loadedCount:n,toLoadCount:i}=t;r&&(this.loadedResources[e.name]=r,this.toLoadCount=n,this.loadedCount=i)}};Et=vc([Ot(te.ResolutionScoped)],Et);var mc=Object.defineProperty,_c=Object.getOwnPropertyDescriptor,yc=(t,e,r,n)=>{for(var i=n>1?void 0:n?_c(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&mc(e,r,i),i},bc=(t,e)=>(r,n)=>e(r,n,t);let pr=class{constructor(t){p(this,"load$",bt(self,"message").pipe(_e(t=>{var e,r,n;return((e=t.data)==null?void 0:e.token)===Wn&&!!((n=(r=t.data)==null?void 0:r.payload)!=null&&n.resource)}),We(t=>{var r,n,i,s,o;const{payload:e}=t.data||{};if(((r=e==null?void 0:e.source)==null?void 0:r.type)==="gltf"){const a=e.resource,u=(n=a.animations)==null?void 0:n.map(v=>E.AnimationClip.parse(v)),c=(i=a.cameras)==null?void 0:i.map(v=>yn(v)),l=(s=a.scenes)==null?void 0:s.map(v=>yn(v)),h=l==null?void 0:l[0];return{...e,resource:{...a,animations:u,cameras:c,scene:h,scenes:l}}}return((o=e==null?void 0:e.source)==null?void 0:o.type)==="font"?{...e,resource:new fi(e.resource.data)}:e}),Ne()));p(this,"loadCompleted$",this.load$.pipe(_e(t=>!!t&&t.toLoadCount===t.loadedCount),We(()=>ui(this._service,["loadedCount","loadedResources","toLoadCount"])),Ne()));this._service=t}};pr=yc([Ot(te.ResolutionScoped),bc(0,I(Et))],pr);var wc=Object.defineProperty,gc=Object.getOwnPropertyDescriptor,Pc=(t,e,r,n)=>{for(var i=n>1?void 0:n?gc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&wc(e,r,i),i},$n=(t,e)=>(r,n)=>e(r,n,t);let vr=class{constructor(t,e){p(this,"_subscriptions",[]);this._controller=t,this._service=e}init(){this._subscriptions.push(this._controller.load$.subscribe(this._service.handleLoad.bind(this._service)))}getLoadedResources(){return this._service.loadedResources}getLoadedCount(){return this._service.loadedCount}getToLoadCount(){return this._service.toLoadCount}getLoad$(){return this._controller.load$}getLoadCompleted$(){return this._controller.loadCompleted$}dispose(){this._subscriptions.forEach(t=>t.unsubscribe())}};vr=Pc([Y(),$n(0,I(pr)),$n(1,I(Et))],vr);var Sc=Object.defineProperty,Cc=Object.getOwnPropertyDescriptor,Ec=(t,e,r,n)=>{for(var i=n>1?void 0:n?Cc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Sc(e,r,i),i},me=(t,e)=>(r,n)=>e(r,n,t);exports.AppModule=class extends Ln{constructor(e,r,n,i,s,o,a,u,c){super(),this._controller=e,this._service=r,this.timer=n,this.sizes=i,this.camera=s,this.world=o,this.renderer=a,this.loader=u,this.debug=c,this._initProxyEvents()}_initProxyEvents(){br.forEach(e=>{this[`${e}$`]=()=>{var r;return(r=this._controller)==null?void 0:r[`${e}$`]},this[e]=r=>{var n,i;return(i=(n=this._controller)==null?void 0:n[e])==null?void 0:i.call(n,r)}})}getProxyReceiver(){return this._service.proxyReceiver}getCanvas(){return this._service.canvas}getIsInitialized(){return this._service.isInitialized}getBeforeStep$(){return this.timer.beforeStep$()}getStep$(){return this.timer.step$()}getBeforeRender$(){return this.world.getBeforeRender$()}getAfterRender$(){return this.world.getAfterRender$()}init(e){this._service.isInitialized||!(e!=null&&e.canvas)||!(this._service.canvas=e.canvas)||(this._service.isInitialized=!0,this.sizes.init(this._service.canvas),this.camera.init(),this.world.init(),this.renderer.init(this._service.canvas),this.timer.init(e.startTimer),this.loader.init(),this.debug.init(e))}dispose(){this.sizes.dispose(),this.camera.dispose(),this.world.dispose(),this.renderer.dispose(),this.timer.dispose(),this.loader.dispose(),this.debug.dispose()}};exports.AppModule=Ec([Ot(te.ContainerScoped),me(0,I(Pt)),me(1,I(tt)),me(2,I(nr)),me(3,I(cr)),me(4,I(sr)),me(5,I(lr)),me(6,I(ar)),me(7,I(vr)),me(8,I(dr))],exports.AppModule);exports.A=Io;exports.AppProxyEventHandlersBlueprint=Ln;exports.C=ko;exports.CONTAINER_TOKEN=Gi;exports.D=zo;exports.DefaultCameraType=yt;exports.FontLoader=tc;exports.J=ui;exports.KEYBOARD_EVENT_CODES=Yi;exports.LOADER_SERIALIZED_LOAD_TOKEN=Wn;exports.Lifecycle=te;exports.PROXY_EVENT_LISTENERS=br;exports.ProxyEventHandlersBlueprint=Fn;exports.ProxyEventObservablesBlueprint=zn;exports.ProxyEventSubjectsBlueprint=In;exports.Q=Fo;exports.RegisterProxyEventHandlersBlueprint=Zi;exports.Subject=Re;exports.U=rr;exports.W=Lo;exports.filter=_e;exports.fromEvent=bt;exports.getDefaultExportFromCjs=jn;exports.inject=I;exports.instance=yr;exports.map=We;exports.requireWorker=ci;exports.scoped=Ot;exports.share=Ne;exports.singleton=Y;
|