• File: main.f7817a3135aa314f.js.stažený soubor
  • Full Path: /home/tlcompan/www/diskport/0 Osobní/Jaguar1 - 9AJ 5686/inzerát/Jaguar E-Pace 2018 P250 AWD 56700km SUV_files/main.f7817a3135aa314f.js.stažený soubor
  • Date Modified: 03/21/2026 10:17 PM
  • File size: 713.77 KB
  • MIME-type: text/plain
  • Charset: utf-8
"use strict";(self.webpackChunkCar360GalleryToolAngular=self.webpackChunkCar360GalleryToolAngular||[]).push([[179],{516:()=>{function ut(n){return"function"==typeof n}function Da(n){const t=n(i=>{Error.call(i),i.stack=(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}const sc=Da(n=>function(t){n(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((i,r)=>`${r+1}) ${i.toString()}`).join("\n  ")}`:"",this.name="UnsubscriptionError",this.errors=t});function Qo(n,e){if(n){const t=n.indexOf(e);0<=t&&n.splice(t,1)}}class Dn{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;const{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(const o of t)o.remove(this);else t.remove(this);const{initialTeardown:i}=this;if(ut(i))try{i()}catch(o){e=o instanceof sc?o.errors:[o]}const{_finalizers:r}=this;if(r){this._finalizers=null;for(const o of r)try{d_(o)}catch(s){e=e??[],s instanceof sc?e=[...e,...s.errors]:e.push(s)}}if(e)throw new sc(e)}}add(e){var t;if(e&&e!==this)if(this.closed)d_(e);else{if(e instanceof Dn){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(e)}}_hasParent(e){const{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){const{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){const{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&Qo(t,e)}remove(e){const{_finalizers:t}=this;t&&Qo(t,e),e instanceof Dn&&e._removeParent(this)}}Dn.EMPTY=(()=>{const n=new Dn;return n.closed=!0,n})();const c_=Dn.EMPTY;function u_(n){return n instanceof Dn||n&&"closed"in n&&ut(n.remove)&&ut(n.add)&&ut(n.unsubscribe)}function d_(n){ut(n)?n():n.unsubscribe()}const co={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ac={setTimeout(n,e,...t){const{delegate:i}=ac;return i?.setTimeout?i.setTimeout(n,e,...t):setTimeout(n,e,...t)},clearTimeout(n){const{delegate:e}=ac;return(e?.clearTimeout||clearTimeout)(n)},delegate:void 0};function h_(n){ac.setTimeout(()=>{const{onUnhandledError:e}=co;if(!e)throw n;e(n)})}function Qd(){}const hC=Jd("C",void 0,void 0);function Jd(n,e,t){return{kind:n,value:e,error:t}}let uo=null;function lc(n){if(co.useDeprecatedSynchronousErrorHandling){const e=!uo;if(e&&(uo={errorThrown:!1,error:null}),n(),e){const{errorThrown:t,error:i}=uo;if(uo=null,t)throw i}}else n()}class eh extends Dn{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,u_(e)&&e.add(this)):this.destination=yC}static create(e,t,i){return new Ca(e,t,i)}next(e){this.isStopped?nh(function pC(n){return Jd("N",n,void 0)}(e),this):this._next(e)}error(e){this.isStopped?nh(function fC(n){return Jd("E",void 0,n)}(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?nh(hC,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const gC=Function.prototype.bind;function th(n,e){return gC.call(n,e)}class _C{constructor(e){this.partialObserver=e}next(e){const{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(i){cc(i)}}error(e){const{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(i){cc(i)}else cc(e)}complete(){const{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){cc(t)}}}class Ca extends eh{constructor(e,t,i){let r;if(super(),ut(e)||!e)r={next:e??void 0,error:t??void 0,complete:i??void 0};else{let o;this&&co.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),r={next:e.next&&th(e.next,o),error:e.error&&th(e.error,o),complete:e.complete&&th(e.complete,o)}):r=e}this.destination=new _C(r)}}function cc(n){co.useDeprecatedSynchronousErrorHandling?function mC(n){co.useDeprecatedSynchronousErrorHandling&&uo&&(uo.errorThrown=!0,uo.error=n)}(n):h_(n)}function nh(n,e){const{onStoppedNotification:t}=co;t&&ac.setTimeout(()=>t(n,e))}const yC={closed:!0,next:Qd,error:function vC(n){throw n},complete:Qd},ih="function"==typeof Symbol&&Symbol.observable||"@@observable";function ho(n){return n}function f_(n){return 0===n.length?ho:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let bt=(()=>{class n{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const o=function EC(n){return n&&n instanceof eh||function xC(n){return n&&ut(n.next)&&ut(n.error)&&ut(n.complete)}(n)&&u_(n)}(t)?t:new Ca(t,i,r);return lc(()=>{const{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=p_(i))((r,o)=>{const s=new Ca({next:a=>{try{t(a)}catch(l){o(l),s.unsubscribe()}},error:o,complete:r});this.subscribe(s)})}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[ih](){return this}pipe(...t){return f_(t)(this)}toPromise(t){return new(t=p_(t))((i,r)=>{let o;this.subscribe(s=>o=s,s=>r(s),()=>i(o))})}}return n.create=e=>new n(e),n})();function p_(n){var e;return null!==(e=n??co.Promise)&&void 0!==e?e:Promise}const bC=Da(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Ai=(()=>{class n extends bt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new m_(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new bC}next(t){lc(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}})}error(t){lc(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}})}complete(){lc(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:r,observers:o}=this;return i||r?c_:(this.currentObservers=null,o.push(t),new Dn(()=>{this.currentObservers=null,Qo(o,t)}))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:r,isStopped:o}=this;i?t.error(r):o&&t.complete()}asObservable(){const t=new bt;return t.source=this,t}}return n.create=(e,t)=>new m_(e,t),n})();class m_ extends Ai{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===i||i.call(t,e)}error(e){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===i||i.call(t,e)}complete(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)}_subscribe(e){var t,i;return null!==(i=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==i?i:c_}}function g_(n){return ut(n?.lift)}function kt(n){return e=>{if(g_(e))return e.lift(function(t){try{return n(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function At(n,e,t,i,r){return new wC(n,e,t,i,r)}class wC extends eh{constructor(e,t,i,r,o,s){super(e),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=t?function(a){try{t(a)}catch(l){e.error(l)}}:super._next,this._error=r?function(a){try{r(a)}catch(l){e.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:t}=this;super.unsubscribe(),!t&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}}}function De(n,e){return kt((t,i)=>{let r=0;t.subscribe(At(i,o=>{i.next(n.call(e,o,r++))}))})}function Cr(n){return this instanceof Cr?(this.v=n,this):new Cr(n)}function M_(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,e=n[Symbol.asyncIterator];return e?e.call(n):(n=function ah(n){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){!function r(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}(a,l,(s=n[o](s)).done,s.value)})}}}const x_=n=>n&&"number"==typeof n.length&&"function"!=typeof n;function E_(n){return ut(n?.then)}function b_(n){return ut(n[ih])}function w_(n){return Symbol.asyncIterator&&ut(n?.[Symbol.asyncIterator])}function S_(n){return new TypeError(`You provided ${null!==n&&"object"==typeof n?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const D_=function GC(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function C_(n){return ut(n?.[D_])}function T_(n){return function y_(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=t.apply(n,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(h){i[h]&&(r[h]=function(f){return new Promise(function(g,_){o.push([h,f,g,_])>1||a(h,f)})})}function a(h,f){try{!function l(h){h.value instanceof Cr?Promise.resolve(h.value.v).then(c,u):d(o[0][2],h)}(i[h](f))}catch(g){d(o[0][3],g)}}function c(h){a("next",h)}function u(h){a("throw",h)}function d(h,f){h(f),o.shift(),o.length&&a(o[0][0],o[0][1])}}(this,arguments,function*(){const t=n.getReader();try{for(;;){const{value:i,done:r}=yield Cr(t.read());if(r)return yield Cr(void 0);yield yield Cr(i)}}finally{t.releaseLock()}})}function A_(n){return ut(n?.getReader)}function Yn(n){if(n instanceof bt)return n;if(null!=n){if(b_(n))return function jC(n){return new bt(e=>{const t=n[ih]();if(ut(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(n);if(x_(n))return function WC(n){return new bt(e=>{for(let t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}(n);if(E_(n))return function $C(n){return new bt(e=>{n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,h_)})}(n);if(w_(n))return I_(n);if(C_(n))return function qC(n){return new bt(e=>{for(const t of n)if(e.next(t),e.closed)return;e.complete()})}(n);if(A_(n))return function XC(n){return I_(T_(n))}(n)}throw S_(n)}function I_(n){return new bt(e=>{(function YC(n,e){var t,i,r,o;return function __(n,e,t,i){return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):function r(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){try{for(t=M_(n);!(i=yield t.next()).done;)if(e.next(i.value),e.closed)return}catch(s){r={error:s}}finally{try{i&&!i.done&&(o=t.return)&&(yield o.call(t))}finally{if(r)throw r.error}}e.complete()})})(n,e).catch(t=>e.error(t))})}function tr(n,e,t,i=0,r=!1){const o=e.schedule(function(){t(),r?n.add(this.schedule(null,i)):this.unsubscribe()},i);if(n.add(o),!r)return o}function Kt(n,e,t=1/0){return ut(e)?Kt((i,r)=>De((o,s)=>e(i,o,r,s))(Yn(n(i,r))),t):("number"==typeof e&&(t=e),kt((i,r)=>function ZC(n,e,t,i,r,o,s,a){const l=[];let c=0,u=0,d=!1;const h=()=>{d&&!l.length&&!c&&e.complete()},f=_=>c<i?g(_):l.push(_),g=_=>{o&&e.next(_),c++;let v=!1;Yn(t(_,u++)).subscribe(At(e,p=>{r?.(p),o?f(p):e.next(p)},()=>{v=!0},void 0,()=>{if(v)try{for(c--;l.length&&c<i;){const p=l.shift();s?tr(e,s,()=>g(p)):g(p)}h()}catch(p){e.error(p)}}))};return n.subscribe(At(e,f,()=>{d=!0,h()})),()=>{a?.()}}(i,r,n,t)))}function Jo(n=1/0){return Kt(ho,n)}const Ii=new bt(n=>n.complete());function lh(n){return n[n.length-1]}function R_(n){return ut(lh(n))?n.pop():void 0}function Ta(n){return function QC(n){return n&&ut(n.schedule)}(lh(n))?n.pop():void 0}function P_(n,e=0){return kt((t,i)=>{t.subscribe(At(i,r=>tr(i,n,()=>i.next(r),e),()=>tr(i,n,()=>i.complete(),e),r=>tr(i,n,()=>i.error(r),e)))})}function L_(n,e=0){return kt((t,i)=>{i.add(n.schedule(()=>t.subscribe(i),e))})}function F_(n,e){if(!n)throw new Error("Iterable cannot be null");return new bt(t=>{tr(t,e,()=>{const i=n[Symbol.asyncIterator]();tr(t,e,()=>{i.next().then(r=>{r.done?t.complete():t.next(r.value)})},0,!0)})})}function Ht(n,e){return e?function oT(n,e){if(null!=n){if(b_(n))return function eT(n,e){return Yn(n).pipe(L_(e),P_(e))}(n,e);if(x_(n))return function nT(n,e){return new bt(t=>{let i=0;return e.schedule(function(){i===n.length?t.complete():(t.next(n[i++]),t.closed||this.schedule())})})}(n,e);if(E_(n))return function tT(n,e){return Yn(n).pipe(L_(e),P_(e))}(n,e);if(w_(n))return F_(n,e);if(C_(n))return function iT(n,e){return new bt(t=>{let i;return tr(t,e,()=>{i=n[D_](),tr(t,e,()=>{let r,o;try{({value:r,done:o}=i.next())}catch(s){return void t.error(s)}o?t.complete():t.next(r)},0,!0)}),()=>ut(i?.return)&&i.return()})}(n,e);if(A_(n))return function rT(n,e){return F_(T_(n),e)}(n,e)}throw S_(n)}(n,e):Yn(n)}function N_(n={}){const{connector:e=(()=>new Ai),resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:r=!0}=n;return o=>{let s,a,l,c=0,u=!1,d=!1;const h=()=>{a?.unsubscribe(),a=void 0},f=()=>{h(),s=l=void 0,u=d=!1},g=()=>{const _=s;f(),_?.unsubscribe()};return kt((_,v)=>{c++,!d&&!u&&h();const p=l=l??e();v.add(()=>{c--,0===c&&!d&&!u&&(a=ch(g,r))}),p.subscribe(v),!s&&c>0&&(s=new Ca({next:m=>p.next(m),error:m=>{d=!0,h(),a=ch(f,t,m),p.error(m)},complete:()=>{u=!0,h(),a=ch(f,i),p.complete()}}),Yn(_).subscribe(s))})(o)}}function ch(n,e,...t){if(!0===e)return void n();if(!1===e)return;const i=new Ca({next:()=>{i.unsubscribe(),n()}});return e(...t).subscribe(i)}function at(n){for(let e in n)if(n[e]===at)return e;throw Error("Could not find renamed property on target object.")}function uh(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function dt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(dt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function dh(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const aT=at({__forward_ref__:at});function hh(n){return n.__forward_ref__=hh,n.toString=function(){return dt(this())},n}function ye(n){return fh(n)?n():n}function fh(n){return"function"==typeof n&&n.hasOwnProperty(aT)&&n.__forward_ref__===hh}function ph(n){return n&&!!n.\u0275providers}const uc="https://g.co/ng/security#xss";class X extends Error{constructor(e,t){super(dc(e,t)),this.code=e}}function dc(n,e){return`NG0${Math.abs(n)}${e?": "+e.trim():""}`}function Te(n){return"string"==typeof n?n:null==n?"":String(n)}function hc(n,e){throw new X(-201,!1)}function Zn(n,e){null==n&&function rt(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function ue(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function ci(n){return{providers:n.providers||[],imports:n.imports||[]}}function fc(n){return O_(n,pc)||O_(n,U_)}function O_(n,e){return n.hasOwnProperty(e)?n[e]:null}function k_(n){return n&&(n.hasOwnProperty(mh)||n.hasOwnProperty(mT))?n[mh]:null}const pc=at({\u0275prov:at}),mh=at({\u0275inj:at}),U_=at({ngInjectableDef:at}),mT=at({ngInjectorDef:at});var Me=(()=>((Me=Me||{})[Me.Default=0]="Default",Me[Me.Host=1]="Host",Me[Me.Self=2]="Self",Me[Me.SkipSelf=4]="SkipSelf",Me[Me.Optional=8]="Optional",Me))();let gh;function Kn(n){const e=gh;return gh=n,e}function B_(n,e,t){const i=fc(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&Me.Optional?null:void 0!==e?e:void hc(dt(n))}const pt=(()=>typeof globalThis<"u"&&globalThis||typeof global<"u"&&global||typeof window<"u"&&window||typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self)(),Aa={},_h="__NG_DI_FLAG__",mc="ngTempTokenPath",_T="ngTokenPath",vT=/\n/gm,yT="\u0275",z_="__source";let Ia;function es(n){const e=Ia;return Ia=n,e}function MT(n,e=Me.Default){if(void 0===Ia)throw new X(-203,!1);return null===Ia?B_(n,void 0,e):Ia.get(n,e&Me.Optional?null:void 0,e)}function K(n,e=Me.Default){return(function gT(){return gh}()||MT)(ye(n),e)}function Ne(n,e=Me.Default){return K(n,gc(e))}function gc(n){return typeof n>"u"||"number"==typeof n?n:0|(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function vh(n){const e=[];for(let t=0;t<n.length;t++){const i=ye(n[t]);if(Array.isArray(i)){if(0===i.length)throw new X(900,!1);let r,o=Me.Default;for(let s=0;s<i.length;s++){const a=i[s],l=xT(a);"number"==typeof l?-1===l?r=a.token:o|=l:r=a}e.push(K(r,o))}else e.push(K(i))}return e}function Ra(n,e){return n[_h]=e,n.prototype[_h]=e,n}function xT(n){return n[_h]}function nr(n){return{toString:n}.toString()}var Ri=(()=>((Ri=Ri||{})[Ri.OnPush=0]="OnPush",Ri[Ri.Default=1]="Default",Ri))(),Pi=(()=>{return(n=Pi||(Pi={}))[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom",Pi;var n})();const ir={},et=[],_c=at({\u0275cmp:at}),yh=at({\u0275dir:at}),Mh=at({\u0275pipe:at}),V_=at({\u0275mod:at}),rr=at({\u0275fac:at}),Pa=at({__NG_ELEMENT_ID__:at});let wT=0;function Cn(n){return nr(()=>{const e=j_(n),t={...e,decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===Ri.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:null,data:n.data||{},encapsulation:n.encapsulation||Pi.Emulated,id:"c"+wT++,styles:n.styles||et,_:null,schemas:n.schemas||null,tView:null};W_(t);const i=n.dependencies;return t.directiveDefs=vc(i,!1),t.pipeDefs=vc(i,!0),t})}function DT(n){return ot(n)||nn(n)}function CT(n){return null!==n}function Li(n){return nr(()=>({type:n.type,bootstrap:n.bootstrap||et,declarations:n.declarations||et,imports:n.imports||et,exports:n.exports||et,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function G_(n,e){if(null==n)return ir;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],o=r;Array.isArray(r)&&(o=r[1],r=r[0]),t[r]=i,e&&(e[r]=o)}return t}function fn(n){return nr(()=>{const e=j_(n);return W_(e),e})}function ot(n){return n[_c]||null}function nn(n){return n[yh]||null}function An(n){return n[Mh]||null}function On(n,e){const t=n[V_]||null;if(!t&&!0===e)throw new Error(`Type ${dt(n)} does not have '\u0275mod' property.`);return t}function j_(n){const e={};return{type:n.type,providersResolver:null,factory:null,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,exportAs:n.exportAs||null,standalone:!0===n.standalone,selectors:n.selectors||et,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:G_(n.inputs,e),outputs:G_(n.outputs)}}function W_(n){n.features?.forEach(e=>e(n))}function vc(n,e){if(!n)return null;const t=e?An:DT;return()=>("function"==typeof n?n():n).map(i=>t(i)).filter(CT)}const or=0,ie=1,Be=2,wt=3,ui=4,fo=5,rn=6,ns=7,It=8,yc=9,Mc=10,Ve=11,xh=12,La=13,$_=14,is=15,on=16,Fa=17,rs=18,Fi=19,Na=20,q_=21,mt=22,Eh=1,X_=2,xc=7,Ec=8,os=9,pn=10;function kn(n){return Array.isArray(n)&&"object"==typeof n[Eh]}function di(n){return Array.isArray(n)&&!0===n[Eh]}function bh(n){return 0!=(4&n.flags)}function Oa(n){return n.componentOffset>-1}function bc(n){return 1==(1&n.flags)}function hi(n){return!!n.template}function AT(n){return 0!=(256&n[Be])}function po(n,e){return n.hasOwnProperty(rr)?n[rr]:null}class PT{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function mo(){return K_}function K_(n){return n.type.prototype.ngOnChanges&&(n.setInput=FT),LT}function LT(){const n=J_(this),e=n?.current;if(e){const t=n.previous;if(t===ir)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function FT(n,e,t,i){const r=this.declaredInputs[t],o=J_(n)||function NT(n,e){return n[Q_]=e}(n,{previous:ir,current:null}),s=o.current||(o.current={}),a=o.previous,l=a[r];s[r]=new PT(l&&l.currentValue,e,a===ir),n[i]=e}mo.ngInherit=!0;const Q_="__ngSimpleChanges__";function J_(n){return n[Q_]||null}const Qn=function(n,e,t){};function Qt(n){for(;Array.isArray(n);)n=n[or];return n}function wc(n,e){return Qt(e[n])}function Un(n,e){return Qt(e[n.index])}function nv(n,e){return n.data[e]}function In(n,e){const t=e[n];return kn(t)?t:t[or]}function Sc(n){return 64==(64&n[Be])}function Ar(n,e){return null==e?null:n[e]}function iv(n){n[rs]=0}function Sh(n,e){n[fo]+=e;let t=n,i=n[wt];for(;null!==i&&(1===e&&1===t[fo]||-1===e&&0===t[fo]);)i[fo]+=e,t=i,i=i[wt]}const Ae={lFrame:fv(null),bindingsEnabled:!0};function ov(){return Ae.bindingsEnabled}function V(){return Ae.lFrame.lView}function Ke(){return Ae.lFrame.tView}function fi(n){return Ae.lFrame.contextLView=n,n[It]}function pi(n){return Ae.lFrame.contextLView=null,n}function Jt(){let n=sv();for(;null!==n&&64===n.type;)n=n.parent;return n}function sv(){return Ae.lFrame.currentTNode}function Ni(n,e){const t=Ae.lFrame;t.currentTNode=n,t.isParent=e}function Dh(){return Ae.lFrame.isParent}function Ch(){Ae.lFrame.isParent=!1}function mn(){const n=Ae.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function as(){return Ae.lFrame.bindingIndex++}function XT(n,e){const t=Ae.lFrame;t.bindingIndex=t.bindingRootIndex=n,Th(e)}function Th(n){Ae.lFrame.currentDirectiveIndex=n}function uv(){return Ae.lFrame.currentQueryIndex}function Ih(n){Ae.lFrame.currentQueryIndex=n}function ZT(n){const e=n[ie];return 2===e.type?e.declTNode:1===e.type?n[rn]:null}function dv(n,e,t){if(t&Me.SkipSelf){let r=e,o=n;for(;!(r=r.parent,null!==r||t&Me.Host||(r=ZT(o),null===r||(o=o[is],10&r.type))););if(null===r)return!1;e=r,n=o}const i=Ae.lFrame=hv();return i.currentTNode=e,i.lView=n,!0}function Rh(n){const e=hv(),t=n[ie];Ae.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function hv(){const n=Ae.lFrame,e=null===n?null:n.child;return null===e?fv(n):e}function fv(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function pv(){const n=Ae.lFrame;return Ae.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const mv=pv;function Ph(){const n=pv();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function gn(){return Ae.lFrame.selectedIndex}function go(n){Ae.lFrame.selectedIndex=n}function vt(){const n=Ae.lFrame;return nv(n.tView,n.selectedIndex)}function Dc(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t<i;t++){const o=n.data[t].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:l,ngAfterViewChecked:c,ngOnDestroy:u}=o;s&&(n.contentHooks??(n.contentHooks=[])).push(-t,s),a&&((n.contentHooks??(n.contentHooks=[])).push(t,a),(n.contentCheckHooks??(n.contentCheckHooks=[])).push(t,a)),l&&(n.viewHooks??(n.viewHooks=[])).push(-t,l),c&&((n.viewHooks??(n.viewHooks=[])).push(t,c),(n.viewCheckHooks??(n.viewCheckHooks=[])).push(t,c)),null!=u&&(n.destroyHooks??(n.destroyHooks=[])).push(t,u)}}function Cc(n,e,t){gv(n,e,3,t)}function Tc(n,e,t,i){(3&n[Be])===t&&gv(n,e,t,i)}function Lh(n,e){let t=n[Be];(3&t)===e&&(t&=2047,t+=1,n[Be]=t)}function gv(n,e,t,i){const o=i??-1,s=e.length-1;let a=0;for(let l=void 0!==i?65535&n[rs]:0;l<s;l++)if("number"==typeof e[l+1]){if(a=e[l],null!=i&&a>=i)break}else e[l]<0&&(n[rs]+=65536),(a<o||-1==o)&&(oA(n,t,e,l),n[rs]=(4294901760&n[rs])+l+2),l++}function oA(n,e,t,i){const r=t[i]<0,o=t[i+1],a=n[r?-t[i]:t[i]];if(r){if(n[Be]>>11<n[rs]>>16&&(3&n[Be])===e){n[Be]+=2048,Qn(4,a,o);try{o.call(a)}finally{Qn(5,a,o)}}}else{Qn(4,a,o);try{o.call(a)}finally{Qn(5,a,o)}}}const ls=-1;class Ua{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Nh(n,e,t){let i=0;for(;i<t.length;){const r=t[i];if("number"==typeof r){if(0!==r)break;i++;const o=t[i++],s=t[i++],a=t[i++];n.setAttribute(e,s,a,o)}else{const o=r,s=t[++i];vv(o)?n.setProperty(e,o,s):n.setAttribute(e,o,s),i++}}return i}function _v(n){return 3===n||4===n||6===n}function vv(n){return 64===n.charCodeAt(0)}function Ba(n,e){if(null!==e&&0!==e.length)if(null===n||0===n.length)n=e.slice();else{let t=-1;for(let i=0;i<e.length;i++){const r=e[i];"number"==typeof r?t=r:0===t||yv(n,t,r,null,-1===t||2===t?e[++i]:null)}}return n}function yv(n,e,t,i,r){let o=0,s=n.length;if(-1===e)s=-1;else for(;o<n.length;){const a=n[o++];if("number"==typeof a){if(a===e){s=-1;break}if(a>e){s=o-1;break}}}for(;o<n.length;){const a=n[o];if("number"==typeof a)break;if(a===t){if(null===i)return void(null!==r&&(n[o+1]=r));if(i===n[o+1])return void(n[o+2]=r)}o++,null!==i&&o++,null!==r&&o++}-1!==s&&(n.splice(s,0,e),o=s+1),n.splice(o++,0,t),null!==i&&n.splice(o++,0,i),null!==r&&n.splice(o++,0,r)}function Mv(n){return n!==ls}function Ac(n){return 32767&n}function Ic(n,e){let t=function cA(n){return n>>16}(n),i=e;for(;t>0;)i=i[is],t--;return i}let Oh=!0;function Rc(n){const e=Oh;return Oh=n,e}const xv=255,Ev=5;let uA=0;const Oi={};function Pc(n,e){const t=bv(n,e);if(-1!==t)return t;const i=e[ie];i.firstCreatePass&&(n.injectorIndex=e.length,kh(i.data,n),kh(e,null),kh(i.blueprint,null));const r=Uh(n,e),o=n.injectorIndex;if(Mv(r)){const s=Ac(r),a=Ic(r,e),l=a[ie].data;for(let c=0;c<8;c++)e[o+c]=a[s+c]|l[s+c]}return e[o+8]=r,o}function kh(n,e){n.push(0,0,0,0,0,0,0,0,e)}function bv(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Uh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){if(i=Rv(r),null===i)return ls;if(t++,r=r[is],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return ls}function Bh(n,e,t){!function dA(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Pa)&&(i=t[Pa]),null==i&&(i=t[Pa]=uA++);const r=i&xv;e.data[n+(r>>Ev)]|=1<<r}(n,e,t)}function wv(n,e,t){if(t&Me.Optional||void 0!==n)return n;hc()}function Sv(n,e,t,i){if(t&Me.Optional&&void 0===i&&(i=null),!(t&(Me.Self|Me.Host))){const r=n[yc],o=Kn(void 0);try{return r?r.get(e,i,t&Me.Optional):B_(e,i,t&Me.Optional)}finally{Kn(o)}}return wv(i,0,t)}function Dv(n,e,t,i=Me.Default,r){if(null!==n){if(1024&e[Be]){const s=function gA(n,e,t,i,r){let o=n,s=e;for(;null!==o&&null!==s&&1024&s[Be]&&!(256&s[Be]);){const a=Cv(o,s,t,i|Me.Self,Oi);if(a!==Oi)return a;let l=o.parent;if(!l){const c=s[q_];if(c){const u=c.get(t,Oi,i);if(u!==Oi)return u}l=Rv(s),s=s[is]}o=l}return r}(n,e,t,i,Oi);if(s!==Oi)return s}const o=Cv(n,e,t,i,Oi);if(o!==Oi)return o}return Sv(e,t,i,r)}function Cv(n,e,t,i,r){const o=function pA(n){if("string"==typeof n)return n.charCodeAt(0)||0;const e=n.hasOwnProperty(Pa)?n[Pa]:void 0;return"number"==typeof e?e>=0?e&xv:mA:e}(t);if("function"==typeof o){if(!dv(e,n,i))return i&Me.Host?wv(r,0,i):Sv(e,t,i,r);try{const s=o(i);if(null!=s||i&Me.Optional)return s;hc()}finally{mv()}}else if("number"==typeof o){let s=null,a=bv(n,e),l=ls,c=i&Me.Host?e[on][rn]:null;for((-1===a||i&Me.SkipSelf)&&(l=-1===a?Uh(n,e):e[a+8],l!==ls&&Av(i,!1)?(s=e[ie],a=Ac(l),e=Ic(l,e)):a=-1);-1!==a;){const u=e[ie];if(Tv(o,a,u.data)){const d=fA(a,e,t,s,i,c);if(d!==Oi)return d}l=e[a+8],l!==ls&&Av(i,e[ie].data[a+8]===c)&&Tv(o,a,e)?(s=u,a=Ac(l),e=Ic(l,e)):a=-1}}return r}function fA(n,e,t,i,r,o){const s=e[ie],a=s.data[n+8],u=Lc(a,s,t,null==i?Oa(a)&&Oh:i!=s&&0!=(3&a.type),r&Me.Host&&o===a);return null!==u?_o(e,s,u,a):Oi}function Lc(n,e,t,i,r){const o=n.providerIndexes,s=e.data,a=1048575&o,l=n.directiveStart,u=o>>20,h=r?a+u:n.directiveEnd;for(let f=i?a:a+u;f<h;f++){const g=s[f];if(f<l&&t===g||f>=l&&g.type===t)return f}if(r){const f=s[l];if(f&&hi(f)&&f.type===t)return l}return null}function _o(n,e,t,i){let r=n[t];const o=e.data;if(function sA(n){return n instanceof Ua}(r)){const s=r;s.resolving&&function lT(n,e){const t=e?`. Dependency path: ${e.join(" > ")} > ${n}`:"";throw new X(-200,`Circular dependency in DI detected for ${n}${t}`)}(function it(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():Te(n)}(o[t]));const a=Rc(s.canSeeViewProviders);s.resolving=!0;const l=s.injectImpl?Kn(s.injectImpl):null;dv(n,i,Me.Default);try{r=n[t]=s.factory(void 0,o,n,i),e.firstCreatePass&&t>=i.directiveStart&&function rA(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:o}=e.type.prototype;if(i){const s=K_(e);(t.preOrderHooks??(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks??(t.preOrderCheckHooks=[])).push(n,s)}r&&(t.preOrderHooks??(t.preOrderHooks=[])).push(0-n,r),o&&((t.preOrderHooks??(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks??(t.preOrderCheckHooks=[])).push(n,o))}(t,o[t],e)}finally{null!==l&&Kn(l),Rc(a),s.resolving=!1,mv()}}return r}function Tv(n,e,t){return!!(t[e+(n>>Ev)]&1<<n)}function Av(n,e){return!(n&Me.Self||n&Me.Host&&e)}class cs{constructor(e,t){this._tNode=e,this._lView=t}get(e,t,i){return Dv(this._tNode,this._lView,e,gc(i),t)}}function mA(){return new cs(Jt(),V())}function zh(n){return fh(n)?()=>{const e=zh(ye(n));return e&&e()}:po(n)}function Rv(n){const e=n[ie],t=e.type;return 2===t?e.declTNode:1===t?n[rn]:null}const ds="__parameters__";function fs(n,e,t){return nr(()=>{const i=function Hh(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...o){if(this instanceof r)return i.apply(this,o),this;const s=new r(...o);return a.annotation=s,a;function a(l,c,u){const d=l.hasOwnProperty(ds)?l[ds]:Object.defineProperty(l,ds,{value:[]})[ds];for(;d.length<=u;)d.push(null);return(d[u]=d[u]||[]).push(s),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class ne{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=ue({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function vo(n,e){n.forEach(t=>Array.isArray(t)?vo(t,e):e(t))}function Lv(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Fc(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Ga(n,e){const t=[];for(let i=0;i<n;i++)t.push(e);return t}function Bn(n,e,t){let i=ps(n,e);return i>=0?n[1|i]=t:(i=~i,function MA(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function Gh(n,e){const t=ps(n,e);if(t>=0)return n[1|t]}function ps(n,e){return function Fv(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const o=i+(r-i>>1),s=n[o<<t];if(e===s)return o<<t;s>e?r=o:i=o+1}return~(r<<t)}(n,e,1)}const Ir=Ra(fs("Optional"),8),ms=Ra(fs("SkipSelf"),4);var Rn=(()=>((Rn=Rn||{})[Rn.Important=1]="Important",Rn[Rn.DashCase=2]="DashCase",Rn))();const Yh=new Map;let VA=0;const Kh="__ngContext__";function sn(n,e){kn(e)?(n[Kh]=e[Na],function jA(n){Yh.set(n[Na],n)}(e)):n[Kh]=e}let Qh;function Jh(n,e){return Qh(n,e)}function qa(n){const e=n[wt];return di(e)?e[wt]:e}function ef(n){return ey(n[La])}function tf(n){return ey(n[ui])}function ey(n){for(;null!==n&&!di(n);)n=n[ui];return n}function _s(n,e,t,i,r){if(null!=i){let o,s=!1;di(i)?o=i:kn(i)&&(s=!0,i=i[or]);const a=Qt(i);0===n&&null!==t?null==r?sy(e,t,a):yo(e,t,a,r||null,!0):1===n&&null!==t?yo(e,t,a,r||null,!0):2===n?function uf(n,e,t){const i=Uc(n,e);i&&function uI(n,e,t,i){n.removeChild(e,t,i)}(n,i,e,t)}(e,a,s):3===n&&e.destroyNode(a),null!=o&&function fI(n,e,t,i,r){const o=t[xc];o!==Qt(t)&&_s(e,n,i,o,r);for(let a=pn;a<t.length;a++){const l=t[a];Xa(l[ie],l,n,e,i,o)}}(e,n,o,t,r)}}function rf(n,e,t){return n.createElement(e,t)}function ny(n,e){const t=n[os],i=t.indexOf(e),r=e[wt];512&e[Be]&&(e[Be]&=-513,Sh(r,-1)),t.splice(i,1)}function sf(n,e){if(n.length<=pn)return;const t=pn+e,i=n[t];if(i){const r=i[Fa];null!==r&&r!==n&&ny(r,i),e>0&&(n[t-1][ui]=i[ui]);const o=Fc(n,pn+e);!function nI(n,e){Xa(n,e,e[Ve],2,null,null),e[or]=null,e[rn]=null}(i[ie],i);const s=o[Fi];null!==s&&s.detachView(o[ie]),i[wt]=null,i[ui]=null,i[Be]&=-65}return i}function iy(n,e){if(!(128&e[Be])){const t=e[Ve];t.destroyNode&&Xa(n,e,t,3,null,null),function oI(n){let e=n[La];if(!e)return af(n[ie],n);for(;e;){let t=null;if(kn(e))t=e[La];else{const i=e[pn];i&&(t=i)}if(!t){for(;e&&!e[ui]&&e!==n;)kn(e)&&af(e[ie],e),e=e[wt];null===e&&(e=n),kn(e)&&af(e[ie],e),t=e&&e[ui]}e=t}}(e)}}function af(n,e){if(!(128&e[Be])){e[Be]&=-65,e[Be]|=128,function cI(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i<t.length;i+=2){const r=e[t[i]];if(!(r instanceof Ua)){const o=t[i+1];if(Array.isArray(o))for(let s=0;s<o.length;s+=2){const a=r[o[s]],l=o[s+1];Qn(4,a,l);try{l.call(a)}finally{Qn(5,a,l)}}else{Qn(4,r,o);try{o.call(r)}finally{Qn(5,r,o)}}}}}(n,e),function lI(n,e){const t=n.cleanup,i=e[ns];let r=-1;if(null!==t)for(let o=0;o<t.length-1;o+=2)if("string"==typeof t[o]){const s=t[o+3];s>=0?i[r=s]():i[r=-s].unsubscribe(),o+=2}else{const s=i[r=t[o+1]];t[o].call(s)}if(null!==i){for(let o=r+1;o<i.length;o++)(0,i[o])();e[ns]=null}}(n,e),1===e[ie].type&&e[Ve].destroy();const t=e[Fa];if(null!==t&&di(e[wt])){t!==e[wt]&&ny(t,e);const i=e[Fi];null!==i&&i.detachView(n)}!function WA(n){Yh.delete(n[Na])}(e)}}function ry(n,e,t){return function oy(n,e,t){let i=e;for(;null!==i&&40&i.type;)i=(e=i).parent;if(null===i)return t[or];{const{componentOffset:r}=i;if(r>-1){const{encapsulation:o}=n.data[i.directiveStart+r];if(o===Pi.None||o===Pi.Emulated)return null}return Un(i,t)}}(n,e.parent,t)}function yo(n,e,t,i,r){n.insertBefore(e,t,i,r)}function sy(n,e,t){n.appendChild(e,t)}function ay(n,e,t,i,r){null!==i?yo(n,e,t,i,r):sy(n,e,t)}function Uc(n,e){return n.parentNode(e)}function ly(n,e,t){return uy(n,e,t)}let lf,Hc,ff,uy=function cy(n,e,t){return 40&n.type?Un(n,t):null};function Bc(n,e,t,i){const r=ry(n,i,e),o=e[Ve],a=ly(i.parent||e[rn],i,e);if(null!=r)if(Array.isArray(t))for(let l=0;l<t.length;l++)ay(o,r,t[l],a,!1);else ay(o,r,t,a,!1);void 0!==lf&&lf(o,i,e,t,r)}function zc(n,e){if(null!==e){const t=e.type;if(3&t)return Un(e,n);if(4&t)return cf(-1,n[e.index]);if(8&t){const i=e.child;if(null!==i)return zc(n,i);{const r=n[e.index];return di(r)?cf(-1,r):Qt(r)}}if(32&t)return Jh(e,n)()||Qt(n[e.index]);{const i=hy(n,e);return null!==i?Array.isArray(i)?i[0]:zc(qa(n[on]),i):zc(n,e.next)}}return null}function hy(n,e){return null!==e?n[on][rn].projection[e.projection]:null}function cf(n,e){const t=pn+n+1;if(t<e.length){const i=e[t],r=i[ie].firstChild;if(null!==r)return zc(i,r)}return e[xc]}function df(n,e,t,i,r,o,s){for(;null!=t;){const a=i[t.index],l=t.type;if(s&&0===e&&(a&&sn(Qt(a),i),t.flags|=2),32!=(32&t.flags))if(8&l)df(n,e,t.child,i,r,o,!1),_s(e,n,r,a,o);else if(32&l){const c=Jh(t,i);let u;for(;u=c();)_s(e,n,r,u,o);_s(e,n,r,a,o)}else 16&l?fy(n,e,i,t,r,o):_s(e,n,r,a,o);t=s?t.projectionNext:t.next}}function Xa(n,e,t,i,r,o){df(t,i,n.firstChild,e,r,o,!1)}function fy(n,e,t,i,r,o){const s=t[on],l=s[rn].projection[i.projection];if(Array.isArray(l))for(let c=0;c<l.length;c++)_s(e,n,r,l[c],o);else df(n,e,l,s[wt],r,o,!0)}function py(n,e,t){""===t?n.removeAttribute(e,"class"):n.setAttribute(e,"class",t)}function my(n,e,t){const{mergedAttrs:i,classes:r,styles:o}=t;null!==i&&Nh(n,e,i),null!==r&&py(n,e,r),null!==o&&function mI(n,e,t){n.setAttribute(e,"style",t)}(n,e,o)}function vs(n){return function hf(){if(void 0===Hc&&(Hc=null,pt.trustedTypes))try{Hc=pt.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return Hc}()?.createHTML(n)||n}class Mo{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${uc})`}}class MI extends Mo{getTypeName(){return"HTML"}}class xI extends Mo{getTypeName(){return"Style"}}class EI extends Mo{getTypeName(){return"Script"}}class bI extends Mo{getTypeName(){return"URL"}}class wI extends Mo{getTypeName(){return"ResourceURL"}}function zn(n){return n instanceof Mo?n.changingThisBreaksApplicationSecurity:n}function ki(n,e){const t=function SI(n){return n instanceof Mo&&n.getTypeName()||null}(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${uc})`)}return t===e}class RI{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{const t=(new window.DOMParser).parseFromString(vs(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch{return null}}}class PI{constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){const t=this.inertDocument.createElement("template");return t.innerHTML=vs(e),t}}const FI=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Gc(n){return(n=String(n)).match(FI)?n:"unsafe:"+n}function lr(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Ya(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const xy=lr("area,br,col,hr,img,wbr"),Ey=lr("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),by=lr("rp,rt"),mf=Ya(xy,Ya(Ey,lr("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Ya(by,lr("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Ya(by,Ey)),gf=lr("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),wy=Ya(gf,lr("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),lr("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),NI=lr("script,style,template");class OI{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!mf.hasOwnProperty(t))return this.sanitizedSomething=!0,!NI.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r<i.length;r++){const o=i.item(r),s=o.name,a=s.toLowerCase();if(!wy.hasOwnProperty(a)){this.sanitizedSomething=!0;continue}let l=o.value;gf[a]&&(l=Gc(l)),this.buf.push(" ",s,'="',Sy(l),'"')}return this.buf.push(">"),!0}endElement(e){const t=e.nodeName.toLowerCase();mf.hasOwnProperty(t)&&!xy.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(Sy(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const kI=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,UI=/([^\#-~ |!])/g;function Sy(n){return n.replace(/&/g,"&amp;").replace(kI,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(UI,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let jc;function Dy(n,e){let t=null;try{jc=jc||function My(n){const e=new PI(n);return function LI(){try{return!!(new window.DOMParser).parseFromString(vs(""),"text/html")}catch{return!1}}()?new RI(e):e}(n);let i=e?String(e):"";t=jc.getInertBodyElement(i);let r=5,o=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=o,o=t.innerHTML,t=jc.getInertBodyElement(i)}while(i!==o);return vs((new OI).sanitizeChildren(_f(t)||t))}finally{if(t){const i=_f(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function _f(n){return"content"in n&&function BI(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var tt=(()=>((tt=tt||{})[tt.NONE=0]="NONE",tt[tt.HTML=1]="HTML",tt[tt.STYLE=2]="STYLE",tt[tt.SCRIPT=3]="SCRIPT",tt[tt.URL=4]="URL",tt[tt.RESOURCE_URL=5]="RESOURCE_URL",tt))();const Wc=new ne("ENVIRONMENT_INITIALIZER"),Iy=new ne("INJECTOR",-1),Ry=new ne("INJECTOR_DEF_TYPES");class Py{get(e,t=Aa){if(t===Aa){const i=new Error(`NullInjectorError: No provider for ${dt(e)}!`);throw i.name="NullInjectorError",i}return t}}function qI(...n){return{\u0275providers:Ly(0,n),\u0275fromNgModule:!0}}function Ly(n,...e){const t=[],i=new Set;let r;return vo(e,o=>{const s=o;vf(s,t,[],i)&&(r||(r=[]),r.push(s))}),void 0!==r&&Fy(r,t),t}function Fy(n,e){for(let t=0;t<n.length;t++){const{providers:r}=n[t];yf(r,o=>{e.push(o)})}}function vf(n,e,t,i){if(!(n=ye(n)))return!1;let r=null,o=k_(n);const s=!o&&ot(n);if(o||s){if(s&&!s.standalone)return!1;r=n}else{const l=n.ngModule;if(o=k_(l),!o)return!1;r=l}const a=i.has(r);if(s){if(a)return!1;if(i.add(r),s.dependencies){const l="function"==typeof s.dependencies?s.dependencies():s.dependencies;for(const c of l)vf(c,e,t,i)}}else{if(!o)return!1;{if(null!=o.imports&&!a){let c;i.add(r);try{vo(o.imports,u=>{vf(u,e,t,i)&&(c||(c=[]),c.push(u))})}finally{}void 0!==c&&Fy(c,e)}if(!a){const c=po(r)||(()=>new r);e.push({provide:r,useFactory:c,deps:et},{provide:Ry,useValue:r,multi:!0},{provide:Wc,useValue:()=>K(r),multi:!0})}const l=o.providers;null==l||a||yf(l,u=>{e.push(u)})}}return r!==n&&void 0!==n.providers}function yf(n,e){for(let t of n)ph(t)&&(t=t.\u0275providers),Array.isArray(t)?yf(t,e):e(t)}const XI=at({provide:String,useValue:at});function Mf(n){return null!==n&&"object"==typeof n&&XI in n}function xo(n){return"function"==typeof n}const xf=new ne("Set Injector scope."),$c={},ZI={};let Ef;function qc(){return void 0===Ef&&(Ef=new Py),Ef}class Ui{}class ky extends Ui{get destroyed(){return this._destroyed}constructor(e,t,i,r){super(),this.parent=t,this.source=i,this.scopes=r,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,wf(e,s=>this.processProvider(s)),this.records.set(Iy,ys(void 0,this)),r.has("environment")&&this.records.set(Ui,ys(void 0,this));const o=this.records.get(xf);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Ry.multi,et,Me.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const e of this._ngOnDestroyHooks)e.ngOnDestroy();for(const e of this._onDestroyHooks)e()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),this._onDestroyHooks.length=0}}onDestroy(e){this._onDestroyHooks.push(e)}runInContext(e){this.assertNotDestroyed();const t=es(this),i=Kn(void 0);try{return e()}finally{es(t),Kn(i)}}get(e,t=Aa,i=Me.Default){this.assertNotDestroyed(),i=gc(i);const r=es(this),o=Kn(void 0);try{if(!(i&Me.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function tR(n){return"function"==typeof n||"object"==typeof n&&n instanceof ne}(e)&&fc(e);a=l&&this.injectableDefInScope(l)?ys(bf(e),$c):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&Me.Self?qc():this.parent).get(e,t=i&Me.Optional&&t===Aa?null:t)}catch(s){if("NullInjectorError"===s.name){if((s[mc]=s[mc]||[]).unshift(dt(e)),r)throw s;return function ET(n,e,t,i){const r=n[mc];throw e[z_]&&r.unshift(e[z_]),n.message=function bT(n,e,t,i=null){n=n&&"\n"===n.charAt(0)&&n.charAt(1)==yT?n.slice(2):n;let r=dt(e);if(Array.isArray(e))r=e.map(dt).join(" -> ");else if("object"==typeof e){let o=[];for(let s in e)if(e.hasOwnProperty(s)){let a=e[s];o.push(s+":"+("string"==typeof a?JSON.stringify(a):dt(a)))}r=`{${o.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(vT,"\n  ")}`}("\n"+n.message,r,t,i),n[_T]=r,n[mc]=null,n}(s,e,"R3InjectorError",this.source)}throw s}finally{Kn(o),es(r)}}resolveInjectorInitializers(){const e=es(this),t=Kn(void 0);try{const i=this.get(Wc.multi,et,Me.Self);for(const r of i)r()}finally{es(e),Kn(t)}}toString(){const e=[],t=this.records;for(const i of t.keys())e.push(dt(i));return`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new X(205,!1)}processProvider(e){let t=xo(e=ye(e))?e:ye(e&&e.provide);const i=function QI(n){return Mf(n)?ys(void 0,n.useValue):ys(function Uy(n,e,t){let i;if(xo(n)){const r=ye(n);return po(r)||bf(r)}if(Mf(n))i=()=>ye(n.useValue);else if(function Oy(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...vh(n.deps||[]));else if(function Ny(n){return!(!n||!n.useExisting)}(n))i=()=>K(ye(n.useExisting));else{const r=ye(n&&(n.useClass||n.provide));if(!function JI(n){return!!n.deps}(n))return po(r)||bf(r);i=()=>new r(...vh(n.deps))}return i}(n),$c)}(e);if(xo(e)||!0!==e.multi)this.records.get(t);else{let r=this.records.get(t);r||(r=ys(void 0,$c,!0),r.factory=()=>vh(r.multi),this.records.set(t,r)),t=e,r.multi.push(e)}this.records.set(t,i)}hydrate(e,t){return t.value===$c&&(t.value=ZI,t.value=t.factory()),"object"==typeof t.value&&t.value&&function eR(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ye(e.providedIn);return"string"==typeof t?"any"===t||this.scopes.has(t):this.injectorDefTypes.has(t)}}function bf(n){const e=fc(n),t=null!==e?e.factory:po(n);if(null!==t)return t;if(n instanceof ne)throw new X(204,!1);if(n instanceof Function)return function KI(n){const e=n.length;if(e>0)throw Ga(e,"?"),new X(204,!1);const t=function pT(n){return n&&(n[pc]||n[U_])||null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new X(204,!1)}function ys(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function wf(n,e){for(const t of n)Array.isArray(t)?wf(t,e):t&&ph(t)?wf(t.\u0275providers,e):e(t)}class nR{}class By{}class rR{resolveComponentFactory(e){throw function iR(n){const e=Error(`No component factory found for ${dt(n)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=n,e}(e)}}let Ka=(()=>{class n{}return n.NULL=new rR,n})();function oR(){return Ms(Jt(),V())}function Ms(n,e){return new Bi(Un(n,e))}let Bi=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=oR,n})();function sR(n){return n instanceof Bi?n.nativeElement:n}class Hy{}let Qa=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>function aR(){const n=V(),t=In(Jt().index,n);return(kn(t)?t:n)[Ve]}(),n})(),lR=(()=>{class n{}return n.\u0275prov=ue({token:n,providedIn:"root",factory:()=>null}),n})();class xs{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const cR=new xs("15.2.9"),Sf={},Df="ngOriginalError";function Cf(n){return n[Df]}class cr{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e);this._console.error("ERROR",e),t&&this._console.error("ORIGINAL ERROR",t)}_findOriginalError(e){let t=e&&Cf(e);for(;t&&Cf(t);)t=Cf(t);return t||null}}function Vy(n){return n.ownerDocument.defaultView}function ur(n){return n instanceof Function?n():n}function jy(n,e,t){let i=n.length;for(;;){const r=n.indexOf(e,t);if(-1===r)return r;if(0===r||n.charCodeAt(r-1)<=32){const o=e.length;if(r+o===i||n.charCodeAt(r+o)<=32)return r}t=r+1}}const Wy="ng-template";function yR(n,e,t){let i=0,r=!0;for(;i<n.length;){let o=n[i++];if("string"==typeof o&&r){const s=n[i++];if(t&&"class"===o&&-1!==jy(s.toLowerCase(),e,0))return!0}else{if(1===o){for(;i<n.length&&"string"==typeof(o=n[i++]);)if(o.toLowerCase()===e)return!0;return!1}"number"==typeof o&&(r=!1)}}return!1}function $y(n){return 4===n.type&&n.value!==Wy}function MR(n,e,t){return e===(4!==n.type||t?n.value:Wy)}function xR(n,e,t){let i=4;const r=n.attrs||[],o=function wR(n){for(let e=0;e<n.length;e++)if(_v(n[e]))return e;return n.length}(r);let s=!1;for(let a=0;a<e.length;a++){const l=e[a];if("number"!=typeof l){if(!s)if(4&i){if(i=2|1&i,""!==l&&!MR(n,l,t)||""===l&&1===e.length){if(mi(i))return!1;s=!0}}else{const c=8&i?l:e[++a];if(8&i&&null!==n.attrs){if(!yR(n.attrs,c,t)){if(mi(i))return!1;s=!0}continue}const d=ER(8&i?"class":l,r,$y(n),t);if(-1===d){if(mi(i))return!1;s=!0;continue}if(""!==c){let h;h=d>o?"":r[d+1].toLowerCase();const f=8&i?h:null;if(f&&-1!==jy(f,c,0)||2&i&&c!==h){if(mi(i))return!1;s=!0}}}}else{if(!s&&!mi(i)&&!mi(l))return!1;if(s&&mi(l))continue;s=!1,i=l|1&i}}return mi(i)||s}function mi(n){return 0==(1&n)}function ER(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let o=!1;for(;r<e.length;){const s=e[r];if(s===n)return r;if(3===s||6===s)o=!0;else{if(1===s||2===s){let a=e[++r];for(;"string"==typeof a;)a=e[++r];continue}if(4===s)break;if(0===s){r+=4;continue}}r+=o?1:2}return-1}return function SR(n,e){let t=n.indexOf(4);if(t>-1)for(t++;t<n.length;){const i=n[t];if("number"==typeof i)return-1;if(i===e)return t;t++}return-1}(e,n)}function qy(n,e,t=!1){for(let i=0;i<e.length;i++)if(xR(n,e[i],t))return!0;return!1}function DR(n,e){e:for(let t=0;t<e.length;t++){const i=e[t];if(n.length===i.length){for(let r=0;r<n.length;r++)if(n[r]!==i[r])continue e;return!0}}return!1}function Xy(n,e){return n?":not("+e.trim()+")":e}function CR(n){let e=n[0],t=1,i=2,r="",o=!1;for(;t<n.length;){let s=n[t];if("string"==typeof s)if(2&i){const a=n[++t];r+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else 8&i?r+="."+s:4&i&&(r+=" "+s);else""!==r&&!mi(s)&&(e+=Xy(o,r),r=""),i=s,o=o||!mi(i);t++}return""!==r&&(e+=Xy(o,r)),e}const Ie={};function Rt(n){Yy(Ke(),V(),gn()+n,!1)}function Yy(n,e,t,i){if(!i)if(3==(3&e[Be])){const o=n.preOrderCheckHooks;null!==o&&Cc(e,o,t)}else{const o=n.preOrderHooks;null!==o&&Tc(e,o,0,t)}go(t)}function Jy(n,e=null,t=null,i){const r=e0(n,e,t,i);return r.resolveInjectorInitializers(),r}function e0(n,e=null,t=null,i,r=new Set){const o=[t||et,qI(n)];return i=i||("object"==typeof n?void 0:dt(n)),new ky(o,e||qc(),i||null,r)}let zi=(()=>{class n{static create(t,i){if(Array.isArray(t))return Jy({name:""},i,t,"");{const r=t.name??"";return Jy({name:r},t.parent,t.providers,r)}}}return n.THROW_IF_NOT_FOUND=Aa,n.NULL=new Py,n.\u0275prov=ue({token:n,providedIn:"any",factory:()=>K(Iy)}),n.__NG_ELEMENT_ID__=-1,n})();function he(n,e=Me.Default){const t=V();return null===t?K(n,e):Dv(Jt(),t,ye(n),e)}function c0(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i<t.length;i+=2){const o=t[i+1];if(-1!==o){const s=n.data[o];Ih(t[i]),s.contentQueries(2,e[o],o)}}}function Yc(n,e,t,i,r,o,s,a,l,c,u){const d=e.blueprint.slice();return d[or]=r,d[Be]=76|i,(null!==u||n&&1024&n[Be])&&(d[Be]|=1024),iv(d),d[wt]=d[is]=n,d[It]=t,d[Mc]=s||n&&n[Mc],d[Ve]=a||n&&n[Ve],d[xh]=l||n&&n[xh]||null,d[yc]=c||n&&n[yc]||null,d[rn]=o,d[Na]=function GA(){return VA++}(),d[q_]=u,d[on]=2==e.type?n[on]:d,d}function ws(n,e,t,i,r){let o=n.data[e];if(null===o)o=function Pf(n,e,t,i,r){const o=sv(),s=Dh(),l=n.data[e]=function JR(n,e,t,i,r,o){return{type:t,index:i,insertBeforeIndex:null,injectorIndex:e?e.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:0,providerIndexes:0,value:r,attrs:o,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,s?o:o&&o.parent,t,e,i,r);return null===n.firstChild&&(n.firstChild=l),null!==o&&(s?null==o.child&&null!==l.parent&&(o.child=l):null===o.next&&(o.next=l,l.prev=o)),l}(n,e,t,i,r),function qT(){return Ae.lFrame.inI18n}()&&(o.flags|=32);else if(64&o.type){o.type=t,o.value=i,o.attrs=r;const s=function ka(){const n=Ae.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}();o.injectorIndex=null===s?-1:s.injectorIndex}return Ni(o,!0),o}function Ja(n,e,t,i){if(0===t)return-1;const r=e.length;for(let o=0;o<t;o++)e.push(i),n.blueprint.push(i),n.data.push(null);return r}function Lf(n,e,t){Rh(e);try{const i=n.viewQuery;null!==i&&Vf(1,i,t);const r=n.template;null!==r&&u0(n,e,r,1,t),n.firstCreatePass&&(n.firstCreatePass=!1),n.staticContentQueries&&c0(n,e),n.staticViewQueries&&Vf(2,n.viewQuery,t);const o=n.components;null!==o&&function ZR(n,e){for(let t=0;t<e.length;t++)M1(n,e[t])}(e,o)}catch(i){throw n.firstCreatePass&&(n.incompleteFirstPass=!0,n.firstCreatePass=!1),i}finally{e[Be]&=-5,Ph()}}function Zc(n,e,t,i){const r=e[Be];if(128!=(128&r)){Rh(e);try{iv(e),function lv(n){return Ae.lFrame.bindingIndex=n}(n.bindingStartIndex),null!==t&&u0(n,e,t,2,i);const s=3==(3&r);if(s){const c=n.preOrderCheckHooks;null!==c&&Cc(e,c,null)}else{const c=n.preOrderHooks;null!==c&&Tc(e,c,0,null),Lh(e,0)}if(function v1(n){for(let e=ef(n);null!==e;e=tf(e)){if(!e[X_])continue;const t=e[os];for(let i=0;i<t.length;i++){const r=t[i];512&r[Be]||Sh(r[wt],1),r[Be]|=512}}}(e),function _1(n){for(let e=ef(n);null!==e;e=tf(e))for(let t=pn;t<e.length;t++){const i=e[t],r=i[ie];Sc(i)&&Zc(r,i,r.template,i[It])}}(e),null!==n.contentQueries&&c0(n,e),s){const c=n.contentCheckHooks;null!==c&&Cc(e,c)}else{const c=n.contentHooks;null!==c&&Tc(e,c,1),Lh(e,1)}!function XR(n,e){const t=n.hostBindingOpCodes;if(null!==t)try{for(let i=0;i<t.length;i++){const r=t[i];if(r<0)go(~r);else{const o=r,s=t[++i],a=t[++i];XT(s,o),a(2,e[o])}}}finally{go(-1)}}(n,e);const a=n.components;null!==a&&function YR(n,e){for(let t=0;t<e.length;t++)y1(n,e[t])}(e,a);const l=n.viewQuery;if(null!==l&&Vf(2,l,i),s){const c=n.viewCheckHooks;null!==c&&Cc(e,c)}else{const c=n.viewHooks;null!==c&&Tc(e,c,2),Lh(e,2)}!0===n.firstUpdatePass&&(n.firstUpdatePass=!1),e[Be]&=-41,512&e[Be]&&(e[Be]&=-513,Sh(e[wt],-1))}finally{Ph()}}}function u0(n,e,t,i,r){const o=gn(),s=2&i;try{go(-1),s&&e.length>mt&&Yy(n,e,mt,!1),Qn(s?2:0,r),t(i,r)}finally{go(o),Qn(s?3:1,r)}}function Ff(n,e,t){if(bh(e)){const r=e.directiveEnd;for(let o=e.directiveStart;o<r;o++){const s=n.data[o];s.contentQueries&&s.contentQueries(1,t[o],o)}}}function Nf(n,e,t){ov()&&(function a1(n,e,t,i){const r=t.directiveStart,o=t.directiveEnd;Oa(t)&&function p1(n,e,t){const i=Un(e,n),r=d0(t),o=n[Mc],s=Kc(n,Yc(n,r,null,t.onPush?32:16,i,e,o,o.createRenderer(i,t),null,null,null));n[e.index]=s}(e,t,n.data[r+t.componentOffset]),n.firstCreatePass||Pc(t,e),sn(i,e);const s=t.initialInputs;for(let a=r;a<o;a++){const l=n.data[a],c=_o(e,n,a,t);sn(c,e),null!==s&&m1(0,a-r,c,l,0,s),hi(l)&&(In(t.index,e)[It]=_o(e,n,a,t))}}(n,e,t,Un(t,e)),64==(64&t.flags)&&g0(n,e,t))}function Of(n,e,t=Un){const i=e.localNames;if(null!==i){let r=e.index+1;for(let o=0;o<i.length;o+=2){const s=i[o+1],a=-1===s?t(e,n):n[s];n[r++]=a}}}function d0(n){const e=n.tView;return null===e||e.incompleteFirstPass?n.tView=kf(1,null,n.template,n.decls,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas,n.consts):e}function kf(n,e,t,i,r,o,s,a,l,c){const u=mt+i,d=u+r,h=function KR(n,e){const t=[];for(let i=0;i<e;i++)t.push(i<n?null:Ie);return t}(u,d),f="function"==typeof c?c():c;return h[ie]={type:n,blueprint:h,template:t,queries:null,viewQuery:a,declTNode:e,data:h.slice().fill(null,u),bindingStartIndex:u,expandoStartIndex:d,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof o?o():o,pipeRegistry:"function"==typeof s?s():s,firstChild:null,schemas:l,consts:f,incompleteFirstPass:!1}}function h0(n,e,t,i){const r=v0(e);null===t?r.push(i):(r.push(t),n.firstCreatePass&&y0(n).push(i,r.length-1))}function f0(n,e,t,i){for(let r in n)if(n.hasOwnProperty(r)){t=null===t?{}:t;const o=n[r];null===i?p0(t,e,r,o):i.hasOwnProperty(r)&&p0(t,e,i[r],o)}return t}function p0(n,e,t,i){n.hasOwnProperty(t)?n[t].push(e,i):n[t]=[e,i]}function Uf(n,e,t,i){if(ov()){const r=null===i?null:{"":-1},o=function c1(n,e){const t=n.directiveRegistry;let i=null,r=null;if(t)for(let o=0;o<t.length;o++){const s=t[o];if(qy(e,s.selectors,!1))if(i||(i=[]),hi(s))if(null!==s.findHostDirectiveDefs){const a=[];r=r||new Map,s.findHostDirectiveDefs(s,a,r),i.unshift(...a,s),Bf(n,e,a.length)}else i.unshift(s),Bf(n,e,0);else r=r||new Map,s.findHostDirectiveDefs?.(s,i,r),i.push(s)}return null===i?null:[i,r]}(n,t);let s,a;null===o?s=a=null:[s,a]=o,null!==s&&m0(n,e,t,s,r,a),r&&function u1(n,e,t){if(e){const i=n.localNames=[];for(let r=0;r<e.length;r+=2){const o=t[e[r+1]];if(null==o)throw new X(-301,!1);i.push(e[r],o)}}}(t,i,r)}t.mergedAttrs=Ba(t.mergedAttrs,t.attrs)}function m0(n,e,t,i,r,o){for(let c=0;c<i.length;c++)Bh(Pc(t,e),n,i[c].type);!function h1(n,e,t){n.flags|=1,n.directiveStart=e,n.directiveEnd=e+t,n.providerIndexes=e}(t,n.data.length,i.length);for(let c=0;c<i.length;c++){const u=i[c];u.providersResolver&&u.providersResolver(u)}let s=!1,a=!1,l=Ja(n,e,i.length,null);for(let c=0;c<i.length;c++){const u=i[c];t.mergedAttrs=Ba(t.mergedAttrs,u.hostAttrs),f1(n,t,e,l,u),d1(l,u,r),null!==u.contentQueries&&(t.flags|=4),(null!==u.hostBindings||null!==u.hostAttrs||0!==u.hostVars)&&(t.flags|=64);const d=u.type.prototype;!s&&(d.ngOnChanges||d.ngOnInit||d.ngDoCheck)&&((n.preOrderHooks??(n.preOrderHooks=[])).push(t.index),s=!0),!a&&(d.ngOnChanges||d.ngDoCheck)&&((n.preOrderCheckHooks??(n.preOrderCheckHooks=[])).push(t.index),a=!0),l++}!function e1(n,e,t){const r=e.directiveEnd,o=n.data,s=e.attrs,a=[];let l=null,c=null;for(let u=e.directiveStart;u<r;u++){const d=o[u],h=t?t.get(d):null,g=h?h.outputs:null;l=f0(d.inputs,u,l,h?h.inputs:null),c=f0(d.outputs,u,c,g);const _=null===l||null===s||$y(e)?null:g1(l,u,s);a.push(_)}null!==l&&(l.hasOwnProperty("class")&&(e.flags|=8),l.hasOwnProperty("style")&&(e.flags|=16)),e.initialInputs=a,e.inputs=l,e.outputs=c}(n,t,o)}function g0(n,e,t){const i=t.directiveStart,r=t.directiveEnd,o=t.index,s=function YT(){return Ae.lFrame.currentDirectiveIndex}();try{go(o);for(let a=i;a<r;a++){const l=n.data[a],c=e[a];Th(a),(null!==l.hostBindings||0!==l.hostVars||null!==l.hostAttrs)&&l1(l,c)}}finally{go(-1),Th(s)}}function l1(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Bf(n,e,t){e.componentOffset=t,(n.components??(n.components=[])).push(e.index)}function d1(n,e,t){if(t){if(e.exportAs)for(let i=0;i<e.exportAs.length;i++)t[e.exportAs[i]]=n;hi(e)&&(t[""]=n)}}function f1(n,e,t,i,r){n.data[i]=r;const o=r.factory||(r.factory=po(r.type)),s=new Ua(o,hi(r),he);n.blueprint[i]=s,t[i]=s,function o1(n,e,t,i,r){const o=r.hostBindings;if(o){let s=n.hostBindingOpCodes;null===s&&(s=n.hostBindingOpCodes=[]);const a=~e.index;(function s1(n){let e=n.length;for(;e>0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(s)!=a&&s.push(a),s.push(t,i,o)}}(n,e,i,Ja(n,t,r.hostVars,Ie),r)}function Hi(n,e,t,i,r,o){const s=Un(n,e);!function zf(n,e,t,i,r,o,s){if(null==o)n.removeAttribute(e,r,t);else{const a=null==s?Te(o):s(o,i||"",r);n.setAttribute(e,r,a,t)}}(e[Ve],s,o,n.value,t,i,r)}function m1(n,e,t,i,r,o){const s=o[e];if(null!==s){const a=i.setInput;for(let l=0;l<s.length;){const c=s[l++],u=s[l++],d=s[l++];null!==a?i.setInput(t,d,c,u):t[u]=d}}}function g1(n,e,t){let i=null,r=0;for(;r<t.length;){const o=t[r];if(0!==o)if(5!==o){if("number"==typeof o)break;if(n.hasOwnProperty(o)){null===i&&(i=[]);const s=n[o];for(let a=0;a<s.length;a+=2)if(s[a]===e){i.push(o,s[a+1],t[r+1]);break}}r+=2}else r+=2;else r+=4}return i}function _0(n,e,t,i){return[n,!0,!1,e,null,0,i,t,null,null]}function y1(n,e){const t=In(e,n);if(Sc(t)){const i=t[ie];48&t[Be]?Zc(i,t,i.template,t[It]):t[fo]>0&&Hf(t)}}function Hf(n){for(let i=ef(n);null!==i;i=tf(i))for(let r=pn;r<i.length;r++){const o=i[r];if(Sc(o))if(512&o[Be]){const s=o[ie];Zc(s,o,s.template,o[It])}else o[fo]>0&&Hf(o)}const t=n[ie].components;if(null!==t)for(let i=0;i<t.length;i++){const r=In(t[i],n);Sc(r)&&r[fo]>0&&Hf(r)}}function M1(n,e){const t=In(e,n),i=t[ie];(function x1(n,e){for(let t=e.length;t<n.blueprint.length;t++)e.push(n.blueprint[t])})(i,t),Lf(i,t,t[It])}function Kc(n,e){return n[La]?n[$_][ui]=e:n[La]=e,n[$_]=e,e}function Qc(n){for(;n;){n[Be]|=32;const e=qa(n);if(AT(n)&&!e)return n;n=e}return null}function Jc(n,e,t,i=!0){const r=e[Mc];r.begin&&r.begin();try{Zc(n,e,n.template,t)}catch(s){throw i&&x0(e,s),s}finally{r.end&&r.end()}}function Vf(n,e,t){Ih(0),e(n,t)}function v0(n){return n[ns]||(n[ns]=[])}function y0(n){return n.cleanup||(n.cleanup=[])}function x0(n,e){const t=n[yc],i=t?t.get(cr,null):null;i&&i.handleError(e)}function Gf(n,e,t,i,r){for(let o=0;o<t.length;){const s=t[o++],a=t[o++],l=e[s],c=n.data[s];null!==c.setInput?c.setInput(l,r,i,a):l[a]=r}}function eu(n,e,t){let i=t?n.styles:null,r=t?n.classes:null,o=0;if(null!==e)for(let s=0;s<e.length;s++){const a=e[s];"number"==typeof a?o=a:1==o?r=dh(r,a):2==o&&(i=dh(i,a+": "+e[++s]+";"))}t?n.styles=i:n.stylesWithoutHost=i,t?n.classes=r:n.classesWithoutHost=r}function tu(n,e,t,i,r=!1){for(;null!==t;){const o=e[t.index];if(null!==o&&i.push(Qt(o)),di(o))for(let a=pn;a<o.length;a++){const l=o[a],c=l[ie].firstChild;null!==c&&tu(l[ie],l,c,i)}const s=t.type;if(8&s)tu(n,e,t.child,i);else if(32&s){const a=Jh(t,e);let l;for(;l=a();)i.push(l)}else if(16&s){const a=hy(e,t);if(Array.isArray(a))i.push(...a);else{const l=qa(e[on]);tu(l[ie],l,a,i,!0)}}t=r?t.projectionNext:t.next}return i}class el{get rootNodes(){const e=this._lView,t=e[ie];return tu(t,e,t.firstChild,[])}constructor(e,t){this._lView=e,this._cdRefInjectingView=t,this._appRef=null,this._attachedToViewContainer=!1}get context(){return this._lView[It]}set context(e){this._lView[It]=e}get destroyed(){return 128==(128&this._lView[Be])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const e=this._lView[wt];if(di(e)){const t=e[Ec],i=t?t.indexOf(this):-1;i>-1&&(sf(e,i),Fc(t,i))}this._attachedToViewContainer=!1}iy(this._lView[ie],this._lView)}onDestroy(e){h0(this._lView[ie],this._lView,null,e)}markForCheck(){Qc(this._cdRefInjectingView||this._lView)}detach(){this._lView[Be]&=-65}reattach(){this._lView[Be]|=64}detectChanges(){Jc(this._lView[ie],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new X(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function rI(n,e){Xa(n,e,e[Ve],2,null,null)}(this._lView[ie],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new X(902,!1);this._appRef=e}}class E1 extends el{constructor(e){super(e),this._view=e}detectChanges(){const e=this._view;Jc(e[ie],e,e[It],!1)}checkNoChanges(){}get context(){return null}}class E0 extends Ka{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=ot(e);return new tl(t,this.ngModule)}}function b0(n){const e=[];for(let t in n)n.hasOwnProperty(t)&&e.push({propName:n[t],templateName:t});return e}class w1{constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,i){i=gc(i);const r=this.injector.get(e,Sf,i);return r!==Sf||t===Sf?r:this.parentInjector.get(e,t,i)}}class tl extends By{get inputs(){return b0(this.componentDef.inputs)}get outputs(){return b0(this.componentDef.outputs)}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function TR(n){return n.map(CR).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}create(e,t,i,r){let o=(r=r||this.ngModule)instanceof Ui?r:r?.injector;o&&null!==this.componentDef.getStandaloneInjector&&(o=this.componentDef.getStandaloneInjector(o)||o);const s=o?new w1(e,o):e,a=s.get(Hy,null);if(null===a)throw new X(407,!1);const l=s.get(lR,null),c=a.createRenderer(null,this.componentDef),u=this.componentDef.selectors[0][0]||"div",d=i?function QR(n,e,t){return n.selectRootElement(e,t===Pi.ShadowDom)}(c,i,this.componentDef.encapsulation):rf(c,u,function b1(n){const e=n.toLowerCase();return"svg"===e?"svg":"math"===e?"math":null}(u)),h=this.componentDef.onPush?288:272,f=kf(0,null,null,1,0,null,null,null,null,null),g=Yc(null,f,null,h,null,null,a,c,l,s,null);let _,v;Rh(g);try{const p=this.componentDef;let m,y=null;p.findHostDirectiveDefs?(m=[],y=new Map,p.findHostDirectiveDefs(p,m,y),m.push(p)):m=[p];const M=function D1(n,e){const t=n[ie],i=mt;return n[i]=e,ws(t,i,2,"#host",null)}(g,d),w=function C1(n,e,t,i,r,o,s,a){const l=r[ie];!function T1(n,e,t,i){for(const r of n)e.mergedAttrs=Ba(e.mergedAttrs,r.hostAttrs);null!==e.mergedAttrs&&(eu(e,e.mergedAttrs,!0),null!==t&&my(i,t,e))}(i,n,e,s);const c=o.createRenderer(e,t),u=Yc(r,d0(t),null,t.onPush?32:16,r[n.index],n,o,c,a||null,null,null);return l.firstCreatePass&&Bf(l,n,i.length-1),Kc(r,u),r[n.index]=u}(M,d,p,m,g,a,c);v=nv(f,mt),d&&function I1(n,e,t,i){if(i)Nh(n,t,["ng-version",cR.full]);else{const{attrs:r,classes:o}=function AR(n){const e=[],t=[];let i=1,r=2;for(;i<n.length;){let o=n[i];if("string"==typeof o)2===r?""!==o&&e.push(o,n[++i]):8===r&&t.push(o);else{if(!mi(r))break;r=o}i++}return{attrs:e,classes:t}}(e.selectors[0]);r&&Nh(n,t,r),o&&o.length>0&&py(n,t,o.join(" "))}}(c,p,d,i),void 0!==t&&function R1(n,e,t){const i=n.projection=[];for(let r=0;r<e.length;r++){const o=t[r];i.push(null!=o?Array.from(o):null)}}(v,this.ngContentSelectors,t),_=function A1(n,e,t,i,r,o){const s=Jt(),a=r[ie],l=Un(s,r);m0(a,r,s,t,null,i);for(let u=0;u<t.length;u++)sn(_o(r,a,s.directiveStart+u,s),r);g0(a,r,s),l&&sn(l,r);const c=_o(r,a,s.directiveStart+s.componentOffset,s);if(n[It]=r[It]=c,null!==o)for(const u of o)u(c,e);return Ff(a,s,n),c}(w,p,m,y,g,[P1]),Lf(f,g,null)}finally{Ph()}return new S1(this.componentType,_,Ms(v,g),g,v)}}class S1 extends nR{constructor(e,t,i,r,o){super(),this.location=i,this._rootLView=r,this._tNode=o,this.instance=t,this.hostView=this.changeDetectorRef=new E1(r),this.componentType=e}setInput(e,t){const i=this._tNode.inputs;let r;if(null!==i&&(r=i[e])){const o=this._rootLView;Gf(o[ie],o,r,e,t),Qc(In(this._tNode.index,o))}}get injector(){return new cs(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}function P1(){const n=Jt();Dc(V()[ie],n)}function jf(n){let e=function w0(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(hi(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new X(903,!1);r=e.\u0275dir}if(r){if(t){i.push(r);const s=n;s.inputs=Wf(n.inputs),s.declaredInputs=Wf(n.declaredInputs),s.outputs=Wf(n.outputs);const a=r.hostBindings;a&&O1(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&F1(n,l),c&&N1(n,c),uh(n.inputs,r.inputs),uh(n.declaredInputs,r.declaredInputs),uh(n.outputs,r.outputs),hi(r)&&r.data.animation){const u=n.data;u.animation=(u.animation||[]).concat(r.data.animation)}}const o=r.features;if(o)for(let s=0;s<o.length;s++){const a=o[s];a&&a.ngInherit&&a(n),a===jf&&(t=!1)}}e=Object.getPrototypeOf(e)}!function L1(n){let e=0,t=null;for(let i=n.length-1;i>=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Ba(r.hostAttrs,t=Ba(t,r.hostAttrs))}}(i)}function Wf(n){return n===ir?{}:n===et?[]:n}function F1(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function N1(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,o)=>{e(i,r,o),t(i,r,o)}:e}function O1(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}function nu(n){return!!$f(n)&&(Array.isArray(n)||!(n instanceof Map)&&Symbol.iterator in n)}function $f(n){return null!==n&&("function"==typeof n||"object"==typeof n)}function Vi(n,e,t){return n[e]=t}function an(n,e,t){return!Object.is(n[e],t)&&(n[e]=t,!0)}function Eo(n,e,t,i){const r=an(n,e,t);return an(n,e+1,i)||r}function ru(n,e,t,i){const r=V();return an(r,as(),e)&&(Ke(),Hi(vt(),r,n,e,t,i)),ru}function Gt(n,e,t,i,r,o,s,a){const l=V(),c=Ke(),u=n+mt,d=c.firstCreatePass?function $1(n,e,t,i,r,o,s,a,l){const c=e.consts,u=ws(e,n,4,s||null,Ar(c,a));Uf(e,t,u,Ar(c,l)),Dc(e,u);const d=u.tView=kf(2,u,i,r,o,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c);return null!==e.queries&&(e.queries.template(e,u),d.queries=e.queries.embeddedTView(u)),u}(u,c,l,e,t,i,r,o,s):c.data[u];Ni(d,!1);const h=l[Ve].createComment("");Bc(c,l,h,d),sn(h,l),Kc(l,l[u]=_0(h,l,h,d)),bc(d)&&Nf(c,l,d),null!=s&&Of(l,d,a)}function Ge(n,e,t){const i=V();return an(i,as(),e)&&function Hn(n,e,t,i,r,o,s,a){const l=Un(e,t);let u,c=e.inputs;!a&&null!=c&&(u=c[i])?(Gf(n,t,u,i,r),Oa(e)&&function n1(n,e){const t=In(e,n);16&t[Be]||(t[Be]|=32)}(t,e.index)):3&e.type&&(i=function t1(n){return"class"===n?"className":"for"===n?"htmlFor":"formaction"===n?"formAction":"innerHtml"===n?"innerHTML":"readonly"===n?"readOnly":"tabindex"===n?"tabIndex":n}(i),r=null!=s?s(r,e.value||"",i):r,o.setProperty(l,i,r))}(Ke(),vt(),i,n,e,i[Ve],t,!1),Ge}function qf(n,e,t,i,r){const s=r?"class":"style";Gf(n,t,e.inputs[s],s,i)}function yt(n,e,t,i){const r=V(),o=Ke(),s=mt+n,a=r[Ve],l=o.firstCreatePass?function Y1(n,e,t,i,r,o){const s=e.consts,l=ws(e,n,2,i,Ar(s,r));return Uf(e,t,l,Ar(s,o)),null!==l.attrs&&eu(l,l.attrs,!1),null!==l.mergedAttrs&&eu(l,l.mergedAttrs,!0),null!==e.queries&&e.queries.elementStart(e,l),l}(s,o,r,e,t,i):o.data[s],c=r[s]=rf(a,e,function iA(){return Ae.lFrame.currentNamespace}()),u=bc(l);return Ni(l,!0),my(a,c,l),32!=(32&l.flags)&&Bc(o,r,c,l),0===function HT(){return Ae.lFrame.elementDepthCount}()&&sn(c,r),function VT(){Ae.lFrame.elementDepthCount++}(),u&&(Nf(o,r,l),Ff(o,l,r)),null!==i&&Of(r,l),yt}function Mt(){let n=Jt();Dh()?Ch():(n=n.parent,Ni(n,!1));const e=n;!function GT(){Ae.lFrame.elementDepthCount--}();const t=Ke();return t.firstCreatePass&&(Dc(t,n),bh(n)&&t.queries.elementEnd(n)),null!=e.classesWithoutHost&&function aA(n){return 0!=(8&n.flags)}(e)&&qf(t,e,V(),e.classesWithoutHost,!0),null!=e.stylesWithoutHost&&function lA(n){return 0!=(16&n.flags)}(e)&&qf(t,e,V(),e.stylesWithoutHost,!1),Mt}function Vn(n,e,t,i){return yt(n,e,t,i),Mt(),Vn}function bo(n,e,t){const i=V(),r=Ke(),o=n+mt,s=r.firstCreatePass?function Z1(n,e,t,i,r){const o=e.consts,s=Ar(o,i),a=ws(e,n,8,"ng-container",s);return null!==s&&eu(a,s,!0),Uf(e,t,a,Ar(o,r)),null!==e.queries&&e.queries.elementStart(e,a),a}(o,r,i,e,t):r.data[o];Ni(s,!0);const a=i[o]=i[Ve].createComment("");return Bc(r,i,a,s),sn(a,i),bc(s)&&(Nf(r,i,s),Ff(r,s,i)),null!=t&&Of(i,s),bo}function wo(){let n=Jt();const e=Ke();return Dh()?Ch():(n=n.parent,Ni(n,!1)),e.firstCreatePass&&(Dc(e,n),bh(n)&&e.queries.elementEnd(n)),wo}function Rr(){return V()}function ou(n){return!!n&&"function"==typeof n.then}const B0=function U0(n){return!!n&&"function"==typeof n.subscribe};function _n(n,e,t,i){const r=V(),o=Ke(),s=Jt();return function H0(n,e,t,i,r,o,s){const a=bc(i),c=n.firstCreatePass&&y0(n),u=e[It],d=v0(e);let h=!0;if(3&i.type||s){const _=Un(i,e),v=s?s(_):_,p=d.length,m=s?M=>s(Qt(M[i.index])):i.index;let y=null;if(!s&&a&&(y=function K1(n,e,t,i){const r=n.cleanup;if(null!=r)for(let o=0;o<r.length-1;o+=2){const s=r[o];if(s===t&&r[o+1]===i){const a=e[ns],l=r[o+2];return a.length>l?a[l]:null}"string"==typeof s&&(o+=2)}return null}(n,e,r,i.index)),null!==y)(y.__ngLastListenerFn__||y).__ngNextListenerFn__=o,y.__ngLastListenerFn__=o,h=!1;else{o=G0(i,e,u,o,!1);const M=t.listen(v,r,o);d.push(o,M),c&&c.push(r,m,p,p+1)}}else o=G0(i,e,u,o,!1);const f=i.outputs;let g;if(h&&null!==f&&(g=f[r])){const _=g.length;if(_)for(let v=0;v<_;v+=2){const w=e[g[v]][g[v+1]].subscribe(o),C=d.length;d.push(o,w),c&&c.push(r,i.index,C,-(C+1))}}}(o,r,r[Ve],s,n,e,i),_n}function V0(n,e,t,i){try{return Qn(6,e,t),!1!==t(i)}catch(r){return x0(n,r),!1}finally{Qn(7,e,t)}}function G0(n,e,t,i,r){return function o(s){if(s===Function)return i;Qc(n.componentOffset>-1?In(n.index,e):e);let l=V0(e,t,i,s),c=o.__ngNextListenerFn__;for(;c;)l=V0(e,t,c,s)&&l,c=c.__ngNextListenerFn__;return r&&!1===l&&(s.preventDefault(),s.returnValue=!1),l}}function _t(n=1){return function KT(n){return(Ae.lFrame.contextLView=function QT(n,e){for(;n>0;)e=e[is],n--;return e}(n,Ae.lFrame.contextLView))[It]}(n)}function Q1(n,e){let t=null;const i=function bR(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(!(1&t))return e[t+1]}return null}(n);for(let r=0;r<e.length;r++){const o=e[r];if("*"!==o){if(null===i?qy(n,o,!0):DR(i,o))return r}else t=r}return t}function So(n){const e=V()[on][rn];if(!e.projection){const i=e.projection=Ga(n?n.length:1,null),r=i.slice();let o=e.child;for(;null!==o;){const s=n?Q1(o,n):0;null!==s&&(r[s]?r[s].projectionNext=o:i[s]=o,r[s]=o),o=o.next}}}function Do(n,e=0,t){const i=V(),r=Ke(),o=ws(r,mt+n,16,null,t||null);null===o.projection&&(o.projection=e),Ch(),32!=(32&o.flags)&&function hI(n,e,t){fy(e[Ve],0,e,t,ry(n,t,e),ly(t.parent||e[rn],t,e))}(r,i,o)}function su(n,e){return n<<17|e<<2}function Pr(n){return n>>17&32767}function Yf(n){return 2|n}function Co(n){return(131068&n)>>2}function Zf(n,e){return-131069&n|e<<2}function Kf(n){return 1|n}function J0(n,e,t,i,r){const o=n[t+1],s=null===e;let a=i?Pr(o):Co(o),l=!1;for(;0!==a&&(!1===l||s);){const u=n[a+1];rP(n[a],e)&&(l=!0,n[a+1]=i?Kf(u):Yf(u)),a=i?Pr(u):Co(u)}l&&(n[t+1]=i?Yf(o):Kf(o))}function rP(n,e){return null===n||null==e||(Array.isArray(n)?n[1]:n)===e||!(!Array.isArray(n)||"string"!=typeof e)&&ps(n,e)>=0}function Qf(n,e,t){return gi(n,e,t,!1),Qf}function Jf(n,e){return gi(n,e,null,!0),Jf}function gi(n,e,t,i){const r=V(),o=Ke(),s=function ar(n){const e=Ae.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}(2);o.firstUpdatePass&&function aM(n,e,t,i){const r=n.data;if(null===r[t+1]){const o=r[gn()],s=function sM(n,e){return e>=n.expandoStartIndex}(n,t);(function dM(n,e){return 0!=(n.flags&(e?8:16))})(o,i)&&null===e&&!s&&(e=!1),e=function fP(n,e,t,i){const r=function Ah(n){const e=Ae.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}(n);let o=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=il(t=ep(null,n,e,t,i),e.attrs,i),o=null);else{const s=e.directiveStylingLast;if(-1===s||n[s]!==r)if(t=ep(r,n,e,t,i),null===o){let l=function pP(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Co(i))return n[Pr(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=ep(null,n,e,l[1],i),l=il(l,e.attrs,i),function mP(n,e,t,i){n[Pr(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else o=function gP(n,e,t){let i;const r=e.directiveEnd;for(let o=1+e.directiveStylingLast;o<r;o++)i=il(i,n[o].hostAttrs,t);return il(i,e.attrs,t)}(n,e,i)}return void 0!==o&&(i?e.residualClasses=o:e.residualStyles=o),t}(r,o,e,i),function nP(n,e,t,i,r,o){let s=o?e.classBindings:e.styleBindings,a=Pr(s),l=Co(s);n[i]=t;let u,c=!1;if(Array.isArray(t)?(u=t[1],(null===u||ps(t,u)>0)&&(c=!0)):u=t,r)if(0!==l){const h=Pr(n[a+1]);n[i+1]=su(h,a),0!==h&&(n[h+1]=Zf(n[h+1],i)),n[a+1]=function eP(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=su(a,0),0!==a&&(n[a+1]=Zf(n[a+1],i)),a=i;else n[i+1]=su(l,0),0===a?a=i:n[l+1]=Zf(n[l+1],i),l=i;c&&(n[i+1]=Yf(n[i+1])),J0(n,u,i,!0),J0(n,u,i,!1),function iP(n,e,t,i,r){const o=r?n.residualClasses:n.residualStyles;null!=o&&"string"==typeof e&&ps(o,e)>=0&&(t[i+1]=Kf(t[i+1]))}(e,u,n,i,o),s=su(a,l),o?e.classBindings=s:e.styleBindings=s}(r,o,e,t,s,i)}}(o,n,s,i),e!==Ie&&an(r,s,e)&&function cM(n,e,t,i,r,o,s,a){if(!(3&e.type))return;const l=n.data,c=l[a+1],u=function tP(n){return 1==(1&n)}(c)?uM(l,e,t,r,Co(c),s):void 0;au(u)||(au(o)||function J1(n){return 2==(2&n)}(c)&&(o=uM(l,null,t,r,a,s)),function pI(n,e,t,i,r){if(e)r?n.addClass(t,i):n.removeClass(t,i);else{let o=-1===i.indexOf("-")?void 0:Rn.DashCase;null==r?n.removeStyle(t,i,o):("string"==typeof r&&r.endsWith("!important")&&(r=r.slice(0,-10),o|=Rn.Important),n.setStyle(t,i,r,o))}}(i,s,wc(gn(),t),r,o))}(o,o.data[gn()],r,r[Ve],n,r[s+1]=function MP(n,e){return null==n||""===n||("string"==typeof e?n+=e:"object"==typeof n&&(n=dt(zn(n)))),n}(e,t),i,s)}function ep(n,e,t,i,r){let o=null;const s=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a<s&&(o=e[a],i=il(i,o.hostAttrs,r),o!==n);)a++;return null!==n&&(t.directiveStylingLast=a),i}function il(n,e,t){const i=t?1:2;let r=-1;if(null!==e)for(let o=0;o<e.length;o++){const s=e[o];"number"==typeof s?r=s:r===i&&(Array.isArray(n)||(n=void 0===n?[]:["",n]),Bn(n,s,!!t||e[++o]))}return void 0===n?null:n}function uM(n,e,t,i,r,o){const s=null===e;let a;for(;r>0;){const l=n[r],c=Array.isArray(l),u=c?l[1]:l,d=null===u;let h=t[r+1];h===Ie&&(h=d?et:void 0);let f=d?Gh(h,i):u===i?h:void 0;if(c&&!au(f)&&(f=Gh(l,i)),au(f)&&(a=f,s))return a;const g=n[r+1];r=s?Pr(g):Co(g)}if(null!==e){let l=o?e.residualClasses:e.residualStyles;null!=l&&(a=Gh(l,i))}return a}function au(n){return void 0!==n}function Lr(n,e=""){const t=V(),i=Ke(),r=n+mt,o=i.firstCreatePass?ws(i,r,1,e,null):i.data[r],s=t[r]=function nf(n,e){return n.createText(e)}(t[Ve],e);Bc(i,t,s,o),Ni(o,!1)}function tp(n){return rl("",n,""),tp}function rl(n,e,t){const i=V(),r=function Ds(n,e,t,i){return an(n,as(),t)?e+Te(t)+i:Ie}(i,n,e,t);return r!==Ie&&function dr(n,e,t){const i=wc(e,n);!function ty(n,e,t){n.setValue(e,t)}(n[Ve],i,t)}(i,gn(),r),rl}const Os="en-US";let LM=Os;class ks{}class ox{}class sx extends ks{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new E0(this);const i=On(e);this._bootstrapComponents=ur(i.bootstrap),this._r3Injector=e0(e,t,[{provide:ks,useValue:this},{provide:Ka,useValue:this.componentFactoryResolver}],dt(e),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(e)}get injector(){return this._r3Injector}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class lp extends ox{constructor(e){super(),this.moduleType=e}create(e){return new sx(this.moduleType,e)}}class HL extends ks{constructor(e,t,i){super(),this.componentFactoryResolver=new E0(this),this.instance=null;const r=new ky([...e,{provide:ks,useValue:this},{provide:Ka,useValue:this.componentFactoryResolver}],t||qc(),i,new Set(["environment"]));this.injector=r,r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}}function hu(n,e,t=null){return new HL(n,e,t).injector}let VL=(()=>{class n{constructor(t){this._injector=t,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t.id)){const i=Ly(0,t.type),r=i.length>0?hu([i],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t.id,r)}return this.cachedInjectors.get(t.id)}ngOnDestroy(){try{for(const t of this.cachedInjectors.values())null!==t&&t.destroy()}finally{this.cachedInjectors.clear()}}}return n.\u0275prov=ue({token:n,providedIn:"environment",factory:()=>new n(K(Ui))}),n})();function ax(n){n.getStandaloneInjector=e=>e.get(VL).getOrCreateStandaloneInjector(n)}function up(n,e,t,i){return function gx(n,e,t,i,r,o){const s=e+t;return an(n,s,r)?Vi(n,s+1,o?i.call(o,r):i(r)):dl(n,s+1)}(V(),mn(),n,e,t,i)}function ul(n,e,t,i,r){return function _x(n,e,t,i,r,o,s){const a=e+t;return Eo(n,a,r,o)?Vi(n,a+2,s?i.call(s,r,o):i(r,o)):dl(n,a+2)}(V(),mn(),n,e,t,i,r)}function px(n,e,t,i,r,o){return function vx(n,e,t,i,r,o,s,a){const l=e+t;return function iu(n,e,t,i,r){const o=Eo(n,e,t,i);return an(n,e+2,r)||o}(n,l,r,o,s)?Vi(n,l+3,a?i.call(a,r,o,s):i(r,o,s)):dl(n,l+3)}(V(),mn(),n,e,t,i,r,o)}function mx(n,e,t,i,r,o,s,a){const l=mn()+n,c=V(),u=function ei(n,e,t,i,r,o){const s=Eo(n,e,t,i);return Eo(n,e+2,r,o)||s}(c,l,t,i,r,o);return an(c,l+4,s)||u?Vi(c,l+5,a?e.call(a,t,i,r,o,s):e(t,i,r,o,s)):function nl(n,e){return n[e]}(c,l+5)}function dl(n,e){const t=n[e];return t===Ie?void 0:t}function dp(n){return e=>{setTimeout(n,void 0,e)}}const Xt=class uF extends Ai{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){let r=e,o=t||(()=>null),s=i;if(e&&"object"==typeof e){const l=e;r=l.next?.bind(l),o=l.error?.bind(l),s=l.complete?.bind(l)}this.__isAsync&&(o=dp(o),r&&(r=dp(r)),s&&(s=dp(s)));const a=super.subscribe({next:r,error:o,complete:s});return e instanceof Dn&&e.add(a),a}};function dF(){return this._results[Symbol.iterator]()}class hp{get changes(){return this._changes||(this._changes=new Xt)}constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=hp.prototype;t[Symbol.iterator]||(t[Symbol.iterator]=dF)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=function Jn(n){return n.flat(Number.POSITIVE_INFINITY)}(e);(this._changesDetected=!function vA(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i<n.length;i++){let r=n[i],o=e[i];if(t&&(r=t(r),o=t(o)),o!==r)return!1}return!0}(i._results,r,t))&&(i._results=r,i.length=r.length,i.last=r[this.length-1],i.first=r[0])}notifyOnChanges(){this._changes&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}let hr=(()=>{class n{}return n.__NG_ELEMENT_ID__=pF,n})();const hF=hr,fF=class extends hF{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e,t){const i=this._declarationTContainer.tView,r=Yc(this._declarationLView,i,e,16,null,i.declTNode,null,null,null,null,t||null);r[Fa]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[Fi];return null!==s&&(r[Fi]=s.createEmbeddedView(i)),Lf(i,r,e),new el(r)}};function pF(){return fu(Jt(),V())}function fu(n,e){return 4&n.type?new fF(e,n,Ms(n,e)):null}let vi=(()=>{class n{}return n.__NG_ELEMENT_ID__=mF,n})();function mF(){return bx(Jt(),V())}const gF=vi,xx=class extends gF{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Ms(this._hostTNode,this._hostLView)}get injector(){return new cs(this._hostTNode,this._hostLView)}get parentInjector(){const e=Uh(this._hostTNode,this._hostLView);if(Mv(e)){const t=Ic(e,this._hostLView),i=Ac(e);return new cs(t[ie].data[i+8],t)}return new cs(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=Ex(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-pn}createEmbeddedView(e,t,i){let r,o;"number"==typeof i?r=i:null!=i&&(r=i.index,o=i.injector);const s=e.createEmbeddedView(t||{},o);return this.insert(s,r),s}createComponent(e,t,i,r,o){const s=e&&!function Va(n){return"function"==typeof n}(e);let a;if(s)a=t;else{const d=t||{};a=d.index,i=d.injector,r=d.projectableNodes,o=d.environmentInjector||d.ngModuleRef}const l=s?e:new tl(ot(e)),c=i||this.parentInjector;if(!o&&null==l.ngModule){const h=(s?c:this.parentInjector).get(Ui,null);h&&(o=h)}const u=l.create(c,r,void 0,o);return this.insert(u.hostView,a),u}insert(e,t){const i=e._lView,r=i[ie];if(function zT(n){return di(n[wt])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const d=i[wt],h=new xx(d,d[rn],d[wt]);h.detach(h.indexOf(e))}}const o=this._adjustIndex(t),s=this._lContainer;!function sI(n,e,t,i){const r=pn+i,o=t.length;i>0&&(t[r-1][ui]=e),i<o-pn?(e[ui]=t[r],Lv(t,pn+i,e)):(t.push(e),e[ui]=null),e[wt]=t;const s=e[Fa];null!==s&&t!==s&&function aI(n,e){const t=n[os];e[on]!==e[wt][wt][on]&&(n[X_]=!0),null===t?n[os]=[e]:t.push(e)}(s,e);const a=e[Fi];null!==a&&a.insertView(n),e[Be]|=64}(r,i,s,o);const a=cf(o,s),l=i[Ve],c=Uc(l,s[xc]);return null!==c&&function iI(n,e,t,i,r,o){i[or]=r,i[rn]=e,Xa(n,i,t,1,r,o)}(r,s[rn],l,i,c,a),e.attachToViewContainerRef(),Lv(fp(s),o,e),e}move(e,t){return this.insert(e,t)}indexOf(e){const t=Ex(this._lContainer);return null!==t?t.indexOf(e):-1}remove(e){const t=this._adjustIndex(e,-1),i=sf(this._lContainer,t);i&&(Fc(fp(this._lContainer),t),iy(i[ie],i))}detach(e){const t=this._adjustIndex(e,-1),i=sf(this._lContainer,t);return i&&null!=Fc(fp(this._lContainer),t)?new el(i):null}_adjustIndex(e,t=0){return e??this.length+t}};function Ex(n){return n[Ec]}function fp(n){return n[Ec]||(n[Ec]=[])}function bx(n,e){let t;const i=e[n.index];if(di(i))t=i;else{let r;if(8&n.type)r=Qt(i);else{const o=e[Ve];r=o.createComment("");const s=Un(n,e);yo(o,Uc(o,s),r,function dI(n,e){return n.nextSibling(e)}(o,s),!1)}e[n.index]=t=_0(i,e,r,n),Kc(e,t)}return new xx(t,n,e)}class pp{constructor(e){this.queryList=e,this.matches=null}clone(){return new pp(this.queryList)}setDirty(){this.queryList.setDirty()}}class mp{constructor(e=[]){this.queries=e}createEmbeddedView(e){const t=e.queries;if(null!==t){const i=null!==e.contentQueries?e.contentQueries[0]:t.length,r=[];for(let o=0;o<i;o++){const s=t.getByIndex(o);r.push(this.queries[s.indexInDeclarationView].clone())}return new mp(r)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let t=0;t<this.queries.length;t++)null!==Ix(e,t).matches&&this.queries[t].setDirty()}}class wx{constructor(e,t,i=null){this.predicate=e,this.flags=t,this.read=i}}class gp{constructor(e=[]){this.queries=e}elementStart(e,t){for(let i=0;i<this.queries.length;i++)this.queries[i].elementStart(e,t)}elementEnd(e){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(e)}embeddedTView(e){let t=null;for(let i=0;i<this.length;i++){const r=null!==t?t.length:0,o=this.getByIndex(i).embeddedTView(e,r);o&&(o.indexInDeclarationView=i,null!==t?t.push(o):t=[o])}return null!==t?new gp(t):null}template(e,t){for(let i=0;i<this.queries.length;i++)this.queries[i].template(e,t)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}}class _p{constructor(e,t=-1){this.metadata=e,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=t}elementStart(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,t){this.elementStart(e,t)}embeddedTView(e,t){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,t),new _p(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){const t=this._declarationNodeIndex;let i=e.parent;for(;null!==i&&8&i.type&&i.index!==t;)i=i.parent;return t===(null!==i?i.index:-1)}return this._appliesToNextNode}matchTNode(e,t){const i=this.metadata.predicate;if(Array.isArray(i))for(let r=0;r<i.length;r++){const o=i[r];this.matchTNodeWithReadOption(e,t,_F(t,o)),this.matchTNodeWithReadOption(e,t,Lc(t,e,o,!1,!1))}else i===hr?4&t.type&&this.matchTNodeWithReadOption(e,t,-1):this.matchTNodeWithReadOption(e,t,Lc(t,e,i,!1,!1))}matchTNodeWithReadOption(e,t,i){if(null!==i){const r=this.metadata.read;if(null!==r)if(r===Bi||r===vi||r===hr&&4&t.type)this.addMatch(t.index,-2);else{const o=Lc(t,e,r,!1,!1);null!==o&&this.addMatch(t.index,o)}else this.addMatch(t.index,i)}}addMatch(e,t){null===this.matches?this.matches=[e,t]:this.matches.push(e,t)}}function _F(n,e){const t=n.localNames;if(null!==t)for(let i=0;i<t.length;i+=2)if(t[i]===e)return t[i+1];return null}function yF(n,e,t,i){return-1===t?function vF(n,e){return 11&n.type?Ms(n,e):4&n.type?fu(n,e):null}(e,n):-2===t?function MF(n,e,t){return t===Bi?Ms(e,n):t===hr?fu(e,n):t===vi?bx(e,n):void 0}(n,e,i):_o(n,n[ie],t,e)}function Sx(n,e,t,i){const r=e[Fi].queries[i];if(null===r.matches){const o=n.data,s=t.matches,a=[];for(let l=0;l<s.length;l+=2){const c=s[l];a.push(c<0?null:yF(e,o[c],s[l+1],t.metadata.read))}r.matches=a}return r.matches}function vp(n,e,t,i){const r=n.queries.getByIndex(t),o=r.matches;if(null!==o){const s=Sx(n,e,r,t);for(let a=0;a<o.length;a+=2){const l=o[a];if(l>0)i.push(s[a/2]);else{const c=o[a+1],u=e[-l];for(let d=pn;d<u.length;d++){const h=u[d];h[Fa]===h[wt]&&vp(h[ie],h,c,i)}if(null!==u[os]){const d=u[os];for(let h=0;h<d.length;h++){const f=d[h];vp(f[ie],f,c,i)}}}}}return i}function yp(n){const e=V(),t=Ke(),i=uv();Ih(i+1);const r=Ix(t,i);if(n.dirty&&function BT(n){return 4==(4&n[Be])}(e)===(2==(2&r.metadata.flags))){if(null===r.matches)n.reset([]);else{const o=r.crossesNgTemplate?vp(t,e,i,[]):Sx(t,e,r,i);n.reset(o,sR),n.notifyOnChanges()}return!0}return!1}function Dx(n,e,t){const i=Ke();i.firstCreatePass&&(function Ax(n,e,t){null===n.queries&&(n.queries=new gp),n.queries.track(new _p(e,t))}(i,new wx(n,e,t),-1),2==(2&e)&&(i.staticViewQueries=!0)),function Tx(n,e,t){const i=new hp(4==(4&t));h0(n,e,i,i.destroy),null===e[Fi]&&(e[Fi]=new mp),e[Fi].queries.push(new pp(i))}(i,V(),e)}function Ix(n,e){return n.queries.getByIndex(e)}function mu(...n){}const gu=new ne("Application Initializer");let _u=(()=>{class n{constructor(t){this.appInits=t,this.resolve=mu,this.reject=mu,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r<this.appInits.length;r++){const o=this.appInits[r]();if(ou(o))t.push(o);else if(B0(o)){const s=new Promise((a,l)=>{o.subscribe({complete:a,error:l})});t.push(s)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(K(gu,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const pl=new ne("AppId",{providedIn:"root",factory:function Xx(){return`${Dp()}${Dp()}${Dp()}`}});function Dp(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Yx=new ne("Platform Initializer"),vu=new ne("Platform ID",{providedIn:"platform",factory:()=>"unknown"});let GF=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();const Wi=new ne("LocaleId",{providedIn:"root",factory:()=>Ne(Wi,Me.Optional|Me.SkipSelf)||function jF(){return typeof $localize<"u"&&$localize.locale||Os}()});class $F{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}let Zx=(()=>{class n{compileModuleSync(t){return new lp(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){const i=this.compileModuleSync(t),o=ur(On(t).declarations).reduce((s,a)=>{const l=ot(a);return l&&s.push(new tl(l)),s},[]);return new $F(i,o)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const YF=(()=>Promise.resolve(0))();function Cp(n){typeof Zone>"u"?YF.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class Dt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Xt(!1),this.onMicrotaskEmpty=new Xt(!1),this.onStable=new Xt(!1),this.onError=new Xt(!1),typeof Zone>"u")throw new X(908,!1);Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function ZF(){let n=pt.requestAnimationFrame,e=pt.cancelAnimationFrame;if(typeof Zone<"u"&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function JF(n){const e=()=>{!function QF(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(pt,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,Ap(n),n.isCheckStableRunning=!0,Tp(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),Ap(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,o,s,a)=>{try{return Jx(n),t.invokeTask(r,o,s,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===o.type||n.shouldCoalesceRunChangeDetection)&&e(),eE(n)}},onInvoke:(t,i,r,o,s,a,l)=>{try{return Jx(n),t.invoke(r,o,s,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),eE(n)}},onHasTask:(t,i,r,o)=>{t.hasTask(r,o),i===r&&("microTask"==o.change?(n._hasPendingMicrotasks=o.microTask,Ap(n),Tp(n)):"macroTask"==o.change&&(n.hasPendingMacrotasks=o.macroTask))},onHandleError:(t,i,r,o)=>(t.handleError(r,o),n.runOutsideAngular(()=>n.onError.emit(o)),!1)})}(r)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Dt.isInAngularZone())throw new X(909,!1)}static assertNotInAngularZone(){if(Dt.isInAngularZone())throw new X(909,!1)}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+r,e,KF,mu,mu);try{return o.runTask(s,t,i)}finally{o.cancelTask(s)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const KF={};function Tp(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function Ap(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function Jx(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function eE(n){n._nesting--,Tp(n)}class eN{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Xt,this.onMicrotaskEmpty=new Xt,this.onStable=new Xt,this.onError=new Xt}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}const tE=new ne(""),yu=new ne("");let Pp,Ip=(()=>{class n{constructor(t,i,r){this._ngZone=t,this.registry=i,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,Pp||(function tN(n){Pp=n}(r),r.addToWindow(i)),this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Dt.assertNotInAngularZone(),Cp(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Cp(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let o=-1;i&&i>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(s=>s.timeoutId!==o),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:o,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(t){this.registry.registerApplication(t,this)}unregisterApplication(t){this.registry.unregisterApplication(t)}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(K(Dt),K(Rp),K(yu))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Rp=(()=>{class n{constructor(){this._applications=new Map}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return Pp?.findTestabilityInTree(this,t,i)??null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();const fr=!1;let Fr=null;const nE=new ne("AllowMultipleToken"),Lp=new ne("PlatformDestroyListeners"),iE=new ne("appBootstrapListener");class rE{constructor(e,t){this.name=e,this.token=t}}function sE(n,e,t=[]){const i=`Platform: ${e}`,r=new ne(i);return(o=[])=>{let s=Fp();if(!s||s.injector.get(nE,!1)){const a=[...t,...o,{provide:r,useValue:!0}];n?n(a):function rN(n){if(Fr&&!Fr.get(nE,!1))throw new X(400,!1);Fr=n;const e=n.get(lE);(function oE(n){const e=n.get(Yx,null);e&&e.forEach(t=>t())})(n)}(function aE(n=[],e){return zi.create({name:e,providers:[{provide:xf,useValue:"platform"},{provide:Lp,useValue:new Set([()=>Fr=null])},...n]})}(a,i))}return function sN(n){const e=Fp();if(!e)throw new X(401,!1);return e}()}}function Fp(){return Fr?.get(lE)??null}let lE=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const r=function uE(n,e){let t;return t="noop"===n?new eN:("zone.js"===n?void 0:n)||new Dt(e),t}(i?.ngZone,function cE(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!(!n||!n.ngZoneEventCoalescing)||!1,shouldCoalesceRunChangeDetection:!(!n||!n.ngZoneRunCoalescing)||!1}}(i)),o=[{provide:Dt,useValue:r}];return r.run(()=>{const s=zi.create({providers:o,parent:this.injector,name:t.moduleType.name}),a=t.create(s),l=a.injector.get(cr,null);if(!l)throw new X(402,!1);return r.runOutsideAngular(()=>{const c=r.onError.subscribe({next:u=>{l.handleError(u)}});a.onDestroy(()=>{xu(this._modules,a),c.unsubscribe()})}),function dE(n,e,t){try{const i=t();return ou(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(l,r,()=>{const c=a.injector.get(_u);return c.runInitializers(),c.donePromise.then(()=>(function FM(n){Zn(n,"Expected localeId to be defined"),"string"==typeof n&&(LM=n.toLowerCase().replace(/_/g,"-"))}(a.injector.get(Wi,Os)||Os),this._moduleDoBootstrap(a),a))})})}bootstrapModule(t,i=[]){const r=hE({},i);return function nN(n,e,t){const i=new lp(t);return Promise.resolve(i)}(0,0,t).then(o=>this.bootstrapModuleFactory(o,r))}_moduleDoBootstrap(t){const i=t.injector.get(Mu);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new X(-403,!1);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new X(404,!1);this._modules.slice().forEach(i=>i.destroy()),this._destroyListeners.forEach(i=>i());const t=this._injector.get(Lp,null);t&&(t.forEach(i=>i()),t.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(K(zi))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();function hE(n,e){return Array.isArray(e)?e.reduce(hE,n):{...n,...e}}let Mu=(()=>{class n{get destroyed(){return this._destroyed}get injector(){return this._injector}constructor(t,i,r){this._zone=t,this._injector=i,this._exceptionHandler=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this._destroyed=!1,this._destroyListeners=[],this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new bt(a=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{a.next(this._stable),a.complete()})}),s=new bt(a=>{let l;this._zone.runOutsideAngular(()=>{l=this._zone.onStable.subscribe(()=>{Dt.assertNotInAngularZone(),Cp(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,a.next(!0))})})});const c=this._zone.onUnstable.subscribe(()=>{Dt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{a.next(!1)}))});return()=>{l.unsubscribe(),c.unsubscribe()}});this.isStable=function sT(...n){const e=Ta(n),t=function JC(n,e){return"number"==typeof lh(n)?n.pop():e}(n,1/0),i=n;return i.length?1===i.length?Yn(i[0]):Jo(t)(Ht(i,e)):Ii}(o,s.pipe(N_()))}bootstrap(t,i){const r=t instanceof By;if(!this._injector.get(_u).done){!r&&function ts(n){const e=ot(n)||nn(n)||An(n);return null!==e&&e.standalone}(t);throw new X(405,fr)}let s;s=r?t:this._injector.get(Ka).resolveComponentFactory(t),this.componentTypes.push(s.componentType);const a=function iN(n){return n.isBoundToModule}(s)?void 0:this._injector.get(ks),c=s.create(zi.NULL,[],i||s.selector,a),u=c.location.nativeElement,d=c.injector.get(tE,null);return d?.registerApplication(u),c.onDestroy(()=>{this.detachView(c.hostView),xu(this.components,c),d?.unregisterApplication(u)}),this._loadComponent(c),c}tick(){if(this._runningTick)throw new X(101,!1);try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;xu(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t);const i=this._injector.get(iE,[]);i.push(...this._bootstrapListeners),i.forEach(r=>r(t))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(t=>t()),this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(t){return this._destroyListeners.push(t),()=>xu(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new X(406,!1);const t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}}return n.\u0275fac=function(t){return new(t||n)(K(Dt),K(Ui),K(cr))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function xu(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}let Np=(()=>{class n{}return n.__NG_ELEMENT_ID__=lN,n})();function lN(n){return function cN(n,e,t){if(Oa(n)&&!t){const i=In(n.index,e);return new el(i,i)}return 47&n.type?new el(e[on],e):null}(Jt(),V(),16==(16&n))}class _E{constructor(){}supports(e){return nu(e)}create(e){return new mN(e)}}const pN=(n,e)=>e;class mN{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||pN}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,o=null;for(;t||i;){const s=!i||t&&t.currentIndex<yE(i,r,o)?t:i,a=yE(s,r,o),l=s.currentIndex;if(s===i)r--,i=i._nextRemoved;else if(t=t._next,null==s.previousIndex)r++;else{o||(o=[]);const c=a-r,u=l-r;if(c!=u){for(let h=0;h<c;h++){const f=h<o.length?o[h]:o[h]=0,g=f+h;u<=g&&g<c&&(o[h]=f+1)}o[s.previousIndex]=u-c}}a!==l&&e(s,a,l)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)}diff(e){if(null==e&&(e=[]),!nu(e))throw new X(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let r,o,s,t=this._itHead,i=!1;if(Array.isArray(e)){this.length=e.length;for(let a=0;a<this.length;a++)o=e[a],s=this._trackByFn(a,o),null!==t&&Object.is(t.trackById,s)?(i&&(t=this._verifyReinsertion(t,o,s,a)),Object.is(t.item,o)||this._addIdentityChange(t,o)):(t=this._mismatch(t,o,s,a),i=!0),t=t._next}else r=0,function G1(n,e){if(Array.isArray(n))for(let t=0;t<n.length;t++)e(n[t]);else{const t=n[Symbol.iterator]();let i;for(;!(i=t.next()).done;)e(i.value)}}(e,a=>{s=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,s)?(i&&(t=this._verifyReinsertion(t,a,s,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,s,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let o;return null===e?o=this._itTail:(o=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,o,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,o,r)):e=this._addAfter(new gN(t,i),o,r),e}_verifyReinsertion(e,t,i,r){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==o?e=this._reinsertAfter(o,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,o=e._nextRemoved;return null===r?this._removalsHead=o:r._nextRemoved=o,null===o?this._removalsTail=r:o._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new vE),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new vE),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class gN{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class _N{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class vE{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new _N,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function yE(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i<t.length&&(r=t[i]),i+e+r}class ME{constructor(){}supports(e){return e instanceof Map||$f(e)}create(){return new vN}}class vN{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(e){let t;for(t=this._mapHead;null!==t;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}diff(e){if(e){if(!(e instanceof Map||$f(e)))throw new X(900,!1)}else e=new Map;return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(i,r)=>{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const o=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,o)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const o=r._prev,s=r._next;return o&&(o._next=s),s&&(s._prev=o),r._next=null,r._prev=null,r}const i=new yN(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class yN{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function xE(){return new wu([new _E])}let wu=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||xE()),deps:[[n,new ms,new Ir]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new X(901,!1)}}return n.\u0275prov=ue({token:n,providedIn:"root",factory:xE}),n})();function EE(){return new ml([new ME])}let ml=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||EE()),deps:[[n,new ms,new Ir]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new X(901,!1)}}return n.\u0275prov=ue({token:n,providedIn:"root",factory:EE}),n})();const EN=sE(null,"core",[]);let bN=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(K(Mu))},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({}),n})(),Hp=null;function Io(){return Hp}class DN{}const xt=new ne("DocumentToken");let Vp=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(){return function CN(){return K(bE)}()},providedIn:"platform"}),n})();const TN=new ne("Location Initialized");let bE=(()=>{class n extends Vp{constructor(t){super(),this._doc=t,this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Io().getBaseHref(this._doc)}onPopState(t){const i=Io().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Io().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(t){this._location.pathname=t}pushState(t,i,r){wE()?this._history.pushState(t,i,r):this._location.hash=r}replaceState(t,i,r){wE()?this._history.replaceState(t,i,r):this._location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(K(xt))},n.\u0275prov=ue({token:n,factory:function(){return function AN(){return new bE(K(xt))}()},providedIn:"platform"}),n})();function wE(){return!!window.history.pushState}function Gp(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}function SE(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function pr(n){return n&&"?"!==n[0]?"?"+n:n}let Ro=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(){return Ne(CE)},providedIn:"root"}),n})();const DE=new ne("appBaseHref");let CE=(()=>{class n extends Ro{constructor(t,i){super(),this._platformLocation=t,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??Ne(xt).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return Gp(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+pr(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,o){const s=this.prepareExternalUrl(r+pr(o));this._platformLocation.pushState(t,i,s)}replaceState(t,i,r,o){const s=this.prepareExternalUrl(r+pr(o));this._platformLocation.replaceState(t,i,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}}return n.\u0275fac=function(t){return new(t||n)(K(Vp),K(DE,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),IN=(()=>{class n extends Ro{constructor(t,i){super(),this._platformLocation=t,this._baseHref="",this._removeListenerFns=[],null!=i&&(this._baseHref=i)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}path(t=!1){let i=this._platformLocation.hash;return null==i&&(i="#"),i.length>0?i.substring(1):i}prepareExternalUrl(t){const i=Gp(this._baseHref,t);return i.length>0?"#"+i:i}pushState(t,i,r,o){let s=this.prepareExternalUrl(r+pr(o));0==s.length&&(s=this._platformLocation.pathname),this._platformLocation.pushState(t,i,s)}replaceState(t,i,r,o){let s=this.prepareExternalUrl(r+pr(o));0==s.length&&(s=this._platformLocation.pathname),this._platformLocation.replaceState(t,i,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}}return n.\u0275fac=function(t){return new(t||n)(K(Vp),K(DE,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),jp=(()=>{class n{constructor(t){this._subject=new Xt,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=t;const i=this._locationStrategy.getBaseHref();this._basePath=function LN(n){if(new RegExp("^(https?:)?//").test(n)){const[,t]=n.split(/\/\/[^\/]+/);return t}return n}(SE(TE(i))),this._locationStrategy.onPopState(r=>{this._subject.emit({url:this.path(!0),pop:!0,state:r.state,type:r.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+pr(i))}normalize(t){return n.stripTrailingSlash(function PN(n,e){if(!n||!e.startsWith(n))return e;const t=e.substring(n.length);return""===t||["/",";","?","#"].includes(t[0])?t:e}(this._basePath,TE(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._locationStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+pr(i)),r)}replaceState(t,i="",r=null){this._locationStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+pr(i)),r)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)})),()=>{const i=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(i,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.normalizeQueryParams=pr,n.joinWithSlash=Gp,n.stripTrailingSlash=SE,n.\u0275fac=function(t){return new(t||n)(K(Ro))},n.\u0275prov=ue({token:n,factory:function(){return function RN(){return new jp(K(Ro))}()},providedIn:"root"}),n})();function TE(n){return n.replace(/\/index.html$/,"")}function kE(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,o]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(o)}return null}const em=/\s+/,UE=[];let Nr=(()=>{class n{constructor(t,i,r,o){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=o,this.initialClasses=UE,this.stateMap=new Map}set klass(t){this.initialClasses=null!=t?t.trim().split(em):UE}set ngClass(t){this.rawClass="string"==typeof t?t.trim().split(em):t}ngDoCheck(){for(const i of this.initialClasses)this._updateState(i,!0);const t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(const i of t)this._updateState(i,!0);else if(null!=t)for(const i of Object.keys(t))this._updateState(i,Boolean(t[i]));this._applyStateDiff()}_updateState(t,i){const r=this.stateMap.get(t);void 0!==r?(r.enabled!==i&&(r.changed=!0,r.enabled=i),r.touched=!0):this.stateMap.set(t,{enabled:i,changed:!0,touched:!0})}_applyStateDiff(){for(const t of this.stateMap){const i=t[0],r=t[1];r.changed?(this._toggleClass(i,r.enabled),r.changed=!1):r.touched||(r.enabled&&this._toggleClass(i,!1),this.stateMap.delete(i)),r.touched=!1}}_toggleClass(t,i){(t=t.trim()).length>0&&t.split(em).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(he(wu),he(ml),he(Bi),he(Qa))},n.\u0275dir=fn({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"},standalone:!0}),n})();class _O{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let HE=(()=>{class n{set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;!this._differ&&t&&(this._differ=this._differs.find(t).create(this.ngForTrackBy))}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=this._viewContainer;t.forEachOperation((r,o,s)=>{if(null==r.previousIndex)i.createEmbeddedView(this._template,new _O(r.item,this._ngForOf,-1,-1),null===s?void 0:s);else if(null==s)i.remove(null===o?void 0:o);else if(null!==o){const a=i.get(o);i.move(a,s),VE(a,r)}});for(let r=0,o=i.length;r<o;r++){const a=i.get(r).context;a.index=r,a.count=o,a.ngForOf=this._ngForOf}t.forEachIdentityChange(r=>{VE(i.get(r.currentIndex),r)})}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(he(vi),he(hr),he(wu))},n.\u0275dir=fn({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0}),n})();function VE(n,e){n.context.$implicit=e.item}let tm=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new yO,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){GE("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){GE("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(he(vi),he(hr))},n.\u0275dir=fn({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0}),n})();class yO{constructor(){this.$implicit=null,this.ngIf=null}}function GE(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${dt(e)}'.`)}let WE=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,i){const[r,o]=t.split("."),s=-1===r.indexOf("-")?void 0:Rn.DashCase;null!=i?this._renderer.setStyle(this._ngEl.nativeElement,r,o?`${i}${o}`:i,s):this._renderer.removeStyle(this._ngEl.nativeElement,r,s)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(he(Bi),he(ml),he(Qa))},n.\u0275dir=fn({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"},standalone:!0}),n})(),WO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({}),n})();const qE="browser";let ZO=(()=>{class n{}return n.\u0275prov=ue({token:n,providedIn:"root",factory:()=>new KO(K(xt),window)}),n})();class KO{constructor(e,t){this.document=e,this.window=t,this.offset=()=>[0,0]}setOffset(e){this.offset=Array.isArray(e)?()=>e:e}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(!this.supportsScrolling())return;const t=function QO(n,e){const t=n.getElementById(e)||n.getElementsByName(e)[0];if(t)return t;if("function"==typeof n.createTreeWalker&&n.body&&(n.body.createShadowRoot||n.body.attachShadow)){const i=n.createTreeWalker(n.body,NodeFilter.SHOW_ELEMENT);let r=i.currentNode;for(;r;){const o=r.shadowRoot;if(o){const s=o.getElementById(e)||o.querySelector(`[name="${e}"]`);if(s)return s}r=i.nextNode()}}return null}(this.document,e);t&&(this.scrollToElement(t),t.focus())}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),i=t.left+this.window.pageXOffset,r=t.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(i-o[0],r-o[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const e=XE(this.window.history)||XE(Object.getPrototypeOf(this.window.history));return!(!e||!e.writable&&!e.set)}catch{return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}function XE(n){return Object.getOwnPropertyDescriptor(n,"scrollRestoration")}class YE{}class S2 extends DN{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class lm extends S2{static makeCurrent(){!function SN(n){Hp||(Hp=n)}(new lm)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=function D2(){return yl=yl||document.querySelector("base"),yl?yl.getAttribute("href"):null}();return null==t?null:function C2(n){Ou=Ou||document.createElement("a"),Ou.setAttribute("href",n);const e=Ou.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){yl=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return kE(document.cookie,e)}}let Ou,yl=null;const eb=new ne("TRANSITION_ID"),A2=[{provide:gu,useFactory:function T2(n,e,t){return()=>{t.get(_u).donePromise.then(()=>{const i=Io(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let o=0;o<r.length;o++)i.remove(r[o])})}},deps:[eb,xt,zi],multi:!0}];let R2=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const ku=new ne("EventManagerPlugins");let Uu=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>{r.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let o=0;o<r.length;o++){const s=r[o];if(s.supports(t))return this._eventNameToPlugin.set(t,s),s}throw new Error(`No event manager plugin found for event ${t}`)}}return n.\u0275fac=function(t){return new(t||n)(K(ku),K(Dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class tb{constructor(e){this._doc=e}addGlobalEventListener(e,t,i){const r=Io().getGlobalEventTarget(this._doc,e);if(!r)throw new Error(`Unsupported event target ${r} for event ${t}`);return this.addEventListener(r,t,i)}}let nb=(()=>{class n{constructor(){this.usageCount=new Map}addStyles(t){for(const i of t)1===this.changeUsageCount(i,1)&&this.onStyleAdded(i)}removeStyles(t){for(const i of t)0===this.changeUsageCount(i,-1)&&this.onStyleRemoved(i)}onStyleRemoved(t){}onStyleAdded(t){}getAllStyles(){return this.usageCount.keys()}changeUsageCount(t,i){const r=this.usageCount;let o=r.get(t)??0;return o+=i,o>0?r.set(t,o):r.delete(t),o}ngOnDestroy(){for(const t of this.getAllStyles())this.onStyleRemoved(t);this.usageCount.clear()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Ml=(()=>{class n extends nb{constructor(t){super(),this.doc=t,this.styleRef=new Map,this.hostNodes=new Set,this.resetHostNodes()}onStyleAdded(t){for(const i of this.hostNodes)this.addStyleToHost(i,t)}onStyleRemoved(t){const i=this.styleRef;i.get(t)?.forEach(o=>o.remove()),i.delete(t)}ngOnDestroy(){super.ngOnDestroy(),this.styleRef.clear(),this.resetHostNodes()}addHost(t){this.hostNodes.add(t);for(const i of this.getAllStyles())this.addStyleToHost(t,i)}removeHost(t){this.hostNodes.delete(t)}addStyleToHost(t,i){const r=this.doc.createElement("style");r.textContent=i,t.appendChild(r);const o=this.styleRef.get(i);o?o.push(r):this.styleRef.set(i,[r])}resetHostNodes(){const t=this.hostNodes;t.clear(),t.add(this.doc.head)}}return n.\u0275fac=function(t){return new(t||n)(K(xt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const cm={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},um=/%COMP%/g,ob=new ne("RemoveStylesOnCompDestory",{providedIn:"root",factory:()=>!1});function sb(n,e){return e.flat(100).map(t=>t.replace(um,n))}function ab(n){return e=>{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let dm=(()=>{class n{constructor(t,i,r,o){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.removeStylesOnCompDestory=o,this.rendererByCompId=new Map,this.defaultRenderer=new hm(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;const r=this.getOrCreateRenderer(t,i);return r instanceof ub?r.applyToHost(t):r instanceof fm&&r.applyStyles(),r}getOrCreateRenderer(t,i){const r=this.rendererByCompId;let o=r.get(i.id);if(!o){const s=this.eventManager,a=this.sharedStylesHost,l=this.removeStylesOnCompDestory;switch(i.encapsulation){case Pi.Emulated:o=new ub(s,a,i,this.appId,l);break;case Pi.ShadowDom:return new U2(s,a,t,i);default:o=new fm(s,a,i,l)}o.onDestroy=()=>r.delete(i.id),r.set(i.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(K(Uu),K(Ml),K(pl),K(ob))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class hm{constructor(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(e,t){return t?document.createElementNS(cm[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){(cb(e)?e.content:e).appendChild(t)}insertBefore(e,t,i){e&&(cb(e)?e.content:e).insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const o=cm[r];o?e.setAttributeNS(o,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=cm[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(Rn.DashCase|Rn.Important)?e.style.setProperty(t,i,r&Rn.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Rn.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,ab(i)):this.eventManager.addEventListener(e,t,ab(i))}}function cb(n){return"TEMPLATE"===n.tagName&&void 0!==n.content}class U2 extends hm{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const o=sb(r.id,r.styles);for(const s of o){const a=document.createElement("style");a.textContent=s,this.shadowRoot.appendChild(a)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,i){return super.insertBefore(this.nodeOrShadowRoot(e),t,i)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class fm extends hm{constructor(e,t,i,r,o=i.id){super(e),this.sharedStylesHost=t,this.removeStylesOnCompDestory=r,this.rendererUsageCount=0,this.styles=sb(o,i.styles)}applyStyles(){this.sharedStylesHost.addStyles(this.styles),this.rendererUsageCount++}destroy(){this.removeStylesOnCompDestory&&(this.sharedStylesHost.removeStyles(this.styles),this.rendererUsageCount--,0===this.rendererUsageCount&&this.onDestroy?.())}}class ub extends fm{constructor(e,t,i,r,o){const s=r+"-"+i.id;super(e,t,i,o,s),this.contentAttr=function N2(n){return"_ngcontent-%COMP%".replace(um,n)}(s),this.hostAttr=function O2(n){return"_nghost-%COMP%".replace(um,n)}(s)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}let B2=(()=>{class n extends tb{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(K(xt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const db=["alt","control","meta","shift"],z2={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},H2={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let V2=(()=>{class n extends tb{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const o=n.parseEventName(i),s=n.eventCallback(o.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Io().onAndCancel(t,o.domEventName,s))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const o=n._normalizeKey(i.pop());let s="",a=i.indexOf("code");if(a>-1&&(i.splice(a,1),s="code."),db.forEach(c=>{const u=i.indexOf(c);u>-1&&(i.splice(u,1),s+=c+".")}),s+=o,0!=i.length||0===o.length)return null;const l={};return l.domEventName=r,l.fullKey=s,l}static matchEventFullKeyCode(t,i){let r=z2[t.key]||t.key,o="";return i.indexOf("code.")>-1&&(r=t.code,o="code."),!(null==r||!r)&&(r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),db.forEach(s=>{s!==r&&(0,H2[s])(t)&&(o+=s+".")}),o+=r,o===i)}static eventCallback(t,i,r){return o=>{n.matchEventFullKeyCode(o,t)&&r.runGuarded(()=>i(o))}}static _normalizeKey(t){return"esc"===t?"escape":t}}return n.\u0275fac=function(t){return new(t||n)(K(xt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const $2=sE(EN,"browser",[{provide:vu,useValue:qE},{provide:Yx,useValue:function G2(){lm.makeCurrent()},multi:!0},{provide:xt,useFactory:function W2(){return function yI(n){ff=n}(document),document},deps:[]}]),pb=new ne(""),mb=[{provide:yu,useClass:class I2{addToWindow(e){pt.getAngularTestability=(i,r=!0)=>{const o=e.findTestabilityInTree(i,r);if(null==o)throw new Error("Could not find testability for element.");return o},pt.getAllAngularTestabilities=()=>e.getAllTestabilities(),pt.getAllAngularRootElements=()=>e.getAllRootElements(),pt.frameworkStabilizers||(pt.frameworkStabilizers=[]),pt.frameworkStabilizers.push(i=>{const r=pt.getAllAngularTestabilities();let o=r.length,s=!1;const a=function(l){s=s||l,o--,0==o&&i(s)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){return null==t?null:e.getTestability(t)??(i?Io().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null)}},deps:[]},{provide:tE,useClass:Ip,deps:[Dt,Rp,yu]},{provide:Ip,useClass:Ip,deps:[Dt,Rp,yu]}],gb=[{provide:xf,useValue:"root"},{provide:cr,useFactory:function j2(){return new cr},deps:[]},{provide:ku,useClass:B2,multi:!0,deps:[xt,Dt,vu]},{provide:ku,useClass:V2,multi:!0,deps:[xt]},{provide:dm,useClass:dm,deps:[Uu,Ml,pl,ob]},{provide:Hy,useExisting:dm},{provide:nb,useExisting:Ml},{provide:Ml,useClass:Ml,deps:[xt]},{provide:Uu,useClass:Uu,deps:[ku,Dt]},{provide:YE,useClass:R2,deps:[]},[]];let q2=(()=>{class n{constructor(t){}static withServerTransition(t){return{ngModule:n,providers:[{provide:pl,useValue:t.appId},{provide:eb,useExisting:pl},A2]}}}return n.\u0275fac=function(t){return new(t||n)(K(pb,12))},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({providers:[...gb,...mb],imports:[WO,bN]}),n})(),_b=(()=>{class n{constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}}return n.\u0275fac=function(t){return new(t||n)(K(xt))},n.\u0275prov=ue({token:n,factory:function(t){let i=null;return i=t?new t:function Y2(){return new _b(K(xt))}(),i},providedIn:"root"}),n})();typeof window<"u"&&window;let Bu=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(t){let i=null;return i=t?new(t||n):K(Mb),i},providedIn:"root"}),n})(),Mb=(()=>{class n extends Bu{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case tt.NONE:return i;case tt.HTML:return ki(i,"HTML")?zn(i):Dy(this._doc,String(i)).toString();case tt.STYLE:return ki(i,"Style")?zn(i):i;case tt.SCRIPT:if(ki(i,"Script"))return zn(i);throw new Error("unsafe value used in a script context");case tt.URL:return ki(i,"URL")?zn(i):Gc(String(i));case tt.RESOURCE_URL:if(ki(i,"ResourceURL"))return zn(i);throw new Error(`unsafe value used in a resource URL context (see ${uc})`);default:throw new Error(`Unexpected SecurityContext ${t} (see ${uc})`)}}bypassSecurityTrustHtml(t){return function DI(n){return new MI(n)}(t)}bypassSecurityTrustStyle(t){return function CI(n){return new xI(n)}(t)}bypassSecurityTrustScript(t){return function TI(n){return new EI(n)}(t)}bypassSecurityTrustUrl(t){return function AI(n){return new bI(n)}(t)}bypassSecurityTrustResourceUrl(t){return function II(n){return new wI(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(K(xt))},n.\u0275prov=ue({token:n,factory:function(t){let i=null;return i=t?new t:function ek(n){return new Mb(n.get(xt))}(K(zi)),i},providedIn:"root"}),n})();function fe(...n){return Ht(n,Ta(n))}class Ei extends Ai{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){const{hasError:e,thrownError:t,_value:i}=this;if(e)throw t;return this._throwIfClosed(),i}next(e){super.next(this._value=e)}}const zu=Da(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:tk}=Array,{getPrototypeOf:nk,prototype:ik,keys:rk}=Object;function xb(n){if(1===n.length){const e=n[0];if(tk(e))return{args:e,keys:null};if(function ok(n){return n&&"object"==typeof n&&nk(n)===ik}(e)){const t=rk(e);return{args:t.map(i=>e[i]),keys:t}}}return{args:n,keys:null}}const{isArray:sk}=Array;function Eb(n){return De(e=>function ak(n,e){return sk(e)?n(...e):n(e)}(n,e))}function bb(n,e){return n.reduce((t,i,r)=>(t[i]=e[r],t),{})}function gm(...n){const e=Ta(n),t=R_(n),{args:i,keys:r}=xb(n);if(0===i.length)return Ht([],e);const o=new bt(function lk(n,e,t=ho){return i=>{wb(e,()=>{const{length:r}=n,o=new Array(r);let s=r,a=r;for(let l=0;l<r;l++)wb(e,()=>{const c=Ht(n[l],e);let u=!1;c.subscribe(At(i,d=>{o[l]=d,u||(u=!0,a--),a||i.next(t(o.slice()))},()=>{--s||i.complete()}))},i)},i)}}(i,e,r?s=>bb(r,s):ho));return t?o.pipe(Eb(t)):o}function wb(n,e,t){n?tr(t,n,e):e()}function Hu(...n){return function ck(){return Jo(1)}()(Ht(n,Ta(n)))}function Sb(n){return new bt(e=>{Yn(n()).subscribe(e)})}function zs(n,e){const t=ut(n)?n:()=>n,i=r=>r.error(t());return new bt(e?r=>e.schedule(i,0,r):i)}function _m(){return kt((n,e)=>{let t=null;n._refCount++;const i=At(e,void 0,void 0,void 0,()=>{if(!n||n._refCount<=0||0<--n._refCount)return void(t=null);const r=n._connection,o=t;t=null,r&&(!o||r===o)&&r.unsubscribe(),e.unsubscribe()});n.subscribe(i),i.closed||(t=n.connect())})}class Db extends bt{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,g_(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new Dn;const t=this.getSubject();e.add(this.source.subscribe(At(t,void 0,()=>{this._teardown(),t.complete()},i=>{this._teardown(),t.error(i)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Dn.EMPTY)}return e}refCount(){return _m()(this)}}function $i(n,e){return kt((t,i)=>{let r=null,o=0,s=!1;const a=()=>s&&!r&&i.complete();t.subscribe(At(i,l=>{r?.unsubscribe();let c=0;const u=o++;Yn(n(l,u)).subscribe(r=At(i,d=>i.next(e?e(l,d,u,c++):d),()=>{r=null,a()}))},()=>{s=!0,a()}))})}function kr(n){return n<=0?()=>Ii:kt((e,t)=>{let i=0;e.subscribe(At(t,r=>{++i<=n&&(t.next(r),n<=i&&t.complete())}))})}function Cb(...n){const e=Ta(n);return kt((t,i)=>{(e?Hu(n,t,e):Hu(n,t)).subscribe(i)})}function qi(n,e){return kt((t,i)=>{let r=0;t.subscribe(At(i,o=>n.call(e,o,r++)&&i.next(o)))})}function Vu(n){return kt((e,t)=>{let i=!1;e.subscribe(At(t,r=>{i=!0,t.next(r)},()=>{i||t.next(n),t.complete()}))})}function Tb(n=uk){return kt((e,t)=>{let i=!1;e.subscribe(At(t,r=>{i=!0,t.next(r)},()=>i?t.complete():t.error(n())))})}function uk(){return new zu}function Ur(n,e){const t=arguments.length>=2;return i=>i.pipe(n?qi((r,o)=>n(r,o,i)):ho,kr(1),t?Vu(e):Tb(()=>new zu))}function Br(n,e){return ut(e)?Kt(n,e,1):Kt(n,1)}function $t(n,e,t){const i=ut(n)||e||t?{next:n,error:e,complete:t}:n;return i?kt((r,o)=>{var s;null===(s=i.subscribe)||void 0===s||s.call(i);let a=!0;r.subscribe(At(o,l=>{var c;null===(c=i.next)||void 0===c||c.call(i,l),o.next(l)},()=>{var l;a=!1,null===(l=i.complete)||void 0===l||l.call(i),o.complete()},l=>{var c;a=!1,null===(c=i.error)||void 0===c||c.call(i,l),o.error(l)},()=>{var l,c;a&&(null===(l=i.unsubscribe)||void 0===l||l.call(i)),null===(c=i.finalize)||void 0===c||c.call(i)}))}):ho}function gr(n){return kt((e,t)=>{let o,i=null,r=!1;i=e.subscribe(At(t,void 0,void 0,s=>{o=Yn(n(s,gr(n)(e))),i?(i.unsubscribe(),i=null,o.subscribe(t)):r=!0})),r&&(i.unsubscribe(),i=null,o.subscribe(t))})}function Ab(n,e){return kt(function dk(n,e,t,i,r){return(o,s)=>{let a=t,l=e,c=0;o.subscribe(At(s,u=>{const d=c++;l=a?n(l,u,d):(a=!0,u),i&&s.next(l)},r&&(()=>{a&&s.next(l),s.complete()})))}}(n,e,arguments.length>=2,!0))}function vm(n){return n<=0?()=>Ii:kt((e,t)=>{let i=[];e.subscribe(At(t,r=>{i.push(r),n<i.length&&i.shift()},()=>{for(const r of i)t.next(r);t.complete()},void 0,()=>{i=null}))})}function Ib(n,e){const t=arguments.length>=2;return i=>i.pipe(n?qi((r,o)=>n(r,o,i)):ho,vm(1),t?Vu(e):Tb(()=>new zu))}function Gu(n){return kt((e,t)=>{try{e.subscribe(t)}finally{t.add(n)}})}const Oe="primary",xl=Symbol("RouteTitle");class pk{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function Hs(n){return new pk(n)}function mk(n,e,t){const i=t.path.split("/");if(i.length>n.length||"full"===t.pathMatch&&(e.hasChildren()||i.length<n.length))return null;const r={};for(let o=0;o<i.length;o++){const s=i[o],a=n[o];if(s.startsWith(":"))r[s.substring(1)]=a;else if(s!==a.path)return null}return{consumed:n.slice(0,i.length),posParams:r}}function Xi(n,e){const t=n?Object.keys(n):void 0,i=e?Object.keys(e):void 0;if(!t||!i||t.length!=i.length)return!1;let r;for(let o=0;o<t.length;o++)if(r=t[o],!Rb(n[r],e[r]))return!1;return!0}function Rb(n,e){if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;const t=[...n].sort(),i=[...e].sort();return t.every((r,o)=>i[o]===r)}return n===e}function Pb(n){return Array.prototype.concat.apply([],n)}function Lb(n){return n.length>0?n[n.length-1]:null}function en(n,e){for(const t in n)n.hasOwnProperty(t)&&e(n[t],t)}function zr(n){return B0(n)?n:ou(n)?Ht(Promise.resolve(n)):fe(n)}const ju=!1,_k={exact:function Ob(n,e,t){if(!Po(n.segments,e.segments)||!Wu(n.segments,e.segments,t)||n.numberOfChildren!==e.numberOfChildren)return!1;for(const i in e.children)if(!n.children[i]||!Ob(n.children[i],e.children[i],t))return!1;return!0},subset:kb},Fb={exact:function vk(n,e){return Xi(n,e)},subset:function yk(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(t=>Rb(n[t],e[t]))},ignored:()=>!0};function Nb(n,e,t){return _k[t.paths](n.root,e.root,t.matrixParams)&&Fb[t.queryParams](n.queryParams,e.queryParams)&&!("exact"===t.fragment&&n.fragment!==e.fragment)}function kb(n,e,t){return Ub(n,e,e.segments,t)}function Ub(n,e,t,i){if(n.segments.length>t.length){const r=n.segments.slice(0,t.length);return!(!Po(r,t)||e.hasChildren()||!Wu(r,t,i))}if(n.segments.length===t.length){if(!Po(n.segments,t)||!Wu(n.segments,t,i))return!1;for(const r in e.children)if(!n.children[r]||!kb(n.children[r],e.children[r],i))return!1;return!0}{const r=t.slice(0,n.segments.length),o=t.slice(n.segments.length);return!!(Po(n.segments,r)&&Wu(n.segments,r,i)&&n.children[Oe])&&Ub(n.children[Oe],e,o,i)}}function Wu(n,e,t){return e.every((i,r)=>Fb[t](n[r].parameters,i.parameters))}class Hr{constructor(e=new We([],{}),t={},i=null){this.root=e,this.queryParams=t,this.fragment=i}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Hs(this.queryParams)),this._queryParamMap}toString(){return Ek.serialize(this)}}class We{constructor(e,t){this.segments=e,this.children=t,this.parent=null,en(t,(i,r)=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return $u(this)}}class El{constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap||(this._parameterMap=Hs(this.parameters)),this._parameterMap}toString(){return Hb(this)}}function Po(n,e){return n.length===e.length&&n.every((t,i)=>t.path===e[i].path)}let bl=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(){return new ym},providedIn:"root"}),n})();class ym{parse(e){const t=new Rk(e);return new Hr(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){const t=`/${wl(e.root,!0)}`,i=function Sk(n){const e=Object.keys(n).map(t=>{const i=n[t];return Array.isArray(i)?i.map(r=>`${qu(t)}=${qu(r)}`).join("&"):`${qu(t)}=${qu(i)}`}).filter(t=>!!t);return e.length?`?${e.join("&")}`:""}(e.queryParams);return`${t}${i}${"string"==typeof e.fragment?`#${function bk(n){return encodeURI(n)}(e.fragment)}`:""}`}}const Ek=new ym;function $u(n){return n.segments.map(e=>Hb(e)).join("/")}function wl(n,e){if(!n.hasChildren())return $u(n);if(e){const t=n.children[Oe]?wl(n.children[Oe],!1):"",i=[];return en(n.children,(r,o)=>{o!==Oe&&i.push(`${o}:${wl(r,!1)}`)}),i.length>0?`${t}(${i.join("//")})`:t}{const t=function xk(n,e){let t=[];return en(n.children,(i,r)=>{r===Oe&&(t=t.concat(e(i,r)))}),en(n.children,(i,r)=>{r!==Oe&&(t=t.concat(e(i,r)))}),t}(n,(i,r)=>r===Oe?[wl(n.children[Oe],!1)]:[`${r}:${wl(i,!1)}`]);return 1===Object.keys(n.children).length&&null!=n.children[Oe]?`${$u(n)}/${t[0]}`:`${$u(n)}/(${t.join("//")})`}}function Bb(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function qu(n){return Bb(n).replace(/%3B/gi,";")}function Mm(n){return Bb(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Xu(n){return decodeURIComponent(n)}function zb(n){return Xu(n.replace(/\+/g,"%20"))}function Hb(n){return`${Mm(n.path)}${function wk(n){return Object.keys(n).map(e=>`;${Mm(e)}=${Mm(n[e])}`).join("")}(n.parameters)}`}const Dk=/^[^\/()?;=#]+/;function Yu(n){const e=n.match(Dk);return e?e[0]:""}const Ck=/^[^=?&#]+/,Ak=/^[^&#]+/;class Rk{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new We([],{}):new We([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(i[Oe]=new We(e,t)),i}parseSegment(){const e=Yu(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new X(4009,ju);return this.capture(e),new El(Xu(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=Yu(this.remaining);if(!t)return;this.capture(t);let i="";if(this.consumeOptional("=")){const r=Yu(this.remaining);r&&(i=r,this.capture(i))}e[Xu(t)]=Xu(i)}parseQueryParam(e){const t=function Tk(n){const e=n.match(Ck);return e?e[0]:""}(this.remaining);if(!t)return;this.capture(t);let i="";if(this.consumeOptional("=")){const s=function Ik(n){const e=n.match(Ak);return e?e[0]:""}(this.remaining);s&&(i=s,this.capture(i))}const r=zb(t),o=zb(i);if(e.hasOwnProperty(r)){let s=e[r];Array.isArray(s)||(s=[s],e[r]=s),s.push(o)}else e[r]=o}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const i=Yu(this.remaining),r=this.remaining[i.length];if("/"!==r&&")"!==r&&";"!==r)throw new X(4010,ju);let o;i.indexOf(":")>-1?(o=i.slice(0,i.indexOf(":")),this.capture(o),this.capture(":")):e&&(o=Oe);const s=this.parseChildren();t[o]=1===Object.keys(s).length?s[Oe]:new We([],s),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new X(4011,ju)}}function xm(n){return n.segments.length>0?new We([],{[Oe]:n}):n}function Zu(n){const e={};for(const i of Object.keys(n.children)){const o=Zu(n.children[i]);(o.segments.length>0||o.hasChildren())&&(e[i]=o)}return function Pk(n){if(1===n.numberOfChildren&&n.children[Oe]){const e=n.children[Oe];return new We(n.segments.concat(e.segments),e.children)}return n}(new We(n.segments,e))}function Lo(n){return n instanceof Hr}const Em=!1;function Lk(n,e,t,i,r){if(0===t.length)return Vs(e.root,e.root,e.root,i,r);const o=function $b(n){if("string"==typeof n[0]&&1===n.length&&"/"===n[0])return new Wb(!0,0,n);let e=0,t=!1;const i=n.reduce((r,o,s)=>{if("object"==typeof o&&null!=o){if(o.outlets){const a={};return en(o.outlets,(l,c)=>{a[c]="string"==typeof l?l.split("/"):l}),[...r,{outlets:a}]}if(o.segmentPath)return[...r,o.segmentPath]}return"string"!=typeof o?[...r,o]:0===s?(o.split("/").forEach((a,l)=>{0==l&&"."===a||(0==l&&""===a?t=!0:".."===a?e++:""!=a&&r.push(a))}),r):[...r,o]},[]);return new Wb(t,e,i)}(t);return o.toRoot()?Vs(e.root,e.root,new We([],{}),i,r):function s(l){const c=function Nk(n,e,t,i){if(n.isAbsolute)return new Gs(e.root,!0,0);if(-1===i)return new Gs(t,t===e.root,0);return function qb(n,e,t){let i=n,r=e,o=t;for(;o>r;){if(o-=r,i=i.parent,!i)throw new X(4005,Em&&"Invalid number of '../'");r=i.segments.length}return new Gs(i,!1,r-o)}(t,i+(Sl(n.commands[0])?0:1),n.numberOfDoubleDots)}(o,e,n.snapshot?._urlSegment,l),u=c.processChildren?js(c.segmentGroup,c.index,o.commands):bm(c.segmentGroup,c.index,o.commands);return Vs(e.root,c.segmentGroup,u,i,r)}(n.snapshot?._lastPathIndex)}function Sl(n){return"object"==typeof n&&null!=n&&!n.outlets&&!n.segmentPath}function Dl(n){return"object"==typeof n&&null!=n&&n.outlets}function Vs(n,e,t,i,r){let s,o={};i&&en(i,(l,c)=>{o[c]=Array.isArray(l)?l.map(u=>`${u}`):`${l}`}),s=n===e?t:jb(n,e,t);const a=xm(Zu(s));return new Hr(a,o,r)}function jb(n,e,t){const i={};return en(n.children,(r,o)=>{i[o]=r===e?t:jb(r,e,t)}),new We(n.segments,i)}class Wb{constructor(e,t,i){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=i,e&&i.length>0&&Sl(i[0]))throw new X(4003,Em&&"Root segment cannot have matrix parameters");const r=i.find(Dl);if(r&&r!==Lb(i))throw new X(4004,Em&&"{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Gs{constructor(e,t,i){this.segmentGroup=e,this.processChildren=t,this.index=i}}function bm(n,e,t){if(n||(n=new We([],{})),0===n.segments.length&&n.hasChildren())return js(n,e,t);const i=function kk(n,e,t){let i=0,r=e;const o={match:!1,pathIndex:0,commandIndex:0};for(;r<n.segments.length;){if(i>=t.length)return o;const s=n.segments[r],a=t[i];if(Dl(a))break;const l=`${a}`,c=i<t.length-1?t[i+1]:null;if(r>0&&void 0===l)break;if(l&&c&&"object"==typeof c&&void 0===c.outlets){if(!Yb(l,c,s))return o;i+=2}else{if(!Yb(l,{},s))return o;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(n,e,t),r=t.slice(i.commandIndex);if(i.match&&i.pathIndex<n.segments.length){const o=new We(n.segments.slice(0,i.pathIndex),{});return o.children[Oe]=new We(n.segments.slice(i.pathIndex),n.children),js(o,0,r)}return i.match&&0===r.length?new We(n.segments,{}):i.match&&!n.hasChildren()?wm(n,e,t):i.match?js(n,0,r):wm(n,e,t)}function js(n,e,t){if(0===t.length)return new We(n.segments,{});{const i=function Ok(n){return Dl(n[0])?n[0].outlets:{[Oe]:n}}(t),r={};if(!i[Oe]&&n.children[Oe]&&1===n.numberOfChildren&&0===n.children[Oe].segments.length){const o=js(n.children[Oe],e,t);return new We(n.segments,o.children)}return en(i,(o,s)=>{"string"==typeof o&&(o=[o]),null!==o&&(r[s]=bm(n.children[s],e,o))}),en(n.children,(o,s)=>{void 0===i[s]&&(r[s]=o)}),new We(n.segments,r)}}function wm(n,e,t){const i=n.segments.slice(0,e);let r=0;for(;r<t.length;){const o=t[r];if(Dl(o)){const l=Uk(o.outlets);return new We(i,l)}if(0===r&&Sl(t[0])){i.push(new El(n.segments[e].path,Xb(t[0]))),r++;continue}const s=Dl(o)?o.outlets[Oe]:`${o}`,a=r<t.length-1?t[r+1]:null;s&&a&&Sl(a)?(i.push(new El(s,Xb(a))),r+=2):(i.push(new El(s,{})),r++)}return new We(i,{})}function Uk(n){const e={};return en(n,(t,i)=>{"string"==typeof t&&(t=[t]),null!==t&&(e[i]=wm(new We([],{}),0,t))}),e}function Xb(n){const e={};return en(n,(t,i)=>e[i]=`${t}`),e}function Yb(n,e,t){return n==t.path&&Xi(e,t.parameters)}const Cl="imperative";class Yi{constructor(e,t){this.id=e,this.url=t}}class Sm extends Yi{constructor(e,t,i="imperative",r=null){super(e,t),this.type=0,this.navigationTrigger=i,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Fo extends Yi{constructor(e,t,i){super(e,t),this.urlAfterRedirects=i,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class Ku extends Yi{constructor(e,t,i,r){super(e,t),this.reason=i,this.code=r,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Qu extends Yi{constructor(e,t,i,r){super(e,t),this.reason=i,this.code=r,this.type=16}}class Dm extends Yi{constructor(e,t,i,r){super(e,t),this.error=i,this.target=r,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Bk extends Yi{constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class zk extends Yi{constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Hk extends Yi{constructor(e,t,i,r,o){super(e,t),this.urlAfterRedirects=i,this.state=r,this.shouldActivate=o,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Vk extends Yi{constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Gk extends Yi{constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class jk{constructor(e){this.route=e,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Wk{constructor(e){this.route=e,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class $k{constructor(e){this.snapshot=e,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class qk{constructor(e){this.snapshot=e,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Xk{constructor(e){this.snapshot=e,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Yk{constructor(e){this.snapshot=e,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Zb{constructor(e,t,i){this.routerEvent=e,this.position=t,this.anchor=i,this.type=15}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}let Qk=(()=>{class n{createUrlTree(t,i,r,o,s,a){return Lk(t||i.root,r,o,s,a)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),eU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(e){return Qk.\u0275fac(e)},providedIn:"root"}),n})();class Kb{constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=Cm(e,this._root);return t?t.children.map(i=>i.value):[]}firstChild(e){const t=Cm(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=Tm(e,this._root);return t.length<2?[]:t[t.length-2].children.map(r=>r.value).filter(r=>r!==e)}pathFromRoot(e){return Tm(e,this._root).map(t=>t.value)}}function Cm(n,e){if(n===e.value)return e;for(const t of e.children){const i=Cm(n,t);if(i)return i}return null}function Tm(n,e){if(n===e.value)return[e];for(const t of e.children){const i=Tm(n,t);if(i.length)return i.unshift(e),i}return[]}class _r{constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function Ws(n){const e={};return n&&n.children.forEach(t=>e[t.value.outlet]=t),e}class Qb extends Kb{constructor(e,t){super(e),this.snapshot=t,Am(this,e)}toString(){return this.snapshot.toString()}}function Jb(n,e){const t=function tU(n,e){const s=new Ju([],{},{},"",{},Oe,e,null,n.root,-1,{});return new tw("",new _r(s,[]))}(n,e),i=new Ei([new El("",{})]),r=new Ei({}),o=new Ei({}),s=new Ei({}),a=new Ei(""),l=new No(i,r,s,a,o,Oe,e,t.root);return l.snapshot=t.root,new Qb(new _r(l,[]),t)}class No{constructor(e,t,i,r,o,s,a,l){this.url=e,this.params=t,this.queryParams=i,this.fragment=r,this.data=o,this.outlet=s,this.component=a,this.title=this.data?.pipe(De(c=>c[xl]))??fe(void 0),this._futureSnapshot=l}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(De(e=>Hs(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(De(e=>Hs(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function ew(n,e="emptyOnly"){const t=n.pathFromRoot;let i=0;if("always"!==e)for(i=t.length-1;i>=1;){const r=t[i],o=t[i-1];if(r.routeConfig&&""===r.routeConfig.path)i--;else{if(o.component)break;i--}}return function nU(n){return n.reduce((e,t)=>({params:{...e.params,...t.params},data:{...e.data,...t.data},resolve:{...t.data,...e.resolve,...t.routeConfig?.data,...t._resolvedData}}),{params:{},data:{},resolve:{}})}(t.slice(i))}class Ju{get title(){return this.data?.[xl]}constructor(e,t,i,r,o,s,a,l,c,u,d){this.url=e,this.params=t,this.queryParams=i,this.fragment=r,this.data=o,this.outlet=s,this.component=a,this.routeConfig=l,this._urlSegment=c,this._lastPathIndex=u,this._resolve=d}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Hs(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Hs(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class tw extends Kb{constructor(e,t){super(t),this.url=e,Am(this,t)}toString(){return nw(this._root)}}function Am(n,e){e.value._routerState=n,e.children.forEach(t=>Am(n,t))}function nw(n){const e=n.children.length>0?` { ${n.children.map(nw).join(", ")} } `:"";return`${n.value}${e}`}function Im(n){if(n.snapshot){const e=n.snapshot,t=n._futureSnapshot;n.snapshot=t,Xi(e.queryParams,t.queryParams)||n.queryParams.next(t.queryParams),e.fragment!==t.fragment&&n.fragment.next(t.fragment),Xi(e.params,t.params)||n.params.next(t.params),function gk(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;++t)if(!Xi(n[t],e[t]))return!1;return!0}(e.url,t.url)||n.url.next(t.url),Xi(e.data,t.data)||n.data.next(t.data)}else n.snapshot=n._futureSnapshot,n.data.next(n._futureSnapshot.data)}function Rm(n,e){const t=Xi(n.params,e.params)&&function Mk(n,e){return Po(n,e)&&n.every((t,i)=>Xi(t.parameters,e[i].parameters))}(n.url,e.url);return t&&!(!n.parent!=!e.parent)&&(!n.parent||Rm(n.parent,e.parent))}function Tl(n,e,t){if(t&&n.shouldReuseRoute(e.value,t.value.snapshot)){const i=t.value;i._futureSnapshot=e.value;const r=function rU(n,e,t){return e.children.map(i=>{for(const r of t.children)if(n.shouldReuseRoute(i.value,r.value.snapshot))return Tl(n,i,r);return Tl(n,i)})}(n,e,t);return new _r(i,r)}{if(n.shouldAttach(e.value)){const o=n.retrieve(e.value);if(null!==o){const s=o.route;return s.value._futureSnapshot=e.value,s.children=e.children.map(a=>Tl(n,a)),s}}const i=function oU(n){return new No(new Ei(n.url),new Ei(n.params),new Ei(n.queryParams),new Ei(n.fragment),new Ei(n.data),n.outlet,n.component,n)}(e.value),r=e.children.map(o=>Tl(n,o));return new _r(i,r)}}const Pm="ngNavigationCancelingError";function iw(n,e){const{redirectTo:t,navigationBehaviorOptions:i}=Lo(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,r=rw(!1,0,e);return r.url=t,r.navigationBehaviorOptions=i,r}function rw(n,e,t){const i=new Error("NavigationCancelingError: "+(n||""));return i[Pm]=!0,i.cancellationCode=e,t&&(i.url=t),i}function ow(n){return sw(n)&&Lo(n.url)}function sw(n){return n&&n[Pm]}class sU{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.injector=null,this.children=new Al,this.attachRef=null}}let Al=(()=>{class n{constructor(){this.contexts=new Map}onChildOutletCreated(t,i){const r=this.getOrCreateContext(t);r.outlet=i,this.contexts.set(t,r)}onChildOutletDestroyed(t){const i=this.getContext(t);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let i=this.getContext(t);return i||(i=new sU,this.contexts.set(t,i)),i}getContext(t){return this.contexts.get(t)||null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const ed=!1;let Lm=(()=>{class n{constructor(){this.activated=null,this._activatedRoute=null,this.name=Oe,this.activateEvents=new Xt,this.deactivateEvents=new Xt,this.attachEvents=new Xt,this.detachEvents=new Xt,this.parentContexts=Ne(Al),this.location=Ne(vi),this.changeDetector=Ne(Np),this.environmentInjector=Ne(Ui)}ngOnChanges(t){if(t.name){const{firstChange:i,previousValue:r}=t.name;if(i)return;this.isTrackedInParentContexts(r)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(r)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new X(4012,ed);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new X(4012,ed);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new X(4012,ed);this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,i){this.activated=t,this._activatedRoute=i,this.location.insert(t.hostView),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,i){if(this.isActivated)throw new X(4013,ed);this._activatedRoute=t;const r=this.location,s=t.snapshot.component,a=this.parentContexts.getOrCreateContext(this.name).children,l=new aU(t,a,r.injector);if(i&&function lU(n){return!!n.resolveComponentFactory}(i)){const c=i.resolveComponentFactory(s);this.activated=r.createComponent(c,r.length,l)}else this.activated=r.createComponent(s,{index:r.length,injector:l,environmentInjector:i??this.environmentInjector});this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=fn({type:n,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[mo]}),n})();class aU{constructor(e,t,i){this.route=e,this.childContexts=t,this.parent=i}get(e,t){return e===No?this.route:e===Al?this.childContexts:this.parent.get(e,t)}}let Fm=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["ng-component"]],standalone:!0,features:[ax],decls:1,vars:0,template:function(t,i){1&t&&Vn(0,"router-outlet")},dependencies:[Lm],encapsulation:2}),n})();function aw(n,e){return n.providers&&!n._injector&&(n._injector=hu(n.providers,e,`Route: ${n.path}`)),n._injector??e}function Om(n){const e=n.children&&n.children.map(Om),t=e?{...n,children:e}:{...n};return!t.component&&!t.loadComponent&&(e||t.loadChildren)&&t.outlet&&t.outlet!==Oe&&(t.component=Fm),t}function ii(n){return n.outlet||Oe}function lw(n,e){const t=n.filter(i=>ii(i)===e);return t.push(...n.filter(i=>ii(i)!==e)),t}function Il(n){if(!n)return null;if(n.routeConfig?._injector)return n.routeConfig._injector;for(let e=n.parent;e;e=e.parent){const t=e.routeConfig;if(t?._loadedInjector)return t._loadedInjector;if(t?._injector)return t._injector}return null}class fU{constructor(e,t,i,r){this.routeReuseStrategy=e,this.futureState=t,this.currState=i,this.forwardEvent=r}activate(e){const t=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,i,e),Im(this.futureState.root),this.activateChildRoutes(t,i,e)}deactivateChildRoutes(e,t,i){const r=Ws(t);e.children.forEach(o=>{const s=o.value.outlet;this.deactivateRoutes(o,r[s],i),delete r[s]}),en(r,(o,s)=>{this.deactivateRouteAndItsChildren(o,i)})}deactivateRoutes(e,t,i){const r=e.value,o=t?t.value:null;if(r===o)if(r.component){const s=i.getContext(r.outlet);s&&this.deactivateChildRoutes(e,t,s.children)}else this.deactivateChildRoutes(e,t,i);else o&&this.deactivateRouteAndItsChildren(t,i)}deactivateRouteAndItsChildren(e,t){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const i=t.getContext(e.value.outlet),r=i&&e.value.component?i.children:t,o=Ws(e);for(const s of Object.keys(o))this.deactivateRouteAndItsChildren(o[s],r);if(i&&i.outlet){const s=i.outlet.detach(),a=i.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:s,route:e,contexts:a})}}deactivateRouteAndOutlet(e,t){const i=t.getContext(e.value.outlet),r=i&&e.value.component?i.children:t,o=Ws(e);for(const s of Object.keys(o))this.deactivateRouteAndItsChildren(o[s],r);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.resolver=null,i.route=null)}activateChildRoutes(e,t,i){const r=Ws(t);e.children.forEach(o=>{this.activateRoutes(o,r[o.value.outlet],i),this.forwardEvent(new Yk(o.value.snapshot))}),e.children.length&&this.forwardEvent(new qk(e.value.snapshot))}activateRoutes(e,t,i){const r=e.value,o=t?t.value:null;if(Im(r),r===o)if(r.component){const s=i.getOrCreateContext(r.outlet);this.activateChildRoutes(e,t,s.children)}else this.activateChildRoutes(e,t,i);else if(r.component){const s=i.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){const a=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),s.children.onOutletReAttached(a.contexts),s.attachRef=a.componentRef,s.route=a.route.value,s.outlet&&s.outlet.attach(a.componentRef,a.route.value),Im(a.route.value),this.activateChildRoutes(e,null,s.children)}else{const a=Il(r.snapshot),l=a?.get(Ka)??null;s.attachRef=null,s.route=r,s.resolver=l,s.injector=a,s.outlet&&s.outlet.activateWith(r,s.injector),this.activateChildRoutes(e,null,s.children)}}else this.activateChildRoutes(e,null,i)}}class cw{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class td{constructor(e,t){this.component=e,this.route=t}}function pU(n,e,t){const i=n._root;return Rl(i,e?e._root:null,t,[i.value])}function $s(n,e){const t=Symbol(),i=e.get(n,t);return i===t?"function"!=typeof n||function fT(n){return null!==fc(n)}(n)?e.get(n):n:i}function Rl(n,e,t,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const o=Ws(e);return n.children.forEach(s=>{(function gU(n,e,t,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const o=n.value,s=e?e.value:null,a=t?t.getContext(n.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){const l=function _U(n,e,t){if("function"==typeof t)return t(n,e);switch(t){case"pathParamsChange":return!Po(n.url,e.url);case"pathParamsOrQueryParamsChange":return!Po(n.url,e.url)||!Xi(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Rm(n,e)||!Xi(n.queryParams,e.queryParams);default:return!Rm(n,e)}}(s,o,o.routeConfig.runGuardsAndResolvers);l?r.canActivateChecks.push(new cw(i)):(o.data=s.data,o._resolvedData=s._resolvedData),Rl(n,e,o.component?a?a.children:null:t,i,r),l&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new td(a.outlet.component,s))}else s&&Pl(e,a,r),r.canActivateChecks.push(new cw(i)),Rl(n,null,o.component?a?a.children:null:t,i,r)})(s,o[s.value.outlet],t,i.concat([s.value]),r),delete o[s.value.outlet]}),en(o,(s,a)=>Pl(s,t.getContext(a),r)),r}function Pl(n,e,t){const i=Ws(n),r=n.value;en(i,(o,s)=>{Pl(o,r.component?e?e.children.getContext(s):null:e,t)}),t.canDeactivateChecks.push(new td(r.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,r))}function Ll(n){return"function"==typeof n}function km(n){return n instanceof zu||"EmptyError"===n?.name}const nd=Symbol("INITIAL_VALUE");function qs(){return $i(n=>gm(n.map(e=>e.pipe(kr(1),Cb(nd)))).pipe(De(e=>{for(const t of e)if(!0!==t){if(t===nd)return nd;if(!1===t||t instanceof Hr)return t}return!0}),qi(e=>e!==nd),kr(1)))}function uw(n){return function MC(...n){return f_(n)}($t(e=>{if(Lo(e))throw iw(0,e)}),De(e=>!0===e))}const Um={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function dw(n,e,t,i,r){const o=Bm(n,e,t);return o.matched?function FU(n,e,t,i){const r=e.canMatch;return r&&0!==r.length?fe(r.map(s=>{const a=$s(s,n);return zr(function bU(n){return n&&Ll(n.canMatch)}(a)?a.canMatch(e,t):n.runInContext(()=>a(e,t)))})).pipe(qs(),uw()):fe(!0)}(i=aw(e,i),e,t).pipe(De(s=>!0===s?o:{...Um})):fe(o)}function Bm(n,e,t){if(""===e.path)return"full"===e.pathMatch&&(n.hasChildren()||t.length>0)?{...Um}:{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};const r=(e.matcher||mk)(t,n,e);if(!r)return{...Um};const o={};en(r.posParams,(a,l)=>{o[l]=a.path});const s=r.consumed.length>0?{...o,...r.consumed[r.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:r.consumed,remainingSegments:t.slice(r.consumed.length),parameters:s,positionalParamSegments:r.posParams??{}}}function id(n,e,t,i){if(t.length>0&&function kU(n,e,t){return t.some(i=>rd(n,e,i)&&ii(i)!==Oe)}(n,t,i)){const o=new We(e,function OU(n,e,t,i){const r={};r[Oe]=i,i._sourceSegment=n,i._segmentIndexShift=e.length;for(const o of t)if(""===o.path&&ii(o)!==Oe){const s=new We([],{});s._sourceSegment=n,s._segmentIndexShift=e.length,r[ii(o)]=s}return r}(n,e,i,new We(t,n.children)));return o._sourceSegment=n,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:[]}}if(0===t.length&&function UU(n,e,t){return t.some(i=>rd(n,e,i))}(n,t,i)){const o=new We(n.segments,function NU(n,e,t,i,r){const o={};for(const s of i)if(rd(n,t,s)&&!r[ii(s)]){const a=new We([],{});a._sourceSegment=n,a._segmentIndexShift=e.length,o[ii(s)]=a}return{...r,...o}}(n,e,t,i,n.children));return o._sourceSegment=n,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:t}}const r=new We(n.segments,n.children);return r._sourceSegment=n,r._segmentIndexShift=e.length,{segmentGroup:r,slicedSegments:t}}function rd(n,e,t){return(!(n.hasChildren()||e.length>0)||"full"!==t.pathMatch)&&""===t.path}function hw(n,e,t,i){return!!(ii(n)===i||i!==Oe&&rd(e,t,n))&&("**"===n.path||Bm(e,n,t).matched)}function fw(n,e,t){return 0===e.length&&!n.children[t]}const od=!1;class sd{constructor(e){this.segmentGroup=e||null}}class pw{constructor(e){this.urlTree=e}}function Fl(n){return zs(new sd(n))}function mw(n){return zs(new pw(n))}class VU{constructor(e,t,i,r,o){this.injector=e,this.configLoader=t,this.urlSerializer=i,this.urlTree=r,this.config=o,this.allowRedirects=!0}apply(){const e=id(this.urlTree.root,[],[],this.config).segmentGroup,t=new We(e.segments,e.children);return this.expandSegmentGroup(this.injector,this.config,t,Oe).pipe(De(o=>this.createUrlTree(Zu(o),this.urlTree.queryParams,this.urlTree.fragment))).pipe(gr(o=>{if(o instanceof pw)return this.allowRedirects=!1,this.match(o.urlTree);throw o instanceof sd?this.noMatchError(o):o}))}match(e){return this.expandSegmentGroup(this.injector,this.config,e.root,Oe).pipe(De(r=>this.createUrlTree(Zu(r),e.queryParams,e.fragment))).pipe(gr(r=>{throw r instanceof sd?this.noMatchError(r):r}))}noMatchError(e){return new X(4002,od)}createUrlTree(e,t,i){const r=xm(e);return new Hr(r,t,i)}expandSegmentGroup(e,t,i,r){return 0===i.segments.length&&i.hasChildren()?this.expandChildren(e,t,i).pipe(De(o=>new We([],o))):this.expandSegment(e,i,t,i.segments,r,!0)}expandChildren(e,t,i){const r=[];for(const o of Object.keys(i.children))"primary"===o?r.unshift(o):r.push(o);return Ht(r).pipe(Br(o=>{const s=i.children[o],a=lw(t,o);return this.expandSegmentGroup(e,a,s,o).pipe(De(l=>({segment:l,outlet:o})))}),Ab((o,s)=>(o[s.outlet]=s.segment,o),{}),Ib())}expandSegment(e,t,i,r,o,s){return Ht(i).pipe(Br(a=>this.expandSegmentAgainstRoute(e,t,i,a,r,o,s).pipe(gr(c=>{if(c instanceof sd)return fe(null);throw c}))),Ur(a=>!!a),gr((a,l)=>{if(km(a))return fw(t,r,o)?fe(new We([],{})):Fl(t);throw a}))}expandSegmentAgainstRoute(e,t,i,r,o,s,a){return hw(r,t,o,s)?void 0===r.redirectTo?this.matchSegmentAgainstRoute(e,t,r,o,s):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,i,r,o,s):Fl(t):Fl(t)}expandSegmentAgainstRouteUsingRedirect(e,t,i,r,o,s){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,i,r,s):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,i,r,o,s)}expandWildCardWithParamsAgainstRouteUsingRedirect(e,t,i,r){const o=this.applyRedirectCommands([],i.redirectTo,{});return i.redirectTo.startsWith("/")?mw(o):this.lineralizeSegments(i,o).pipe(Kt(s=>{const a=new We(s,{});return this.expandSegment(e,a,t,s,r,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(e,t,i,r,o,s){const{matched:a,consumedSegments:l,remainingSegments:c,positionalParamSegments:u}=Bm(t,r,o);if(!a)return Fl(t);const d=this.applyRedirectCommands(l,r.redirectTo,u);return r.redirectTo.startsWith("/")?mw(d):this.lineralizeSegments(r,d).pipe(Kt(h=>this.expandSegment(e,t,i,h.concat(c),s,!1)))}matchSegmentAgainstRoute(e,t,i,r,o){return"**"===i.path?(e=aw(i,e),i.loadChildren?(i._loadedRoutes?fe({routes:i._loadedRoutes,injector:i._loadedInjector}):this.configLoader.loadChildren(e,i)).pipe(De(a=>(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,new We(r,{})))):fe(new We(r,{}))):dw(t,i,r,e).pipe($i(({matched:s,consumedSegments:a,remainingSegments:l})=>s?this.getChildConfig(e=i._injector??e,i,r).pipe(Kt(u=>{const d=u.injector??e,h=u.routes,{segmentGroup:f,slicedSegments:g}=id(t,a,l,h),_=new We(f.segments,f.children);if(0===g.length&&_.hasChildren())return this.expandChildren(d,h,_).pipe(De(y=>new We(a,y)));if(0===h.length&&0===g.length)return fe(new We(a,{}));const v=ii(i)===o;return this.expandSegment(d,_,h,g,v?Oe:o,!0).pipe(De(m=>new We(a.concat(m.segments),m.children)))})):Fl(t)))}getChildConfig(e,t,i){return t.children?fe({routes:t.children,injector:e}):t.loadChildren?void 0!==t._loadedRoutes?fe({routes:t._loadedRoutes,injector:t._loadedInjector}):function LU(n,e,t,i){const r=e.canLoad;return void 0===r||0===r.length?fe(!0):fe(r.map(s=>{const a=$s(s,n);return zr(function yU(n){return n&&Ll(n.canLoad)}(a)?a.canLoad(e,t):n.runInContext(()=>a(e,t)))})).pipe(qs(),uw())}(e,t,i).pipe(Kt(r=>r?this.configLoader.loadChildren(e,t).pipe($t(o=>{t._loadedRoutes=o.routes,t._loadedInjector=o.injector})):function zU(n){return zs(rw(od,3))}())):fe({routes:[],injector:e})}lineralizeSegments(e,t){let i=[],r=t.root;for(;;){if(i=i.concat(r.segments),0===r.numberOfChildren)return fe(i);if(r.numberOfChildren>1||!r.children[Oe])return e.redirectTo,zs(new X(4e3,od));r=r.children[Oe]}}applyRedirectCommands(e,t,i){return this.applyRedirectCreateUrlTree(t,this.urlSerializer.parse(t),e,i)}applyRedirectCreateUrlTree(e,t,i,r){const o=this.createSegmentGroup(e,t.root,i,r);return new Hr(o,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const i={};return en(e,(r,o)=>{if("string"==typeof r&&r.startsWith(":")){const a=r.substring(1);i[o]=t[a]}else i[o]=r}),i}createSegmentGroup(e,t,i,r){const o=this.createSegments(e,t.segments,i,r);let s={};return en(t.children,(a,l)=>{s[l]=this.createSegmentGroup(e,a,i,r)}),new We(o,s)}createSegments(e,t,i,r){return t.map(o=>o.path.startsWith(":")?this.findPosParam(e,o,r):this.findOrReturn(o,i))}findPosParam(e,t,i){const r=i[t.path.substring(1)];if(!r)throw new X(4001,od);return r}findOrReturn(e,t){let i=0;for(const r of t){if(r.path===e.path)return t.splice(i),r;i++}return e}}class jU{}class qU{constructor(e,t,i,r,o,s,a){this.injector=e,this.rootComponentType=t,this.config=i,this.urlTree=r,this.url=o,this.paramsInheritanceStrategy=s,this.urlSerializer=a}recognize(){const e=id(this.urlTree.root,[],[],this.config.filter(t=>void 0===t.redirectTo)).segmentGroup;return this.processSegmentGroup(this.injector,this.config,e,Oe).pipe(De(t=>{if(null===t)return null;const i=new Ju([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},Oe,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new _r(i,t),o=new tw(this.url,r);return this.inheritParamsAndData(o._root),o}))}inheritParamsAndData(e){const t=e.value,i=ew(t,this.paramsInheritanceStrategy);t.params=Object.freeze(i.params),t.data=Object.freeze(i.data),e.children.forEach(r=>this.inheritParamsAndData(r))}processSegmentGroup(e,t,i,r){return 0===i.segments.length&&i.hasChildren()?this.processChildren(e,t,i):this.processSegment(e,t,i,i.segments,r)}processChildren(e,t,i){return Ht(Object.keys(i.children)).pipe(Br(r=>{const o=i.children[r],s=lw(t,r);return this.processSegmentGroup(e,s,o,r)}),Ab((r,o)=>r&&o?(r.push(...o),r):null),function hk(n,e=!1){return kt((t,i)=>{let r=0;t.subscribe(At(i,o=>{const s=n(o,r++);(s||e)&&i.next(o),!s&&i.complete()}))})}(r=>null!==r),Vu(null),Ib(),De(r=>{if(null===r)return null;const o=_w(r);return function XU(n){n.sort((e,t)=>e.value.outlet===Oe?-1:t.value.outlet===Oe?1:e.value.outlet.localeCompare(t.value.outlet))}(o),o}))}processSegment(e,t,i,r,o){return Ht(t).pipe(Br(s=>this.processSegmentAgainstRoute(s._injector??e,s,i,r,o)),Ur(s=>!!s),gr(s=>{if(km(s))return fw(i,r,o)?fe([]):fe(null);throw s}))}processSegmentAgainstRoute(e,t,i,r,o){if(t.redirectTo||!hw(t,i,r,o))return fe(null);let s;if("**"===t.path){const a=r.length>0?Lb(r).parameters:{},l=yw(i)+r.length;s=fe({snapshot:new Ju(r,a,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Mw(t),ii(t),t.component??t._loadedComponent??null,t,vw(i),l,xw(t)),consumedSegments:[],remainingSegments:[]})}else s=dw(i,t,r,e).pipe(De(({matched:a,consumedSegments:l,remainingSegments:c,parameters:u})=>{if(!a)return null;const d=yw(i)+l.length;return{snapshot:new Ju(l,u,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Mw(t),ii(t),t.component??t._loadedComponent??null,t,vw(i),d,xw(t)),consumedSegments:l,remainingSegments:c}}));return s.pipe($i(a=>{if(null===a)return fe(null);const{snapshot:l,consumedSegments:c,remainingSegments:u}=a;e=t._injector??e;const d=t._loadedInjector??e,h=function YU(n){return n.children?n.children:n.loadChildren?n._loadedRoutes:[]}(t),{segmentGroup:f,slicedSegments:g}=id(i,c,u,h.filter(v=>void 0===v.redirectTo));if(0===g.length&&f.hasChildren())return this.processChildren(d,h,f).pipe(De(v=>null===v?null:[new _r(l,v)]));if(0===h.length&&0===g.length)return fe([new _r(l,[])]);const _=ii(t)===o;return this.processSegment(d,h,f,g,_?Oe:o).pipe(De(v=>null===v?null:[new _r(l,v)]))}))}}function ZU(n){const e=n.value.routeConfig;return e&&""===e.path&&void 0===e.redirectTo}function _w(n){const e=[],t=new Set;for(const i of n){if(!ZU(i)){e.push(i);continue}const r=e.find(o=>i.value.routeConfig===o.value.routeConfig);void 0!==r?(r.children.push(...i.children),t.add(r)):e.push(i)}for(const i of t){const r=_w(i.children);e.push(new _r(i.value,r))}return e.filter(i=>!t.has(i))}function vw(n){let e=n;for(;e._sourceSegment;)e=e._sourceSegment;return e}function yw(n){let e=n,t=e._segmentIndexShift??0;for(;e._sourceSegment;)e=e._sourceSegment,t+=e._segmentIndexShift??0;return t-1}function Mw(n){return n.data||{}}function xw(n){return n.resolve||{}}function Ew(n){return"string"==typeof n.title||null===n.title}function zm(n){return $i(e=>{const t=n(e);return t?Ht(t).pipe(De(()=>e)):fe(e)})}const Xs=new ne("ROUTES");let Hm=(()=>{class n{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=Ne(Zx)}loadComponent(t){if(this.componentLoaders.get(t))return this.componentLoaders.get(t);if(t._loadedComponent)return fe(t._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(t);const i=zr(t.loadComponent()).pipe(De(ww),$t(o=>{this.onLoadEndListener&&this.onLoadEndListener(t),t._loadedComponent=o}),Gu(()=>{this.componentLoaders.delete(t)})),r=new Db(i,()=>new Ai).pipe(_m());return this.componentLoaders.set(t,r),r}loadChildren(t,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return fe({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);const o=this.loadModuleFactoryOrRoutes(i.loadChildren).pipe(De(a=>{this.onLoadEndListener&&this.onLoadEndListener(i);let l,c,u=!1;Array.isArray(a)?c=a:(l=a.create(t).injector,c=Pb(l.get(Xs,[],Me.Self|Me.Optional)));return{routes:c.map(Om),injector:l}}),Gu(()=>{this.childrenLoaders.delete(i)})),s=new Db(o,()=>new Ai).pipe(_m());return this.childrenLoaders.set(i,s),s}loadModuleFactoryOrRoutes(t){return zr(t()).pipe(De(ww),Kt(i=>i instanceof ox||Array.isArray(i)?fe(i):Ht(this.compiler.compileModuleAsync(i))))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function ww(n){return function rB(n){return n&&"object"==typeof n&&"default"in n}(n)?n.default:n}let ld=(()=>{class n{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.lastSuccessfulNavigation=null,this.events=new Ai,this.configLoader=Ne(Hm),this.environmentInjector=Ne(Ui),this.urlSerializer=Ne(bl),this.rootContexts=Ne(Al),this.navigationId=0,this.afterPreactivation=()=>fe(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=r=>this.events.next(new Wk(r)),this.configLoader.onLoadStartListener=r=>this.events.next(new jk(r))}complete(){this.transitions?.complete()}handleNavigationRequest(t){const i=++this.navigationId;this.transitions?.next({...this.transitions.value,...t,id:i})}setupNavigations(t){return this.transitions=new Ei({id:0,targetPageId:0,currentUrlTree:t.currentUrlTree,currentRawUrl:t.currentUrlTree,extractedUrl:t.urlHandlingStrategy.extract(t.currentUrlTree),urlAfterRedirects:t.urlHandlingStrategy.extract(t.currentUrlTree),rawUrl:t.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:Cl,restoredState:null,currentSnapshot:t.routerState.snapshot,targetSnapshot:null,currentRouterState:t.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(qi(i=>0!==i.id),De(i=>({...i,extractedUrl:t.urlHandlingStrategy.extract(i.rawUrl)})),$i(i=>{let r=!1,o=!1;return fe(i).pipe($t(s=>{this.currentNavigation={id:s.id,initialUrl:s.rawUrl,extractedUrl:s.extractedUrl,trigger:s.source,extras:s.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),$i(s=>{const a=t.browserUrlTree.toString(),l=!t.navigated||s.extractedUrl.toString()!==a||a!==t.currentUrlTree.toString();if(!l&&"reload"!==(s.extras.onSameUrlNavigation??t.onSameUrlNavigation)){const u="";return this.events.next(new Qu(s.id,t.serializeUrl(i.rawUrl),u,0)),t.rawUrlTree=s.rawUrl,s.resolve(null),Ii}if(t.urlHandlingStrategy.shouldProcessUrl(s.rawUrl))return Sw(s.source)&&(t.browserUrlTree=s.extractedUrl),fe(s).pipe($i(u=>{const d=this.transitions?.getValue();return this.events.next(new Sm(u.id,this.urlSerializer.serialize(u.extractedUrl),u.source,u.restoredState)),d!==this.transitions?.getValue()?Ii:Promise.resolve(u)}),function GU(n,e,t,i){return $i(r=>function HU(n,e,t,i,r){return new VU(n,e,t,i,r).apply()}(n,e,t,r.extractedUrl,i).pipe(De(o=>({...r,urlAfterRedirects:o}))))}(this.environmentInjector,this.configLoader,this.urlSerializer,t.config),$t(u=>{this.currentNavigation={...this.currentNavigation,finalUrl:u.urlAfterRedirects},i.urlAfterRedirects=u.urlAfterRedirects}),function QU(n,e,t,i,r){return Kt(o=>function $U(n,e,t,i,r,o,s="emptyOnly"){return new qU(n,e,t,i,r,s,o).recognize().pipe($i(a=>null===a?function WU(n){return new bt(e=>e.error(n))}(new jU):fe(a)))}(n,e,t,o.urlAfterRedirects,i.serialize(o.urlAfterRedirects),i,r).pipe(De(s=>({...o,targetSnapshot:s}))))}(this.environmentInjector,this.rootComponentType,t.config,this.urlSerializer,t.paramsInheritanceStrategy),$t(u=>{if(i.targetSnapshot=u.targetSnapshot,"eager"===t.urlUpdateStrategy){if(!u.extras.skipLocationChange){const h=t.urlHandlingStrategy.merge(u.urlAfterRedirects,u.rawUrl);t.setBrowserUrl(h,u)}t.browserUrlTree=u.urlAfterRedirects}const d=new Bk(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}));if(l&&t.urlHandlingStrategy.shouldProcessUrl(t.rawUrlTree)){const{id:u,extractedUrl:d,source:h,restoredState:f,extras:g}=s,_=new Sm(u,this.urlSerializer.serialize(d),h,f);this.events.next(_);const v=Jb(d,this.rootComponentType).snapshot;return fe(i={...s,targetSnapshot:v,urlAfterRedirects:d,extras:{...g,skipLocationChange:!1,replaceUrl:!1}})}{const u="";return this.events.next(new Qu(s.id,t.serializeUrl(i.extractedUrl),u,1)),t.rawUrlTree=s.rawUrl,s.resolve(null),Ii}}),$t(s=>{const a=new zk(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot);this.events.next(a)}),De(s=>i={...s,guards:pU(s.targetSnapshot,s.currentSnapshot,this.rootContexts)}),function SU(n,e){return Kt(t=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:o,canDeactivateChecks:s}}=t;return 0===s.length&&0===o.length?fe({...t,guardsResult:!0}):function DU(n,e,t,i){return Ht(n).pipe(Kt(r=>function PU(n,e,t,i,r){const o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return o&&0!==o.length?fe(o.map(a=>{const l=Il(e)??r,c=$s(a,l);return zr(function EU(n){return n&&Ll(n.canDeactivate)}(c)?c.canDeactivate(n,e,t,i):l.runInContext(()=>c(n,e,t,i))).pipe(Ur())})).pipe(qs()):fe(!0)}(r.component,r.route,t,e,i)),Ur(r=>!0!==r,!0))}(s,i,r,n).pipe(Kt(a=>a&&function vU(n){return"boolean"==typeof n}(a)?function CU(n,e,t,i){return Ht(e).pipe(Br(r=>Hu(function AU(n,e){return null!==n&&e&&e(new $k(n)),fe(!0)}(r.route.parent,i),function TU(n,e){return null!==n&&e&&e(new Xk(n)),fe(!0)}(r.route,i),function RU(n,e,t){const i=e[e.length-1],o=e.slice(0,e.length-1).reverse().map(s=>function mU(n){const e=n.routeConfig?n.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:n,guards:e}:null}(s)).filter(s=>null!==s).map(s=>Sb(()=>fe(s.guards.map(l=>{const c=Il(s.node)??t,u=$s(l,c);return zr(function xU(n){return n&&Ll(n.canActivateChild)}(u)?u.canActivateChild(i,n):c.runInContext(()=>u(i,n))).pipe(Ur())})).pipe(qs())));return fe(o).pipe(qs())}(n,r.path,t),function IU(n,e,t){const i=e.routeConfig?e.routeConfig.canActivate:null;if(!i||0===i.length)return fe(!0);const r=i.map(o=>Sb(()=>{const s=Il(e)??t,a=$s(o,s);return zr(function MU(n){return n&&Ll(n.canActivate)}(a)?a.canActivate(e,n):s.runInContext(()=>a(e,n))).pipe(Ur())}));return fe(r).pipe(qs())}(n,r.route,t))),Ur(r=>!0!==r,!0))}(i,o,n,e):fe(a)),De(a=>({...t,guardsResult:a})))})}(this.environmentInjector,s=>this.events.next(s)),$t(s=>{if(i.guardsResult=s.guardsResult,Lo(s.guardsResult))throw iw(0,s.guardsResult);const a=new Hk(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot,!!s.guardsResult);this.events.next(a)}),qi(s=>!!s.guardsResult||(t.restoreHistory(s),this.cancelNavigationTransition(s,"",3),!1)),zm(s=>{if(s.guards.canActivateChecks.length)return fe(s).pipe($t(a=>{const l=new Vk(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(l)}),$i(a=>{let l=!1;return fe(a).pipe(function JU(n,e){return Kt(t=>{const{targetSnapshot:i,guards:{canActivateChecks:r}}=t;if(!r.length)return fe(t);let o=0;return Ht(r).pipe(Br(s=>function eB(n,e,t,i){const r=n.routeConfig,o=n._resolve;return void 0!==r?.title&&!Ew(r)&&(o[xl]=r.title),function tB(n,e,t,i){const r=function nB(n){return[...Object.keys(n),...Object.getOwnPropertySymbols(n)]}(n);if(0===r.length)return fe({});const o={};return Ht(r).pipe(Kt(s=>function iB(n,e,t,i){const r=Il(e)??i,o=$s(n,r);return zr(o.resolve?o.resolve(e,t):r.runInContext(()=>o(e,t)))}(n[s],e,t,i).pipe(Ur(),$t(a=>{o[s]=a}))),vm(1),function fk(n){return De(()=>n)}(o),gr(s=>km(s)?Ii:zs(s)))}(o,n,e,i).pipe(De(s=>(n._resolvedData=s,n.data=ew(n,t).resolve,r&&Ew(r)&&(n.data[xl]=r.title),null)))}(s.route,i,n,e)),$t(()=>o++),vm(1),Kt(s=>o===r.length?fe(t):Ii))})}(t.paramsInheritanceStrategy,this.environmentInjector),$t({next:()=>l=!0,complete:()=>{l||(t.restoreHistory(a),this.cancelNavigationTransition(a,"",2))}}))}),$t(a=>{const l=new Gk(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(l)}))}),zm(s=>{const a=l=>{const c=[];l.routeConfig?.loadComponent&&!l.routeConfig._loadedComponent&&c.push(this.configLoader.loadComponent(l.routeConfig).pipe($t(u=>{l.component=u}),De(()=>{})));for(const u of l.children)c.push(...a(u));return c};return gm(a(s.targetSnapshot.root)).pipe(Vu(),kr(1))}),zm(()=>this.afterPreactivation()),De(s=>{const a=function iU(n,e,t){const i=Tl(n,e._root,t?t._root:void 0);return new Qb(i,e)}(t.routeReuseStrategy,s.targetSnapshot,s.currentRouterState);return i={...s,targetRouterState:a}}),$t(s=>{t.currentUrlTree=s.urlAfterRedirects,t.rawUrlTree=t.urlHandlingStrategy.merge(s.urlAfterRedirects,s.rawUrl),t.routerState=s.targetRouterState,"deferred"===t.urlUpdateStrategy&&(s.extras.skipLocationChange||t.setBrowserUrl(t.rawUrlTree,s),t.browserUrlTree=s.urlAfterRedirects)}),((n,e,t)=>De(i=>(new fU(e,i.targetRouterState,i.currentRouterState,t).activate(n),i)))(this.rootContexts,t.routeReuseStrategy,s=>this.events.next(s)),kr(1),$t({next:s=>{r=!0,this.lastSuccessfulNavigation=this.currentNavigation,t.navigated=!0,this.events.next(new Fo(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(t.currentUrlTree))),t.titleStrategy?.updateTitle(s.targetRouterState.snapshot),s.resolve(!0)},complete:()=>{r=!0}}),Gu(()=>{r||o||this.cancelNavigationTransition(i,"",1),this.currentNavigation?.id===i.id&&(this.currentNavigation=null)}),gr(s=>{if(o=!0,sw(s)){ow(s)||(t.navigated=!0,t.restoreHistory(i,!0));const a=new Ku(i.id,this.urlSerializer.serialize(i.extractedUrl),s.message,s.cancellationCode);if(this.events.next(a),ow(s)){const l=t.urlHandlingStrategy.merge(s.url,t.rawUrlTree),c={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===t.urlUpdateStrategy||Sw(i.source)};t.scheduleNavigation(l,Cl,null,c,{resolve:i.resolve,reject:i.reject,promise:i.promise})}else i.resolve(!1)}else{t.restoreHistory(i,!0);const a=new Dm(i.id,this.urlSerializer.serialize(i.extractedUrl),s,i.targetSnapshot??void 0);this.events.next(a);try{i.resolve(t.errorHandler(s))}catch(l){i.reject(l)}}return Ii}))}))}cancelNavigationTransition(t,i,r){const o=new Ku(t.id,this.urlSerializer.serialize(t.extractedUrl),i,r);this.events.next(o),t.resolve(!1)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Sw(n){return n!==Cl}let Dw=(()=>{class n{buildTitle(t){let i,r=t.root;for(;void 0!==r;)i=this.getResolvedTitleForRoute(r)??i,r=r.children.find(o=>o.outlet===Oe);return i}getResolvedTitleForRoute(t){return t.data[xl]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(){return Ne(oB)},providedIn:"root"}),n})(),oB=(()=>{class n extends Dw{constructor(t){super(),this.title=t}updateTitle(t){const i=this.buildTitle(t);void 0!==i&&this.title.setTitle(i)}}return n.\u0275fac=function(t){return new(t||n)(K(_b))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),sB=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(){return Ne(lB)},providedIn:"root"}),n})();class aB{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}let lB=(()=>{class n extends aB{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=function Iv(n){return nr(()=>{const e=n.prototype.constructor,t=e[rr]||zh(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const o=r[rr]||zh(r);if(o&&o!==t)return o;r=Object.getPrototypeOf(r)}return o=>new o})}(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const cd=new ne("",{providedIn:"root",factory:()=>({})});let uB=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:function(){return Ne(dB)},providedIn:"root"}),n})(),dB=(()=>{class n{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,i){return t}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function hB(n){throw n}function fB(n,e,t){return e.parse("/")}const pB={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},mB={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let Gn=(()=>{class n{get navigationId(){return this.navigationTransitions.navigationId}get browserPageId(){if("computed"===this.canceledNavigationResolution)return this.location.getState()?.\u0275routerPageId}get events(){return this.navigationTransitions.events}constructor(){this.disposed=!1,this.currentPageId=0,this.console=Ne(GF),this.isNgZoneEnabled=!1,this.options=Ne(cd,{optional:!0})||{},this.errorHandler=this.options.errorHandler||hB,this.malformedUriErrorHandler=this.options.malformedUriErrorHandler||fB,this.navigated=!1,this.lastSuccessfulId=-1,this.urlHandlingStrategy=Ne(uB),this.routeReuseStrategy=Ne(sB),this.urlCreationStrategy=Ne(eU),this.titleStrategy=Ne(Dw),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.config=Pb(Ne(Xs,{optional:!0})??[]),this.navigationTransitions=Ne(ld),this.urlSerializer=Ne(bl),this.location=Ne(jp),this.isNgZoneEnabled=Ne(Dt)instanceof Dt&&Dt.isInAngularZone(),this.resetConfig(this.config),this.currentUrlTree=new Hr,this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.routerState=Jb(this.currentUrlTree,null),this.navigationTransitions.setupNavigations(this).subscribe(t=>{this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId??0},t=>{this.console.warn(`Unhandled Navigation Error: ${t}`)})}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){if(this.setUpLocationChangeListener(),!this.navigationTransitions.hasRequestedNavigation){const t=this.location.getState();this.navigateToSyncWithBrowser(this.location.path(!0),Cl,t)}}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{const i="popstate"===t.type?"popstate":"hashchange";"popstate"===i&&setTimeout(()=>{this.navigateToSyncWithBrowser(t.url,i,t.state)},0)}))}navigateToSyncWithBrowser(t,i,r){const o={replaceUrl:!0},s=r?.navigationId?r:null;if(r){const l={...r};delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(o.state=l)}const a=this.parseUrl(t);this.scheduleNavigation(a,i,s,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}resetConfig(t){this.config=t.map(Om),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(t,i={}){const{relativeTo:r,queryParams:o,fragment:s,queryParamsHandling:a,preserveFragment:l}=i,c=l?this.currentUrlTree.fragment:s;let u=null;switch(a){case"merge":u={...this.currentUrlTree.queryParams,...o};break;case"preserve":u=this.currentUrlTree.queryParams;break;default:u=o||null}return null!==u&&(u=this.removeEmptyProps(u)),this.urlCreationStrategy.createUrlTree(r,this.routerState,this.currentUrlTree,t,u,c??null)}navigateByUrl(t,i={skipLocationChange:!1}){const r=Lo(t)?t:this.parseUrl(t),o=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(o,Cl,null,i)}navigate(t,i={skipLocationChange:!1}){return function gB(n){for(let e=0;e<n.length;e++){const t=n[e];if(null==t)throw new X(4008,false)}}(t),this.navigateByUrl(this.createUrlTree(t,i),i)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){let i;try{i=this.urlSerializer.parse(t)}catch(r){i=this.malformedUriErrorHandler(r,this.urlSerializer,t)}return i}isActive(t,i){let r;if(r=!0===i?{...pB}:!1===i?{...mB}:i,Lo(t))return Nb(this.currentUrlTree,t,r);const o=this.parseUrl(t);return Nb(this.currentUrlTree,o,r)}removeEmptyProps(t){return Object.keys(t).reduce((i,r)=>{const o=t[r];return null!=o&&(i[r]=o),i},{})}scheduleNavigation(t,i,r,o,s){if(this.disposed)return Promise.resolve(!1);let a,l,c,u;return s?(a=s.resolve,l=s.reject,c=s.promise):c=new Promise((d,h)=>{a=d,l=h}),u="computed"===this.canceledNavigationResolution?r&&r.\u0275routerPageId?r.\u0275routerPageId:(this.browserPageId??0)+1:0,this.navigationTransitions.handleNavigationRequest({targetPageId:u,source:i,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:o,resolve:a,reject:l,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(d=>Promise.reject(d))}setBrowserUrl(t,i){const r=this.urlSerializer.serialize(t);if(this.location.isCurrentPathEqualTo(r)||i.extras.replaceUrl){const s={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId)};this.location.replaceState(r,"",s)}else{const o={...i.extras.state,...this.generateNgRouterState(i.id,i.targetPageId)};this.location.go(r,"",o)}}restoreHistory(t,i=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-(this.browserPageId??this.currentPageId);0!==o?this.location.historyGo(o):this.currentUrlTree===this.getCurrentNavigation()?.finalUrl&&0===o&&(this.resetState(t),this.browserUrlTree=t.currentUrlTree,this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(i&&this.resetState(t),this.resetUrlToCurrentUrlTree())}resetState(t){this.routerState=t.currentRouterState,this.currentUrlTree=t.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,i){return"computed"===this.canceledNavigationResolution?{navigationId:t,\u0275routerPageId:i}:{navigationId:t}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();class Cw{}let yB=(()=>{class n{constructor(t,i,r,o,s){this.router=t,this.injector=r,this.preloadingStrategy=o,this.loader=s}setUpPreloading(){this.subscription=this.router.events.pipe(qi(t=>t instanceof Fo),Br(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,i){const r=[];for(const o of i){o.providers&&!o._injector&&(o._injector=hu(o.providers,t,`Route: ${o.path}`));const s=o._injector??t,a=o._loadedInjector??s;(o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent)&&r.push(this.preloadConfig(s,o)),(o.children||o._loadedRoutes)&&r.push(this.processRoutes(a,o.children??o._loadedRoutes))}return Ht(r).pipe(Jo())}preloadConfig(t,i){return this.preloadingStrategy.preload(i,()=>{let r;r=i.loadChildren&&void 0===i.canLoad?this.loader.loadChildren(t,i):fe(null);const o=r.pipe(Kt(s=>null===s?fe(void 0):(i._loadedRoutes=s.routes,i._loadedInjector=s.injector,this.processRoutes(s.injector??t,s.routes))));return i.loadComponent&&!i._loadedComponent?Ht([o,this.loader.loadComponent(i)]).pipe(Jo()):o})}}return n.\u0275fac=function(t){return new(t||n)(K(Gn),K(Zx),K(Ui),K(Cw),K(Hm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const jm=new ne("");let Tw=(()=>{class n{constructor(t,i,r,o,s={}){this.urlSerializer=t,this.transitions=i,this.viewportScroller=r,this.zone=o,this.options=s,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},s.scrollPositionRestoration=s.scrollPositionRestoration||"disabled",s.anchorScrolling=s.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof Sm?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof Fo&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof Zb&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,i){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new Zb(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,i))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}}return n.\u0275fac=function(t){!function l0(){throw new Error("invalid")}()},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();var jn=(()=>((jn=jn||{})[jn.COMPLETE=0]="COMPLETE",jn[jn.FAILED=1]="FAILED",jn[jn.REDIRECTING=2]="REDIRECTING",jn))();const Ys=!1;function Vr(n,e){return{\u0275kind:n,\u0275providers:e}}const Wm=new ne("",{providedIn:"root",factory:()=>!1});function Iw(){const n=Ne(zi);return e=>{const t=n.get(Mu);if(e!==t.components[0])return;const i=n.get(Gn),r=n.get(Rw);1===n.get($m)&&i.initialNavigation(),n.get(Pw,null,Me.Optional)?.setUpPreloading(),n.get(jm,null,Me.Optional)?.init(),i.resetRootComponentType(t.componentTypes[0]),r.closed||(r.next(),r.complete(),r.unsubscribe())}}const Rw=new ne(Ys?"bootstrap done indicator":"",{factory:()=>new Ai}),$m=new ne(Ys?"initial navigation":"",{providedIn:"root",factory:()=>1});function wB(){let n=[];return n=Ys?[{provide:Wc,multi:!0,useFactory:()=>{const e=Ne(Gn);return()=>e.events.subscribe(t=>{console.group?.(`Router Event: ${t.constructor.name}`),console.log(function Zk(n){if(!("type"in n))return`Unknown Router Event: ${n.constructor.name}`;switch(n.type){case 14:return`ActivationEnd(path: '${n.snapshot.routeConfig?.path||""}')`;case 13:return`ActivationStart(path: '${n.snapshot.routeConfig?.path||""}')`;case 12:return`ChildActivationEnd(path: '${n.snapshot.routeConfig?.path||""}')`;case 11:return`ChildActivationStart(path: '${n.snapshot.routeConfig?.path||""}')`;case 8:return`GuardsCheckEnd(id: ${n.id}, url: '${n.url}', urlAfterRedirects: '${n.urlAfterRedirects}', state: ${n.state}, shouldActivate: ${n.shouldActivate})`;case 7:return`GuardsCheckStart(id: ${n.id}, url: '${n.url}', urlAfterRedirects: '${n.urlAfterRedirects}', state: ${n.state})`;case 2:return`NavigationCancel(id: ${n.id}, url: '${n.url}')`;case 16:return`NavigationSkipped(id: ${n.id}, url: '${n.url}')`;case 1:return`NavigationEnd(id: ${n.id}, url: '${n.url}', urlAfterRedirects: '${n.urlAfterRedirects}')`;case 3:return`NavigationError(id: ${n.id}, url: '${n.url}', error: ${n.error})`;case 0:return`NavigationStart(id: ${n.id}, url: '${n.url}')`;case 6:return`ResolveEnd(id: ${n.id}, url: '${n.url}', urlAfterRedirects: '${n.urlAfterRedirects}', state: ${n.state})`;case 5:return`ResolveStart(id: ${n.id}, url: '${n.url}', urlAfterRedirects: '${n.urlAfterRedirects}', state: ${n.state})`;case 10:return`RouteConfigLoadEnd(path: ${n.route.path})`;case 9:return`RouteConfigLoadStart(path: ${n.route.path})`;case 4:return`RoutesRecognized(id: ${n.id}, url: '${n.url}', urlAfterRedirects: '${n.urlAfterRedirects}', state: ${n.state})`;case 15:return`Scroll(anchor: '${n.anchor}', position: '${n.position?`${n.position[0]}, ${n.position[1]}`:null}')`}}(t)),console.log(t),console.groupEnd?.()})}}]:[],Vr(1,n)}const Pw=new ne(Ys?"router preloader":"");function SB(n){return Vr(0,[{provide:Pw,useExisting:yB},{provide:Cw,useExisting:n}])}const Nl=!1,Lw=new ne(Nl?"router duplicate forRoot guard":"ROUTER_FORROOT_GUARD"),DB=[jp,{provide:bl,useClass:ym},Gn,Al,{provide:No,useFactory:function Aw(n){return n.routerState.root},deps:[Gn]},Hm,Nl?{provide:Wm,useValue:!0}:[]];function CB(){return new rE("Router",Gn)}let TB=(()=>{class n{constructor(t){}static forRoot(t,i){return{ngModule:n,providers:[DB,Nl&&i?.enableTracing?wB().\u0275providers:[],{provide:Xs,multi:!0,useValue:t},{provide:Lw,useFactory:PB,deps:[[Gn,new Ir,new ms]]},{provide:cd,useValue:i||{}},i?.useHash?{provide:Ro,useClass:IN}:{provide:Ro,useClass:CE},{provide:jm,useFactory:()=>{const n=Ne(ZO),e=Ne(Dt),t=Ne(cd),i=Ne(ld),r=Ne(bl);return t.scrollOffset&&n.setOffset(t.scrollOffset),new Tw(r,i,n,e,t)}},i?.preloadingStrategy?SB(i.preloadingStrategy).\u0275providers:[],{provide:rE,multi:!0,useFactory:CB},i?.initialNavigation?LB(i):[],[{provide:Fw,useFactory:Iw},{provide:iE,multi:!0,useExisting:Fw}]]}}static forChild(t){return{ngModule:n,providers:[{provide:Xs,multi:!0,useValue:t}]}}}return n.\u0275fac=function(t){return new(t||n)(K(Lw,8))},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({imports:[Fm]}),n})();function PB(n){if(Nl&&n)throw new X(4007,"The Router was provided more than once. This can happen if 'forRoot' is used outside of the root injector. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function LB(n){return["disabled"===n.initialNavigation?Vr(3,[{provide:gu,multi:!0,useFactory:()=>{const e=Ne(Gn);return()=>{e.setUpLocationChangeListener()}}},{provide:$m,useValue:2}]).\u0275providers:[],"enabledBlocking"===n.initialNavigation?Vr(2,[{provide:$m,useValue:0},{provide:gu,multi:!0,deps:[zi],useFactory:e=>{const t=e.get(TN,Promise.resolve());return()=>t.then(()=>new Promise(i=>{const r=e.get(Gn),o=e.get(Rw);(function MB(n,e){n.events.pipe(qi(t=>t instanceof Fo||t instanceof Ku||t instanceof Dm||t instanceof Qu),De(t=>t instanceof Fo||t instanceof Qu?jn.COMPLETE:t instanceof Ku&&(0===t.code||1===t.code)?jn.REDIRECTING:jn.FAILED),qi(t=>t!==jn.REDIRECTING),kr(1)).subscribe(()=>{e()})})(r,()=>{i(!0)}),e.get(ld).afterPreactivation=()=>(i(!0),o.closed?fe(void 0):o),r.initialNavigation()}))}}]).\u0275providers:[]]}const Fw=new ne(Nl?"Router Initializer":"");class ud{}class qm{}class vr{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),o=r.toLowerCase(),s=t.slice(i+1).trim();this.maybeSetNormalizedName(r,o),this.headers.has(o)?this.headers.get(o).push(s):this.headers.set(o,[s])}})}:()=>{this.headers=new Map,Object.entries(e).forEach(([t,i])=>{let r;if(r="string"==typeof i?[i]:"number"==typeof i?[i.toString()]:i.map(o=>o.toString()),r.length>0){const o=t.toLowerCase();this.headers.set(o,r),this.maybeSetNormalizedName(t,o)}})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof vr?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new vr;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof vr?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const o=e.value;if(o){let s=this.headers.get(t);if(!s)return;s=s.filter(a=>-1===o.indexOf(a)),0===s.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,s)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class NB{encodeKey(e){return Nw(e)}encodeValue(e){return Nw(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const kB=/%(\d[a-f0-9])/gi,UB={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function Nw(n){return encodeURIComponent(n).replace(kB,(e,t)=>UB[t]??e)}function dd(n){return`${n}`}class Gr{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new NB,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function OB(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const o=r.indexOf("="),[s,a]=-1==o?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,o)),e.decodeValue(r.slice(o+1))],l=t.get(s)||[];l.push(a),t.set(s,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t],r=Array.isArray(i)?i.map(dd):[dd(i)];this.map.set(t,r)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(o=>{t.push({param:i,value:o,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new Gr({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(dd(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(dd(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class BB{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}}function Ow(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer}function kw(n){return typeof Blob<"u"&&n instanceof Blob}function Uw(n){return typeof FormData<"u"&&n instanceof FormData}class Ol{constructor(e,t,i,r){let o;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function zB(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,o=r):o=i,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params)),this.headers||(this.headers=new vr),this.context||(this.context=new BB),this.params){const s=this.params.toString();if(0===s.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":a<t.length-1?"&":"")+s}}else this.params=new Gr,this.urlWithParams=t}serializeBody(){return null===this.body?null:Ow(this.body)||kw(this.body)||Uw(this.body)||function HB(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}(this.body)||"string"==typeof this.body?this.body:this.body instanceof Gr?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||Uw(this.body)?null:kw(this.body)?this.body.type||null:Ow(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof Gr?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||"boolean"==typeof this.body?"application/json":null}clone(e={}){const t=e.method||this.method,i=e.url||this.url,r=e.responseType||this.responseType,o=void 0!==e.body?e.body:this.body,s=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,a=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let l=e.headers||this.headers,c=e.params||this.params;const u=e.context??this.context;return void 0!==e.setHeaders&&(l=Object.keys(e.setHeaders).reduce((d,h)=>d.set(h,e.setHeaders[h]),l)),e.setParams&&(c=Object.keys(e.setParams).reduce((d,h)=>d.set(h,e.setParams[h]),c)),new Ol(t,i,o,{params:c,headers:l,context:u,reportProgress:a,responseType:r,withCredentials:s})}}var zt=(()=>((zt=zt||{})[zt.Sent=0]="Sent",zt[zt.UploadProgress=1]="UploadProgress",zt[zt.ResponseHeader=2]="ResponseHeader",zt[zt.DownloadProgress=3]="DownloadProgress",zt[zt.Response=4]="Response",zt[zt.User=5]="User",zt))();class Xm{constructor(e,t=200,i="OK"){this.headers=e.headers||new vr,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class Ym extends Xm{constructor(e={}){super(e),this.type=zt.ResponseHeader}clone(e={}){return new Ym({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class hd extends Xm{constructor(e={}){super(e),this.type=zt.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new hd({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Bw extends Xm{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function Zm(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let Km=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let o;if(t instanceof Ol)o=t;else{let l,c;l=r.headers instanceof vr?r.headers:new vr(r.headers),r.params&&(c=r.params instanceof Gr?r.params:new Gr({fromObject:r.params})),o=new Ol(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const s=fe(o).pipe(Br(l=>this.handler.handle(l)));if(t instanceof Ol||"events"===r.observe)return s;const a=s.pipe(qi(l=>l instanceof hd));switch(r.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return a.pipe(De(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(De(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(De(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));default:return a.pipe(De(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new Gr).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,Zm(r,i))}post(t,i,r={}){return this.request("POST",t,Zm(r,i))}put(t,i,r={}){return this.request("PUT",t,Zm(r,i))}}return n.\u0275fac=function(t){return new(t||n)(K(ud))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function zw(n,e){return e(n)}function VB(n,e){return(t,i)=>e.intercept(t,{handle:r=>n(r,i)})}const jB=new ne("HTTP_INTERCEPTORS"),kl=new ne("HTTP_INTERCEPTOR_FNS");function WB(){let n=null;return(e,t)=>(null===n&&(n=(Ne(jB,{optional:!0})??[]).reduceRight(VB,zw)),n(e,t))}let Hw=(()=>{class n extends ud{constructor(t,i){super(),this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=Array.from(new Set(this.injector.get(kl)));this.chain=i.reduceRight((r,o)=>function GB(n,e,t){return(i,r)=>t.runInContext(()=>e(i,o=>n(o,r)))}(r,o,this.injector),zw)}return this.chain(t,i=>this.backend.handle(i))}}return n.\u0275fac=function(t){return new(t||n)(K(qm),K(Ui))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const YB=/^\)\]\}',?\n/;let Gw=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new bt(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((f,g)=>r.setRequestHeader(f,g.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const f=t.detectContentTypeHeader();null!==f&&r.setRequestHeader("Content-Type",f)}if(t.responseType){const f=t.responseType.toLowerCase();r.responseType="json"!==f?f:"text"}const o=t.serializeBody();let s=null;const a=()=>{if(null!==s)return s;const f=r.statusText||"OK",g=new vr(r.getAllResponseHeaders()),_=function ZB(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return s=new Ym({headers:g,status:r.status,statusText:f,url:_}),s},l=()=>{let{headers:f,status:g,statusText:_,url:v}=a(),p=null;204!==g&&(p=typeof r.response>"u"?r.responseText:r.response),0===g&&(g=p?200:0);let m=g>=200&&g<300;if("json"===t.responseType&&"string"==typeof p){const y=p;p=p.replace(YB,"");try{p=""!==p?JSON.parse(p):null}catch(M){p=y,m&&(m=!1,p={error:M,text:p})}}m?(i.next(new hd({body:p,headers:f,status:g,statusText:_,url:v||void 0})),i.complete()):i.error(new Bw({error:p,headers:f,status:g,statusText:_,url:v||void 0}))},c=f=>{const{url:g}=a(),_=new Bw({error:f,status:r.status||0,statusText:r.statusText||"Unknown Error",url:g||void 0});i.error(_)};let u=!1;const d=f=>{u||(i.next(a()),u=!0);let g={type:zt.DownloadProgress,loaded:f.loaded};f.lengthComputable&&(g.total=f.total),"text"===t.responseType&&r.responseText&&(g.partialText=r.responseText),i.next(g)},h=f=>{let g={type:zt.UploadProgress,loaded:f.loaded};f.lengthComputable&&(g.total=f.total),i.next(g)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",d),null!==o&&r.upload&&r.upload.addEventListener("progress",h)),r.send(o),i.next({type:zt.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",d),null!==o&&r.upload&&r.upload.removeEventListener("progress",h)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(K(YE))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Qm=new ne("XSRF_ENABLED"),jw=new ne("XSRF_COOKIE_NAME",{providedIn:"root",factory:()=>"XSRF-TOKEN"}),Ww=new ne("XSRF_HEADER_NAME",{providedIn:"root",factory:()=>"X-XSRF-TOKEN"});class $w{}let JB=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=kE(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(K(xt),K(vu),K(jw))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function e3(n,e){const t=n.url.toLowerCase();if(!Ne(Qm)||"GET"===n.method||"HEAD"===n.method||t.startsWith("http://")||t.startsWith("https://"))return e(n);const i=Ne($w).getToken(),r=Ne(Ww);return null!=i&&!n.headers.has(r)&&(n=n.clone({headers:n.headers.set(r,i)})),e(n)}var Ft=(()=>((Ft=Ft||{})[Ft.Interceptors=0]="Interceptors",Ft[Ft.LegacyInterceptors=1]="LegacyInterceptors",Ft[Ft.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",Ft[Ft.NoXsrfProtection=3]="NoXsrfProtection",Ft[Ft.JsonpSupport=4]="JsonpSupport",Ft[Ft.RequestsMadeViaParent=5]="RequestsMadeViaParent",Ft))();function Zs(n,e){return{\u0275kind:n,\u0275providers:e}}function t3(...n){const e=[Km,Gw,Hw,{provide:ud,useExisting:Hw},{provide:qm,useExisting:Gw},{provide:kl,useValue:e3,multi:!0},{provide:Qm,useValue:!0},{provide:$w,useClass:JB}];for(const t of n)e.push(...t.\u0275providers);return function $I(n){return{\u0275providers:n}}(e)}const qw=new ne("LEGACY_INTERCEPTOR_FN");let Jm,r3=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({providers:[t3(Zs(Ft.LegacyInterceptors,[{provide:qw,useFactory:WB},{provide:kl,useExisting:qw,multi:!0}]))]}),n})();try{Jm=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Jm=!1}let Ul,Xw=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?function YO(n){return n===qE}(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!Jm)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(K(vu))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function fd(n){return function o3(){if(null==Ul&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Ul=!0}))}finally{Ul=Ul||!1}return Ul}()?n:!!n.capture}function Zw(n){return Array.isArray(n)?n:[n]}function Kw(n){return n instanceof Bi?n.nativeElement:n}class _3 extends Dn{constructor(e,t){super()}schedule(e,t=0){return this}}const md={setInterval(n,e,...t){const{delegate:i}=md;return i?.setInterval?i.setInterval(n,e,...t):setInterval(n,e,...t)},clearInterval(n){const{delegate:e}=md;return(e?.clearInterval||clearInterval)(n)},delegate:void 0},Qw={now:()=>(Qw.delegate||Date).now(),delegate:void 0};class Bl{constructor(e,t=Bl.now){this.schedulerActionCtor=e,this.now=t}schedule(e,t=0,i){return new this.schedulerActionCtor(this,e).schedule(i,t)}}Bl.now=Qw.now;const M3=new class y3 extends Bl{constructor(e,t=Bl.now){super(e,t),this.actions=[],this._active=!1}flush(e){const{actions:t}=this;if(this._active)return void t.push(e);let i;this._active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}(class v3 extends _3{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){var i;if(this.closed)return this;this.state=e;const r=this.id,o=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(o,r,t)),this.pending=!0,this.delay=t,this.id=null!==(i=this.id)&&void 0!==i?i:this.requestAsyncId(o,this.id,t),this}requestAsyncId(e,t,i=0){return md.setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!=i&&this.delay===i&&!1===this.pending)return t;null!=t&&md.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r}unsubscribe(){if(!this.closed){const{id:e,scheduler:t}=this,{actions:i}=t;this.work=this.state=this.scheduler=null,this.pending=!1,Qo(i,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}});function E3(n){return kt((e,t)=>{Yn(n).subscribe(At(t,()=>t.complete(),Qd)),!t.closed&&e.subscribe(t)})}const Jw=new Set;let Qs,b3=(()=>{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):S3}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&function w3(n){if(!Jw.has(n))try{Qs||(Qs=document.createElement("style"),Qs.setAttribute("type","text/css"),document.head.appendChild(Qs)),Qs.sheet&&(Qs.sheet.insertRule(`@media ${n} {body{ }}`,0),Jw.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(K(Xw))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function S3(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let D3=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new Ai}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return eS(Zw(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let o=gm(eS(Zw(t)).map(s=>this._registerQuery(s).observable));return o=Hu(o.pipe(kr(1)),o.pipe(function g3(n){return qi((e,t)=>n<=t)}(1),function x3(n,e=M3){return kt((t,i)=>{let r=null,o=null,s=null;const a=()=>{if(r){r.unsubscribe(),r=null;const c=o;o=null,i.next(c)}};function l(){const c=s+n,u=e.now();if(u<c)return r=this.schedule(void 0,c-u),void i.add(r);a()}t.subscribe(At(i,c=>{o=c,s=e.now(),r||(r=e.schedule(l,n),i.add(r))},()=>{a(),i.complete()},void 0,()=>{o=r=null}))})}(0))),o.pipe(De(s=>{const a={matches:!1,breakpoints:{}};return s.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),o={observable:new bt(s=>{const a=l=>this._zone.run(()=>s.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(Cb(i),De(({matches:s})=>({query:t,matches:s})),E3(this._destroySubject)),mql:i};return this._queries.set(t,o),o}}return n.\u0275fac=function(t){return new(t||n)(K(b3),K(Dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function eS(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}const rS="cdk-high-contrast-black-on-white",oS="cdk-high-contrast-white-on-black",tg="cdk-high-contrast-active";let k3=(()=>{class n{constructor(t,i){this._platform=t,this._document=i,this._breakpointSubscription=Ne(D3).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,o=(r&&r.backgroundColor||"").replace(/ /g,"");switch(t.remove(),o){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return 2;case"rgb(255,255,255)":case"rgb(255,250,239)":return 1}return 0}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(tg,rS,oS),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?t.add(tg,rS):2===i&&t.add(tg,oS)}}}return n.\u0275fac=function(t){return new(t||n)(K(Xw),K(xt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),sS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({}),n})();const H3=new ne("mat-sanity-checks",{providedIn:"root",factory:function z3(){return!0}});let cS=(()=>{class n{constructor(t,i,r){this._sanityChecks=i,this._document=r,this._hasDoneGlobalChecks=!1,t._applyBodyHighContrastModeCssClasses(),this._hasDoneGlobalChecks||(this._hasDoneGlobalChecks=!0)}_checkIsEnabled(t){return!function l3(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}()&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}}return n.\u0275fac=function(t){return new(t||n)(K(k3),K(H3,8),K(xt))},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({imports:[sS,sS]}),n})();function V3(n,e){return class extends n{get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}constructor(...t){super(...t),this.defaultColor=e,this.color=e}}}class j3{constructor(e,t,i,r=!1){this._renderer=e,this.element=t,this.config=i,this._animationForciblyDisabledThroughCss=r,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const uS=fd({passive:!0,capture:!0});class W3{constructor(){this._events=new Map,this._delegateEventHandler=e=>{const t=function a3(n){return n.composedPath?n.composedPath()[0]:n.target}(e);t&&this._events.get(e.type)?.forEach((i,r)=>{(r===t||r.contains(t))&&i.forEach(o=>o.handleEvent(e))})}}addHandler(e,t,i,r){const o=this._events.get(t);if(o){const s=o.get(i);s?s.add(r):o.set(i,new Set([r]))}else this._events.set(t,new Map([[i,new Set([r])]])),e.runOutsideAngular(()=>{document.addEventListener(t,this._delegateEventHandler,uS)})}removeHandler(e,t,i){const r=this._events.get(e);if(!r)return;const o=r.get(t);o&&(o.delete(i),0===o.size&&r.delete(t),0===r.size&&(this._events.delete(e),document.removeEventListener(e,this._delegateEventHandler,uS)))}}const dS={enterDuration:225,exitDuration:150},hS=fd({passive:!0,capture:!0}),fS=["mousedown","touchstart"],pS=["mouseup","mouseleave","touchend","touchcancel"];class gd{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._platform=r,this._isPointerDown=!1,this._activeRipples=new Map,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Kw(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o={...dS,...i.animation};i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const s=i.radius||function q3(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=o.enterDuration,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=a-s+"px",u.style.top=l-s+"px",u.style.height=2*s+"px",u.style.width=2*s+"px",null!=i.color&&(u.style.backgroundColor=i.color),u.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(u);const d=window.getComputedStyle(u),f=d.transitionDuration,g="none"===d.transitionProperty||"0s"===f||"0s, 0s"===f||0===r.width&&0===r.height,_=new j3(this,u,i,g);u.style.transform="scale3d(1, 1, 1)",_.state=0,i.persistent||(this._mostRecentTransientRipple=_);let v=null;return!g&&(c||o.exitDuration)&&this._ngZone.runOutsideAngular(()=>{const p=()=>this._finishRippleTransition(_),m=()=>this._destroyRipple(_);u.addEventListener("transitionend",p),u.addEventListener("transitioncancel",m),v={onTransitionEnd:p,onTransitionCancel:m}}),this._activeRipples.set(_,v),(g||!c)&&this._finishRippleTransition(_),_}fadeOutRipple(e){if(2===e.state||3===e.state)return;const t=e.element,i={...dS,...e.config.animation};t.style.transitionDuration=`${i.exitDuration}ms`,t.style.opacity="0",e.state=2,(e._animationForciblyDisabledThroughCss||!i.exitDuration)&&this._finishRippleTransition(e)}fadeOutAll(){this._getActiveRipples().forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Kw(e);!this._platform.isBrowser||!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,fS.forEach(i=>{gd._eventManager.addHandler(this._ngZone,i,t,this)}))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{pS.forEach(t=>{this._triggerElement.addEventListener(t,this,hS)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(e){0===e.state?this._startFadeOutTransition(e):2===e.state&&this._destroyRipple(e)}_startFadeOutTransition(e){const t=e===this._mostRecentTransientRipple,{persistent:i}=e.config;e.state=1,!i&&(!t||!this._isPointerDown)&&e.fadeOut()}_destroyRipple(e){const t=this._activeRipples.get(e)??null;this._activeRipples.delete(e),this._activeRipples.size||(this._containerRect=null),e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),e.state=3,null!==t&&(e.element.removeEventListener("transitionend",t.onTransitionEnd),e.element.removeEventListener("transitioncancel",t.onTransitionCancel)),e.element.remove()}_onMousedown(e){const t=function F3(n){return 0===n.buttons||0===n.offsetX&&0===n.offsetY}(e),i=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+800;!this._target.rippleDisabled&&!t&&!i&&(this._isPointerDown=!0,this.fadeInRipple(e.clientX,e.clientY,this._target.rippleConfig))}_onTouchStart(e){if(!this._target.rippleDisabled&&!function N3(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}(e)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;const t=e.changedTouches;for(let i=0;i<t.length;i++)this.fadeInRipple(t[i].clientX,t[i].clientY,this._target.rippleConfig)}}_onPointerUp(){this._isPointerDown&&(this._isPointerDown=!1,this._getActiveRipples().forEach(e=>{!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){const e=this._triggerElement;e&&(fS.forEach(t=>gd._eventManager.removeHandler(t,e,this)),this._pointerUpEventsRegistered&&pS.forEach(t=>e.removeEventListener(t,this,hS)))}}gd._eventManager=new W3;const Y3=["*"];let _d;function Hl(n){return function Z3(){if(void 0===_d&&(_d=null,typeof window<"u")){const n=window;void 0!==n.trustedTypes&&(_d=n.trustedTypes.createPolicy("angular#components",{createHTML:e=>e}))}return _d}()?.createHTML(n)||n}function mS(n){return Error(`Unable to find icon with the name "${n}"`)}function gS(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function _S(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class ko{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let Vl=(()=>{class n{constructor(t,i,r,o){this._httpClient=t,this._sanitizer=i,this._errorHandler=o,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass=["material-icons","mat-ligature-font"],this._document=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,o){return this._addSvgIconConfig(t,i,new ko(r,null,o))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,o){const s=this._sanitizer.sanitize(tt.HTML,r);if(!s)throw _S(r);const a=Hl(s);return this._addSvgIconConfig(t,i,new ko("",a,o))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new ko(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const o=this._sanitizer.sanitize(tt.HTML,i);if(!o)throw _S(i);const s=Hl(o);return this._addSvgIconSetConfig(t,new ko("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(tt.RESOURCE_URL,t);if(!i)throw gS(t);const r=this._cachedIconsByUrl.get(i);return r?fe(vd(r)):this._loadSvgIconFromConfig(new ko(t,null)).pipe($t(o=>this._cachedIconsByUrl.set(i,o)),De(o=>vd(o)))}getNamedSvgIcon(t,i=""){const r=vS(i,t);let o=this._svgIconConfigs.get(r);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(i,t),o)return this._svgIconConfigs.set(r,o),this._getSvgFromConfig(o);const s=this._iconSetConfigs.get(i);return s?this._getSvgFromIconSetConfigs(t,s):zs(mS(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?fe(vd(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(De(i=>vd(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?fe(r):function X3(...n){const e=R_(n),{args:t,keys:i}=xb(n),r=new bt(o=>{const{length:s}=t;if(!s)return void o.complete();const a=new Array(s);let l=s,c=s;for(let u=0;u<s;u++){let d=!1;Yn(t[u]).subscribe(At(o,h=>{d||(d=!0,c--),a[u]=h},()=>l--,void 0,()=>{(!l||!d)&&(c||o.next(i?bb(i,a):a),o.complete())}))}});return e?r.pipe(Eb(e)):r}(i.filter(s=>!s.svgText).map(s=>this._loadSvgIconSetFromConfig(s).pipe(gr(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(tt.RESOURCE_URL,s.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),fe(null)})))).pipe(De(()=>{const s=this._extractIconWithNameFromAnySet(t,i);if(!s)throw mS(t);return s}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const o=i[r];if(o.svgText&&o.svgText.toString().indexOf(t)>-1){const s=this._svgElementFromConfig(o),a=this._extractSvgIconFromSet(s,t,o.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe($t(i=>t.svgText=i),De(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?fe(null):this._fetchIcon(t).pipe($t(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const o=t.querySelector(`[id="${i}"]`);if(!o)return null;const s=o.cloneNode(!0);if(s.removeAttribute("id"),"svg"===s.nodeName.toLowerCase())return this._setSvgAttributes(s,r);if("symbol"===s.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(s),r);const a=this._svgElementFromString(Hl("<svg></svg>"));return a.appendChild(s),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error("<svg> tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(Hl("<svg></svg>")),r=t.attributes;for(let o=0;o<r.length;o++){const{name:s,value:a}=r[o];"id"!==s&&i.setAttribute(s,a)}for(let o=0;o<t.childNodes.length;o++)t.childNodes[o].nodeType===this._document.ELEMENT_NODE&&i.appendChild(t.childNodes[o].cloneNode(!0));return i}_setSvgAttributes(t,i){return t.setAttribute("fit",""),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("focusable","false"),i&&i.viewBox&&t.setAttribute("viewBox",i.viewBox),t}_fetchIcon(t){const{url:i,options:r}=t,o=r?.withCredentials??!1;if(!this._httpClient)throw function K3(){return Error("Could not find HttpClient provider for use with Angular Material icons. Please include the HttpClientModule from @angular/common/http in your app imports.")}();if(null==i)throw Error(`Cannot fetch icon from URL "${i}".`);const s=this._sanitizer.sanitize(tt.RESOURCE_URL,i);if(!s)throw gS(i);const a=this._inProgressUrlFetches.get(s);if(a)return a;const l=this._httpClient.get(s,{responseType:"text",withCredentials:o}).pipe(De(c=>Hl(c)),Gu(()=>this._inProgressUrlFetches.delete(s)),N_());return this._inProgressUrlFetches.set(s,l),l}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(vS(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;r<this._resolvers.length;r++){const o=this._resolvers[r](i,t);if(o)return J3(o)?new ko(o.url,null,o.options):new ko(o,null)}}}return n.\u0275fac=function(t){return new(t||n)(K(Km,8),K(Bu),K(xt,8),K(cr))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function vd(n){return n.cloneNode(!0)}function vS(n,e){return n+":"+e}function J3(n){return!(!n.url||!n.options)}const ez=V3(class{constructor(n){this._elementRef=n}}),tz=new ne("MAT_ICON_DEFAULT_OPTIONS"),nz=new ne("mat-icon-location",{providedIn:"root",factory:function iz(){const n=Ne(xt),e=n?n.location:null;return{getPathname:()=>e?e.pathname+e.search:""}}}),yS=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],rz=yS.map(n=>`[${n}]`).join(", "),oz=/^url\(['"]?#(.*?)['"]?\)$/;let yd=(()=>{class n extends ez{get inline(){return this._inline}set inline(t){this._inline=function p3(n){return null!=n&&"false"!=`${n}`}(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}constructor(t,i,r,o,s,a){super(t),this._iconRegistry=i,this._location=o,this._errorHandler=s,this._inline=!1,this._previousFontSetClass=[],this._currentIconFetch=Dn.EMPTY,a&&(a.color&&(this.color=this.defaultColor=a.color),a.fontSet&&(this.fontSet=a.fontSet)),r||t.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=this._location.getPathname();this._previousPath=i,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(i),this._elementRef.nativeElement.appendChild(t)}_clearSvgElement(){const t=this._elementRef.nativeElement;let i=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();i--;){const r=t.childNodes[i];(1!==r.nodeType||"svg"===r.nodeName.toLowerCase())&&r.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;const t=this._elementRef.nativeElement,i=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(r=>r.length>0);this._previousFontSetClass.forEach(r=>t.classList.remove(r)),i.forEach(r=>t.classList.add(r)),this._previousFontSetClass=i,this.fontIcon!==this._previousFontIconClass&&!i.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(t){return"string"==typeof t?t.trim().split(" ")[0]:t}_prependPathToReferences(t){const i=this._elementsWithExternalReferences;i&&i.forEach((r,o)=>{r.forEach(s=>{o.setAttribute(s.name,`url('${t}#${s.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(rz),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o<i.length;o++)yS.forEach(s=>{const a=i[o],l=a.getAttribute(s),c=l?l.match(oz):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:s,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(kr(1)).subscribe(o=>this._setSvgElement(o),o=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${o.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(he(Bi),he(Vl),function za(n){return function hA(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r<i;){const o=t[r];if(_v(o))break;if(0===o)r+=2;else if("number"==typeof o)for(r++;r<i&&"string"==typeof t[r];)r++;else{if(o===e)return t[r+1];r+=2}}}return null}(Jt(),n)}("aria-hidden"),he(nz),he(cr),he(tz,8))},n.\u0275cmp=Cn({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:8,hostBindings:function(t,i){2&t&&(ru("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet)("fontIcon",i._usingFontIcon()?i.fontIcon:null),Jf("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[jf],ngContentSelectors:Y3,decls:1,vars:0,template:function(t,i){1&t&&(So(),Do(0))},styles:[".mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],encapsulation:2,changeDetection:0}),n})(),sz=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Li({type:n}),n.\u0275inj=ci({imports:[cS,cS]}),n})();const az=["*"];let lz=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-page"]],ngContentSelectors:az,decls:2,vars:0,consts:[[1,"page"]],template:function(t,i){1&t&&(So(),yt(0,"div",0),Do(1),Mt())},styles:[".page[_ngcontent-%COMP%]{width:100vw;height:100vh;overflow:hidden;position:relative;z-index:1}"]}),n})(),cz=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-root"]],decls:2,vars:0,template:function(t,i){1&t&&(yt(0,"app-page"),Vn(1,"router-outlet"),Mt())},dependencies:[Lm,lz],encapsulation:2}),n})();function MS(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function ng(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){MS(o,i,r,s,a,"next",l)}function a(l){MS(o,i,r,s,a,"throw",l)}s(void 0)})}}const uz=0,xS=1,dz=2,ES=1,hz=2,Gl=3,jl=0,qt=1,Js=2,jr=0,Wl=1,bS=2,wS=3,SS=4,pz=5,ea=100,mz=101,gz=102,DS=103,CS=104,_z=200,vz=201,yz=202,Mz=203,TS=204,AS=205,xz=206,Ez=207,bz=208,wz=209,Sz=210,Dz=0,Cz=1,Tz=2,ig=3,Az=4,Iz=5,Rz=6,Pz=7,IS=0,Lz=1,Fz=2,Uo=0,Nz=1,Oz=2,kz=3,Uz=4,Bz=5,Md=301,xd=302,rg=303,og=304,Ed=306,sg=307,ag=1e3,Wn=1001,lg=1002,Fn=1003,PS=1004,LS=1005,Zi=1006,zz=1007,bd=1008,Wr=1009,Hz=1010,Vz=1011,cg=1012,Gz=1013,wd=1014,$r=1015,ta=1016,jz=1017,Wz=1018,$z=1019,Sd=1020,qz=1021,$l=1022,Mn=1023,Xz=1024,Yz=1025,Zz=Mn,ug=1026,dg=1027,Kz=1028,Qz=1029,Jz=1030,eH=1031,tH=1032,nH=1033,FS=33776,NS=33777,OS=33778,kS=33779,US=35840,BS=35841,zS=35842,HS=35843,iH=36196,VS=37492,GS=37496,rH=37808,oH=37809,sH=37810,aH=37811,lH=37812,cH=37813,uH=37814,dH=37815,hH=37816,fH=37817,pH=37818,mH=37819,gH=37820,_H=37821,vH=36492,yH=37840,MH=37841,xH=37842,EH=37843,bH=37844,wH=37845,SH=37846,DH=37847,CH=37848,TH=37849,AH=37850,IH=37851,RH=37852,PH=37853,xn=3e3,na=3001,hg=3007,fg=3002,LH=3003,jS=3004,WS=3005,$S=3006,NH=3201,OH=0,kH=1,XS="300 es",Cd=Math.PI/180,mg=180/Math.PI,tn=[];for(let n=0;n<256;n++)tn[n]=(n<16?"0":"")+n.toString(16);const BH=typeof crypto<"u"&&"randomUUID"in crypto;function ql(){if(BH)return crypto.randomUUID().toUpperCase();const n=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(tn[255&n]+tn[n>>8&255]+tn[n>>16&255]+tn[n>>24&255]+"-"+tn[255&e]+tn[e>>8&255]+"-"+tn[e>>16&15|64]+tn[e>>24&255]+"-"+tn[63&t|128]+tn[t>>8&255]+"-"+tn[t>>16&255]+tn[t>>24&255]+tn[255&i]+tn[i>>8&255]+tn[i>>16&255]+tn[i>>24&255]).toUpperCase()}function Nt(n,e,t){return Math.max(e,Math.min(t,n))}function Td(n,e,t){return(1-t)*n+t*e}function Xl(n){return n*Cd}function ZS(n){return 0==(n&n-1)&&0!==n}function zH(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}class qr{constructor(e=0,t=0,i=0,r=1){this._x=e,this._y=t,this._z=i,this._w=r}static slerp(e,t,i,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,r)}static slerpFlat(e,t,i,r,o,s,a){let l=i[r+0],c=i[r+1],u=i[r+2],d=i[r+3];const h=o[s+0],f=o[s+1],g=o[s+2],_=o[s+3];if(0===a)return e[t+0]=l,e[t+1]=c,e[t+2]=u,void(e[t+3]=d);if(1===a)return e[t+0]=h,e[t+1]=f,e[t+2]=g,void(e[t+3]=_);if(d!==_||l!==h||c!==f||u!==g){let v=1-a;const p=l*h+c*f+u*g+d*_,m=p>=0?1:-1,y=1-p*p;if(y>Number.EPSILON){const w=Math.sqrt(y),C=Math.atan2(w,p*m);v=Math.sin(v*C)/w,a=Math.sin(a*C)/w}const M=a*m;if(l=l*v+h*M,c=c*v+f*M,u=u*v+g*M,d=d*v+_*M,v===1-a){const w=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=w,c*=w,u*=w,d*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,o,s){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],d=o[s],h=o[s+1],f=o[s+2],g=o[s+3];return e[t]=a*g+u*d+l*f-c*h,e[t+1]=l*g+u*h+c*d-a*f,e[t+2]=c*g+u*f+a*h-l*d,e[t+3]=u*g-a*d-l*h-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=e._x,r=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),d=a(o/2),h=l(i/2),f=l(r/2),g=l(o/2);switch(s){case"XYZ":this._x=h*u*d+c*f*g,this._y=c*f*d-h*u*g,this._z=c*u*g+h*f*d,this._w=c*u*d-h*f*g;break;case"YXZ":this._x=h*u*d+c*f*g,this._y=c*f*d-h*u*g,this._z=c*u*g-h*f*d,this._w=c*u*d+h*f*g;break;case"ZXY":this._x=h*u*d-c*f*g,this._y=c*f*d+h*u*g,this._z=c*u*g+h*f*d,this._w=c*u*d-h*f*g;break;case"ZYX":this._x=h*u*d-c*f*g,this._y=c*f*d+h*u*g,this._z=c*u*g-h*f*d,this._w=c*u*d+h*f*g;break;case"YZX":this._x=h*u*d+c*f*g,this._y=c*f*d+h*u*g,this._z=c*u*g-h*f*d,this._w=c*u*d-h*f*g;break;case"XZY":this._x=h*u*d-c*f*g,this._y=c*f*d-h*u*g,this._z=c*u*g+h*f*d,this._w=c*u*d+h*f*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],o=t[8],s=t[1],a=t[5],l=t[9],c=t[2],u=t[6],d=t[10],h=i+a+d;if(h>0){const f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(u-l)*f,this._y=(o-c)*f,this._z=(s-r)*f}else if(i>a&&i>d){const f=2*Math.sqrt(1+i-a-d);this._w=(u-l)/f,this._x=.25*f,this._y=(r+s)/f,this._z=(o+c)/f}else if(a>d){const f=2*Math.sqrt(1+a-i-d);this._w=(o-c)/f,this._x=(r+s)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+d-i-a);this._w=(s-r)/f,this._x=(o+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Nt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(0===i)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,o=e._z,s=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+s*a+r*c-o*l,this._y=r*u+s*l+o*a-i*c,this._z=o*u+s*c+i*l-r*a,this._w=s*u-i*a-r*l-o*c,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const i=this._x,r=this._y,o=this._z,s=this._w;let a=s*e._w+i*e._x+r*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=i,this._y=r,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-t;return this._w=f*s+t*this._w,this._x=f*i+t*this._x,this._y=f*r+t*this._y,this._z=f*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),d=Math.sin((1-t)*u)/c,h=Math.sin(t*u)/c;return this._w=s*d+this._w*h,this._x=i*d+this._x*h,this._y=r*d+this._y*h,this._z=o*d+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(t*Math.cos(r),i*Math.sin(o),i*Math.cos(o),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}qr.prototype.isQuaternion=!0;class I{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(KS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(KS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,o=e.elements;return this.x=o[0]*t+o[3]*i+o[6]*r,this.y=o[1]*t+o[4]*i+o[7]*r,this.z=o[2]*t+o[5]*i+o[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,o=e.elements,s=1/(o[3]*t+o[7]*i+o[11]*r+o[15]);return this.x=(o[0]*t+o[4]*i+o[8]*r+o[12])*s,this.y=(o[1]*t+o[5]*i+o[9]*r+o[13])*s,this.z=(o[2]*t+o[6]*i+o[10]*r+o[14])*s,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,o=e.x,s=e.y,a=e.z,l=e.w,c=l*t+s*r-a*i,u=l*i+a*t-o*r,d=l*r+o*i-s*t,h=-o*t-s*i-a*r;return this.x=c*l+h*-o+u*-a-d*-s,this.y=u*l+h*-s+d*-o-c*-a,this.z=d*l+h*-a+c*-s-u*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r,this.y=o[1]*t+o[5]*i+o[9]*r,this.z=o[2]*t+o[6]*i+o[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,o=e.z,s=t.x,a=t.y,l=t.z;return this.x=r*l-o*a,this.y=o*s-i*l,this.z=i*a-r*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return gg.copy(this).projectOnVector(e),this.sub(gg)}reflect(e){return this.sub(gg.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Nt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}I.prototype.isVector3=!0;const gg=new I,KS=new qr;class Bo{constructor(e=new I(1/0,1/0,1/0),t=new I(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.length;l<c;l+=3){const u=e[l],d=e[l+1],h=e[l+2];u<t&&(t=u),d<i&&(i=d),h<r&&(r=h),u>o&&(o=u),d>s&&(s=d),h>a&&(a=h)}return this.min.set(t,i,r),this.max.set(o,s,a),this}setFromBufferAttribute(e){let t=1/0,i=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.count;l<c;l++){const u=e.getX(l),d=e.getY(l),h=e.getZ(l);u<t&&(t=u),d<i&&(i=d),h<r&&(r=h),u>o&&(o=u),d>s&&(s=d),h>a&&(a=h)}return this.min.set(t,i,r),this.max.set(o,s,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Yl.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),_g.copy(t.boundingBox),_g.applyMatrix4(e.matrixWorld),this.union(_g));const i=e.children;for(let r=0,o=i.length;r<o;r++)this.expandByObject(i[r]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Yl),Yl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Zl),Ad.subVectors(this.max,Zl),ia.subVectors(e.a,Zl),ra.subVectors(e.b,Zl),oa.subVectors(e.c,Zl),Xr.subVectors(ra,ia),Yr.subVectors(oa,ra),zo.subVectors(ia,oa);let t=[0,-Xr.z,Xr.y,0,-Yr.z,Yr.y,0,-zo.z,zo.y,Xr.z,0,-Xr.x,Yr.z,0,-Yr.x,zo.z,0,-zo.x,-Xr.y,Xr.x,0,-Yr.y,Yr.x,0,-zo.y,zo.x,0];return!(!vg(t,ia,ra,oa,Ad)||(t=[1,0,0,0,1,0,0,0,1],!vg(t,ia,ra,oa,Ad)))&&(Id.crossVectors(Xr,Yr),t=[Id.x,Id.y,Id.z],vg(t,ia,ra,oa,Ad))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Yl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Yl).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(yr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),yr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),yr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),yr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),yr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),yr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),yr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),yr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(yr)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Bo.prototype.isBox3=!0;const yr=[new I,new I,new I,new I,new I,new I,new I,new I],Yl=new I,_g=new Bo,ia=new I,ra=new I,oa=new I,Xr=new I,Yr=new I,zo=new I,Zl=new I,Ad=new I,Id=new I,Ho=new I;function vg(n,e,t,i,r){for(let o=0,s=n.length-3;o<=s;o+=3){Ho.fromArray(n,o);const a=r.x*Math.abs(Ho.x)+r.y*Math.abs(Ho.y)+r.z*Math.abs(Ho.z),l=e.dot(Ho),c=t.dot(Ho),u=i.dot(Ho);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const HH=new Bo,QS=new I,yg=new I,Mg=new I;class xg{constructor(e=new I,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;void 0!==t?i.copy(t):HH.setFromPoints(e).getCenter(i);let r=0;for(let o=0,s=e.length;o<s;o++)r=Math.max(r,i.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){Mg.subVectors(e,this.center);const t=Mg.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=.5*(i-this.radius);this.center.add(Mg.multiplyScalar(r/i)),this.radius+=r}return this}union(e){return yg.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(QS.copy(e.center).add(yg)),this.expandByPoint(QS.copy(e.center).sub(yg)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}class bi{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,r,o,s,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=o,u[5]=l,u[6]=i,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,o=this.elements,s=i[0],a=i[3],l=i[6],c=i[1],u=i[4],d=i[7],h=i[2],f=i[5],g=i[8],_=r[0],v=r[3],p=r[6],m=r[1],y=r[4],M=r[7],w=r[2],C=r[5],E=r[8];return o[0]=s*_+a*m+l*w,o[3]=s*v+a*y+l*C,o[6]=s*p+a*M+l*E,o[1]=c*_+u*m+d*w,o[4]=c*v+u*y+d*C,o[7]=c*p+u*M+d*E,o[2]=h*_+f*m+g*w,o[5]=h*v+f*y+g*C,o[8]=h*p+f*M+g*E,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*s*u-t*a*c-i*o*u+i*a*l+r*o*c-r*s*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*s-a*c,h=a*l-u*o,f=c*o-s*l,g=t*d+i*h+r*f;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return e[0]=d*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*s)*_,e[3]=h*_,e[4]=(u*t-r*l)*_,e[5]=(r*o-a*t)*_,e[6]=f*_,e[7]=(i*l-c*t)*_,e[8]=(s*t-i*o)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,o,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(i*l,i*c,-i*(l*s+c*a)+s+e,-r*c,r*l,-r*(-c*s+l*a)+a+t,0,0,1),this}scale(e,t){const i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),r=this.elements,o=r[0],s=r[3],a=r[6],l=r[1],c=r[4],u=r[7];return r[0]=t*o+i*l,r[3]=t*s+i*c,r[6]=t*a+i*u,r[1]=-i*o+t*l,r[4]=-i*s+t*c,r[7]=-i*a+t*u,this}translate(e,t){const i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}bi.prototype.isMatrix3=!0;const Eg=new I,VH=new I,GH=new bi;class Zr{constructor(e=new I(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Eg.subVectors(i,t).cross(VH.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const i=e.delta(Eg),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?null:t.copy(i).multiplyScalar(o).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||GH.getNormalMatrix(e),r=this.coplanarPoint(Eg).applyMatrix4(e),o=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Zr.prototype.isPlane=!0;const sa=new xg,Rd=new I;class bg{constructor(e=new Zr,t=new Zr,i=new Zr,r=new Zr,o=new Zr,s=new Zr){this.planes=[e,t,i,r,o,s]}set(e,t,i,r,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(o),a[5].copy(s),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){const t=this.planes,i=e.elements,r=i[0],o=i[1],s=i[2],a=i[3],l=i[4],c=i[5],u=i[6],d=i[7],h=i[8],f=i[9],g=i[10],_=i[11],v=i[12],p=i[13],m=i[14],y=i[15];return t[0].setComponents(a-r,d-l,_-h,y-v).normalize(),t[1].setComponents(a+r,d+l,_+h,y+v).normalize(),t[2].setComponents(a+o,d+c,_+f,y+p).normalize(),t[3].setComponents(a-o,d-c,_-f,y-p).normalize(),t[4].setComponents(a-s,d-u,_-g,y-m).normalize(),t[5].setComponents(a+s,d+u,_+g,y+m).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),sa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(sa)}intersectsSprite(e){return sa.center.set(0,0,0),sa.radius=.7071067811865476,sa.applyMatrix4(e.matrixWorld),this.intersectsSphere(sa)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Rd.x=r.normal.x>0?e.max.x:e.min.x,Rd.y=r.normal.y>0?e.max.y:e.min.y,Rd.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Rd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}class Yt{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,r,o,s,a,l,c,u,d,h,f,g,_,v){const p=this.elements;return p[0]=e,p[4]=t,p[8]=i,p[12]=r,p[1]=o,p[5]=s,p[9]=a,p[13]=l,p[2]=c,p[6]=u,p[10]=d,p[14]=h,p[3]=f,p[7]=g,p[11]=_,p[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Yt).fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/aa.setFromMatrixColumn(e,0).length(),o=1/aa.setFromMatrixColumn(e,1).length(),s=1/aa.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*o,t[5]=i[5]*o,t[6]=i[6]*o,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,i=e.x,r=e.y,o=e.z,s=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(o),d=Math.sin(o);if("XYZ"===e.order){const h=s*u,f=s*d,g=a*u,_=a*d;t[0]=l*u,t[4]=-l*d,t[8]=c,t[1]=f+g*c,t[5]=h-_*c,t[9]=-a*l,t[2]=_-h*c,t[6]=g+f*c,t[10]=s*l}else if("YXZ"===e.order){const h=l*u,f=l*d,g=c*u,_=c*d;t[0]=h+_*a,t[4]=g*a-f,t[8]=s*c,t[1]=s*d,t[5]=s*u,t[9]=-a,t[2]=f*a-g,t[6]=_+h*a,t[10]=s*l}else if("ZXY"===e.order){const h=l*u,f=l*d,g=c*u,_=c*d;t[0]=h-_*a,t[4]=-s*d,t[8]=g+f*a,t[1]=f+g*a,t[5]=s*u,t[9]=_-h*a,t[2]=-s*c,t[6]=a,t[10]=s*l}else if("ZYX"===e.order){const h=s*u,f=s*d,g=a*u,_=a*d;t[0]=l*u,t[4]=g*c-f,t[8]=h*c+_,t[1]=l*d,t[5]=_*c+h,t[9]=f*c-g,t[2]=-c,t[6]=a*l,t[10]=s*l}else if("YZX"===e.order){const h=s*l,f=s*c,g=a*l,_=a*c;t[0]=l*u,t[4]=_-h*d,t[8]=g*d+f,t[1]=d,t[5]=s*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*d+g,t[10]=h-_*d}else if("XZY"===e.order){const h=s*l,f=s*c,g=a*l,_=a*c;t[0]=l*u,t[4]=-d,t[8]=c*u,t[1]=h*d+_,t[5]=s*u,t[9]=f*d-g,t[2]=g*d-f,t[6]=a*u,t[10]=_*d+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(jH,e,WH)}lookAt(e,t,i){const r=this.elements;return $n.subVectors(e,t),0===$n.lengthSq()&&($n.z=1),$n.normalize(),Kr.crossVectors(i,$n),0===Kr.lengthSq()&&(1===Math.abs(i.z)?$n.x+=1e-4:$n.z+=1e-4,$n.normalize(),Kr.crossVectors(i,$n)),Kr.normalize(),Pd.crossVectors($n,Kr),r[0]=Kr.x,r[4]=Pd.x,r[8]=$n.x,r[1]=Kr.y,r[5]=Pd.y,r[9]=$n.y,r[2]=Kr.z,r[6]=Pd.z,r[10]=$n.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,o=this.elements,s=i[0],a=i[4],l=i[8],c=i[12],u=i[1],d=i[5],h=i[9],f=i[13],g=i[2],_=i[6],v=i[10],p=i[14],m=i[3],y=i[7],M=i[11],w=i[15],C=r[0],E=r[4],B=r[8],q=r[12],H=r[1],R=r[5],ee=r[9],N=r[13],U=r[2],z=r[6],O=r[10],k=r[14],Y=r[3],me=r[7],Ee=r[11],de=r[15];return o[0]=s*C+a*H+l*U+c*Y,o[4]=s*E+a*R+l*z+c*me,o[8]=s*B+a*ee+l*O+c*Ee,o[12]=s*q+a*N+l*k+c*de,o[1]=u*C+d*H+h*U+f*Y,o[5]=u*E+d*R+h*z+f*me,o[9]=u*B+d*ee+h*O+f*Ee,o[13]=u*q+d*N+h*k+f*de,o[2]=g*C+_*H+v*U+p*Y,o[6]=g*E+_*R+v*z+p*me,o[10]=g*B+_*ee+v*O+p*Ee,o[14]=g*q+_*N+v*k+p*de,o[3]=m*C+y*H+M*U+w*Y,o[7]=m*E+y*R+M*z+w*me,o[11]=m*B+y*ee+M*O+w*Ee,o[15]=m*q+y*N+M*k+w*de,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],o=e[12],s=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],h=e[10],f=e[14];return e[3]*(+o*l*d-r*c*d-o*a*h+i*c*h+r*a*f-i*l*f)+e[7]*(+t*l*f-t*c*h+o*s*h-r*s*f+r*c*u-o*l*u)+e[11]*(+t*c*d-t*a*f-o*s*d+i*s*f+o*a*u-i*c*u)+e[15]*(-r*a*u-t*l*d+t*a*h+r*s*d-i*s*h+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],h=e[10],f=e[11],g=e[12],_=e[13],v=e[14],p=e[15],m=d*v*c-_*h*c+_*l*f-a*v*f-d*l*p+a*h*p,y=g*h*c-u*v*c-g*l*f+s*v*f+u*l*p-s*h*p,M=u*_*c-g*d*c+g*a*f-s*_*f-u*a*p+s*d*p,w=g*d*l-u*_*l-g*a*h+s*_*h+u*a*v-s*d*v,C=t*m+i*y+r*M+o*w;if(0===C)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/C;return e[0]=m*E,e[1]=(_*h*o-d*v*o-_*r*f+i*v*f+d*r*p-i*h*p)*E,e[2]=(a*v*o-_*l*o+_*r*c-i*v*c-a*r*p+i*l*p)*E,e[3]=(d*l*o-a*h*o-d*r*c+i*h*c+a*r*f-i*l*f)*E,e[4]=y*E,e[5]=(u*v*o-g*h*o+g*r*f-t*v*f-u*r*p+t*h*p)*E,e[6]=(g*l*o-s*v*o-g*r*c+t*v*c+s*r*p-t*l*p)*E,e[7]=(s*h*o-u*l*o+u*r*c-t*h*c-s*r*f+t*l*f)*E,e[8]=M*E,e[9]=(g*d*o-u*_*o-g*i*f+t*_*f+u*i*p-t*d*p)*E,e[10]=(s*_*o-g*a*o+g*i*c-t*_*c-s*i*p+t*a*p)*E,e[11]=(u*a*o-s*d*o-u*i*c+t*d*c+s*i*f-t*a*f)*E,e[12]=w*E,e[13]=(u*_*r-g*d*r+g*i*h-t*_*h-u*i*v+t*d*v)*E,e[14]=(g*a*r-s*_*r-g*i*l+t*_*l+s*i*v-t*a*v)*E,e[15]=(s*d*r-u*a*r+u*i*l-t*d*l-s*i*h+t*a*h)*E,this}scale(e){const t=this.elements,i=e.x,r=e.y,o=e.z;return t[0]*=i,t[4]*=r,t[8]*=o,t[1]*=i,t[5]*=r,t[9]*=o,t[2]*=i,t[6]*=r,t[10]*=o,t[3]*=i,t[7]*=r,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),o=1-i,s=e.x,a=e.y,l=e.z,c=o*s,u=o*a;return this.set(c*s+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*s,0,c*l-r*a,u*l+r*s,o*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,o,s){return this.set(1,i,o,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,o=t._x,s=t._y,a=t._z,l=t._w,c=o+o,u=s+s,d=a+a,h=o*c,f=o*u,g=o*d,_=s*u,v=s*d,p=a*d,m=l*c,y=l*u,M=l*d,w=i.x,C=i.y,E=i.z;return r[0]=(1-(_+p))*w,r[1]=(f+M)*w,r[2]=(g-y)*w,r[3]=0,r[4]=(f-M)*C,r[5]=(1-(h+p))*C,r[6]=(v+m)*C,r[7]=0,r[8]=(g+y)*E,r[9]=(v-m)*E,r[10]=(1-(h+_))*E,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let o=aa.set(r[0],r[1],r[2]).length();const s=aa.set(r[4],r[5],r[6]).length(),a=aa.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),e.x=r[12],e.y=r[13],e.z=r[14],wi.copy(this);const c=1/o,u=1/s,d=1/a;return wi.elements[0]*=c,wi.elements[1]*=c,wi.elements[2]*=c,wi.elements[4]*=u,wi.elements[5]*=u,wi.elements[6]*=u,wi.elements[8]*=d,wi.elements[9]*=d,wi.elements[10]*=d,t.setFromRotationMatrix(wi),i.x=o,i.y=s,i.z=a,this}makePerspective(e,t,i,r,o,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,c=2*o/(i-r),u=(t+e)/(t-e),d=(i+r)/(i-r),h=-(s+o)/(s-o),f=-2*s*o/(s-o);return a[0]=2*o/(t-e),a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,r,o,s){const a=this.elements,l=1/(t-e),c=1/(i-r),u=1/(s-o),d=(t+e)*l,h=(i+r)*c,f=(s+o)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}Yt.prototype.isMatrix4=!0;const aa=new I,wi=new Yt,jH=new I(0,0,0),WH=new I(1,1,1),Kr=new I,Pd=new I,$n=new I;class En{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r+s[12]*o,this.y=s[1]*t+s[5]*i+s[9]*r+s[13]*o,this.z=s[2]*t+s[6]*i+s[10]*r+s[14]*o,this.w=s[3]*t+s[7]*i+s[11]*r+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,o;const l=e.elements,c=l[0],u=l[4],d=l[8],h=l[1],f=l[5],g=l[9],_=l[2],v=l[6],p=l[10];if(Math.abs(u-h)<.01&&Math.abs(d-_)<.01&&Math.abs(g-v)<.01){if(Math.abs(u+h)<.1&&Math.abs(d+_)<.1&&Math.abs(g+v)<.1&&Math.abs(c+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(c+1)/2,M=(f+1)/2,w=(p+1)/2,C=(u+h)/4,E=(d+_)/4,B=(g+v)/4;return y>M&&y>w?y<.01?(i=0,r=.707106781,o=.707106781):(i=Math.sqrt(y),r=C/i,o=E/i):M>w?M<.01?(i=.707106781,r=0,o=.707106781):(r=Math.sqrt(M),i=C/r,o=B/r):w<.01?(i=.707106781,r=.707106781,o=0):(o=Math.sqrt(w),i=E/o,r=B/o),this.set(i,r,o,t),this}let m=Math.sqrt((v-g)*(v-g)+(d-_)*(d-_)+(h-u)*(h-u));return Math.abs(m)<.001&&(m=1),this.x=(v-g)/m,this.y=(d-_)/m,this.z=(h-u)/m,this.w=Math.acos((c+f+p-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}function JS(){let n=null,e=!1,t=null,i=null;function r(o,s){t(o,s),i=n.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==t&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){n=o}}}function $H(n,e){const t=e.isWebGL2,i=new WeakMap;return{get:function s(c){return c.isInterleavedBufferAttribute&&(c=c.data),i.get(c)},remove:function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=i.get(c);u&&(n.deleteBuffer(u.buffer),i.delete(c))},update:function l(c,u){if(c.isGLBufferAttribute){const h=i.get(c);return void((!h||h.version<c.version)&&i.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version}))}c.isInterleavedBufferAttribute&&(c=c.data);const d=i.get(c);void 0===d?i.set(c,function r(c,u){const d=c.array,h=c.usage,f=n.createBuffer();n.bindBuffer(u,f),n.bufferData(u,d,h),c.onUploadCallback();let g=n.FLOAT;return d instanceof Float32Array?g=n.FLOAT:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c.isFloat16BufferAttribute?t?g=n.HALF_FLOAT:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):g=n.UNSIGNED_SHORT:d instanceof Int16Array?g=n.SHORT:d instanceof Uint32Array?g=n.UNSIGNED_INT:d instanceof Int32Array?g=n.INT:d instanceof Int8Array?g=n.BYTE:(d instanceof Uint8Array||d instanceof Uint8ClampedArray)&&(g=n.UNSIGNED_BYTE),{buffer:f,type:g,bytesPerElement:d.BYTES_PER_ELEMENT,version:c.version}}(c,u)):d.version<c.version&&(function o(c,u,d){const h=u.array,f=u.updateRange;n.bindBuffer(d,c),-1===f.count?n.bufferSubData(d,0,h):(t?n.bufferSubData(d,f.offset*h.BYTES_PER_ELEMENT,h,f.offset,f.count):n.bufferSubData(d,f.offset*h.BYTES_PER_ELEMENT,h.subarray(f.offset,f.offset+f.count)),f.count=-1)}(d.buffer,c,u),d.version=c.version)}}}En.prototype.isVector4=!0;class Ce{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*i-s*r+e.x,this.y=o*r+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Ce.prototype.isVector2=!0;class Vo{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const r=this._listeners[e];if(void 0!==r){const o=r.indexOf(t);-1!==o&&r.splice(o,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const i=this._listeners[e.type];if(void 0!==i){e.target=this;const r=i.slice(0);for(let o=0,s=r.length;o<s;o++)r[o].call(this,e);e.target=null}}}const eD={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Si={h:0,s:0,l:0},Ld={h:0,s:0,l:0};function wg(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(e-n)*t:t<.5?e:t<2/3?n+6*(e-n)*(2/3-t):n}function Sg(n){return n<.04045?.0773993808*n:Math.pow(.9478672986*n+.0521327014,2.4)}function Dg(n){return n<.0031308?12.92*n:1.055*Math.pow(n,.41666)-.055}let lt=(()=>{class n{constructor(t,i,r){return void 0===i&&void 0===r?this.set(t):this.setRGB(t,i,r)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,i,r){return this.r=t,this.g=i,this.b=r,this}setHSL(t,i,r){if(t=function YS(n,e){return(n%e+e)%e}(t,1),i=Nt(i,0,1),r=Nt(r,0,1),0===i)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+i):r+i-r*i,s=2*r-o;this.r=wg(s,o,t+1/3),this.g=wg(s,o,t),this.b=wg(s,o,t-1/3)}return this}setStyle(t){function i(o){void 0!==o&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let o;const a=r[2];switch(r[1]){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,i(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,i(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const l=parseFloat(o[1])/360,c=parseInt(o[2],10)/100,u=parseInt(o[3],10)/100;return i(o[4]),this.setHSL(l,c,u)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const o=r[1],s=o.length;if(3===s)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,this;if(6===s)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const i=eD[t.toLowerCase()];return void 0!==i?this.setHex(i):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,i=2){return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this}copyLinearToGamma(t,i=2){const r=i>0?1/i:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Sg(t.r),this.g=Sg(t.g),this.b=Sg(t.b),this}copyLinearToSRGB(t){return this.r=Dg(t.r),this.g=Dg(t.g),this.b=Dg(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const i=this.r,r=this.g,o=this.b,s=Math.max(i,r,o),a=Math.min(i,r,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const d=s-a;switch(c=u<=.5?d/(s+a):d/(2-s-a),s){case i:l=(r-o)/d+(r<o?6:0);break;case r:l=(o-i)/d+2;break;case o:l=(i-r)/d+4}l/=6}return t.h=l,t.s=c,t.l=u,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,i,r){return this.getHSL(Si),Si.h+=t,Si.s+=i,Si.l+=r,this.setHSL(Si.h,Si.s,Si.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,i){return this.r=t.r+i.r,this.g=t.g+i.g,this.b=t.b+i.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,i){return this.r+=(t.r-this.r)*i,this.g+=(t.g-this.g)*i,this.b+=(t.b-this.b)*i,this}lerpColors(t,i,r){return this.r=t.r+(i.r-t.r)*r,this.g=t.g+(i.g-t.g)*r,this.b=t.b+(i.b-t.b)*r,this}lerpHSL(t,i){this.getHSL(Si),t.getHSL(Ld);const r=Td(Si.h,Ld.h,i),o=Td(Si.s,Ld.s,i),s=Td(Si.l,Ld.l,i);return this.setHSL(r,o,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,i=0){return this.r=t[i],this.g=t[i+1],this.b=t[i+2],this}toArray(t=[],i=0){return t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t}fromBufferAttribute(t,i){return this.r=t.getX(i),this.g=t.getY(i),this.b=t.getZ(i),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}return n.NAMES=eD,n})();lt.prototype.isColor=!0,lt.prototype.r=1,lt.prototype.g=1,lt.prototype.b=1;const ft=new I,Fd=new Ce;class ri{constructor(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===i,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let i=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];void 0===s&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),s=new lt),t[i++]=s.r,t[i++]=s.g,t[i++]=s.b}return this}copyVector2sArray(e){const t=this.array;let i=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new Ce),t[i++]=s.x,t[i++]=s.y}return this}copyVector3sArray(e){const t=this.array;let i=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),s=new I),t[i++]=s.x,t[i++]=s.y,t[i++]=s.z}return this}copyVector4sArray(e){const t=this.array;let i=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new En),t[i++]=s.x,t[i++]=s.y,t[i++]=s.z,t[i++]=s.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)Fd.fromBufferAttribute(this,t),Fd.applyMatrix3(e),this.setXY(t,Fd.x,Fd.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)ft.fromBufferAttribute(this,t),ft.applyMatrix3(e),this.setXYZ(t,ft.x,ft.y,ft.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)ft.x=this.getX(t),ft.y=this.getY(t),ft.z=this.getZ(t),ft.applyMatrix4(e),this.setXYZ(t,ft.x,ft.y,ft.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)ft.x=this.getX(t),ft.y=this.getY(t),ft.z=this.getZ(t),ft.applyNormalMatrix(e),this.setXYZ(t,ft.x,ft.y,ft.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)ft.x=this.getX(t),ft.y=this.getY(t),ft.z=this.getZ(t),ft.transformDirection(e),this.setXYZ(t,ft.x,ft.y,ft.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return this.array[0+(e*=this.itemSize)]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return this.array[0+(e*=this.itemSize)]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,o){return this.array[0+(e*=this.itemSize)]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=o,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),(0!==this.updateRange.offset||-1!==this.updateRange.count)&&(e.updateRange=this.updateRange),e}}ri.prototype.isBufferAttribute=!0;class tD extends ri{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class nD extends ri{constructor(e,t,i){super(new Uint32Array(e),t,i)}}(class qH extends ri{constructor(e,t,i){super(new Uint16Array(e),t,i)}}).prototype.isFloat16BufferAttribute=!0;class Go extends ri{constructor(e,t,i){super(new Float32Array(e),t,i)}}const iD=new Yt,rD=new qr;class la{constructor(e=0,t=0,i=0,r=la.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,o=r[0],s=r[4],a=r[8],l=r[1],c=r[5],u=r[9],d=r[2],h=r[6],f=r[10];switch(t){case"XYZ":this._y=Math.asin(Nt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Nt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(Nt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Nt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(h,f),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(Nt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Nt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return iD.makeRotationFromQuaternion(e),this.setFromRotationMatrix(iD,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return rD.setFromEuler(this),this.setFromQuaternion(rD,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new I(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}la.prototype.isEuler=!0,la.DefaultOrder="XYZ",la.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class XH{constructor(){this.mask=1}set(e){this.mask=1<<e|0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}}let YH=0;const oD=new I,ca=new qr,Mr=new Yt,Nd=new I,Kl=new I,ZH=new I,KH=new qr,sD=new I(1,0,0),aD=new I(0,1,0),lD=new I(0,0,1),QH={type:"added"},cD={type:"removed"};class oi extends Vo{constructor(){super(),Object.defineProperty(this,"id",{value:YH++}),this.uuid=ql(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=oi.DefaultUp.clone();const e=new I,t=new la,i=new qr,r=new I(1,1,1);t._onChange(function o(){i.setFromEuler(t,!1)}),i._onChange(function s(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Yt},normalMatrix:{value:new bi}}),this.matrix=new Yt,this.matrixWorld=new Yt,this.matrixAutoUpdate=oi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new XH,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ca.setFromAxisAngle(e,t),this.quaternion.multiply(ca),this}rotateOnWorldAxis(e,t){return ca.setFromAxisAngle(e,t),this.quaternion.premultiply(ca),this}rotateX(e){return this.rotateOnAxis(sD,e)}rotateY(e){return this.rotateOnAxis(aD,e)}rotateZ(e){return this.rotateOnAxis(lD,e)}translateOnAxis(e,t){return oD.copy(e).applyQuaternion(this.quaternion),this.position.add(oD.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(sD,e)}translateY(e){return this.translateOnAxis(aD,e)}translateZ(e){return this.translateOnAxis(lD,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Mr.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Nd.copy(e):Nd.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Kl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Mr.lookAt(Kl,Nd,this.up):Mr.lookAt(Nd,Kl,this.up),this.quaternion.setFromRotationMatrix(Mr),r&&(Mr.extractRotation(r.matrixWorld),ca.setFromRotationMatrix(Mr),this.quaternion.premultiply(ca.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(QH)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(cD)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(cD)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Mr.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Mr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Mr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const s=this.children[i].getObjectByProperty(e,t);if(void 0!==s)return s}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Kl,e,ZH),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Kl,KH,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const r=this.children;for(let o=0,s=r.length;o<s;o++)r[o].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function o(a,l){return void 0===a[l.uuid]&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=o(e.geometries,this.geometry);const a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++)o(e.shapes,l[c]);else o(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(o(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(o(e.materials,this.material[l]));r.material=a}else r.material=o(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++)r.animations.push(o(e.animations,this.animations[a]))}if(t){const a=s(e.geometries),l=s(e.materials),c=s(e.textures),u=s(e.images),d=s(e.shapes),h=s(e.skeletons),f=s(e.animations);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),d.length>0&&(i.shapes=d),h.length>0&&(i.skeletons=h),f.length>0&&(i.animations=f)}return i.object=r,i;function s(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let i=0;i<e.children.length;i++)this.add(e.children[i].clone());return this}}function uD(n){if(0===n.length)return-1/0;let e=n[0];for(let t=1,i=n.length;t<i;++t)n[t]>e&&(e=n[t]);return e}function Cg(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}oi.DefaultUp=new I(0,1,0),oi.DefaultMatrixAutoUpdate=!0,oi.prototype.isObject3D=!0,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let eV=0;const si=new Yt,Tg=new oi,ua=new I,qn=new Bo,Ql=new Bo,Zt=new I;class Qr extends Vo{constructor(){super(),Object.defineProperty(this,"id",{value:eV++}),this.uuid=ql(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return this.index=Array.isArray(e)?new(uD(e)>65535?nD:tD)(e,1):e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const o=(new bi).getNormalMatrix(e);i.applyNormalMatrix(o),i.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return si.makeRotationFromQuaternion(e),this.applyMatrix4(si),this}rotateX(e){return si.makeRotationX(e),this.applyMatrix4(si),this}rotateY(e){return si.makeRotationY(e),this.applyMatrix4(si),this}rotateZ(e){return si.makeRotationZ(e),this.applyMatrix4(si),this}translate(e,t,i){return si.makeTranslation(e,t,i),this.applyMatrix4(si),this}scale(e,t,i){return si.makeScale(e,t,i),this.applyMatrix4(si),this}lookAt(e){return Tg.lookAt(e),Tg.updateMatrix(),this.applyMatrix4(Tg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ua).negate(),this.translate(ua.x,ua.y,ua.z),this}setFromPoints(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new Go(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Bo);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new I(-1/0,-1/0,-1/0),new I(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++)qn.setFromBufferAttribute(t[i]),this.morphTargetsRelative?(Zt.addVectors(this.boundingBox.min,qn.min),this.boundingBox.expandByPoint(Zt),Zt.addVectors(this.boundingBox.max,qn.max),this.boundingBox.expandByPoint(Zt)):(this.boundingBox.expandByPoint(qn.min),this.boundingBox.expandByPoint(qn.max))}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new xg);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new I,1/0);if(e){const i=this.boundingSphere.center;if(qn.setFromBufferAttribute(e),t)for(let o=0,s=t.length;o<s;o++)Ql.setFromBufferAttribute(t[o]),this.morphTargetsRelative?(Zt.addVectors(qn.min,Ql.min),qn.expandByPoint(Zt),Zt.addVectors(qn.max,Ql.max),qn.expandByPoint(Zt)):(qn.expandByPoint(Ql.min),qn.expandByPoint(Ql.max));qn.getCenter(i);let r=0;for(let o=0,s=e.count;o<s;o++)Zt.fromBufferAttribute(e,o),r=Math.max(r,i.distanceToSquared(Zt));if(t)for(let o=0,s=t.length;o<s;o++){const a=t[o],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)Zt.fromBufferAttribute(a,c),l&&(ua.fromBufferAttribute(e,c),Zt.add(ua)),r=Math.max(r,i.distanceToSquared(Zt))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=e.array,r=t.position.array,o=t.normal.array,s=t.uv.array,a=r.length/3;void 0===t.tangent&&this.setAttribute("tangent",new ri(new Float32Array(4*a),4));const l=t.tangent.array,c=[],u=[];for(let H=0;H<a;H++)c[H]=new I,u[H]=new I;const d=new I,h=new I,f=new I,g=new Ce,_=new Ce,v=new Ce,p=new I,m=new I;function y(H,R,ee){d.fromArray(r,3*H),h.fromArray(r,3*R),f.fromArray(r,3*ee),g.fromArray(s,2*H),_.fromArray(s,2*R),v.fromArray(s,2*ee),h.sub(d),f.sub(d),_.sub(g),v.sub(g);const N=1/(_.x*v.y-v.x*_.y);isFinite(N)&&(p.copy(h).multiplyScalar(v.y).addScaledVector(f,-_.y).multiplyScalar(N),m.copy(f).multiplyScalar(_.x).addScaledVector(h,-v.x).multiplyScalar(N),c[H].add(p),c[R].add(p),c[ee].add(p),u[H].add(m),u[R].add(m),u[ee].add(m))}let M=this.groups;0===M.length&&(M=[{start:0,count:i.length}]);for(let H=0,R=M.length;H<R;++H){const ee=M[H],N=ee.start;for(let z=N,O=N+ee.count;z<O;z+=3)y(i[z+0],i[z+1],i[z+2])}const w=new I,C=new I,E=new I,B=new I;function q(H){E.fromArray(o,3*H),B.copy(E);const R=c[H];w.copy(R),w.sub(E.multiplyScalar(E.dot(R))).normalize(),C.crossVectors(B,R);const N=C.dot(u[H])<0?-1:1;l[4*H]=w.x,l[4*H+1]=w.y,l[4*H+2]=w.z,l[4*H+3]=N}for(let H=0,R=M.length;H<R;++H){const ee=M[H],N=ee.start;for(let z=N,O=N+ee.count;z<O;z+=3)q(i[z+0]),q(i[z+1]),q(i[z+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new ri(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let h=0,f=i.count;h<f;h++)i.setXYZ(h,0,0,0);const r=new I,o=new I,s=new I,a=new I,l=new I,c=new I,u=new I,d=new I;if(e)for(let h=0,f=e.count;h<f;h+=3){const g=e.getX(h+0),_=e.getX(h+1),v=e.getX(h+2);r.fromBufferAttribute(t,g),o.fromBufferAttribute(t,_),s.fromBufferAttribute(t,v),u.subVectors(s,o),d.subVectors(r,o),u.cross(d),a.fromBufferAttribute(i,g),l.fromBufferAttribute(i,_),c.fromBufferAttribute(i,v),a.add(u),l.add(u),c.add(u),i.setXYZ(g,a.x,a.y,a.z),i.setXYZ(_,l.x,l.y,l.z),i.setXYZ(v,c.x,c.y,c.z)}else for(let h=0,f=t.count;h<f;h+=3)r.fromBufferAttribute(t,h+0),o.fromBufferAttribute(t,h+1),s.fromBufferAttribute(t,h+2),u.subVectors(s,o),d.subVectors(r,o),u.cross(d),i.setXYZ(h+0,u.x,u.y,u.z),i.setXYZ(h+1,u.x,u.y,u.z),i.setXYZ(h+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const i=this.attributes;for(const r in i){if(void 0===e.attributes[r])continue;const s=i[r].array,a=e.attributes[r],l=a.array,c=a.itemSize*t,u=Math.min(l.length,s.length-c);for(let d=0,h=c;d<u;d++,h++)s[h]=l[d]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Zt.fromBufferAttribute(e,t),Zt.normalize(),e.setXYZ(t,Zt.x,Zt.y,Zt.z)}toNonIndexed(){function e(a,l){const c=a.array,u=a.itemSize,d=a.normalized,h=new c.constructor(l.length*u);let f=0,g=0;for(let _=0,v=l.length;_<v;_++){f=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*u;for(let p=0;p<u;p++)h[g++]=c[f++]}return new ri(h,u,d)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Qr,i=this.index.array,r=this.attributes;for(const a in r){const c=e(r[a],i);t.setAttribute(a,c)}const o=this.morphAttributes;for(const a in o){const l=[],c=o[a];for(let u=0,d=c.length;u<d;u++){const f=e(c[u],i);l.push(f)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,l=s.length;a<l;a++){const c=s[a];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const l=this.parameters;for(const c in l)void 0!==l[c]&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i)e.data.attributes[l]=i[l].toJSON(e.data);const r={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,h=c.length;d<h;d++)u.push(c[d].toJSON(e.data));u.length>0&&(r[l]=u,o=!0)}o&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;null!==i&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r)this.setAttribute(c,r[c].clone(t));const o=e.morphAttributes;for(const c in o){const u=[],d=o[c];for(let h=0,f=d.length;h<f;h++)u.push(d[h].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let c=0,u=s.length;c<u;c++){const d=s[c];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const l=e.boundingSphere;return null!==l&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}Qr.prototype.isBufferGeometry=!0;class Jl extends Qr{constructor(e=1,t=1,i=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const l=[],c=[],u=[],d=[];let h=0,f=0;function g(_,v,p,m,y,M,w,C,E,B,q){const H=M/E,R=w/B,ee=M/2,N=w/2,U=C/2,z=E+1,O=B+1;let k=0,Y=0;const me=new I;for(let Ee=0;Ee<O;Ee++){const de=Ee*R-N;for(let je=0;je<z;je++)me[_]=(je*H-ee)*m,me[v]=de*y,me[p]=U,c.push(me.x,me.y,me.z),me[_]=0,me[v]=0,me[p]=C>0?1:-1,u.push(me.x,me.y,me.z),d.push(je/E),d.push(1-Ee/B),k+=1}for(let Ee=0;Ee<B;Ee++)for(let de=0;de<E;de++){const $=h+de+z*(Ee+1),se=h+(de+1)+z*(Ee+1),ae=h+(de+1)+z*Ee;l.push(h+de+z*Ee,$,ae),l.push($,se,ae),Y+=6}a.addGroup(f,Y,q),f+=Y,h+=k}g("z","y","x",-1,-1,i,t,e,s,o,0),g("z","y","x",1,-1,i,t,-e,s,o,1),g("x","z","y",1,1,e,i,t,r,s,2),g("x","z","y",1,-1,e,i,-t,r,s,3),g("x","y","z",1,-1,e,t,i,r,o,4),g("x","y","z",-1,-1,e,t,-i,r,o,5),this.setIndex(l),this.setAttribute("position",new Go(c,3)),this.setAttribute("normal",new Go(u,3)),this.setAttribute("uv",new Go(d,2))}static fromJSON(e){return new Jl(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class ec extends Qr{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const o=e/2,s=t/2,a=Math.floor(i),l=Math.floor(r),c=a+1,u=l+1,d=e/a,h=t/l,f=[],g=[],_=[],v=[];for(let p=0;p<u;p++){const m=p*h-s;for(let y=0;y<c;y++)g.push(y*d-o,-m,0),_.push(0,0,1),v.push(y/a),v.push(1-p/l)}for(let p=0;p<l;p++)for(let m=0;m<a;m++){const M=m+c*(p+1),w=m+1+c*(p+1),C=m+1+c*p;f.push(m+c*p,M,C),f.push(M,w,C)}this.setIndex(f),this.setAttribute("position",new Go(g,3)),this.setAttribute("normal",new Go(_,3)),this.setAttribute("uv",new Go(v,2))}static fromJSON(e){return new ec(e.width,e.height,e.widthSegments,e.heightSegments)}}let tV=0;class tc extends Vo{constructor(){super(),Object.defineProperty(this,"id",{value:tV++}),this.uuid=ql(),this.name="",this.type="Material",this.fog=!0,this.blending=Wl,this.side=jl,this.vertexColors=!1,this.opacity=1,this.format=Mn,this.transparent=!1,this.blendSrc=TS,this.blendDst=AS,this.blendEquation=ea,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=ig,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const i=e[t];if(void 0===i){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenTint&&this.sheenTint.isColor&&(i.sheenTint=this.sheenTint.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(i.specularTint=this.specularTint.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(i.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationTint&&(i.attenuationTint=this.attenuationTint.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Wl&&(i.blending=this.blending),this.side!==jl&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.format!==Mn&&(i.format=this.format),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t){const o=r(e.textures),s=r(e.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.format=e.format,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(null!==t){const r=t.length;i=new Array(r);for(let o=0;o!==r;++o)i[o]=t[o].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}function da(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];e[t][i]=r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.clone():Array.isArray(r)?r.slice():r}}return e}function ln(n){const e={};for(let t=0;t<n.length;t++){const i=da(n[t]);for(const r in i)e[r]=i[r]}return e}tc.prototype.isMaterial=!0;const nV={clone:da,merge:ln};class ha extends tc{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=da(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const s=this.uniforms[r].value;t.uniforms[r]=s&&s.isTexture?{type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?{type:"c",value:s.getHex()}:s&&s.isVector2?{type:"v2",value:s.toArray()}:s&&s.isVector3?{type:"v3",value:s.toArray()}:s&&s.isVector4?{type:"v4",value:s.toArray()}:s&&s.isMatrix3?{type:"m3",value:s.toArray()}:s&&s.isMatrix4?{type:"m4",value:s.toArray()}:{value:s}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const i={};for(const r in this.extensions)!0===this.extensions[r]&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}ha.prototype.isShaderMaterial=!0;const xr=new I,Ag=new I,Od=new I,Jr=new I,Ig=new I,kd=new I,Rg=new I;class oV{constructor(e=new I,t=new I(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,xr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=xr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(xr.copy(this.direction).multiplyScalar(t).add(this.origin),xr.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Ag.copy(e).add(t).multiplyScalar(.5),Od.copy(t).sub(e).normalize(),Jr.copy(this.origin).sub(Ag);const o=.5*e.distanceTo(t),s=-this.direction.dot(Od),a=Jr.dot(this.direction),l=-Jr.dot(Od),c=Jr.lengthSq(),u=Math.abs(1-s*s);let d,h,f,g;if(u>0)if(d=s*l-a,h=s*a-l,g=o*u,d>=0)if(h>=-g)if(h<=g){const _=1/u;d*=_,h*=_,f=d*(d+s*h+2*a)+h*(s*d+h+2*l)+c}else h=o,d=Math.max(0,-(s*h+a)),f=-d*d+h*(h+2*l)+c;else h=-o,d=Math.max(0,-(s*h+a)),f=-d*d+h*(h+2*l)+c;else h<=-g?(d=Math.max(0,-(-s*o+a)),h=d>0?-o:Math.min(Math.max(-o,-l),o),f=-d*d+h*(h+2*l)+c):h<=g?(d=0,h=Math.min(Math.max(-o,-l),o),f=h*(h+2*l)+c):(d=Math.max(0,-(s*o+a)),h=d>0?o:Math.min(Math.max(-o,-l),o),f=-d*d+h*(h+2*l)+c);else h=s>0?-o:o,d=Math.max(0,-(s*h+a)),f=-d*d+h*(h+2*l)+c;return i&&i.copy(this.direction).multiplyScalar(d).add(this.origin),r&&r.copy(Od).multiplyScalar(h).add(Ag),f}intersectSphere(e,t){xr.subVectors(e.center,this.origin);const i=xr.dot(this.direction),r=xr.dot(xr)-i*i,o=e.radius*e.radius;if(r>o)return null;const s=Math.sqrt(o-r),a=i-s,l=i+s;return a<0&&l<0?null:this.at(a<0?l:a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,o,s,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(o=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(o=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),i>s||o>r||((o>i||i!=i)&&(i=o),(s<r||r!=r)&&(r=s),d>=0?(a=(e.min.z-h.z)*d,l=(e.max.z-h.z)*d):(a=(e.max.z-h.z)*d,l=(e.min.z-h.z)*d),i>l||a>r)||((a>i||i!=i)&&(i=a),(l<r||r!=r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return null!==this.intersectBox(e,xr)}intersectTriangle(e,t,i,r,o){Ig.subVectors(t,e),kd.subVectors(i,e),Rg.crossVectors(Ig,kd);let a,s=this.direction.dot(Rg);if(s>0){if(r)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}Jr.subVectors(this.origin,e);const l=a*this.direction.dot(kd.crossVectors(Jr,kd));if(l<0)return null;const c=a*this.direction.dot(Ig.cross(Jr));if(c<0||l+c>s)return null;const u=-a*Jr.dot(Rg);return u<0?null:this.at(u/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}const Di=new I,Er=new I,Pg=new I,br=new I,fa=new I,pa=new I,dD=new I,Lg=new I,Fg=new I,Ng=new I;class wr{constructor(e=new I,t=new I,i=new I){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),Di.subVectors(e,t),r.cross(Di);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(e,t,i,r,o){Di.subVectors(r,t),Er.subVectors(i,t),Pg.subVectors(e,t);const s=Di.dot(Di),a=Di.dot(Er),l=Di.dot(Pg),c=Er.dot(Er),u=Er.dot(Pg),d=s*c-a*a;if(0===d)return o.set(-2,-1,-1);const h=1/d,f=(c*l-a*u)*h,g=(s*u-a*l)*h;return o.set(1-f-g,g,f)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,br),br.x>=0&&br.y>=0&&br.x+br.y<=1}static getUV(e,t,i,r,o,s,a,l){return this.getBarycoord(e,t,i,r,br),l.set(0,0),l.addScaledVector(o,br.x),l.addScaledVector(s,br.y),l.addScaledVector(a,br.z),l}static isFrontFacing(e,t,i,r){return Di.subVectors(i,t),Er.subVectors(e,t),Di.cross(Er).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Di.subVectors(this.c,this.b),Er.subVectors(this.a,this.b),.5*Di.cross(Er).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wr.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,o){return wr.getUV(e,this.a,this.b,this.c,t,i,r,o)}containsPoint(e){return wr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,o=this.c;let s,a;fa.subVectors(r,i),pa.subVectors(o,i),Lg.subVectors(e,i);const l=fa.dot(Lg),c=pa.dot(Lg);if(l<=0&&c<=0)return t.copy(i);Fg.subVectors(e,r);const u=fa.dot(Fg),d=pa.dot(Fg);if(u>=0&&d<=u)return t.copy(r);const h=l*d-u*c;if(h<=0&&l>=0&&u<=0)return s=l/(l-u),t.copy(i).addScaledVector(fa,s);Ng.subVectors(e,o);const f=fa.dot(Ng),g=pa.dot(Ng);if(g>=0&&f<=g)return t.copy(o);const _=f*c-l*g;if(_<=0&&c>=0&&g<=0)return a=c/(c-g),t.copy(i).addScaledVector(pa,a);const v=u*g-f*d;if(v<=0&&d-u>=0&&f-g>=0)return dD.subVectors(o,r),a=(d-u)/(d-u+(f-g)),t.copy(r).addScaledVector(dD,a);const p=1/(v+_+h);return s=_*p,a=h*p,t.copy(i).addScaledVector(fa,s).addScaledVector(pa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class ma extends tc{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new lt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=IS,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}ma.prototype.isMeshBasicMaterial=!0;const hD=new Yt,ga=new oV,Og=new xg,eo=new I,to=new I,no=new I,kg=new I,Ug=new I,Bg=new I,Ud=new I,Bd=new I,zd=new I,Hd=new Ce,Vd=new Ce,Gd=new Ce,zg=new I,jd=new I;class Ki extends oi{constructor(e=new Qr,t=new ma){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const i=this.geometry,r=this.material,o=this.matrixWorld;if(void 0===r||(null===i.boundingSphere&&i.computeBoundingSphere(),Og.copy(i.boundingSphere),Og.applyMatrix4(o),!1===e.ray.intersectsSphere(Og))||(hD.copy(o).invert(),ga.copy(e.ray).applyMatrix4(hD),null!==i.boundingBox&&!1===ga.intersectsBox(i.boundingBox)))return;let s;if(i.isBufferGeometry){const a=i.index,l=i.attributes.position,c=i.morphAttributes.position,u=i.morphTargetsRelative,d=i.attributes.uv,h=i.attributes.uv2,f=i.groups,g=i.drawRange;if(null!==a)if(Array.isArray(r))for(let _=0,v=f.length;_<v;_++){const p=f[_],m=r[p.materialIndex];for(let w=Math.max(p.start,g.start),C=Math.min(a.count,Math.min(p.start+p.count,g.start+g.count));w<C;w+=3){const E=a.getX(w),B=a.getX(w+1),q=a.getX(w+2);s=Wd(this,m,e,ga,l,c,u,d,h,E,B,q),s&&(s.faceIndex=Math.floor(w/3),s.face.materialIndex=p.materialIndex,t.push(s))}}else for(let p=Math.max(0,g.start),m=Math.min(a.count,g.start+g.count);p<m;p+=3){const y=a.getX(p),M=a.getX(p+1),w=a.getX(p+2);s=Wd(this,r,e,ga,l,c,u,d,h,y,M,w),s&&(s.faceIndex=Math.floor(p/3),t.push(s))}else if(void 0!==l)if(Array.isArray(r))for(let _=0,v=f.length;_<v;_++){const p=f[_],m=r[p.materialIndex];for(let w=Math.max(p.start,g.start),C=Math.min(l.count,Math.min(p.start+p.count,g.start+g.count));w<C;w+=3)s=Wd(this,m,e,ga,l,c,u,d,h,w,w+1,w+2),s&&(s.faceIndex=Math.floor(w/3),s.face.materialIndex=p.materialIndex,t.push(s))}else for(let p=Math.max(0,g.start),m=Math.min(l.count,g.start+g.count);p<m;p+=3)s=Wd(this,r,e,ga,l,c,u,d,h,p,p+1,p+2),s&&(s.faceIndex=Math.floor(p/3),t.push(s))}else i.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function Wd(n,e,t,i,r,o,s,a,l,c,u,d){eo.fromBufferAttribute(r,c),to.fromBufferAttribute(r,u),no.fromBufferAttribute(r,d);const h=n.morphTargetInfluences;if(o&&h){Ud.set(0,0,0),Bd.set(0,0,0),zd.set(0,0,0);for(let g=0,_=o.length;g<_;g++){const v=h[g],p=o[g];0!==v&&(kg.fromBufferAttribute(p,c),Ug.fromBufferAttribute(p,u),Bg.fromBufferAttribute(p,d),s?(Ud.addScaledVector(kg,v),Bd.addScaledVector(Ug,v),zd.addScaledVector(Bg,v)):(Ud.addScaledVector(kg.sub(eo),v),Bd.addScaledVector(Ug.sub(to),v),zd.addScaledVector(Bg.sub(no),v)))}eo.add(Ud),to.add(Bd),no.add(zd)}n.isSkinnedMesh&&(n.boneTransform(c,eo),n.boneTransform(u,to),n.boneTransform(d,no));const f=function sV(n,e,t,i,r,o,s,a){let l;if(l=e.side===qt?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,e.side!==Js,a),null===l)return null;jd.copy(a),jd.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(jd);return c<t.near||c>t.far?null:{distance:c,point:jd.clone(),object:n}}(n,e,t,i,eo,to,no,zg);if(f){a&&(Hd.fromBufferAttribute(a,c),Vd.fromBufferAttribute(a,u),Gd.fromBufferAttribute(a,d),f.uv=wr.getUV(zg,eo,to,no,Hd,Vd,Gd,new Ce)),l&&(Hd.fromBufferAttribute(l,c),Vd.fromBufferAttribute(l,u),Gd.fromBufferAttribute(l,d),f.uv2=wr.getUV(zg,eo,to,no,Hd,Vd,Gd,new Ce));const g={a:c,b:u,c:d,normal:new I,materialIndex:0};wr.getNormal(eo,to,no,g.normal),f.face=g}return f}Ki.prototype.isMesh=!0;const qe={alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef USE_ALPHATEST\n\n\tif ( diffuseColor.a < alphaTest ) discard;\n\n#endif\n",alphatest_pars_fragment:"\n#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:'\n\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney\u2019s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( V * D );\n\n}\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\n\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\n\t// project rect onto sphere\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\n\t// calculate vector form factor\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat D_Charlie( float roughness, float dotNH ) {\n\n\tfloat alpha = pow2( roughness );\n\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 ); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n\n}\n\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenTint, const in float sheenRoughness ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\n\treturn sheenTint * ( D * V );\n\n}\n\n#endif\n',bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tdiffuseColor *= vColor;\n\n#elif defined( USE_COLOR )\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvColor = vec4( 1.0 );\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvColor = vec3( 1.0 );\n\n#endif\n\n#ifdef USE_COLOR\n\n\tvColor *= color;\n\n#endif\n\n#ifdef USE_INSTANCING_COLOR\n\n\tvColor.xyz *= instanceColor.xyz;\n\n#endif\n",common:"\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n\treturn fract( sin( sn ) * c );\n\n}\n\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\n\treturn tmp;\n\n}\n\n// https://en.wikipedia.org/wiki/Relative_luminance\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\n\treturn dot( weights, color.rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n\treturn m[ 2 ][ 3 ] == - 1.0;\n\n}\n\nvec2 equirectUv( in vec3 dir ) {\n\n\t// dir is assumed to be unit length\n\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\treturn vec2( u, v );\n\n}\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\n\t// These shader functions convert between the UV coordinates of a single face of\n\t// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n\t// sampling a textureCube (not generally normalized ).\n\n\tfloat getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\n\t// RH coordinate system; PMREM face-indexing convention\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\n\t\tvec2 f = fract( uv );\n\n\t\tuv += 0.5 - f;\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\n\t\t}\n\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\n\t\tuv *= texelSize;\n\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tuv.x += texelSize;\n\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tuv.y += texelSize;\n\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tuv.x -= texelSize;\n\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tvec3 tm = mix( tl, tr, f.x );\n\n\t\tvec3 bm = mix( bl, br, f.x );\n\n\t\treturn mix( tm, bm, f.y );\n\n\t}\n\n\t// These defines must match with PMREMGenerator\n\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\n\tfloat roughnessToMip( float roughness ) {\n\n\t\tfloat mip = 0.0;\n\n\t\tif ( roughness >= r1 ) {\n\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\n\t\t} else if ( roughness >= r4 ) {\n\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\n\t\t} else if ( roughness >= r5 ) {\n\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\n\t\t} else if ( roughness >= r6 ) {\n\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\n\t\t} else {\n\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25\n\t\t}\n\n\t\treturn mip;\n\n\t}\n\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\n\t\tfloat mipF = fract( mip );\n\n\t\tfloat mipInt = floor( mip );\n\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\n\t\tif ( mipF == 0.0 ) {\n\n\t\t\treturn vec4( color0, 1.0 );\n\n\t\t} else {\n\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\n\t\t}\n\n\t}\n\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",encodings_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\n// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\n\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\n\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\n\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\n\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n\t// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\n\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\n\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\t// NOTE: The implementation with min causes the shader to not compile on\n\t// a common Alcatel A502DL in Chrome 78/Android 8.1. Some research suggests \n\t// that the chipset is Mediatek MT6739 w/ IMG PowerVR GE8100 GPU.\n\t// D = min( floor( D ) / 255.0, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\n\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\n\n// M matrix, for encoding\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\n\n// Inverse M matrix, for decoding\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t\tenvColor = envMapTexelToLinear( envColor );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 reflectVec;\n\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\n\t\t\t\t// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t\t#else\n\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\n\t\t\t#endif\n\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tvFogDepth = - mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float vFogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\n\t#else\n\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\n\t#endif\n\n}\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tlightMapIrradiance *= PI;\n\n\t#endif\n\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_vertex:"\nvec3 diffuse = vec3( 1.0 );\n\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\n\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\n\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\n\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n#ifdef DOUBLE_SIDED\n\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n\n#endif\n\n#if NUM_POINT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_SPOT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_DIR_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_HEMI_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\n\t// band 2\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\treturn irradiance;\n\n}\n\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t\t// page 32, equation 26: E[window1]\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\t\tif ( cutoffDistance > 0.0 ) {\n\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t\t}\n\n\t\treturn distanceFalloff;\n\n\t#else\n\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t\t}\n\n\t\treturn 1.0;\n\n\t#endif\n\n}\n\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\tif ( spotAttenuation > 0.0 ) {\n\n\t\t\tfloat lightDistance = length( lVector );\n\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\n\t\t} else {\n\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\n\t\t}\n\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct ToonMaterial {\n\n\tvec3 diffuseColor;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct BlinnPhongMaterial {\n\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.roughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n\n#ifdef IOR\n\n\t#ifdef SPECULAR\n\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularTintFactor = specularTint;\n\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\n\t\t#endif\n\n\t\t#ifdef USE_SPECULARTINTMAP\n\n\t\t\tspecularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\n\n\t\t#endif\n\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\n\t#else\n\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularTintFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\n\t#endif\n\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n\n#endif\n\n#ifdef USE_CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenTint = sheenTint;\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\n#endif\n",lights_physical_pars_fragment:'\nstruct PhysicalMaterial {\n\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenTint;\n\t\tfloat sheenRoughness;\n\t#endif\n\n};\n\n// temporary\nvec3 clearcoatSpecular = vec3( 0.0 );\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\n\treturn fab;\n\n}\n\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\treturn specularColor * fab.x + specularF90 * fab.y;\n\n}\n\n// Fdez-Ag\xfcera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenTint, material.sheenRoughness );\n\n\t#endif\n\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\n\t#endif\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n',lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ???\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef USE_CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI;\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_MAP\n\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tuniform mat3 uvTransform;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\n\t\t}\n\n\t#else\n\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n\t#endif\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\n\t\t}\n\n\t#else\n\n\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\n\t\t#else\n\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\n\t\t\t#endif\n\n\t\t}\n\n\t#else\n\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\nfloat faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n\n#ifdef FLAT_SHADED\n\n\t// Workaround for Adreno GPUs not able to do dFdx( vViewPosition )\n\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * faceDirection;\n\n\t#endif\n\n\t#ifdef USE_TANGENT\n\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\n\t\t#endif\n\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * faceDirection;\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( TANGENTSPACE_NORMALMAP )\n\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tnormal = normalize( vTBN * mapN );\n\n\t#else\n\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\n\t#endif\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n\n#endif\n",normal_pars_fragment:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_pars_vertex:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_vertex:"\n#ifndef FLAT_SHADED // normal is computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Normal Mapping Without Precomputed Tangents\n\t// http://www.thetenthplanet.de/archives/1180\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 N = surf_norm; // normalized\n\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef USE_CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\n\t#else\n\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\n\t#endif\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n",output_fragment:"\n#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n\n// https://github.com/mrdoob/three.js/pull/22425\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\n\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\n\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\n\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\n\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\n\n// NOTE: https://twitter.com/gonnavis/status/1377183786949959682\n\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t//  y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim    := ( 4 , 2 )\n\t\t//  # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\t// Offsetting the position used for querying occlusion along the world normal can be used to reduce shadow acne.\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\n\t#endif\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n\n}\n\n// source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs\nvec3 RRTAndODTFit( vec3 v ) {\n\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n\n}\n\n// this implementation of ACES is modified to accommodate a brighter viewing environment.\n// the scale factor of 1/0.6 is subjective. see discussion in #19621.\n\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\n\t// ODT_SAT => XYZ => D60_2_D65 => sRGB\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\n\tcolor *= toneMappingExposure / 0.6;\n\n\tcolor = ACESInputMat * color;\n\n\t// Apply RRT and ODT\n\tcolor = RRTAndODTFit( color );\n\n\tcolor = ACESOutputMat * color;\n\n\t// Clamp to [0, 1]\n\treturn saturate( color );\n\n}\n\nvec3 CustomToneMapping( vec3 color ) { return color; }\n",transmission_fragment:"\n#ifdef USE_TRANSMISSION\n\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationTint, attenuationDistance );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif\n",transmission_pars_fragment:"\n#ifdef USE_TRANSMISSION\n\n\t// Transmission code is based on glTF-Sampler-Viewer\n\t// https://github.com/KhronosGroup/glTF-Sample-Viewer\n\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationTint;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tuniform sampler2D transmissionMap;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tuniform sampler2D thicknessMap;\n\n\t#endif\n\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\n\tvarying vec3 vWorldPosition;\n\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\n\t\t// Direction of refracted light.\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\n\t\t// Compute rotation-independant scaling of the model matrix.\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\n\t\t// The thickness is specified in local space.\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\n\t}\n\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\n\t\t// Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and\n\t\t// an IOR of 1.5 results in the default amount of microfacet refraction.\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\n\t}\n\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\n\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\n\t\t#else\n\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\n\t\t#endif\n\n\t}\n\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\n\t\tif ( attenuationDistance == 0.0 ) {\n\n\t\t\t// Attenuation distance is +\u221e (which we indicate by zero), i.e. the transmitted color is not attenuated at all.\n\t\t\treturn radiance;\n\n\t\t} else {\n\n\t\t\t// Compute light attenuation using Beer's law.\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law\n\t\t\treturn transmittance * radiance;\n\n\t\t}\n\n\t}\n\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\n\t\t// Project refracted vector on the framebuffer, while mapping to normalized device coordinates.\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\n\t\t// Sample framebuffer to get pixel the refracted ray hits.\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\n\t\t// Get the specular component.\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\n\t}\n#endif\n",uv_pars_fragment:"\n#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\n\tvarying vec2 vUv;\n\n#endif\n",uv_pars_vertex:"\n#ifdef USE_UV\n\n\t#ifdef UVS_VERTEX_ONLY\n\n\t\tvec2 vUv;\n\n\t#else\n\n\t\tvarying vec2 vUv;\n\n\t#endif\n\n\tuniform mat3 uvTransform;\n\n#endif\n",uv_vertex:"\n#ifdef USE_UV\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n",uv2_pars_fragment:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif\n",uv2_pars_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n\tuniform mat3 uv2Transform;\n\n#endif\n",uv2_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",background_frag:"\nuniform sampler2D t2D;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",cube_frag:"\n#include <envmap_common_pars_fragment>\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",depth_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV = equirectUv( direction );\n\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",meshbasic_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\t#include <lightmap_fragment>\n\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\n\t// modulation\n\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( 1.0 );\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshnormal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",meshnormal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifdef USE_TRANSMISSION\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularTint;\n\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\n\t#ifdef USE_SPECULARTINTMAP\n\t\tuniform sampler2D specularTintMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenTint;\n\tuniform float sheenRoughness;\n#endif\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include <transmission_fragment>\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\n\t\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\n\n\t#endif\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",shadow_vert:"\n#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n\nvoid main() {\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"},Q={common:{diffuse:{value:new lt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new bi},uv2Transform:{value:new bi},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ce(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new lt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new lt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new bi}},sprite:{diffuse:{value:new lt(16777215)},opacity:{value:1},center:{value:new Ce(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new bi}}},Qi={basic:{uniforms:ln([Q.common,Q.specularmap,Q.envmap,Q.aomap,Q.lightmap,Q.fog]),vertexShader:qe.meshbasic_vert,fragmentShader:qe.meshbasic_frag},lambert:{uniforms:ln([Q.common,Q.specularmap,Q.envmap,Q.aomap,Q.lightmap,Q.emissivemap,Q.fog,Q.lights,{emissive:{value:new lt(0)}}]),vertexShader:qe.meshlambert_vert,fragmentShader:qe.meshlambert_frag},phong:{uniforms:ln([Q.common,Q.specularmap,Q.envmap,Q.aomap,Q.lightmap,Q.emissivemap,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.fog,Q.lights,{emissive:{value:new lt(0)},specular:{value:new lt(1118481)},shininess:{value:30}}]),vertexShader:qe.meshphong_vert,fragmentShader:qe.meshphong_frag},standard:{uniforms:ln([Q.common,Q.envmap,Q.aomap,Q.lightmap,Q.emissivemap,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.roughnessmap,Q.metalnessmap,Q.fog,Q.lights,{emissive:{value:new lt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:qe.meshphysical_vert,fragmentShader:qe.meshphysical_frag},toon:{uniforms:ln([Q.common,Q.aomap,Q.lightmap,Q.emissivemap,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.gradientmap,Q.fog,Q.lights,{emissive:{value:new lt(0)}}]),vertexShader:qe.meshtoon_vert,fragmentShader:qe.meshtoon_frag},matcap:{uniforms:ln([Q.common,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.fog,{matcap:{value:null}}]),vertexShader:qe.meshmatcap_vert,fragmentShader:qe.meshmatcap_frag},points:{uniforms:ln([Q.points,Q.fog]),vertexShader:qe.points_vert,fragmentShader:qe.points_frag},dashed:{uniforms:ln([Q.common,Q.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:qe.linedashed_vert,fragmentShader:qe.linedashed_frag},depth:{uniforms:ln([Q.common,Q.displacementmap]),vertexShader:qe.depth_vert,fragmentShader:qe.depth_frag},normal:{uniforms:ln([Q.common,Q.bumpmap,Q.normalmap,Q.displacementmap,{opacity:{value:1}}]),vertexShader:qe.meshnormal_vert,fragmentShader:qe.meshnormal_frag},sprite:{uniforms:ln([Q.sprite,Q.fog]),vertexShader:qe.sprite_vert,fragmentShader:qe.sprite_frag},background:{uniforms:{uvTransform:{value:new bi},t2D:{value:null}},vertexShader:qe.background_vert,fragmentShader:qe.background_frag},cube:{uniforms:ln([Q.envmap,{opacity:{value:1}}]),vertexShader:qe.cube_vert,fragmentShader:qe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:qe.equirect_vert,fragmentShader:qe.equirect_frag},distanceRGBA:{uniforms:ln([Q.common,Q.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:qe.distanceRGBA_vert,fragmentShader:qe.distanceRGBA_frag},shadow:{uniforms:ln([Q.lights,Q.fog,{color:{value:new lt(0)},opacity:{value:1}}]),vertexShader:qe.shadow_vert,fragmentShader:qe.shadow_frag}};function aV(n,e,t,i,r){const o=new lt(0);let a,l,s=0,c=null,u=0,d=null;function f(g,_){t.buffers.color.setClear(g.r,g.g,g.b,_,r)}return{getClearColor:function(){return o},setClearColor:function(g,_=1){o.set(g),s=_,f(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(g){s=g,f(o,s)},render:function h(g,_){let v=!1,p=!0===_.isScene?_.background:null;p&&p.isTexture&&(p=e.get(p));const m=n.xr,y=m.getSession&&m.getSession();y&&"additive"===y.environmentBlendMode&&(p=null),null===p?f(o,s):p&&p.isColor&&(f(p,1),v=!0),(n.autoClear||v)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),p&&(p.isCubeTexture||p.mapping===Ed)?(void 0===l&&(l=new Ki(new Jl(1,1,1),new ha({name:"BackgroundCubeMaterial",uniforms:da(Qi.cube.uniforms),vertexShader:Qi.cube.vertexShader,fragmentShader:Qi.cube.fragmentShader,side:qt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(M,w,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),l.material.uniforms.envMap.value=p,l.material.uniforms.flipEnvMap.value=p.isCubeTexture&&!1===p.isRenderTargetTexture?-1:1,(c!==p||u!==p.version||d!==n.toneMapping)&&(l.material.needsUpdate=!0,c=p,u=p.version,d=n.toneMapping),g.unshift(l,l.geometry,l.material,0,0,null)):p&&p.isTexture&&(void 0===a&&(a=new Ki(new ec(2,2),new ha({name:"BackgroundMaterial",uniforms:da(Qi.background.uniforms),vertexShader:Qi.background.vertexShader,fragmentShader:Qi.background.fragmentShader,side:jl,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(a)),a.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),a.material.uniforms.uvTransform.value.copy(p.matrix),(c!==p||u!==p.version||d!==n.toneMapping)&&(a.material.needsUpdate=!0,c=p,u=p.version,d=n.toneMapping),g.unshift(a,a.geometry,a.material,0,0,null))}}}function lV(n,e,t,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),o=i.isWebGL2?null:e.get("OES_vertex_array_object"),s=i.isWebGL2||null!==o,a={},l=_(null);let c=l;function h(N){return i.isWebGL2?n.bindVertexArray(N):o.bindVertexArrayOES(N)}function f(N){return i.isWebGL2?n.deleteVertexArray(N):o.deleteVertexArrayOES(N)}function _(N){const U=[],z=[],O=[];for(let k=0;k<r;k++)U[k]=0,z[k]=0,O[k]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:z,attributeDivisors:O,object:N,attributes:{},index:null}}function m(){const N=c.newAttributes;for(let U=0,z=N.length;U<z;U++)N[U]=0}function y(N){M(N,0)}function M(N,U){const O=c.enabledAttributes,k=c.attributeDivisors;c.newAttributes[N]=1,0===O[N]&&(n.enableVertexAttribArray(N),O[N]=1),k[N]!==U&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](N,U),k[N]=U)}function w(){const N=c.newAttributes,U=c.enabledAttributes;for(let z=0,O=U.length;z<O;z++)U[z]!==N[z]&&(n.disableVertexAttribArray(z),U[z]=0)}function C(N,U,z,O,k,Y){!0!==i.isWebGL2||z!==n.INT&&z!==n.UNSIGNED_INT?n.vertexAttribPointer(N,U,z,O,k,Y):n.vertexAttribIPointer(N,U,z,k,Y)}function R(){ee(),c!==l&&(c=l,h(c.object))}function ee(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function u(N,U,z,O,k){let Y=!1;if(s){const me=function g(N,U,z){const O=!0===z.wireframe;let k=a[N.id];void 0===k&&(k={},a[N.id]=k);let Y=k[U.id];void 0===Y&&(Y={},k[U.id]=Y);let me=Y[O];return void 0===me&&(me=_(function d(){return i.isWebGL2?n.createVertexArray():o.createVertexArrayOES()}()),Y[O]=me),me}(O,z,U);c!==me&&(c=me,h(c.object)),Y=function v(N,U){const z=c.attributes,O=N.attributes;let k=0;for(const Y in O){const me=z[Y],Ee=O[Y];if(void 0===me||me.attribute!==Ee||me.data!==Ee.data)return!0;k++}return c.attributesNum!==k||c.index!==U}(O,k),Y&&function p(N,U){const z={},O=N.attributes;let k=0;for(const Y in O){const me=O[Y],Ee={};Ee.attribute=me,me.data&&(Ee.data=me.data),z[Y]=Ee,k++}c.attributes=z,c.attributesNum=k,c.index=U}(O,k)}else{const me=!0===U.wireframe;(c.geometry!==O.id||c.program!==z.id||c.wireframe!==me)&&(c.geometry=O.id,c.program=z.id,c.wireframe=me,Y=!0)}!0===N.isInstancedMesh&&(Y=!0),null!==k&&t.update(k,n.ELEMENT_ARRAY_BUFFER),Y&&(function E(N,U,z,O){if(!1===i.isWebGL2&&(N.isInstancedMesh||O.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;m();const k=O.attributes,Y=z.getAttributes(),me=U.defaultAttributeValues;for(const Ee in Y){const de=Y[Ee];if(de.location>=0){let je=k[Ee];if(void 0===je&&("instanceMatrix"===Ee&&N.instanceMatrix&&(je=N.instanceMatrix),"instanceColor"===Ee&&N.instanceColor&&(je=N.instanceColor)),void 0!==je){const $=je.normalized,se=je.itemSize,ae=t.get(je);if(void 0===ae)continue;const S=ae.buffer,Re=ae.type,He=ae.bytesPerElement;if(je.isInterleavedBufferAttribute){const le=je.data,Se=le.stride,Qe=je.offset;if(le&&le.isInstancedInterleavedBuffer){for(let Pe=0;Pe<de.locationSize;Pe++)M(de.location+Pe,le.meshPerAttribute);!0!==N.isInstancedMesh&&void 0===O._maxInstanceCount&&(O._maxInstanceCount=le.meshPerAttribute*le.count)}else for(let Pe=0;Pe<de.locationSize;Pe++)y(de.location+Pe);n.bindBuffer(n.ARRAY_BUFFER,S);for(let Pe=0;Pe<de.locationSize;Pe++)C(de.location+Pe,se/de.locationSize,Re,$,Se*He,(Qe+se/de.locationSize*Pe)*He)}else{if(je.isInstancedBufferAttribute){for(let le=0;le<de.locationSize;le++)M(de.location+le,je.meshPerAttribute);!0!==N.isInstancedMesh&&void 0===O._maxInstanceCount&&(O._maxInstanceCount=je.meshPerAttribute*je.count)}else for(let le=0;le<de.locationSize;le++)y(de.location+le);n.bindBuffer(n.ARRAY_BUFFER,S);for(let le=0;le<de.locationSize;le++)C(de.location+le,se/de.locationSize,Re,$,se*He,se/de.locationSize*le*He)}}else if(void 0!==me){const $=me[Ee];if(void 0!==$)switch($.length){case 2:n.vertexAttrib2fv(de.location,$);break;case 3:n.vertexAttrib3fv(de.location,$);break;case 4:n.vertexAttrib4fv(de.location,$);break;default:n.vertexAttrib1fv(de.location,$)}}}}w()}(N,U,z,O),null!==k&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(k).buffer))},reset:R,resetDefaultState:ee,dispose:function B(){R();for(const N in a){const U=a[N];for(const z in U){const O=U[z];for(const k in O)f(O[k].object),delete O[k];delete U[z]}delete a[N]}},releaseStatesOfGeometry:function q(N){if(void 0===a[N.id])return;const U=a[N.id];for(const z in U){const O=U[z];for(const k in O)f(O[k].object),delete O[k];delete U[z]}delete a[N.id]},releaseStatesOfProgram:function H(N){for(const U in a){const z=a[U];if(void 0===z[N.id])continue;const O=z[N.id];for(const k in O)f(O[k].object),delete O[k];delete z[N.id]}},initAttributes:m,enableAttribute:y,disableUnusedAttributes:w}}function cV(n,e,t,i){const r=i.isWebGL2;let o;this.setMode=function s(c){o=c},this.render=function a(c,u){n.drawArrays(o,c,u),t.update(u,o,1)},this.renderInstances=function l(c,u,d){if(0===d)return;let h,f;if(r)h=n,f="drawArraysInstanced";else if(h=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",null===h)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[f](o,c,u,d),t.update(u,o,d)}}function uV(n,e,t){let i;function o(E){if("highp"===E){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";E="mediump"}return"mediump"===E&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let a=void 0!==t.precision?t.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=s||e.has("WEBGL_draw_buffers"),u=!0===t.logarithmicDepthBuffer,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),_=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),p=n.getParameter(n.MAX_VARYING_VECTORS),m=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,M=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:function r(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const E=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(E.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:o,precision:a,logarithmicDepthBuffer:u,maxTextures:d,maxVertexTextures:h,maxTextureSize:f,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:y,floatFragmentTextures:M,floatVertexTextures:y&&M,maxSamples:s?n.getParameter(n.MAX_SAMPLES):0}}function dV(n){const e=this;let t=null,i=0,r=!1,o=!1;const s=new Zr,a=new bi,l={value:null,needsUpdate:!1};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(d,h,f,g){const _=null!==d?d.length:0;let v=null;if(0!==_){if(v=l.value,!0!==g||null===v){const p=f+4*_,m=h.matrixWorldInverse;a.getNormalMatrix(m),(null===v||v.length<p)&&(v=new Float32Array(p));for(let y=0,M=f;y!==_;++y,M+=4)s.copy(d[y]).applyMatrix4(m,a),s.normal.toArray(v,M),v[M+3]=s.constant}l.value=v,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,v}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,h,f){const g=0!==d.length||h||0!==i||r;return r=h,t=u(d,f,0),i=d.length,g},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(d,h,f){const g=d.clippingPlanes,_=d.clipIntersection,v=d.clipShadows,p=n.get(d);if(!r||null===g||0===g.length||o&&!v)o?u(null):c();else{const m=o?0:i,y=4*m;let M=p.clippingState||null;l.value=M,M=u(g,h,y,f);for(let w=0;w!==y;++w)M[w]=t[w];p.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=m}}}let _a;Qi.physical={uniforms:ln([Qi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ce(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenTint:{value:new lt(0)},sheenRoughness:{value:0},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ce},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new lt(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new lt(1,1,1)},specularTintMap:{value:null}}]),vertexShader:qe.meshphysical_vert,fragmentShader:qe.meshphysical_frag};class hV{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===_a&&(_a=Cg("canvas")),_a.width=e.width,_a.height=e.height;const i=_a.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=_a}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let fV=0;class ai extends Vo{constructor(e=ai.DEFAULT_IMAGE,t=ai.DEFAULT_MAPPING,i=Wn,r=Wn,o=Zi,s=bd,a=Mn,l=Wr,c=1,u=xn){super(),Object.defineProperty(this,"id",{value:fV++}),this.uuid=ql(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=r,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new Ce(0,0),this.repeat=new Ce(1,1),this.center=new Ce(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new bi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=ql()),!t&&void 0===e.images[r.uuid]){let o;if(Array.isArray(r)){o=[];for(let s=0,a=r.length;s<a;s++)o.push(Hg(r[s].isDataTexture?r[s].image:r[s]))}else o=Hg(r);e.images[r.uuid]={uuid:r.uuid,url:o}}i.image=r.uuid}return t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ag:e.x=e.x-Math.floor(e.x);break;case Wn:e.x=e.x<0?0:1;break;case lg:e.x=1===Math.abs(Math.floor(e.x)%2)?Math.ceil(e.x)-e.x:e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ag:e.y=e.y-Math.floor(e.y);break;case Wn:e.y=e.y<0?0:1;break;case lg:e.y=1===Math.abs(Math.floor(e.y)%2)?Math.ceil(e.y)-e.y:e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&this.version++}}function Hg(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?hV.getDataURL(n):n.data?{data:Array.prototype.slice.call(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}ai.DEFAULT_IMAGE=void 0,ai.DEFAULT_MAPPING=300,ai.prototype.isTexture=!0;class io extends Vo{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new En(0,0,e,t),this.scissorTest=!1,this.viewport=new En(0,0,e,t),this.texture=new ai(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:Zi,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}io.prototype.isWebGLRenderTarget=!0;class Vg extends oi{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Yt,this.projectionMatrix=new Yt,this.projectionMatrixInverse=new Yt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Vg.prototype.isCamera=!0;class Xn extends Vg{constructor(e=50,t=1,i=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*mg*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Cd*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*mg*Math.atan(Math.tan(.5*Cd*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,o,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Cd*this.fov)/this.zoom,i=2*t,r=this.aspect*i,o=-.5*r;const s=this.view;if(null!==this.view&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;o+=s.offsetX*r/l,t-=s.offsetY*i/c,r*=s.width/l,i*=s.height/c}const a=this.filmOffset;0!==a&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}Xn.prototype.isPerspectiveCamera=!0;class pV extends oi{constructor(e,t,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const r=new Xn(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new I(1,0,0)),this.add(r);const o=new Xn(90,1,e,t);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new I(-1,0,0)),this.add(o);const s=new Xn(90,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new I(0,1,0)),this.add(s);const a=new Xn(90,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new I(0,-1,0)),this.add(a);const l=new Xn(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new I(0,0,1)),this.add(l);const c=new Xn(90,1,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new I(0,0,-1)),this.add(c)}update(e,t){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[r,o,s,a,l,c]=this.children,u=e.xr.enabled,d=e.getRenderTarget();e.xr.enabled=!1;const h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,o),e.setRenderTarget(i,2),e.render(t,s),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=h,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(d),e.xr.enabled=u}}class Gg extends ai{constructor(e,t,i,r,o,s,a,l,c,u){super(e=void 0!==e?e:[],t=void 0!==t?t:Md,i,r,o,s,a,l,c,u),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Gg.prototype.isCubeTexture=!0;class fD extends io{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),this.texture=new Gg(void 0,(t=t||{}).mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:Zi,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Mn,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i_uniforms={tEquirect:{value:null}},i_vertexShader="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",i_fragmentShader="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",r=new Jl(5,5,5),o=new ha({name:"CubemapFromEquirect",uniforms:da(i_uniforms),vertexShader:i_vertexShader,fragmentShader:i_fragmentShader,side:qt,blending:jr});o.uniforms.tEquirect.value=t;const s=new Ki(r,o),a=t.minFilter;return t.minFilter===bd&&(t.minFilter=Zi),new pV(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,i,r){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,i,r);e.setRenderTarget(o)}}function mV(n){let e=new WeakMap;function t(s,a){return a===rg?s.mapping=Md:a===og&&(s.mapping=xd),s}function r(s){const a=s.target;a.removeEventListener("dispose",r);const l=e.get(a);void 0!==l&&(e.delete(a),l.dispose())}return{get:function i(s){if(s&&s.isTexture&&!1===s.isRenderTargetTexture){const a=s.mapping;if(a===rg||a===og){if(e.has(s))return t(e.get(s).texture,s.mapping);{const l=s.image;if(l&&l.height>0){const c=n.getRenderTarget(),u=new fD(l.height/2);return u.fromEquirectangularTexture(n,s),e.set(s,u),n.setRenderTarget(c),s.addEventListener("dispose",r),t(u.texture,s.mapping)}return null}}}return s},dispose:function o(){e=new WeakMap}}}fD.prototype.isWebGLCubeRenderTarget=!0;class jg extends Vg{constructor(e=-1,t=1,i=1,r=-1,o=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,o,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let o=i-e,s=i+e,a=r+t,l=r-t;if(null!==this.view&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}jg.prototype.isOrthographicCamera=!0;class $d extends ha{constructor(e){super(e),this.type="RawShaderMaterial"}}$d.prototype.isRawShaderMaterial=!0;const Ma=4,ro=8,Ji=Math.pow(2,ro),pD=[.125,.215,.35,.446,.526,.582],mD=ro-Ma+1+pD.length,oo={[xn]:0,[na]:1,[fg]:2,[jS]:3,[WS]:4,[$S]:5,[hg]:6},Wg=new jg,{_lodPlanes:nc,_sizeLods:gD,_sigmas:qd}=vV(),_D=new lt;let $g=null;const jo=(1+Math.sqrt(5))/2,Ea=1/jo,vD=[new I(1,1,1),new I(-1,1,1),new I(1,1,-1),new I(-1,1,-1),new I(0,jo,Ea),new I(0,jo,-Ea),new I(Ea,0,jo),new I(-Ea,0,jo),new I(jo,Ea,0),new I(-jo,Ea,0)];class gV{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function yV(n){const e=new Float32Array(n),t=new I(0,1,0);return new $d({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:oo[xn]},outputEncoding:{value:oo[xn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:jr,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){$g=this._renderer.getRenderTarget();const o=this._allocateTargets();return this._sceneToCubeUV(e,i,r,o),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=xD(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=MD(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e<nc.length;e++)nc[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget($g),e.scissorTest=!1,Xd(e,0,0,e.width,e.height)}_fromTexture(e){$g=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:Fn,minFilter:Fn,generateMipmaps:!1,type:Wr,format:Zz,encoding:(n=e,void 0===n||n.type!==Wr||n.encoding!==xn&&n.encoding!==na&&n.encoding!==hg?fg:e.encoding),depthBuffer:!1},i=yD(t);var n;return i.depthBuffer=!e,this._pingPongRenderTarget=yD(t),i}_compileMaterial(e){const t=new Ki(nc[0],e);this._renderer.compile(t,Wg)}_sceneToCubeUV(e,t,i,r){const a=new Xn(90,1,t,i),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,h=u.outputEncoding,f=u.toneMapping;u.getClearColor(_D),u.toneMapping=Uo,u.outputEncoding=xn,u.autoClear=!1;const g=new ma({name:"PMREM.Background",side:qt,depthWrite:!1,depthTest:!1}),_=new Ki(new Jl,g);let v=!1;const p=e.background;p?p.isColor&&(g.color.copy(p),e.background=null,v=!0):(g.color.copy(_D),v=!0);for(let m=0;m<6;m++){const y=m%3;0==y?(a.up.set(0,l[m],0),a.lookAt(c[m],0,0)):1==y?(a.up.set(0,0,l[m]),a.lookAt(0,c[m],0)):(a.up.set(0,l[m],0),a.lookAt(0,0,c[m])),Xd(r,y*Ji,m>2?Ji:0,Ji,Ji),u.setRenderTarget(r),v&&u.render(_,a),u.render(e,a)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.outputEncoding=h,u.autoClear=d,e.background=p}_setEncoding(e,t){e.value=!0===this._renderer.capabilities.isWebGL2&&t.format===Mn&&t.type===Wr&&t.encoding===na?oo[xn]:oo[t.encoding]}_textureToCubeUV(e,t){const i=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=xD()):null==this._equirectShader&&(this._equirectShader=MD());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,o=new Ki(nc[0],r),s=r.uniforms;s.envMap.value=e,e.isCubeTexture||s.texelSize.value.set(1/e.image.width,1/e.image.height),this._setEncoding(s.inputEncoding,e),this._setEncoding(s.outputEncoding,t.texture),Xd(t,0,0,3*Ji,2*Ji),i.setRenderTarget(t),i.render(o,Wg)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<mD;r++){const o=Math.sqrt(qd[r]*qd[r]-qd[r-1]*qd[r-1]);this._blur(e,r-1,r,o,vD[(r-1)%vD.length])}t.autoClear=i}_blur(e,t,i,r,o){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,i,r,"latitudinal",o),this._halfBlur(s,e,i,i,r,"longitudinal",o)}_halfBlur(e,t,i,r,o,s,a){const l=this._renderer,c=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const d=new Ki(nc[r],c),h=c.uniforms,f=gD[i]-1,g=isFinite(o)?Math.PI/(2*f):2*Math.PI/39,_=o/g,v=isFinite(o)?1+Math.floor(3*_):20;v>20&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${v} samples when the maximum is set to 20`);const p=[];let m=0;for(let C=0;C<20;++C){const E=C/_,B=Math.exp(-E*E/2);p.push(B),0==C?m+=B:C<v&&(m+=2*B)}for(let C=0;C<p.length;C++)p[C]=p[C]/m;h.envMap.value=e.texture,h.samples.value=v,h.weights.value=p,h.latitudinal.value="latitudinal"===s,a&&(h.poleAxis.value=a),h.dTheta.value=g,h.mipInt.value=ro-i,this._setEncoding(h.inputEncoding,e.texture),this._setEncoding(h.outputEncoding,e.texture);const y=gD[r];Xd(t,3*Math.max(0,Ji-2*y),(0===r?0:2*Ji)+2*y*(r>ro-Ma?r-ro+Ma:0),3*y,2*y),l.setRenderTarget(t),l.render(d,Wg)}}function vV(){const n=[],e=[],t=[];let i=ro;for(let r=0;r<mD;r++){const o=Math.pow(2,i);e.push(o);let s=1/o;r>ro-Ma?s=pD[r-ro+Ma-1]:0==r&&(s=0),t.push(s);const a=1/(o-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],d=6,h=6,f=3,g=2,_=1,v=new Float32Array(f*h*d),p=new Float32Array(g*h*d),m=new Float32Array(_*h*d);for(let M=0;M<d;M++){const w=M%3*2/3-1,C=M>2?0:-1;v.set([w,C,0,w+2/3,C,0,w+2/3,C+1,0,w,C,0,w+2/3,C+1,0,w,C+1,0],f*h*M),p.set(u,g*h*M),m.set([M,M,M,M,M,M],_*h*M)}const y=new Qr;y.setAttribute("position",new ri(v,f)),y.setAttribute("uv",new ri(p,g)),y.setAttribute("faceIndex",new ri(m,_)),n.push(y),i>Ma&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function yD(n){const e=new io(3*Ji,3*Ji,n);return e.texture.mapping=Ed,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xd(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function MD(){const n=new Ce(1,1);return new $d({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:n},inputEncoding:{value:oo[xn]},outputEncoding:{value:oo[xn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:jr,depthTest:!1,depthWrite:!1})}function xD(){return new $d({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:oo[xn]},outputEncoding:{value:oo[xn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:jr,depthTest:!1,depthWrite:!1})}function MV(n){let e=new WeakMap,t=null;function o(a){const l=a.target;l.removeEventListener("dispose",o);const c=e.get(l);void 0!==c&&(e.delete(l),c.dispose())}return{get:function i(a){if(a&&a.isTexture&&!1===a.isRenderTargetTexture){const l=a.mapping,c=l===rg||l===og,u=l===Md||l===xd;if(c||u){if(e.has(a))return e.get(a).texture;{const d=a.image;if(c&&d&&d.height>0||u&&d&&function r(a){let l=0;for(let u=0;u<6;u++)void 0!==a[u]&&l++;return 6===l}(d)){const h=n.getRenderTarget();null===t&&(t=new gV(n));const f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),n.setRenderTarget(h),a.addEventListener("dispose",o),f.texture}return null}}}return a},dispose:function s(){e=new WeakMap,null!==t&&(t.dispose(),t=null)}}}function xV(n){const e={};function t(i){if(void 0!==e[i])return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return null!==t(i)},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(i){const r=t(i);return null===r&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function EV(n,e,t,i){const r={},o=new WeakMap;function s(d){const h=d.target;null!==h.index&&e.remove(h.index);for(const g in h.attributes)e.remove(h.attributes[g]);h.removeEventListener("dispose",s),delete r[h.id];const f=o.get(h);f&&(e.remove(f),o.delete(h)),i.releaseStatesOfGeometry(h),!0===h.isInstancedBufferGeometry&&delete h._maxInstanceCount,t.memory.geometries--}function c(d){const h=[],f=d.index,g=d.attributes.position;let _=0;if(null!==f){const m=f.array;_=f.version;for(let y=0,M=m.length;y<M;y+=3){const w=m[y+0],C=m[y+1],E=m[y+2];h.push(w,C,C,E,E,w)}}else{_=g.version;for(let y=0,M=g.array.length/3-1;y<M;y+=3){const w=y+0,C=y+1,E=y+2;h.push(w,C,C,E,E,w)}}const v=new(uD(h)>65535?nD:tD)(h,1);v.version=_;const p=o.get(d);p&&e.remove(p),o.set(d,v)}return{get:function a(d,h){return!0===r[h.id]||(h.addEventListener("dispose",s),r[h.id]=!0,t.memory.geometries++),h},update:function l(d){const h=d.attributes;for(const g in h)e.update(h[g],n.ARRAY_BUFFER);const f=d.morphAttributes;for(const g in f){const _=f[g];for(let v=0,p=_.length;v<p;v++)e.update(_[v],n.ARRAY_BUFFER)}},getWireframeAttribute:function u(d){const h=o.get(d);if(h){const f=d.index;null!==f&&h.version<f.version&&c(d)}else c(d);return o.get(d)}}}function bV(n,e,t,i){const r=i.isWebGL2;let o,a,l;this.setMode=function s(h){o=h},this.setIndex=function c(h){a=h.type,l=h.bytesPerElement},this.render=function u(h,f){n.drawElements(o,f,a,h*l),t.update(f,o,1)},this.renderInstances=function d(h,f,g){if(0===g)return;let _,v;if(r)_=n,v="drawElementsInstanced";else if(_=e.get("ANGLE_instanced_arrays"),v="drawElementsInstancedANGLE",null===_)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");_[v](o,f,a,h*l,g),t.update(f,o,g)}}function wV(n){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function r(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function i(o,s,a){switch(t.calls++,s){case n.TRIANGLES:t.triangles+=a*(o/3);break;case n.LINES:t.lines+=a*(o/2);break;case n.LINE_STRIP:t.lines+=a*(o-1);break;case n.LINE_LOOP:t.lines+=a*o;break;case n.POINTS:t.points+=a*o;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s)}}}}class Yg extends ai{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=Wn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}function SV(n,e){return n[0]-e[0]}function DV(n,e){return Math.abs(e[1])-Math.abs(n[1])}function ED(n,e){let t=1;const i=e.isInterleavedBufferAttribute?e.data.array:e.array;i instanceof Int8Array?t=127:i instanceof Int16Array?t=32767:i instanceof Int32Array?t=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",i),n.divideScalar(t)}function CV(n,e,t){const i={},r=new Float32Array(8),o=new WeakMap,s=new I,a=[];for(let c=0;c<8;c++)a[c]=[c,0];return{update:function l(c,u,d,h){const f=c.morphTargetInfluences;if(!0===e.isWebGL2){const g=u.morphAttributes.position.length;let _=o.get(u);if(void 0===_||_.count!==g){void 0!==_&&_.texture.dispose();const m=void 0!==u.morphAttributes.normal,y=u.morphAttributes.position,M=u.morphAttributes.normal||[],C=!0===m?2:1;let E=u.attributes.position.count*C,B=1;E>e.maxTextureSize&&(B=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const q=new Float32Array(E*B*4*g),H=new Yg(q,E,B,g);H.format=Mn,H.type=$r;const R=4*C;for(let ee=0;ee<g;ee++){const N=y[ee],U=M[ee],z=E*B*4*ee;for(let O=0;O<N.count;O++){s.fromBufferAttribute(N,O),!0===N.normalized&&ED(s,N);const k=O*R;q[z+k+0]=s.x,q[z+k+1]=s.y,q[z+k+2]=s.z,q[z+k+3]=0,!0===m&&(s.fromBufferAttribute(U,O),!0===U.normalized&&ED(s,U),q[z+k+4]=s.x,q[z+k+5]=s.y,q[z+k+6]=s.z,q[z+k+7]=0)}}_={count:g,texture:H,size:new Ce(E,B)},o.set(u,_)}let v=0;for(let m=0;m<f.length;m++)v+=f[m];const p=u.morphTargetsRelative?1:1-v;h.getUniforms().setValue(n,"morphTargetBaseInfluence",p),h.getUniforms().setValue(n,"morphTargetInfluences",f),h.getUniforms().setValue(n,"morphTargetsTexture",_.texture,t),h.getUniforms().setValue(n,"morphTargetsTextureSize",_.size)}else{const g=void 0===f?0:f.length;let _=i[u.id];if(void 0===_||_.length!==g){_=[];for(let M=0;M<g;M++)_[M]=[M,0];i[u.id]=_}for(let M=0;M<g;M++){const w=_[M];w[0]=M,w[1]=f[M]}_.sort(DV);for(let M=0;M<8;M++)M<g&&_[M][1]?(a[M][0]=_[M][0],a[M][1]=_[M][1]):(a[M][0]=Number.MAX_SAFE_INTEGER,a[M][1]=0);a.sort(SV);const v=u.morphAttributes.position,p=u.morphAttributes.normal;let m=0;for(let M=0;M<8;M++){const w=a[M],C=w[0],E=w[1];C!==Number.MAX_SAFE_INTEGER&&E?(v&&u.getAttribute("morphTarget"+M)!==v[C]&&u.setAttribute("morphTarget"+M,v[C]),p&&u.getAttribute("morphNormal"+M)!==p[C]&&u.setAttribute("morphNormal"+M,p[C]),r[M]=E,m+=E):(v&&!0===u.hasAttribute("morphTarget"+M)&&u.deleteAttribute("morphTarget"+M),p&&!0===u.hasAttribute("morphNormal"+M)&&u.deleteAttribute("morphNormal"+M),r[M]=0)}const y=u.morphTargetsRelative?1:1-m;h.getUniforms().setValue(n,"morphTargetBaseInfluence",y),h.getUniforms().setValue(n,"morphTargetInfluences",r)}}}}Yg.prototype.isDataTexture2DArray=!0;class bD extends io{constructor(e,t,i){super(e,t,i),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}function TV(n,e,t,i){let r=new WeakMap;function a(l){const c=l.target;c.removeEventListener("dispose",a),t.remove(c.instanceMatrix),null!==c.instanceColor&&t.remove(c.instanceColor)}return{update:function o(l){const c=i.render.frame,d=e.get(l,l.geometry);return r.get(d)!==c&&(e.update(d),r.set(d,c)),l.isInstancedMesh&&(!1===l.hasEventListener("dispose",a)&&l.addEventListener("dispose",a),t.update(l.instanceMatrix,n.ARRAY_BUFFER),null!==l.instanceColor&&t.update(l.instanceColor,n.ARRAY_BUFFER)),d},dispose:function s(){r=new WeakMap}}}bD.prototype.isWebGLMultisampleRenderTarget=!0;class wD extends ai{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=Wn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}wD.prototype.isDataTexture3D=!0;const SD=new ai,AV=new Yg,IV=new wD,DD=new Gg,CD=[],TD=[],AD=new Float32Array(16),ID=new Float32Array(9),RD=new Float32Array(4);function ba(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let o=CD[r];if(void 0===o&&(o=new Float32Array(r),CD[r]=o),0!==e){i.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=t,n[s].toArray(o,a)}return o}function bn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function cn(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function PD(n,e){let t=TD[e];void 0===t&&(t=new Int32Array(e),TD[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function RV(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function PV(n,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(bn(t,e))return;n.uniform2fv(this.addr,e),cn(t,e)}}function LV(n,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(void 0!==e.r)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(bn(t,e))return;n.uniform3fv(this.addr,e),cn(t,e)}}function FV(n,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(bn(t,e))return;n.uniform4fv(this.addr,e),cn(t,e)}}function NV(n,e){const t=this.cache,i=e.elements;if(void 0===i){if(bn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),cn(t,e)}else{if(bn(t,i))return;RD.set(i),n.uniformMatrix2fv(this.addr,!1,RD),cn(t,i)}}function OV(n,e){const t=this.cache,i=e.elements;if(void 0===i){if(bn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),cn(t,e)}else{if(bn(t,i))return;ID.set(i),n.uniformMatrix3fv(this.addr,!1,ID),cn(t,i)}}function kV(n,e){const t=this.cache,i=e.elements;if(void 0===i){if(bn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),cn(t,e)}else{if(bn(t,i))return;AD.set(i),n.uniformMatrix4fv(this.addr,!1,AD),cn(t,i)}}function UV(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function BV(n,e){const t=this.cache;bn(t,e)||(n.uniform2iv(this.addr,e),cn(t,e))}function zV(n,e){const t=this.cache;bn(t,e)||(n.uniform3iv(this.addr,e),cn(t,e))}function HV(n,e){const t=this.cache;bn(t,e)||(n.uniform4iv(this.addr,e),cn(t,e))}function VV(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function GV(n,e){const t=this.cache;bn(t,e)||(n.uniform2uiv(this.addr,e),cn(t,e))}function jV(n,e){const t=this.cache;bn(t,e)||(n.uniform3uiv(this.addr,e),cn(t,e))}function WV(n,e){const t=this.cache;bn(t,e)||(n.uniform4uiv(this.addr,e),cn(t,e))}function $V(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTexture2D(e||SD,r)}function qV(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||IV,r)}function XV(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTextureCube(e||DD,r)}function YV(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||AV,r)}function KV(n,e){n.uniform1fv(this.addr,e)}function QV(n,e){const t=ba(e,this.size,2);n.uniform2fv(this.addr,t)}function JV(n,e){const t=ba(e,this.size,3);n.uniform3fv(this.addr,t)}function eG(n,e){const t=ba(e,this.size,4);n.uniform4fv(this.addr,t)}function tG(n,e){const t=ba(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function nG(n,e){const t=ba(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function iG(n,e){const t=ba(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function rG(n,e){n.uniform1iv(this.addr,e)}function oG(n,e){n.uniform2iv(this.addr,e)}function sG(n,e){n.uniform3iv(this.addr,e)}function aG(n,e){n.uniform4iv(this.addr,e)}function lG(n,e){n.uniform1uiv(this.addr,e)}function cG(n,e){n.uniform2uiv(this.addr,e)}function uG(n,e){n.uniform3uiv(this.addr,e)}function dG(n,e){n.uniform4uiv(this.addr,e)}function hG(n,e,t){const i=e.length,r=PD(t,i);n.uniform1iv(this.addr,r);for(let o=0;o!==i;++o)t.safeSetTexture2D(e[o]||SD,r[o])}function fG(n,e,t){const i=e.length,r=PD(t,i);n.uniform1iv(this.addr,r);for(let o=0;o!==i;++o)t.safeSetTextureCube(e[o]||DD,r[o])}function mG(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=function ZV(n){switch(n){case 5126:return RV;case 35664:return PV;case 35665:return LV;case 35666:return FV;case 35674:return NV;case 35675:return OV;case 35676:return kV;case 5124:case 35670:return UV;case 35667:case 35671:return BV;case 35668:case 35672:return zV;case 35669:case 35673:return HV;case 5125:return VV;case 36294:return GV;case 36295:return jV;case 36296:return WV;case 35678:case 36198:case 36298:case 36306:case 35682:return $V;case 35679:case 36299:case 36307:return qV;case 35680:case 36300:case 36308:case 36293:return XV;case 36289:case 36303:case 36311:case 36292:return YV}}(e.type)}function LD(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=function pG(n){switch(n){case 5126:return KV;case 35664:return QV;case 35665:return JV;case 35666:return eG;case 35674:return tG;case 35675:return nG;case 35676:return iG;case 5124:case 35670:return rG;case 35667:case 35671:return oG;case 35668:case 35672:return sG;case 35669:case 35673:return aG;case 5125:return lG;case 36294:return cG;case 36295:return uG;case 36296:return dG;case 35678:case 36198:case 36298:case 36306:case 35682:return hG;case 35680:case 36300:case 36308:case 36293:return fG}}(e.type)}function FD(n){this.id=n,this.seq=[],this.map={}}LD.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),cn(e,n)},FD.prototype.setValue=function(n,e,t){const i=this.seq;for(let r=0,o=i.length;r!==o;++r){const s=i[r];s.setValue(n,e[s.id],t)}};const Zg=/(\w+)(\])?(\[|\.)?/g;function ND(n,e){n.seq.push(e),n.map[e.id]=e}function gG(n,e,t){const i=n.name,r=i.length;for(Zg.lastIndex=0;;){const o=Zg.exec(i);let a=o[1];const c=o[3];if("]"===o[2]&&(a|=0),void 0===c||"["===c&&Zg.lastIndex+2===r){ND(t,void 0===c?new mG(a,n,e):new LD(a,n,e));break}{let d=t.map[a];void 0===d&&(d=new FD(a),ND(t,d)),t=d}}}function so(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,n.ACTIVE_UNIFORMS);for(let i=0;i<t;++i){const r=n.getActiveUniform(e,i);gG(r,n.getUniformLocation(e,r.name),this)}}function OD(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}so.prototype.setValue=function(n,e,t,i){const r=this.map[e];void 0!==r&&r.setValue(n,t,i)},so.prototype.setOptional=function(n,e,t){const i=e[t];void 0!==i&&this.setValue(n,t,i)},so.upload=function(n,e,t,i){for(let r=0,o=e.length;r!==o;++r){const s=e[r],a=t[s.id];!1!==a.needsUpdate&&s.setValue(n,a.value,i)}},so.seqWithValue=function(n,e){const t=[];for(let i=0,r=n.length;i!==r;++i){const o=n[i];o.id in e&&t.push(o)}return t};let _G=0;function kD(n){switch(n){case xn:return["Linear","( value )"];case na:return["sRGB","( value )"];case fg:return["RGBE","( value )"];case jS:return["RGBM","( value, 7.0 )"];case WS:return["RGBM","( value, 16.0 )"];case $S:return["RGBD","( value, 256.0 )"];case hg:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case LH:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function UD(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();return i&&""===r?"":t.toUpperCase()+"\n\n"+r+"\n\n"+function vG(n){const e=n.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}(n.getShaderSource(e))}function wa(n,e){const t=kD(e);return"vec4 "+n+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function yG(n,e){const t=kD(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function MG(n,e){let t;switch(e){case Nz:t="Linear";break;case Oz:t="Reinhard";break;case kz:t="OptimizedCineon";break;case Uz:t="ACESFilmic";break;case Bz:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function ic(n){return""!==n}function BD(n,e){return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function zD(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const wG=/^[ \t]*#include +<([\w\d./]+)>/gm;function Kg(n){return n.replace(wG,SG)}function SG(n,e){const t=qe[e];if(void 0===t)throw new Error("Can not resolve #include <"+e+">");return Kg(t)}const DG=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,CG=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function HD(n){return n.replace(CG,VD).replace(DG,TG)}function TG(n,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),VD(0,e,t,i)}function VD(n,e,t,i){let r="";for(let o=parseInt(e);o<parseInt(t);o++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function GD(n){let e="precision "+n.precision+" float;\nprecision "+n.precision+" int;";return"highp"===n.precision?e+="\n#define HIGH_PRECISION":"mediump"===n.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===n.precision&&(e+="\n#define LOW_PRECISION"),e}function LG(n,e,t,i){const r=n.getContext(),o=t.defines;let s=t.vertexShader,a=t.fragmentShader;const l=function AG(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===ES?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===hz?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Gl&&(e="SHADOWMAP_TYPE_VSM"),e}(t),c=function IG(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Md:case xd:e="ENVMAP_TYPE_CUBE";break;case Ed:case sg:e="ENVMAP_TYPE_CUBE_UV"}return e}(t),u=function RG(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case xd:case sg:e="ENVMAP_MODE_REFRACTION"}return e}(t),d=function PG(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case IS:e="ENVMAP_BLENDING_MULTIPLY";break;case Lz:e="ENVMAP_BLENDING_MIX";break;case Fz:e="ENVMAP_BLENDING_ADD"}return e}(t),h=n.gammaFactor>0?n.gammaFactor:1,f=t.isWebGL2?"":function xG(n){return[n.extensionDerivatives||n.envMapCubeUV||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||"physical"===n.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ic).join("\n")}(t),g=function EG(n){const e=[];for(const t in n){const i=n[t];!1!==i&&e.push("#define "+t+" "+i)}return e.join("\n")}(o),_=r.createProgram();let v,p,m=t.glslVersion?"#version "+t.glslVersion+"\n":"";t.isRawShaderMaterial?(v=[g].filter(ic).join("\n"),v.length>0&&(v+="\n"),p=[f,g].filter(ic).join("\n"),p.length>0&&(p+="\n")):(v=[GD(t),"#define SHADER_NAME "+t.shaderName,g,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+h,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&!1===t.flatShading?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ic).join("\n"),p=[f,GD(t),"#define SHADER_NAME "+t.shaderName,g,"#define GAMMA_FACTOR "+h,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Uo?"#define TONE_MAPPING":"",t.toneMapping!==Uo?qe.tonemapping_pars_fragment:"",t.toneMapping!==Uo?MG("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.format===$l?"#define OPAQUE":"",qe.encodings_pars_fragment,t.map?wa("mapTexelToLinear",t.mapEncoding):"",t.matcap?wa("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?wa("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?wa("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?wa("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?wa("lightMapTexelToLinear",t.lightMapEncoding):"",yG("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"","\n"].filter(ic).join("\n")),s=Kg(s),s=BD(s,t),s=zD(s,t),a=Kg(a),a=BD(a,t),a=zD(a,t),s=HD(s),a=HD(a),t.isWebGL2&&!0!==t.isRawShaderMaterial&&(m="#version 300 es\n",v=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,p=["#define varying in",t.glslVersion===XS?"":"out highp vec4 pc_fragColor;",t.glslVersion===XS?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+p);const M=m+p+a,w=OD(r,r.VERTEX_SHADER,m+v+s),C=OD(r,r.FRAGMENT_SHADER,M);if(r.attachShader(_,w),r.attachShader(_,C),void 0!==t.index0AttributeName?r.bindAttribLocation(_,0,t.index0AttributeName):!0===t.morphTargets&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),n.debug.checkShaderErrors){const q=r.getProgramInfoLog(_).trim(),H=r.getShaderInfoLog(w).trim(),R=r.getShaderInfoLog(C).trim();let ee=!0,N=!0;if(!1===r.getProgramParameter(_,r.LINK_STATUS)){ee=!1;const U=UD(r,w,"vertex"),z=UD(r,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+"\n\nProgram Info Log: "+q+"\n"+U+"\n"+z)}else""!==q?console.warn("THREE.WebGLProgram: Program Info Log:",q):(""===H||""===R)&&(N=!1);N&&(this.diagnostics={runnable:ee,programLog:q,vertexShader:{log:H,prefix:v},fragmentShader:{log:R,prefix:p}})}let E,B;return r.deleteShader(w),r.deleteShader(C),this.getUniforms=function(){return void 0===E&&(E=new so(r,_)),E},this.getAttributes=function(){return void 0===B&&(B=function bG(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const o=n.getActiveAttrib(e,r),s=o.name;let a=1;o.type===n.FLOAT_MAT2&&(a=2),o.type===n.FLOAT_MAT3&&(a=3),o.type===n.FLOAT_MAT4&&(a=4),t[s]={type:o.type,location:n.getAttribLocation(e,s),locationSize:a}}return t}(r,_)),B},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=_G++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=w,this.fragmentShader=C,this}function FG(n,e,t,i,r,o,s){const a=[],l=r.isWebGL2,c=r.logarithmicDepthBuffer,u=r.floatVertexTextures,d=r.maxVertexUniforms,h=r.vertexTextures;let f=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},_=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","morphTargetsCount","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","sheen","transmission","transmissionMap","thicknessMap"];function p(E){let B;return E&&E.isTexture?B=E.encoding:E&&E.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),B=E.texture.encoding):B=xn,l&&E&&E.isTexture&&E.format===Mn&&E.type===Wr&&E.encoding===na&&(B=xn),B}return{getParameters:function m(E,B,q,H,R){const ee=H.fog,U=(E.isMeshStandardMaterial?t:e).get(E.envMap||(E.isMeshStandardMaterial?H.environment:null)),z=g[E.type],O=R.isSkinnedMesh?function v(E){const q=E.skeleton.bones;if(u)return 1024;{const R=Math.floor((d-20)/4),ee=Math.min(R,q.length);return ee<q.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+q.length+" bones. This GPU supports "+ee+"."),0):ee}}(R):0;let k,Y;if(null!==E.precision&&(f=r.getMaxPrecision(E.precision),f!==E.precision&&console.warn("THREE.WebGLProgram.getParameters:",E.precision,"not supported, using",f,"instead.")),z){const $=Qi[z];k=$.vertexShader,Y=$.fragmentShader}else k=E.vertexShader,Y=E.fragmentShader;const me=n.getRenderTarget(),Ee=E.alphaTest>0,de=E.clearcoat>0;return{isWebGL2:l,shaderID:z,shaderName:E.type,vertexShader:k,fragmentShader:Y,defines:E.defines,isRawShaderMaterial:!0===E.isRawShaderMaterial,glslVersion:E.glslVersion,precision:f,instancing:!0===R.isInstancedMesh,instancingColor:!0===R.isInstancedMesh&&null!==R.instanceColor,supportsVertexTextures:h,outputEncoding:null!==me?p(me.texture):n.outputEncoding,map:!!E.map,mapEncoding:p(E.map),matcap:!!E.matcap,matcapEncoding:p(E.matcap),envMap:!!U,envMapMode:U&&U.mapping,envMapEncoding:p(U),envMapCubeUV:!!U&&(U.mapping===Ed||U.mapping===sg),lightMap:!!E.lightMap,lightMapEncoding:p(E.lightMap),aoMap:!!E.aoMap,emissiveMap:!!E.emissiveMap,emissiveMapEncoding:p(E.emissiveMap),bumpMap:!!E.bumpMap,normalMap:!!E.normalMap,objectSpaceNormalMap:E.normalMapType===kH,tangentSpaceNormalMap:E.normalMapType===OH,clearcoat:de,clearcoatMap:de&&!!E.clearcoatMap,clearcoatRoughnessMap:de&&!!E.clearcoatRoughnessMap,clearcoatNormalMap:de&&!!E.clearcoatNormalMap,displacementMap:!!E.displacementMap,roughnessMap:!!E.roughnessMap,metalnessMap:!!E.metalnessMap,specularMap:!!E.specularMap,specularIntensityMap:!!E.specularIntensityMap,specularTintMap:!!E.specularTintMap,specularTintMapEncoding:p(E.specularTintMap),alphaMap:!!E.alphaMap,alphaTest:Ee,gradientMap:!!E.gradientMap,sheen:E.sheen>0,transmission:E.transmission>0,transmissionMap:!!E.transmissionMap,thicknessMap:!!E.thicknessMap,combine:E.combine,vertexTangents:!!E.normalMap&&!!R.geometry&&!!R.geometry.attributes.tangent,vertexColors:E.vertexColors,vertexAlphas:!0===E.vertexColors&&!!R.geometry&&!!R.geometry.attributes.color&&4===R.geometry.attributes.color.itemSize,vertexUvs:!!(E.map||E.bumpMap||E.normalMap||E.specularMap||E.alphaMap||E.emissiveMap||E.roughnessMap||E.metalnessMap||E.clearcoatMap||E.clearcoatRoughnessMap||E.clearcoatNormalMap||E.displacementMap||E.transmissionMap||E.thicknessMap||E.specularIntensityMap||E.specularTintMap),uvsVertexOnly:!(E.map||E.bumpMap||E.normalMap||E.specularMap||E.alphaMap||E.emissiveMap||E.roughnessMap||E.metalnessMap||E.clearcoatNormalMap||E.transmission>0||E.transmissionMap||E.thicknessMap||E.specularIntensityMap||E.specularTintMap||!E.displacementMap),fog:!!ee,useFog:E.fog,fogExp2:ee&&ee.isFogExp2,flatShading:!!E.flatShading,sizeAttenuation:E.sizeAttenuation,logarithmicDepthBuffer:c,skinning:!0===R.isSkinnedMesh&&O>0,maxBones:O,useVertexTexture:u,morphTargets:!!R.geometry&&!!R.geometry.morphAttributes.position,morphNormals:!!R.geometry&&!!R.geometry.morphAttributes.normal,morphTargetsCount:R.geometry&&R.geometry.morphAttributes.position?R.geometry.morphAttributes.position.length:0,numDirLights:B.directional.length,numPointLights:B.point.length,numSpotLights:B.spot.length,numRectAreaLights:B.rectArea.length,numHemiLights:B.hemi.length,numDirLightShadows:B.directionalShadowMap.length,numPointLightShadows:B.pointShadowMap.length,numSpotLightShadows:B.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,format:E.format,dithering:E.dithering,shadowMapEnabled:n.shadowMap.enabled&&q.length>0,shadowMapType:n.shadowMap.type,toneMapping:E.toneMapped?n.toneMapping:Uo,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===Js,flipSided:E.side===qt,depthPacking:void 0!==E.depthPacking&&E.depthPacking,index0AttributeName:E.index0AttributeName,extensionDerivatives:E.extensions&&E.extensions.derivatives,extensionFragDepth:E.extensions&&E.extensions.fragDepth,extensionDrawBuffers:E.extensions&&E.extensions.drawBuffers,extensionShaderTextureLOD:E.extensions&&E.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||i.has("EXT_shader_texture_lod"),customProgramCacheKey:E.customProgramCacheKey()}},getProgramCacheKey:function y(E){const B=[];if(E.shaderID?B.push(E.shaderID):(B.push(E.fragmentShader),B.push(E.vertexShader)),void 0!==E.defines)for(const q in E.defines)B.push(q),B.push(E.defines[q]);if(!1===E.isRawShaderMaterial){for(let q=0;q<_.length;q++)B.push(E[_[q]]);B.push(n.outputEncoding),B.push(n.gammaFactor)}return B.push(E.customProgramCacheKey),B.join()},getUniforms:function M(E){const B=g[E.type];let q;return q=B?nV.clone(Qi[B].uniforms):E.uniforms,q},acquireProgram:function w(E,B){let q;for(let H=0,R=a.length;H<R;H++){const ee=a[H];if(ee.cacheKey===B){q=ee,++q.usedTimes;break}}return void 0===q&&(q=new LG(n,B,E,o),a.push(q)),q},releaseProgram:function C(E){if(0==--E.usedTimes){const B=a.indexOf(E);a[B]=a[a.length-1],a.pop(),E.destroy()}},programs:a}}function NG(){let n=new WeakMap;return{get:function e(o){let s=n.get(o);return void 0===s&&(s={},n.set(o,s)),s},remove:function t(o){n.delete(o)},update:function i(o,s,a){n.get(o)[s]=a},dispose:function r(){n=new WeakMap}}}function OG(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.program!==e.program?n.program.id-e.program.id:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function jD(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function WD(n){const e=[];let t=0;const i=[],r=[],o=[],s={id:-1};function l(f,g,_,v,p,m){let y=e[t];const M=n.get(_);return void 0===y?(y={id:f.id,object:f,geometry:g,material:_,program:M.program||s,groupOrder:v,renderOrder:f.renderOrder,z:p,group:m},e[t]=y):(y.id=f.id,y.object=f,y.geometry=g,y.material=_,y.program=M.program||s,y.groupOrder=v,y.renderOrder=f.renderOrder,y.z=p,y.group=m),t++,y}return{opaque:i,transmissive:r,transparent:o,init:function a(){t=0,i.length=0,r.length=0,o.length=0},push:function c(f,g,_,v,p,m){const y=l(f,g,_,v,p,m);_.transmission>0?r.push(y):!0===_.transparent?o.push(y):i.push(y)},unshift:function u(f,g,_,v,p,m){const y=l(f,g,_,v,p,m);_.transmission>0?r.unshift(y):!0===_.transparent?o.unshift(y):i.unshift(y)},finish:function h(){for(let f=t,g=e.length;f<g;f++){const _=e[f];if(null===_.id)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.program=null,_.group=null}},sort:function d(f,g){i.length>1&&i.sort(f||OG),r.length>1&&r.sort(g||jD),o.length>1&&o.sort(g||jD)}}}function kG(n){let e=new WeakMap;return{get:function t(r,o){let s;return!1===e.has(r)?(s=new WD(n),e.set(r,[s])):o>=e.get(r).length?(s=new WD(n),e.get(r).push(s)):s=e.get(r)[o],s},dispose:function i(){e=new WeakMap}}}function UG(){const n={};return{get:function(e){if(void 0!==n[e.id])return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new I,color:new lt};break;case"SpotLight":t={position:new I,direction:new I,color:new lt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new I,color:new lt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new I,skyColor:new lt,groundColor:new lt};break;case"RectAreaLight":t={color:new lt,position:new I,halfWidth:new I,halfHeight:new I}}return n[e.id]=t,t}}}let zG=0;function HG(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function VG(n,e){const t=new UG,i=function BG(){const n={};return{get:function(e){if(void 0!==n[e.id])return n[e.id];let t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ce};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ce,shadowCameraNear:1,shadowCameraFar:1e3}}return n[e.id]=t,t}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)r.probe.push(new I);const o=new I,s=new Yt,a=new Yt;return{setup:function l(u,d){let h=0,f=0,g=0;for(let q=0;q<9;q++)r.probe[q].set(0,0,0);let _=0,v=0,p=0,m=0,y=0,M=0,w=0,C=0;u.sort(HG);const E=!0!==d?Math.PI:1;for(let q=0,H=u.length;q<H;q++){const R=u[q],ee=R.color,N=R.intensity,U=R.distance,z=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=ee.r*N*E,f+=ee.g*N*E,g+=ee.b*N*E;else if(R.isLightProbe)for(let O=0;O<9;O++)r.probe[O].addScaledVector(R.sh.coefficients[O],N);else if(R.isDirectionalLight){const O=t.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity*E),R.castShadow){const k=R.shadow,Y=i.get(R);Y.shadowBias=k.bias,Y.shadowNormalBias=k.normalBias,Y.shadowRadius=k.radius,Y.shadowMapSize=k.mapSize,r.directionalShadow[_]=Y,r.directionalShadowMap[_]=z,r.directionalShadowMatrix[_]=R.shadow.matrix,M++}r.directional[_]=O,_++}else if(R.isSpotLight){const O=t.get(R);if(O.position.setFromMatrixPosition(R.matrixWorld),O.color.copy(ee).multiplyScalar(N*E),O.distance=U,O.coneCos=Math.cos(R.angle),O.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),O.decay=R.decay,R.castShadow){const k=R.shadow,Y=i.get(R);Y.shadowBias=k.bias,Y.shadowNormalBias=k.normalBias,Y.shadowRadius=k.radius,Y.shadowMapSize=k.mapSize,r.spotShadow[p]=Y,r.spotShadowMap[p]=z,r.spotShadowMatrix[p]=R.shadow.matrix,C++}r.spot[p]=O,p++}else if(R.isRectAreaLight){const O=t.get(R);O.color.copy(ee).multiplyScalar(N),O.halfWidth.set(.5*R.width,0,0),O.halfHeight.set(0,.5*R.height,0),r.rectArea[m]=O,m++}else if(R.isPointLight){const O=t.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity*E),O.distance=R.distance,O.decay=R.decay,R.castShadow){const k=R.shadow,Y=i.get(R);Y.shadowBias=k.bias,Y.shadowNormalBias=k.normalBias,Y.shadowRadius=k.radius,Y.shadowMapSize=k.mapSize,Y.shadowCameraNear=k.camera.near,Y.shadowCameraFar=k.camera.far,r.pointShadow[v]=Y,r.pointShadowMap[v]=z,r.pointShadowMatrix[v]=R.shadow.matrix,w++}r.point[v]=O,v++}else if(R.isHemisphereLight){const O=t.get(R);O.skyColor.copy(R.color).multiplyScalar(N*E),O.groundColor.copy(R.groundColor).multiplyScalar(N*E),r.hemi[y]=O,y++}}m>0&&(e.isWebGL2||!0===n.has("OES_texture_float_linear")?(r.rectAreaLTC1=Q.LTC_FLOAT_1,r.rectAreaLTC2=Q.LTC_FLOAT_2):!0===n.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Q.LTC_HALF_1,r.rectAreaLTC2=Q.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=h,r.ambient[1]=f,r.ambient[2]=g;const B=r.hash;(B.directionalLength!==_||B.pointLength!==v||B.spotLength!==p||B.rectAreaLength!==m||B.hemiLength!==y||B.numDirectionalShadows!==M||B.numPointShadows!==w||B.numSpotShadows!==C)&&(r.directional.length=_,r.spot.length=p,r.rectArea.length=m,r.point.length=v,r.hemi.length=y,r.directionalShadow.length=M,r.directionalShadowMap.length=M,r.pointShadow.length=w,r.pointShadowMap.length=w,r.spotShadow.length=C,r.spotShadowMap.length=C,r.directionalShadowMatrix.length=M,r.pointShadowMatrix.length=w,r.spotShadowMatrix.length=C,B.directionalLength=_,B.pointLength=v,B.spotLength=p,B.rectAreaLength=m,B.hemiLength=y,B.numDirectionalShadows=M,B.numPointShadows=w,B.numSpotShadows=C,r.version=zG++)},setupView:function c(u,d){let h=0,f=0,g=0,_=0,v=0;const p=d.matrixWorldInverse;for(let m=0,y=u.length;m<y;m++){const M=u[m];if(M.isDirectionalLight){const w=r.directional[h];w.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),w.direction.sub(o),w.direction.transformDirection(p),h++}else if(M.isSpotLight){const w=r.spot[g];w.position.setFromMatrixPosition(M.matrixWorld),w.position.applyMatrix4(p),w.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),w.direction.sub(o),w.direction.transformDirection(p),g++}else if(M.isRectAreaLight){const w=r.rectArea[_];w.position.setFromMatrixPosition(M.matrixWorld),w.position.applyMatrix4(p),a.identity(),s.copy(M.matrixWorld),s.premultiply(p),a.extractRotation(s),w.halfWidth.set(.5*M.width,0,0),w.halfHeight.set(0,.5*M.height,0),w.halfWidth.applyMatrix4(a),w.halfHeight.applyMatrix4(a),_++}else if(M.isPointLight){const w=r.point[f];w.position.setFromMatrixPosition(M.matrixWorld),w.position.applyMatrix4(p),f++}else if(M.isHemisphereLight){const w=r.hemi[v];w.direction.setFromMatrixPosition(M.matrixWorld),w.direction.transformDirection(p),w.direction.normalize(),v++}}},state:r}}function $D(n,e){const t=new VG(n,e),i=[],r=[];return{init:function o(){i.length=0,r.length=0},state:{lightsArray:i,shadowsArray:r,lights:t},setupLights:function l(d){t.setup(i,d)},setupLightsView:function c(d){t.setupView(i,d)},pushLight:function s(d){i.push(d)},pushShadow:function a(d){r.push(d)}}}function GG(n,e){let t=new WeakMap;return{get:function i(o,s=0){let a;return!1===t.has(o)?(a=new $D(n,e),t.set(o,[a])):s>=t.get(o).length?(a=new $D(n,e),t.get(o).push(a)):a=t.get(o)[s],a},dispose:function r(){t=new WeakMap}}}class qD extends tc{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}qD.prototype.isMeshDepthMaterial=!0;class XD extends tc{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new I,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}XD.prototype.isMeshDistanceMaterial=!0;const jG="\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",WG="\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nuniform float samples;\n\n#include <packing>\n\nvoid main() {\n\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\n\t// This seems totally useless but it's a crazy work around for a Adreno compiler bug\n\t// float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\n\t\t#ifdef HORIZONTAL_PASS\n\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n\t\t#else\n\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\n\t\t#endif\n\n\t}\n\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n";function $G(n,e,t){let i=new bg;const r=new Ce,o=new Ce,s=new En,a=new qD({depthPacking:NH}),l=new XD,c={},u=t.maxTextureSize,d={0:qt,1:jl,2:Js},h=new ha({uniforms:{shadow_pass:{value:null},resolution:{value:new Ce},radius:{value:4},samples:{value:8}},vertexShader:jG,fragmentShader:WG}),f=h.clone();f.defines.HORIZONTAL_PASS=1;const g=new Qr;g.setAttribute("position",new ri(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ki(g,h),v=this;function p(M,w){const C=e.update(_);h.uniforms.shadow_pass.value=M.map.texture,h.uniforms.resolution.value=M.mapSize,h.uniforms.radius.value=M.radius,h.uniforms.samples.value=M.blurSamples,n.setRenderTarget(M.mapPass),n.clear(),n.renderBufferDirect(w,null,C,h,_,null),f.uniforms.shadow_pass.value=M.mapPass.texture,f.uniforms.resolution.value=M.mapSize,f.uniforms.radius.value=M.radius,f.uniforms.samples.value=M.blurSamples,n.setRenderTarget(M.map),n.clear(),n.renderBufferDirect(w,null,C,f,_,null)}function m(M,w,C,E,B,q,H){let R=null;const ee=!0===E.isPointLight?M.customDistanceMaterial:M.customDepthMaterial;if(R=void 0!==ee?ee:!0===E.isPointLight?l:a,n.localClippingEnabled&&!0===C.clipShadows&&0!==C.clippingPlanes.length||C.displacementMap&&0!==C.displacementScale||C.alphaMap&&C.alphaTest>0){const N=R.uuid,U=C.uuid;let z=c[N];void 0===z&&(z={},c[N]=z);let O=z[U];void 0===O&&(O=R.clone(),z[U]=O),R=O}return R.visible=C.visible,R.wireframe=C.wireframe,R.side=H===Gl?null!==C.shadowSide?C.shadowSide:C.side:null!==C.shadowSide?C.shadowSide:d[C.side],R.alphaMap=C.alphaMap,R.alphaTest=C.alphaTest,R.clipShadows=C.clipShadows,R.clippingPlanes=C.clippingPlanes,R.clipIntersection=C.clipIntersection,R.displacementMap=C.displacementMap,R.displacementScale=C.displacementScale,R.displacementBias=C.displacementBias,R.wireframeLinewidth=C.wireframeLinewidth,R.linewidth=C.linewidth,!0===E.isPointLight&&!0===R.isMeshDistanceMaterial&&(R.referencePosition.setFromMatrixPosition(E.matrixWorld),R.nearDistance=B,R.farDistance=q),R}function y(M,w,C,E,B){if(!1===M.visible)return;if(M.layers.test(w.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&B===Gl)&&(!M.frustumCulled||i.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,M.matrixWorld);const R=e.update(M),ee=M.material;if(Array.isArray(ee)){const N=R.groups;for(let U=0,z=N.length;U<z;U++){const O=N[U],k=ee[O.materialIndex];if(k&&k.visible){const Y=m(M,0,k,E,C.near,C.far,B);n.renderBufferDirect(C,null,R,Y,M,O)}}}else if(ee.visible){const N=m(M,0,ee,E,C.near,C.far,B);n.renderBufferDirect(C,null,R,N,M,null)}}const H=M.children;for(let R=0,ee=H.length;R<ee;R++)y(H[R],w,C,E,B)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ES,this.render=function(M,w,C){if(!1===v.enabled||!1===v.autoUpdate&&!1===v.needsUpdate||0===M.length)return;const E=n.getRenderTarget(),B=n.getActiveCubeFace(),q=n.getActiveMipmapLevel(),H=n.state;H.setBlending(jr),H.buffers.color.setClear(1,1,1,1),H.buffers.depth.setTest(!0),H.setScissorTest(!1);for(let R=0,ee=M.length;R<ee;R++){const N=M[R],U=N.shadow;if(void 0===U){console.warn("THREE.WebGLShadowMap:",N,"has no shadow.");continue}if(!1===U.autoUpdate&&!1===U.needsUpdate)continue;r.copy(U.mapSize);const z=U.getFrameExtents();if(r.multiply(z),o.copy(U.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(o.x=Math.floor(u/z.x),r.x=o.x*z.x,U.mapSize.x=o.x),r.y>u&&(o.y=Math.floor(u/z.y),r.y=o.y*z.y,U.mapSize.y=o.y)),null===U.map&&!U.isPointLightShadow&&this.type===Gl){const k={minFilter:Zi,magFilter:Zi,format:Mn};U.map=new io(r.x,r.y,k),U.map.texture.name=N.name+".shadowMap",U.mapPass=new io(r.x,r.y,k),U.camera.updateProjectionMatrix()}null===U.map&&(U.map=new io(r.x,r.y,{minFilter:Fn,magFilter:Fn,format:Mn}),U.map.texture.name=N.name+".shadowMap",U.camera.updateProjectionMatrix()),n.setRenderTarget(U.map),n.clear();const O=U.getViewportCount();for(let k=0;k<O;k++){const Y=U.getViewport(k);s.set(o.x*Y.x,o.y*Y.y,o.x*Y.z,o.y*Y.w),H.viewport(s),U.updateMatrices(N,k),i=U.getFrustum(),y(w,C,U.camera,N,this.type)}!U.isPointLightShadow&&this.type===Gl&&p(U,C),U.needsUpdate=!1}v.needsUpdate=!1,n.setRenderTarget(E,B,q)}}function qG(n,e,t){const i=t.isWebGL2,a=new function r(){let T=!1;const oe=new En;let j=null;const ce=new En(0,0,0,0);return{setMask:function(ge){j!==ge&&!T&&(n.colorMask(ge,ge,ge,ge),j=ge)},setLocked:function(ge){T=ge},setClear:function(ge,Ye,dn,hn,ao){!0===ao&&(ge*=hn,Ye*=hn,dn*=hn),oe.set(ge,Ye,dn,hn),!1===ce.equals(oe)&&(n.clearColor(ge,Ye,dn,hn),ce.copy(oe))},reset:function(){T=!1,j=null,ce.set(-1,0,0,0)}}},l=new function o(){let T=!1,oe=null,j=null,ce=null;return{setTest:function(ge){ge?se(n.DEPTH_TEST):ae(n.DEPTH_TEST)},setMask:function(ge){oe!==ge&&!T&&(n.depthMask(ge),oe=ge)},setFunc:function(ge){if(j!==ge){if(ge)switch(ge){case Dz:n.depthFunc(n.NEVER);break;case Cz:n.depthFunc(n.ALWAYS);break;case Tz:n.depthFunc(n.LESS);break;case ig:n.depthFunc(n.LEQUAL);break;case Az:n.depthFunc(n.EQUAL);break;case Iz:n.depthFunc(n.GEQUAL);break;case Rz:n.depthFunc(n.GREATER);break;case Pz:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}else n.depthFunc(n.LEQUAL);j=ge}},setLocked:function(ge){T=ge},setClear:function(ge){ce!==ge&&(n.clearDepth(ge),ce=ge)},reset:function(){T=!1,oe=null,j=null,ce=null}}},c=new function s(){let T=!1,oe=null,j=null,ce=null,ge=null,Ye=null,dn=null,hn=null,ao=null;return{setTest:function(Ot){T||(Ot?se(n.STENCIL_TEST):ae(n.STENCIL_TEST))},setMask:function(Ot){oe!==Ot&&!T&&(n.stencilMask(Ot),oe=Ot)},setFunc:function(Ot,Sr,Dr){(j!==Ot||ce!==Sr||ge!==Dr)&&(n.stencilFunc(Ot,Sr,Dr),j=Ot,ce=Sr,ge=Dr)},setOp:function(Ot,Sr,Dr){(Ye!==Ot||dn!==Sr||hn!==Dr)&&(n.stencilOp(Ot,Sr,Dr),Ye=Ot,dn=Sr,hn=Dr)},setLocked:function(Ot){T=Ot},setClear:function(Ot){ao!==Ot&&(n.clearStencil(Ot),ao=Ot)},reset:function(){T=!1,oe=null,j=null,ce=null,ge=null,Ye=null,dn=null,hn=null,ao=null}}};let u={},d=null,h={},f=null,g=!1,_=null,v=null,p=null,m=null,y=null,M=null,w=null,C=!1,E=null,B=null,q=null,H=null,R=null;const ee=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let N=!1,U=0;const z=n.getParameter(n.VERSION);-1!==z.indexOf("WebGL")?(U=parseFloat(/^WebGL (\d)/.exec(z)[1]),N=U>=1):-1!==z.indexOf("OpenGL ES")&&(U=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),N=U>=2);let O=null,k={};const Y=n.getParameter(n.SCISSOR_BOX),me=n.getParameter(n.VIEWPORT),Ee=(new En).fromArray(Y),de=(new En).fromArray(me);function je(T,oe,j){const ce=new Uint8Array(4),ge=n.createTexture();n.bindTexture(T,ge),n.texParameteri(T,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(T,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ye=0;Ye<j;Ye++)n.texImage2D(oe+Ye,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,ce);return ge}const $={};function se(T){!0!==u[T]&&(n.enable(T),u[T]=!0)}function ae(T){!1!==u[T]&&(n.disable(T),u[T]=!1)}$[n.TEXTURE_2D]=je(n.TEXTURE_2D,n.TEXTURE_2D,1),$[n.TEXTURE_CUBE_MAP]=je(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),a.setClear(0,0,0,1),l.setClear(1),c.setClear(0),se(n.DEPTH_TEST),l.setFunc(ig),ct(!1),Sn(xS),se(n.CULL_FACE),Qe(jr);const le={[ea]:n.FUNC_ADD,[mz]:n.FUNC_SUBTRACT,[gz]:n.FUNC_REVERSE_SUBTRACT};if(i)le[DS]=n.MIN,le[CS]=n.MAX;else{const T=e.get("EXT_blend_minmax");null!==T&&(le[DS]=T.MIN_EXT,le[CS]=T.MAX_EXT)}const Se={[_z]:n.ZERO,[vz]:n.ONE,[yz]:n.SRC_COLOR,[TS]:n.SRC_ALPHA,[Sz]:n.SRC_ALPHA_SATURATE,[bz]:n.DST_COLOR,[xz]:n.DST_ALPHA,[Mz]:n.ONE_MINUS_SRC_COLOR,[AS]:n.ONE_MINUS_SRC_ALPHA,[wz]:n.ONE_MINUS_DST_COLOR,[Ez]:n.ONE_MINUS_DST_ALPHA};function Qe(T,oe,j,ce,ge,Ye,dn,hn){if(T!==jr){if(!1===g&&(se(n.BLEND),g=!0),T===pz)ge=ge||oe,Ye=Ye||j,dn=dn||ce,(oe!==v||ge!==y)&&(n.blendEquationSeparate(le[oe],le[ge]),v=oe,y=ge),(j!==p||ce!==m||Ye!==M||dn!==w)&&(n.blendFuncSeparate(Se[j],Se[ce],Se[Ye],Se[dn]),p=j,m=ce,M=Ye,w=dn),_=T,C=null;else if(T!==_||hn!==C){if((v!==ea||y!==ea)&&(n.blendEquation(n.FUNC_ADD),v=ea,y=ea),hn)switch(T){case Wl:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case bS:n.blendFunc(n.ONE,n.ONE);break;case wS:n.blendFuncSeparate(n.ZERO,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE_MINUS_SRC_ALPHA);break;case SS:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",T)}else switch(T){case Wl:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case bS:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case wS:n.blendFunc(n.ZERO,n.ONE_MINUS_SRC_COLOR);break;case SS:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",T)}p=null,m=null,M=null,w=null,_=T,C=hn}}else!0===g&&(ae(n.BLEND),g=!1)}function ct(T){E!==T&&(n.frontFace(T?n.CW:n.CCW),E=T)}function Sn(T){T!==uz?(se(n.CULL_FACE),T!==B&&n.cullFace(T===xS?n.BACK:T===dz?n.FRONT:n.FRONT_AND_BACK)):ae(n.CULL_FACE),B=T}function li(T,oe,j){T?(se(n.POLYGON_OFFSET_FILL),(H!==oe||R!==j)&&(n.polygonOffset(oe,j),H=oe,R=j)):ae(n.POLYGON_OFFSET_FILL)}function b(T){void 0===T&&(T=n.TEXTURE0+ee-1),O!==T&&(n.activeTexture(T),O=T)}return{buffers:{color:a,depth:l,stencil:c},enable:se,disable:ae,bindFramebuffer:function Re(T,oe){return null===oe&&null!==d&&(oe=d),h[T]!==oe&&(n.bindFramebuffer(T,oe),h[T]=oe,i&&(T===n.DRAW_FRAMEBUFFER&&(h[n.FRAMEBUFFER]=oe),T===n.FRAMEBUFFER&&(h[n.DRAW_FRAMEBUFFER]=oe)),!0)},bindXRFramebuffer:function S(T){T!==d&&(n.bindFramebuffer(n.FRAMEBUFFER,T),d=T)},useProgram:function He(T){return f!==T&&(n.useProgram(T),f=T,!0)},setBlending:Qe,setMaterial:function Pe(T,oe){T.side===Js?ae(n.CULL_FACE):se(n.CULL_FACE);let j=T.side===qt;oe&&(j=!j),ct(j),T.blending===Wl&&!1===T.transparent?Qe(jr):Qe(T.blending,T.blendEquation,T.blendSrc,T.blendDst,T.blendEquationAlpha,T.blendSrcAlpha,T.blendDstAlpha,T.premultipliedAlpha),l.setFunc(T.depthFunc),l.setTest(T.depthTest),l.setMask(T.depthWrite),a.setMask(T.colorWrite);const ce=T.stencilWrite;c.setTest(ce),ce&&(c.setMask(T.stencilWriteMask),c.setFunc(T.stencilFunc,T.stencilRef,T.stencilFuncMask),c.setOp(T.stencilFail,T.stencilZFail,T.stencilZPass)),li(T.polygonOffset,T.polygonOffsetFactor,T.polygonOffsetUnits),!0===T.alphaToCoverage?se(n.SAMPLE_ALPHA_TO_COVERAGE):ae(n.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:ct,setCullFace:Sn,setLineWidth:function Ci(T){T!==q&&(N&&n.lineWidth(T),q=T)},setPolygonOffset:li,setScissorTest:function D(T){T?se(n.SCISSOR_TEST):ae(n.SCISSOR_TEST)},activeTexture:b,bindTexture:function W(T,oe){null===O&&b();let j=k[O];void 0===j&&(j={type:void 0,texture:void 0},k[O]=j),(j.type!==T||j.texture!==oe)&&(n.bindTexture(T,oe||$[T]),j.type=T,j.texture=oe)},unbindTexture:function te(){const T=k[O];void 0!==T&&void 0!==T.type&&(n.bindTexture(T.type,null),T.type=void 0,T.texture=void 0)},compressedTexImage2D:function re(){try{n.compressedTexImage2D.apply(n,arguments)}catch(T){console.error("THREE.WebGLState:",T)}},texImage2D:function pe(){try{n.texImage2D.apply(n,arguments)}catch(T){console.error("THREE.WebGLState:",T)}},texImage3D:function ke(){try{n.texImage3D.apply(n,arguments)}catch(T){console.error("THREE.WebGLState:",T)}},scissor:function Le(T){!1===Ee.equals(T)&&(n.scissor(T.x,T.y,T.z,T.w),Ee.copy(T))},viewport:function Ue(T){!1===de.equals(T)&&(n.viewport(T.x,T.y,T.z,T.w),de.copy(T))},reset:function _e(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),!0===i&&(n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),u={},O=null,k={},d=null,h={},f=null,g=!1,_=null,v=null,p=null,m=null,y=null,M=null,w=null,C=!1,E=null,B=null,q=null,H=null,R=null,Ee.set(0,0,n.canvas.width,n.canvas.height),de.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),c.reset()}}}function XG(n,e,t,i,r,o,s){const a=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,u=r.maxTextureSize,d=r.maxSamples,h=new WeakMap;let f,g=!1;try{g=typeof OffscreenCanvas<"u"&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch{}function _(D,b){return g?new OffscreenCanvas(D,b):Cg("canvas")}function v(D,b,W,te){let re=1;if((D.width>te||D.height>te)&&(re=te/Math.max(D.width,D.height)),re<1||!0===b){if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap){const pe=b?zH:Math.floor,ke=pe(re*D.width),Le=pe(re*D.height);void 0===f&&(f=_(ke,Le));const Ue=W?_(ke,Le):f;return Ue.width=ke,Ue.height=Le,Ue.getContext("2d").drawImage(D,0,0,ke,Le),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+ke+"x"+Le+")."),Ue}return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+D.width+"x"+D.height+")."),D}return D}function p(D){return ZS(D.width)&&ZS(D.height)}function y(D,b){return D.generateMipmaps&&b&&D.minFilter!==Fn&&D.minFilter!==Zi}function M(D,b,W,te,re=1){n.generateMipmap(D),i.get(b).__maxMipLevel=Math.log2(Math.max(W,te,re))}function w(D,b,W,te){if(!1===a)return b;if(null!==D){if(void 0!==n[D])return n[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let re=b;return b===n.RED&&(W===n.FLOAT&&(re=n.R32F),W===n.HALF_FLOAT&&(re=n.R16F),W===n.UNSIGNED_BYTE&&(re=n.R8)),b===n.RGB&&(W===n.FLOAT&&(re=n.RGB32F),W===n.HALF_FLOAT&&(re=n.RGB16F),W===n.UNSIGNED_BYTE&&(re=n.RGB8)),b===n.RGBA&&(W===n.FLOAT&&(re=n.RGBA32F),W===n.HALF_FLOAT&&(re=n.RGBA16F),W===n.UNSIGNED_BYTE&&(re=te===na?n.SRGB8_ALPHA8:n.RGBA8)),(re===n.R16F||re===n.R32F||re===n.RGBA16F||re===n.RGBA32F)&&e.get("EXT_color_buffer_float"),re}function C(D){return D===Fn||D===PS||D===LS?n.NEAREST:n.LINEAR}function E(D){const b=D.target;b.removeEventListener("dispose",E),function q(D){const b=i.get(D);void 0!==b.__webglInit&&(n.deleteTexture(b.__webglTexture),i.remove(D))}(b),b.isVideoTexture&&h.delete(b),s.memory.textures--}function B(D){const b=D.target;b.removeEventListener("dispose",B),function H(D){const b=D.texture,W=i.get(D),te=i.get(b);if(D){if(void 0!==te.__webglTexture&&(n.deleteTexture(te.__webglTexture),s.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let re=0;re<6;re++)n.deleteFramebuffer(W.__webglFramebuffer[re]),W.__webglDepthbuffer&&n.deleteRenderbuffer(W.__webglDepthbuffer[re]);else n.deleteFramebuffer(W.__webglFramebuffer),W.__webglDepthbuffer&&n.deleteRenderbuffer(W.__webglDepthbuffer),W.__webglMultisampledFramebuffer&&n.deleteFramebuffer(W.__webglMultisampledFramebuffer),W.__webglColorRenderbuffer&&n.deleteRenderbuffer(W.__webglColorRenderbuffer),W.__webglDepthRenderbuffer&&n.deleteRenderbuffer(W.__webglDepthRenderbuffer);if(D.isWebGLMultipleRenderTargets)for(let re=0,pe=b.length;re<pe;re++){const ke=i.get(b[re]);ke.__webglTexture&&(n.deleteTexture(ke.__webglTexture),s.memory.textures--),i.remove(b[re])}i.remove(b),i.remove(D)}}(b)}let R=0;function U(D,b){const W=i.get(D);if(D.isVideoTexture&&function Pe(D){const b=s.render.frame;h.get(D)!==b&&(h.set(D,b),D.update())}(D),D.version>0&&W.__version!==D.version){const te=D.image;if(void 0===te)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==te.complete)return void je(W,D,b);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}t.activeTexture(n.TEXTURE0+b),t.bindTexture(n.TEXTURE_2D,W.__webglTexture)}function k(D,b){const W=i.get(D);D.version>0&&W.__version!==D.version?function $(D,b,W){if(6!==b.image.length)return;de(D,b),t.activeTexture(n.TEXTURE0+W),t.bindTexture(n.TEXTURE_CUBE_MAP,D.__webglTexture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);const te=b&&(b.isCompressedTexture||b.image[0].isCompressedTexture),re=b.image[0]&&b.image[0].isDataTexture,pe=[];for(let j=0;j<6;j++)pe[j]=te||re?re?b.image[j].image:b.image[j]:v(b.image[j],!1,!0,c);const ke=pe[0],Le=p(ke)||a,Ue=o.convert(b.format),_e=o.convert(b.type),T=w(b.internalFormat,Ue,_e,b.encoding);let oe;if(Ee(n.TEXTURE_CUBE_MAP,b,Le),te){for(let j=0;j<6;j++){oe=pe[j].mipmaps;for(let ce=0;ce<oe.length;ce++){const ge=oe[ce];b.format!==Mn&&b.format!==$l?null!==Ue?t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce,T,ge.width,ge.height,0,ge.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce,T,ge.width,ge.height,0,Ue,_e,ge.data)}}D.__maxMipLevel=oe.length-1}else{oe=b.mipmaps;for(let j=0;j<6;j++)if(re){t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,T,pe[j].width,pe[j].height,0,Ue,_e,pe[j].data);for(let ce=0;ce<oe.length;ce++){const Ye=oe[ce].image[j].image;t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce+1,T,Ye.width,Ye.height,0,Ue,_e,Ye.data)}}else{t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,T,Ue,_e,pe[j]);for(let ce=0;ce<oe.length;ce++)t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce+1,T,Ue,_e,oe[ce].image[j])}D.__maxMipLevel=oe.length}y(b,Le)&&M(n.TEXTURE_CUBE_MAP,b,ke.width,ke.height),D.__version=b.version,b.onUpdate&&b.onUpdate(b)}(W,D,b):(t.activeTexture(n.TEXTURE0+b),t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture))}const Y={[ag]:n.REPEAT,[Wn]:n.CLAMP_TO_EDGE,[lg]:n.MIRRORED_REPEAT},me={[Fn]:n.NEAREST,[PS]:n.NEAREST_MIPMAP_NEAREST,[LS]:n.NEAREST_MIPMAP_LINEAR,[Zi]:n.LINEAR,[zz]:n.LINEAR_MIPMAP_NEAREST,[bd]:n.LINEAR_MIPMAP_LINEAR};function Ee(D,b,W){if(W?(n.texParameteri(D,n.TEXTURE_WRAP_S,Y[b.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,Y[b.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,Y[b.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,me[b.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,me[b.minFilter])):(n.texParameteri(D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(b.wrapS!==Wn||b.wrapT!==Wn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(D,n.TEXTURE_MAG_FILTER,C(b.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,C(b.minFilter)),b.minFilter!==Fn&&b.minFilter!==Zi&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const te=e.get("EXT_texture_filter_anisotropic");if(b.type===$r&&!1===e.has("OES_texture_float_linear")||!1===a&&b.type===ta&&!1===e.has("OES_texture_half_float_linear"))return;(b.anisotropy>1||i.get(b).__currentAnisotropy)&&(n.texParameterf(D,te.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),i.get(b).__currentAnisotropy=b.anisotropy)}}function de(D,b){void 0===D.__webglInit&&(D.__webglInit=!0,b.addEventListener("dispose",E),D.__webglTexture=n.createTexture(),s.memory.textures++)}function je(D,b,W){let te=n.TEXTURE_2D;b.isDataTexture2DArray&&(te=n.TEXTURE_2D_ARRAY),b.isDataTexture3D&&(te=n.TEXTURE_3D),de(D,b),t.activeTexture(n.TEXTURE0+W),t.bindTexture(te,D.__webglTexture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);const re=function m(D){return!a&&(D.wrapS!==Wn||D.wrapT!==Wn||D.minFilter!==Fn&&D.minFilter!==Zi)}(b)&&!1===p(b.image),pe=v(b.image,re,!1,u),ke=p(pe)||a,Le=o.convert(b.format);let T,Ue=o.convert(b.type),_e=w(b.internalFormat,Le,Ue,b.encoding);Ee(te,b,ke);const oe=b.mipmaps;if(b.isDepthTexture)_e=n.DEPTH_COMPONENT,a?_e=b.type===$r?n.DEPTH_COMPONENT32F:b.type===wd?n.DEPTH_COMPONENT24:b.type===Sd?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT16:b.type===$r&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),b.format===ug&&_e===n.DEPTH_COMPONENT&&b.type!==cg&&b.type!==wd&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),b.type=cg,Ue=o.convert(b.type)),b.format===dg&&_e===n.DEPTH_COMPONENT&&(_e=n.DEPTH_STENCIL,b.type!==Sd&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),b.type=Sd,Ue=o.convert(b.type))),t.texImage2D(n.TEXTURE_2D,0,_e,pe.width,pe.height,0,Le,Ue,null);else if(b.isDataTexture)if(oe.length>0&&ke){for(let j=0,ce=oe.length;j<ce;j++)T=oe[j],t.texImage2D(n.TEXTURE_2D,j,_e,T.width,T.height,0,Le,Ue,T.data);b.generateMipmaps=!1,D.__maxMipLevel=oe.length-1}else t.texImage2D(n.TEXTURE_2D,0,_e,pe.width,pe.height,0,Le,Ue,pe.data),D.__maxMipLevel=0;else if(b.isCompressedTexture){for(let j=0,ce=oe.length;j<ce;j++)T=oe[j],b.format!==Mn&&b.format!==$l?null!==Le?t.compressedTexImage2D(n.TEXTURE_2D,j,_e,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(n.TEXTURE_2D,j,_e,T.width,T.height,0,Le,Ue,T.data);D.__maxMipLevel=oe.length-1}else if(b.isDataTexture2DArray)t.texImage3D(n.TEXTURE_2D_ARRAY,0,_e,pe.width,pe.height,pe.depth,0,Le,Ue,pe.data),D.__maxMipLevel=0;else if(b.isDataTexture3D)t.texImage3D(n.TEXTURE_3D,0,_e,pe.width,pe.height,pe.depth,0,Le,Ue,pe.data),D.__maxMipLevel=0;else if(oe.length>0&&ke){for(let j=0,ce=oe.length;j<ce;j++)T=oe[j],t.texImage2D(n.TEXTURE_2D,j,_e,Le,Ue,T);b.generateMipmaps=!1,D.__maxMipLevel=oe.length-1}else t.texImage2D(n.TEXTURE_2D,0,_e,Le,Ue,pe),D.__maxMipLevel=0;y(b,ke)&&M(te,b,pe.width,pe.height),D.__version=b.version,b.onUpdate&&b.onUpdate(b)}function se(D,b,W,te,re){const pe=o.convert(W.format),ke=o.convert(W.type),Le=w(W.internalFormat,pe,ke,W.encoding);re===n.TEXTURE_3D||re===n.TEXTURE_2D_ARRAY?t.texImage3D(re,0,Le,b.width,b.height,b.depth,0,pe,ke,null):t.texImage2D(re,0,Le,b.width,b.height,0,pe,ke,null),t.bindFramebuffer(n.FRAMEBUFFER,D),n.framebufferTexture2D(n.FRAMEBUFFER,te,re,i.get(W).__webglTexture,0),t.bindFramebuffer(n.FRAMEBUFFER,null)}function ae(D,b,W){if(n.bindRenderbuffer(n.RENDERBUFFER,D),b.depthBuffer&&!b.stencilBuffer){let te=n.DEPTH_COMPONENT16;if(W){const re=b.depthTexture;re&&re.isDepthTexture&&(re.type===$r?te=n.DEPTH_COMPONENT32F:re.type===wd&&(te=n.DEPTH_COMPONENT24));const pe=Qe(b);n.renderbufferStorageMultisample(n.RENDERBUFFER,pe,te,b.width,b.height)}else n.renderbufferStorage(n.RENDERBUFFER,te,b.width,b.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(b.depthBuffer&&b.stencilBuffer){if(W){const te=Qe(b);n.renderbufferStorageMultisample(n.RENDERBUFFER,te,n.DEPTH24_STENCIL8,b.width,b.height)}else n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,b.width,b.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,D)}else{const te=!0===b.isWebGLMultipleRenderTargets?b.texture[0]:b.texture,re=o.convert(te.format),pe=o.convert(te.type),ke=w(te.internalFormat,re,pe,te.encoding);if(W){const Le=Qe(b);n.renderbufferStorageMultisample(n.RENDERBUFFER,Le,ke,b.width,b.height)}else n.renderbufferStorage(n.RENDERBUFFER,ke,b.width,b.height)}n.bindRenderbuffer(n.RENDERBUFFER,null)}function Qe(D){return a&&D.isWebGLMultisampleRenderTarget?Math.min(d,D.samples):0}let ct=!1,Sn=!1;this.allocateTextureUnit=function N(){const D=R;return D>=l&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+l),R+=1,D},this.resetTextureUnits=function ee(){R=0},this.setTexture2D=U,this.setTexture2DArray=function z(D,b){const W=i.get(D);D.version>0&&W.__version!==D.version?je(W,D,b):(t.activeTexture(n.TEXTURE0+b),t.bindTexture(n.TEXTURE_2D_ARRAY,W.__webglTexture))},this.setTexture3D=function O(D,b){const W=i.get(D);D.version>0&&W.__version!==D.version?je(W,D,b):(t.activeTexture(n.TEXTURE0+b),t.bindTexture(n.TEXTURE_3D,W.__webglTexture))},this.setTextureCube=k,this.setupRenderTarget=function He(D){const b=D.texture,W=i.get(D),te=i.get(b);D.addEventListener("dispose",B),!0!==D.isWebGLMultipleRenderTargets&&(te.__webglTexture=n.createTexture(),te.__version=b.version,s.memory.textures++);const re=!0===D.isWebGLCubeRenderTarget,pe=!0===D.isWebGLMultipleRenderTargets,ke=!0===D.isWebGLMultisampleRenderTarget,Le=b.isDataTexture3D||b.isDataTexture2DArray,Ue=p(D)||a;if(a&&b.format===$l&&(b.type===$r||b.type===ta)&&(b.format=Mn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),re){W.__webglFramebuffer=[];for(let _e=0;_e<6;_e++)W.__webglFramebuffer[_e]=n.createFramebuffer()}else if(W.__webglFramebuffer=n.createFramebuffer(),pe)if(r.drawBuffers){const _e=D.texture;for(let T=0,oe=_e.length;T<oe;T++){const j=i.get(_e[T]);void 0===j.__webglTexture&&(j.__webglTexture=n.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(ke)if(a){W.__webglMultisampledFramebuffer=n.createFramebuffer(),W.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,W.__webglColorRenderbuffer);const _e=o.convert(b.format),T=o.convert(b.type),oe=w(b.internalFormat,_e,T,b.encoding),j=Qe(D);n.renderbufferStorageMultisample(n.RENDERBUFFER,j,oe,D.width,D.height),t.bindFramebuffer(n.FRAMEBUFFER,W.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,W.__webglColorRenderbuffer),n.bindRenderbuffer(n.RENDERBUFFER,null),D.depthBuffer&&(W.__webglDepthRenderbuffer=n.createRenderbuffer(),ae(W.__webglDepthRenderbuffer,D,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(re){t.bindTexture(n.TEXTURE_CUBE_MAP,te.__webglTexture),Ee(n.TEXTURE_CUBE_MAP,b,Ue);for(let _e=0;_e<6;_e++)se(W.__webglFramebuffer[_e],D,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+_e);y(b,Ue)&&M(n.TEXTURE_CUBE_MAP,b,D.width,D.height),t.unbindTexture()}else if(pe){const _e=D.texture;for(let T=0,oe=_e.length;T<oe;T++){const j=_e[T],ce=i.get(j);t.bindTexture(n.TEXTURE_2D,ce.__webglTexture),Ee(n.TEXTURE_2D,j,Ue),se(W.__webglFramebuffer,D,j,n.COLOR_ATTACHMENT0+T,n.TEXTURE_2D),y(j,Ue)&&M(n.TEXTURE_2D,j,D.width,D.height)}t.unbindTexture()}else{let _e=n.TEXTURE_2D;Le&&(a?_e=b.isDataTexture3D?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(_e,te.__webglTexture),Ee(_e,b,Ue),se(W.__webglFramebuffer,D,b,n.COLOR_ATTACHMENT0,_e),y(b,Ue)&&M(_e,b,D.width,D.height,D.depth),t.unbindTexture()}D.depthBuffer&&function Re(D){const b=i.get(D),W=!0===D.isWebGLCubeRenderTarget;if(D.depthTexture){if(W)throw new Error("target.depthTexture not supported in Cube render targets");!function S(D,b){if(b&&b.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,D),!b.depthTexture||!b.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(b.depthTexture).__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),U(b.depthTexture,0);const te=i.get(b.depthTexture).__webglTexture;if(b.depthTexture.format===ug)n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,te,0);else{if(b.depthTexture.format!==dg)throw new Error("Unknown depthTexture format");n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,te,0)}}(b.__webglFramebuffer,D)}else if(W){b.__webglDepthbuffer=[];for(let te=0;te<6;te++)t.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[te]),b.__webglDepthbuffer[te]=n.createRenderbuffer(),ae(b.__webglDepthbuffer[te],D,!1)}else t.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer=n.createRenderbuffer(),ae(b.__webglDepthbuffer,D,!1);t.bindFramebuffer(n.FRAMEBUFFER,null)}(D)},this.updateRenderTargetMipmap=function le(D){const b=p(D)||a,W=!0===D.isWebGLMultipleRenderTargets?D.texture:[D.texture];for(let te=0,re=W.length;te<re;te++){const pe=W[te];if(y(pe,b)){const ke=D.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,Le=i.get(pe).__webglTexture;t.bindTexture(ke,Le),M(ke,pe,D.width,D.height),t.unbindTexture()}}},this.updateMultisampleRenderTarget=function Se(D){if(D.isWebGLMultisampleRenderTarget)if(a){const b=D.width,W=D.height;let te=n.COLOR_BUFFER_BIT;D.depthBuffer&&(te|=n.DEPTH_BUFFER_BIT),D.stencilBuffer&&(te|=n.STENCIL_BUFFER_BIT);const re=i.get(D);t.bindFramebuffer(n.READ_FRAMEBUFFER,re.__webglMultisampledFramebuffer),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,re.__webglFramebuffer),n.blitFramebuffer(0,0,b,W,0,0,b,W,te,n.NEAREST),t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,re.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function Ci(D,b){D&&D.isWebGLRenderTarget&&(!1===ct&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ct=!0),D=D.texture),U(D,b)},this.safeSetTextureCube=function li(D,b){D&&D.isWebGLCubeRenderTarget&&(!1===Sn&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Sn=!0),D=D.texture),k(D,b)}}function YG(n,e,t){const i=t.isWebGL2;return{convert:function r(o){let s;if(o===Wr)return n.UNSIGNED_BYTE;if(o===jz)return n.UNSIGNED_SHORT_4_4_4_4;if(o===Wz)return n.UNSIGNED_SHORT_5_5_5_1;if(o===$z)return n.UNSIGNED_SHORT_5_6_5;if(o===Hz)return n.BYTE;if(o===Vz)return n.SHORT;if(o===cg)return n.UNSIGNED_SHORT;if(o===Gz)return n.INT;if(o===wd)return n.UNSIGNED_INT;if(o===$r)return n.FLOAT;if(o===ta)return i?n.HALF_FLOAT:(s=e.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(o===qz)return n.ALPHA;if(o===$l)return n.RGB;if(o===Mn)return n.RGBA;if(o===Xz)return n.LUMINANCE;if(o===Yz)return n.LUMINANCE_ALPHA;if(o===ug)return n.DEPTH_COMPONENT;if(o===dg)return n.DEPTH_STENCIL;if(o===Kz)return n.RED;if(o===Qz)return n.RED_INTEGER;if(o===Jz)return n.RG;if(o===eH)return n.RG_INTEGER;if(o===tH)return n.RGB_INTEGER;if(o===nH)return n.RGBA_INTEGER;if(o===FS||o===NS||o===OS||o===kS){if(s=e.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(o===FS)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===NS)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===OS)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===kS)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(o===US||o===BS||o===zS||o===HS){if(s=e.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(o===US)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===BS)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===zS)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===HS)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(o===iH)return s=e.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if((o===VS||o===GS)&&(s=e.get("WEBGL_compressed_texture_etc"),null!==s)){if(o===VS)return s.COMPRESSED_RGB8_ETC2;if(o===GS)return s.COMPRESSED_RGBA8_ETC2_EAC}return o===rH||o===oH||o===sH||o===aH||o===lH||o===cH||o===uH||o===dH||o===hH||o===fH||o===pH||o===mH||o===gH||o===_H||o===yH||o===MH||o===xH||o===EH||o===bH||o===wH||o===SH||o===DH||o===CH||o===TH||o===AH||o===IH||o===RH||o===PH?(s=e.get("WEBGL_compressed_texture_astc"),null!==s?o:null):o===vH?(s=e.get("EXT_texture_compression_bptc"),null!==s?o:null):o===Sd?i?n.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class YD extends Xn{constructor(e=[]){super(),this.cameras=e}}YD.prototype.isArrayCamera=!0;class Wo extends oi{constructor(){super(),this.type="Group"}}Wo.prototype.isGroup=!0;const ZG={type:"move"};class Qg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Wo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Wo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new I,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new I),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Wo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new I,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new I),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let r=null,o=null,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==a&&(r=t.getPose(e.targetRaySpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(ZG))),c&&e.hand){s=!0;for(const _ of e.hand.values()){const v=t.getJointPose(_,i);if(void 0===c.joints[_.jointName]){const m=new Wo;m.matrixAutoUpdate=!1,m.visible=!1,c.joints[_.jointName]=m,c.add(m)}const p=c.joints[_.jointName];null!==v&&(p.matrix.fromArray(v.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=v.radius),p.visible=null!==v}const h=c.joints["index-finger-tip"].position.distanceTo(c.joints["thumb-tip"].position),f=.02,g=.005;c.inputState.pinching&&h>f+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=f-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&(o=t.getPose(e.gripSpace,i),null!==o&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==o),null!==c&&(c.visible=null!==s),this}}class KG extends Vo{constructor(e,t){super();const i=this,r=e.state;let o=null,s=1,a=null,l="local-floor",c=null,u=null,d=null,h=null,f=null,g=!1,_=null,v=null,p=null,m=null,y=null,M=null;const w=[],C=new Map,E=new Xn;E.layers.enable(1),E.viewport=new En;const B=new Xn;B.layers.enable(2),B.viewport=new En;const q=[E,B],H=new YD;H.layers.enable(1),H.layers.enable(2);let R=null,ee=null;function N($){const se=C.get($.inputSource);se&&se.dispatchEvent({type:$.type,data:$.inputSource})}function U(){C.forEach(function($,se){$.disconnect(se)}),C.clear(),R=null,ee=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),d&&t.deleteFramebuffer(d),_&&t.deleteFramebuffer(_),v&&t.deleteRenderbuffer(v),p&&t.deleteRenderbuffer(p),d=null,_=null,v=null,p=null,f=null,h=null,u=null,o=null,je.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function z($){const se=o.inputSources;for(let ae=0;ae<w.length;ae++)C.set(se[ae],w[ae]);for(let ae=0;ae<$.removed.length;ae++){const S=$.removed[ae],Re=C.get(S);Re&&(Re.dispatchEvent({type:"disconnected",data:S}),C.delete(S))}for(let ae=0;ae<$.added.length;ae++){const S=$.added[ae],Re=C.get(S);Re&&Re.dispatchEvent({type:"connected",data:S})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function($){let se=w[$];return void 0===se&&(se=new Qg,w[$]=se),se.getTargetRaySpace()},this.getControllerGrip=function($){let se=w[$];return void 0===se&&(se=new Qg,w[$]=se),se.getGripSpace()},this.getHand=function($){let se=w[$];return void 0===se&&(se=new Qg,w[$]=se),se.getHandSpace()},this.setFramebufferScaleFactor=function($){s=$,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function($){l=$,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getBaseLayer=function(){return null!==h?h:f},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return o},this.setSession=function(){var $=ng(function*(se){if(o=se,null!==o){o.addEventListener("select",N),o.addEventListener("selectstart",N),o.addEventListener("selectend",N),o.addEventListener("squeeze",N),o.addEventListener("squeezestart",N),o.addEventListener("squeezeend",N),o.addEventListener("end",U),o.addEventListener("inputsourceschange",z);const ae=t.getContextAttributes();if(!0!==ae.xrCompatible&&(yield t.makeXRCompatible()),void 0===o.renderState.layers)f=new XRWebGLLayer(o,t,{antialias:ae.antialias,alpha:ae.alpha,depth:ae.depth,stencil:ae.stencil,framebufferScaleFactor:s}),o.updateRenderState({baseLayer:f});else if(t instanceof WebGLRenderingContext)f=new XRWebGLLayer(o,t,{antialias:!0,alpha:ae.alpha,depth:ae.depth,stencil:ae.stencil,framebufferScaleFactor:s}),o.updateRenderState({layers:[f]});else{g=ae.antialias;let S=null;ae.depth&&(M=t.DEPTH_BUFFER_BIT,ae.stencil&&(M|=t.STENCIL_BUFFER_BIT),y=ae.stencil?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,S=ae.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24);const Re={colorFormat:ae.alpha?t.RGBA8:t.RGB8,depthFormat:S,scaleFactor:s};u=new XRWebGLBinding(o,t),h=u.createProjectionLayer(Re),d=t.createFramebuffer(),o.updateRenderState({layers:[h]}),g&&(_=t.createFramebuffer(),v=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,v),t.renderbufferStorageMultisample(t.RENDERBUFFER,4,t.RGBA8,h.textureWidth,h.textureHeight),r.bindFramebuffer(t.FRAMEBUFFER,_),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,v),t.bindRenderbuffer(t.RENDERBUFFER,null),null!==S&&(p=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,p),t.renderbufferStorageMultisample(t.RENDERBUFFER,4,S,h.textureWidth,h.textureHeight),t.framebufferRenderbuffer(t.FRAMEBUFFER,y,t.RENDERBUFFER,p),t.bindRenderbuffer(t.RENDERBUFFER,null)),r.bindFramebuffer(t.FRAMEBUFFER,null))}a=yield o.requestReferenceSpace(l),je.setContext(o),je.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}});return function(se){return $.apply(this,arguments)}}();const O=new I,k=new I;function me($,se){null===se?$.matrixWorld.copy($.matrix):$.matrixWorld.multiplyMatrices(se.matrixWorld,$.matrix),$.matrixWorldInverse.copy($.matrixWorld).invert()}this.updateCamera=function($){if(null===o)return;H.near=B.near=E.near=$.near,H.far=B.far=E.far=$.far,(R!==H.near||ee!==H.far)&&(o.updateRenderState({depthNear:H.near,depthFar:H.far}),R=H.near,ee=H.far);const se=$.parent,ae=H.cameras;me(H,se);for(let Re=0;Re<ae.length;Re++)me(ae[Re],se);H.matrixWorld.decompose(H.position,H.quaternion,H.scale),$.position.copy(H.position),$.quaternion.copy(H.quaternion),$.scale.copy(H.scale),$.matrix.copy(H.matrix),$.matrixWorld.copy(H.matrixWorld);const S=$.children;for(let Re=0,He=S.length;Re<He;Re++)S[Re].updateMatrixWorld(!0);2===ae.length?function Y($,se,ae){O.setFromMatrixPosition(se.matrixWorld),k.setFromMatrixPosition(ae.matrixWorld);const S=O.distanceTo(k),Re=se.projectionMatrix.elements,He=ae.projectionMatrix.elements,le=Re[14]/(Re[10]-1),Se=Re[14]/(Re[10]+1),Qe=(Re[9]+1)/Re[5],Pe=(Re[9]-1)/Re[5],ct=(Re[8]-1)/Re[0],Sn=(He[8]+1)/He[0],Ci=le*ct,li=le*Sn,D=S/(-ct+Sn),b=D*-ct;se.matrixWorld.decompose($.position,$.quaternion,$.scale),$.translateX(b),$.translateZ(D),$.matrixWorld.compose($.position,$.quaternion,$.scale),$.matrixWorldInverse.copy($.matrixWorld).invert();const W=le+D,te=Se+D;$.projectionMatrix.makePerspective(Ci-b,li+(S-b),Qe*Se/te*W,Pe*Se/te*W,W,te)}(H,E,B):H.projectionMatrix.copy(E.projectionMatrix)},this.getCamera=function(){return H},this.getFoveation=function(){return null!==h?h.fixedFoveation:null!==f?f.fixedFoveation:void 0},this.setFoveation=function($){null!==h&&(h.fixedFoveation=$),null!==f&&void 0!==f.fixedFoveation&&(f.fixedFoveation=$)};let Ee=null;const je=new JS;je.setAnimationLoop(function de($,se){if(c=se.getViewerPose(a),m=se,null!==c){const S=c.views;null!==f&&r.bindXRFramebuffer(f.framebuffer);let Re=!1;S.length!==H.cameras.length&&(H.cameras.length=0,Re=!0);for(let He=0;He<S.length;He++){const le=S[He];let Se=null;if(null!==f)Se=f.getViewport(le);else{const Pe=u.getViewSubImage(h,le);r.bindXRFramebuffer(d),void 0!==Pe.depthStencilTexture&&t.framebufferTexture2D(t.FRAMEBUFFER,y,t.TEXTURE_2D,Pe.depthStencilTexture,0),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Pe.colorTexture,0),Se=Pe.viewport}const Qe=q[He];Qe.matrix.fromArray(le.transform.matrix),Qe.projectionMatrix.fromArray(le.projectionMatrix),Qe.viewport.set(Se.x,Se.y,Se.width,Se.height),0===He&&H.matrix.copy(Qe.matrix),!0===Re&&H.cameras.push(Qe)}g&&(r.bindXRFramebuffer(_),null!==M&&t.clear(M))}const ae=o.inputSources;for(let S=0;S<w.length;S++)w[S].update(ae[S],se,a);if(Ee&&Ee($,se),g){const S=h.textureWidth,Re=h.textureHeight;r.bindFramebuffer(t.READ_FRAMEBUFFER,_),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,d),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[y]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[y]),t.blitFramebuffer(0,0,S,Re,0,0,S,Re,t.COLOR_BUFFER_BIT,t.NEAREST),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[t.COLOR_ATTACHMENT0]),r.bindFramebuffer(t.READ_FRAMEBUFFER,null),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(t.FRAMEBUFFER,_)}m=null}),this.setAnimationLoop=function($){Ee=$},this.dispose=function(){}}}function QG(n){function i(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.specularMap&&(p.specularMap.value=m.specularMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);const y=n.get(m).envMap;if(y){p.envMap.value=y,p.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio;const C=n.get(y).__maxMipLevel;void 0!==C&&(p.maxMipLevel.value=C)}let M,w;m.lightMap&&(p.lightMap.value=m.lightMap,p.lightMapIntensity.value=m.lightMapIntensity),m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity),m.map?M=m.map:m.specularMap?M=m.specularMap:m.displacementMap?M=m.displacementMap:m.normalMap?M=m.normalMap:m.bumpMap?M=m.bumpMap:m.roughnessMap?M=m.roughnessMap:m.metalnessMap?M=m.metalnessMap:m.alphaMap?M=m.alphaMap:m.emissiveMap?M=m.emissiveMap:m.clearcoatMap?M=m.clearcoatMap:m.clearcoatNormalMap?M=m.clearcoatNormalMap:m.clearcoatRoughnessMap?M=m.clearcoatRoughnessMap:m.specularIntensityMap?M=m.specularIntensityMap:m.specularTintMap?M=m.specularTintMap:m.transmissionMap?M=m.transmissionMap:m.thicknessMap&&(M=m.thicknessMap),void 0!==M&&(M.isWebGLRenderTarget&&(M=M.texture),!0===M.matrixAutoUpdate&&M.updateMatrix(),p.uvTransform.value.copy(M.matrix)),m.aoMap?w=m.aoMap:m.lightMap&&(w=m.lightMap),void 0!==w&&(w.isWebGLRenderTarget&&(w=w.texture),!0===w.matrixAutoUpdate&&w.updateMatrix(),p.uv2Transform.value.copy(w.matrix))}function d(p,m){p.roughness.value=m.roughness,p.metalness.value=m.metalness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap),m.bumpMap&&(p.bumpMap.value=m.bumpMap,p.bumpScale.value=m.bumpScale,m.side===qt&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,p.normalScale.value.copy(m.normalScale),m.side===qt&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),n.get(m).envMap&&(p.envMapIntensity.value=m.envMapIntensity)}return{refreshFogUniforms:function e(p,m){p.fogColor.value.copy(m.color),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)},refreshMaterialUniforms:function t(p,m,y,M,w){m.isMeshBasicMaterial?i(p,m):m.isMeshLambertMaterial?(i(p,m),function l(p,m){m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap)}(p,m)):m.isMeshToonMaterial?(i(p,m),function u(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap),m.bumpMap&&(p.bumpMap.value=m.bumpMap,p.bumpScale.value=m.bumpScale,m.side===qt&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,p.normalScale.value.copy(m.normalScale),m.side===qt&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias)}(p,m)):m.isMeshPhongMaterial?(i(p,m),function c(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap),m.bumpMap&&(p.bumpMap.value=m.bumpMap,p.bumpScale.value=m.bumpScale,m.side===qt&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,p.normalScale.value.copy(m.normalScale),m.side===qt&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias)}(p,m)):m.isMeshStandardMaterial?(i(p,m),m.isMeshPhysicalMaterial?function h(p,m,y){d(p,m),p.ior.value=m.ior,m.sheen>0&&(p.sheenTint.value.copy(m.sheenTint).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),p.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===qt&&p.clearcoatNormalScale.value.negate())),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=y.texture,p.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap),p.attenuationDistance.value=m.attenuationDistance,p.attenuationTint.value.copy(m.attenuationTint)),p.specularIntensity.value=m.specularIntensity,p.specularTint.value.copy(m.specularTint),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap),m.specularTintMap&&(p.specularTintMap.value=m.specularTintMap)}(p,m,w):d(p,m)):m.isMeshMatcapMaterial?(i(p,m),function f(p,m){m.matcap&&(p.matcap.value=m.matcap),m.bumpMap&&(p.bumpMap.value=m.bumpMap,p.bumpScale.value=m.bumpScale,m.side===qt&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,p.normalScale.value.copy(m.normalScale),m.side===qt&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias)}(p,m)):m.isMeshDepthMaterial?(i(p,m),function g(p,m){m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias)}(p,m)):m.isMeshDistanceMaterial?(i(p,m),function _(p,m){m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),p.referencePosition.value.copy(m.referencePosition),p.nearDistance.value=m.nearDistance,p.farDistance.value=m.farDistance}(p,m)):m.isMeshNormalMaterial?(i(p,m),function v(p,m){m.bumpMap&&(p.bumpMap.value=m.bumpMap,p.bumpScale.value=m.bumpScale,m.side===qt&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,p.normalScale.value.copy(m.normalScale),m.side===qt&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias)}(p,m)):m.isLineBasicMaterial?(function r(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity}(p,m),m.isLineDashedMaterial&&function o(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}(p,m)):m.isPointsMaterial?function s(p,m,y,M){let w;p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*y,p.scale.value=.5*M,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest),m.map?w=m.map:m.alphaMap&&(w=m.alphaMap),void 0!==w&&(!0===w.matrixAutoUpdate&&w.updateMatrix(),p.uvTransform.value.copy(w.matrix))}(p,m,y,M):m.isSpriteMaterial?function a(p,m){let y;p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest),m.map?y=m.map:m.alphaMap&&(y=m.alphaMap),void 0!==y&&(!0===y.matrixAutoUpdate&&y.updateMatrix(),p.uvTransform.value.copy(y.matrix))}(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}}}function e4(n={}){const e=void 0!==n.canvas?n.canvas:function JG(){const n=Cg("canvas");return n.style.display="block",n}(),t=void 0!==n.context?n.context:null,i=void 0!==n.alpha&&n.alpha,r=void 0===n.depth||n.depth,o=void 0===n.stencil||n.stencil,s=void 0!==n.antialias&&n.antialias,a=void 0===n.premultipliedAlpha||n.premultipliedAlpha,l=void 0!==n.preserveDrawingBuffer&&n.preserveDrawingBuffer,c=void 0!==n.powerPreference?n.powerPreference:"default",u=void 0!==n.failIfMajorPerformanceCaveat&&n.failIfMajorPerformanceCaveat;let d=null,h=null;const f=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=xn,this.physicallyCorrectLights=!1,this.toneMapping=Uo,this.toneMappingExposure=1;const _=this;let v=!1,p=0,m=0,y=null,M=-1,w=null;const C=new En,E=new En;let B=null,q=e.width,H=e.height,R=1,ee=null,N=null;const U=new En(0,0,q,H),z=new En(0,0,q,H);let O=!1;const k=[],Y=new bg;let me=!1,Ee=!1,de=null;const je=new Yt,$=new I,se={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ae(){return null===y?R:1}let He,le,Se,Qe,Pe,ct,Sn,Ci,li,D,b,W,te,re,pe,ke,Le,Ue,_e,T,oe,j,ce,S=t;function Re(x,P){for(let F=0;F<x.length;F++){const G=e.getContext(x[F],P);if(null!==G)return G}return null}try{const x={alpha:i,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if(e.addEventListener("webglcontextlost",dn,!1),e.addEventListener("webglcontextrestored",hn,!1),null===S){const P=["webgl2","webgl","experimental-webgl"];if(!0===_.isWebGL1Renderer&&P.shift(),S=Re(P,x),null===S)throw Re(P)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===S.getShaderPrecisionFormat&&(S.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(x){throw console.error("THREE.WebGLRenderer: "+x.message),x}function ge(){He=new xV(S),le=new uV(S,He,n),He.init(le),j=new YG(S,He,le),Se=new qG(S,He,le),k[0]=S.BACK,Qe=new wV(S),Pe=new NG,ct=new XG(S,He,Se,Pe,le,j,Qe),Sn=new mV(_),Ci=new MV(_),li=new $H(S,le),ce=new lV(S,He,li,le),D=new EV(S,li,Qe,ce),b=new TV(S,D,li,Qe),_e=new CV(S,le,ct),ke=new dV(Pe),W=new FG(_,Sn,Ci,He,le,ce,ke),te=new QG(Pe),re=new kG(Pe),pe=new GG(He,le),Ue=new aV(_,Sn,Se,b,a),Le=new $G(_,b,le),T=new cV(S,He,Qe,le),oe=new bV(S,He,Qe,le),Qe.programs=W.programs,_.capabilities=le,_.extensions=He,_.properties=Pe,_.renderLists=re,_.shadowMap=Le,_.state=Se,_.info=Qe}ge();const Ye=new KG(_,S);function dn(x){x.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),v=!0}function hn(){console.log("THREE.WebGLRenderer: Context Restored."),v=!1;const x=Qe.autoReset,P=Le.enabled,F=Le.autoUpdate,L=Le.needsUpdate,G=Le.type;ge(),Qe.autoReset=x,Le.enabled=P,Le.autoUpdate=F,Le.needsUpdate=L,Le.type=G}function ao(x){const P=x.target;P.removeEventListener("dispose",ao),function Ot(x){(function Sr(x){const P=Pe.get(x).programs;void 0!==P&&P.forEach(function(F){W.releaseProgram(F)})})(x),Pe.remove(x)}(P)}this.xr=Ye,this.getContext=function(){return S},this.getContextAttributes=function(){return S.getContextAttributes()},this.forceContextLoss=function(){const x=He.get("WEBGL_lose_context");x&&x.loseContext()},this.forceContextRestore=function(){const x=He.get("WEBGL_lose_context");x&&x.restoreContext()},this.getPixelRatio=function(){return R},this.setPixelRatio=function(x){void 0!==x&&(R=x,this.setSize(q,H,!1))},this.getSize=function(x){return x.set(q,H)},this.setSize=function(x,P,F){Ye.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(q=x,H=P,e.width=Math.floor(x*R),e.height=Math.floor(P*R),!1!==F&&(e.style.width=x+"px",e.style.height=P+"px"),this.setViewport(0,0,x,P))},this.getDrawingBufferSize=function(x){return x.set(q*R,H*R).floor()},this.setDrawingBufferSize=function(x,P,F){q=x,H=P,R=F,e.width=Math.floor(x*F),e.height=Math.floor(P*F),this.setViewport(0,0,x,P)},this.getCurrentViewport=function(x){return x.copy(C)},this.getViewport=function(x){return x.copy(U)},this.setViewport=function(x,P,F,L){x.isVector4?U.set(x.x,x.y,x.z,x.w):U.set(x,P,F,L),Se.viewport(C.copy(U).multiplyScalar(R).floor())},this.getScissor=function(x){return x.copy(z)},this.setScissor=function(x,P,F,L){x.isVector4?z.set(x.x,x.y,x.z,x.w):z.set(x,P,F,L),Se.scissor(E.copy(z).multiplyScalar(R).floor())},this.getScissorTest=function(){return O},this.setScissorTest=function(x){Se.setScissorTest(O=x)},this.setOpaqueSort=function(x){ee=x},this.setTransparentSort=function(x){N=x},this.getClearColor=function(x){return x.copy(Ue.getClearColor())},this.setClearColor=function(){Ue.setClearColor.apply(Ue,arguments)},this.getClearAlpha=function(){return Ue.getClearAlpha()},this.setClearAlpha=function(){Ue.setClearAlpha.apply(Ue,arguments)},this.clear=function(x,P,F){let L=0;(void 0===x||x)&&(L|=S.COLOR_BUFFER_BIT),(void 0===P||P)&&(L|=S.DEPTH_BUFFER_BIT),(void 0===F||F)&&(L|=S.STENCIL_BUFFER_BIT),S.clear(L)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",dn,!1),e.removeEventListener("webglcontextrestored",hn,!1),re.dispose(),pe.dispose(),Pe.dispose(),Sn.dispose(),Ci.dispose(),b.dispose(),ce.dispose(),Ye.dispose(),Ye.removeEventListener("sessionstart",sC),Ye.removeEventListener("sessionend",aC),de&&(de.dispose(),de=null),qo.stop()},this.renderBufferImmediate=function(x,P){ce.initAttributes();const F=Pe.get(x);x.hasPositions&&!F.position&&(F.position=S.createBuffer()),x.hasNormals&&!F.normal&&(F.normal=S.createBuffer()),x.hasUvs&&!F.uv&&(F.uv=S.createBuffer()),x.hasColors&&!F.color&&(F.color=S.createBuffer());const L=P.getAttributes();x.hasPositions&&(S.bindBuffer(S.ARRAY_BUFFER,F.position),S.bufferData(S.ARRAY_BUFFER,x.positionArray,S.DYNAMIC_DRAW),ce.enableAttribute(L.position.location),S.vertexAttribPointer(L.position.location,3,S.FLOAT,!1,0,0)),x.hasNormals&&(S.bindBuffer(S.ARRAY_BUFFER,F.normal),S.bufferData(S.ARRAY_BUFFER,x.normalArray,S.DYNAMIC_DRAW),ce.enableAttribute(L.normal.location),S.vertexAttribPointer(L.normal.location,3,S.FLOAT,!1,0,0)),x.hasUvs&&(S.bindBuffer(S.ARRAY_BUFFER,F.uv),S.bufferData(S.ARRAY_BUFFER,x.uvArray,S.DYNAMIC_DRAW),ce.enableAttribute(L.uv.location),S.vertexAttribPointer(L.uv.location,2,S.FLOAT,!1,0,0)),x.hasColors&&(S.bindBuffer(S.ARRAY_BUFFER,F.color),S.bufferData(S.ARRAY_BUFFER,x.colorArray,S.DYNAMIC_DRAW),ce.enableAttribute(L.color.location),S.vertexAttribPointer(L.color.location,3,S.FLOAT,!1,0,0)),ce.disableUnusedAttributes(),S.drawArrays(S.TRIANGLES,0,x.count),x.count=0},this.renderBufferDirect=function(x,P,F,L,G,Fe){null===P&&(P=se);const be=G.isMesh&&G.matrixWorld.determinant()<0,we=dC(x,P,F,L,G);Se.setMaterial(L,be);let Xe=F.index;const st=F.attributes.position;if(null===Xe){if(void 0===st||0===st.count)return}else if(0===Xe.count)return;let Ze=1;!0===L.wireframe&&(Xe=D.getWireframeAttribute(F),Ze=2),ce.setup(G,L,we,F,Xe);let Je,Ct=T;null!==Xe&&(Je=li.get(Xe),Ct=oe,Ct.setIndex(Je));const Xo=null!==Xe?Xe.count:st.count,nt=F.drawRange.start*Ze,rc=F.drawRange.count*Ze,gt=null!==Fe?Fe.start*Ze:0,Yo=null!==Fe?Fe.count*Ze:1/0,Zo=Math.max(nt,gt),Ko=Math.min(Xo,nt+rc,gt+Yo)-1,lo=Math.max(0,Ko-Zo+1);if(0!==lo){if(G.isMesh)!0===L.wireframe?(Se.setLineWidth(L.wireframeLinewidth*ae()),Ct.setMode(S.LINES)):Ct.setMode(S.TRIANGLES);else if(G.isLine){let Tt=L.linewidth;void 0===Tt&&(Tt=1),Se.setLineWidth(Tt*ae()),Ct.setMode(G.isLineSegments?S.LINES:G.isLineLoop?S.LINE_LOOP:S.LINE_STRIP)}else G.isPoints?Ct.setMode(S.POINTS):G.isSprite&&Ct.setMode(S.TRIANGLES);if(G.isInstancedMesh)Ct.renderInstances(Zo,lo,G.count);else if(F.isInstancedBufferGeometry){const Tt=Math.min(F.instanceCount,F._maxInstanceCount);Ct.renderInstances(Zo,lo,Tt)}else Ct.render(Zo,lo)}},this.compile=function(x,P){h=pe.get(x),h.init(),g.push(h),x.traverseVisible(function(F){F.isLight&&F.layers.test(P.layers)&&(h.pushLight(F),F.castShadow&&h.pushShadow(F))}),h.setupLights(_.physicallyCorrectLights),x.traverse(function(F){const L=F.material;if(L)if(Array.isArray(L))for(let G=0;G<L.length;G++)l_(L[G],x,F);else l_(L,x,F)}),g.pop(),h=null};let a_=null;function sC(){qo.stop()}function aC(){qo.start()}const qo=new JS;function lC(x,P,F,L){if(!1===x.visible)return;if(x.layers.test(P.layers))if(x.isGroup)F=x.renderOrder;else if(x.isLOD)!0===x.autoUpdate&&x.update(P);else if(x.isLight)h.pushLight(x),x.castShadow&&h.pushShadow(x);else if(x.isSprite){if(!x.frustumCulled||Y.intersectsSprite(x)){L&&$.setFromMatrixPosition(x.matrixWorld).applyMatrix4(je);const be=b.update(x),we=x.material;we.visible&&d.push(x,be,we,F,$.z,null)}}else if(x.isImmediateRenderObject)L&&$.setFromMatrixPosition(x.matrixWorld).applyMatrix4(je),d.push(x,null,x.material,F,$.z,null);else if((x.isMesh||x.isLine||x.isPoints)&&(x.isSkinnedMesh&&x.skeleton.frame!==Qe.render.frame&&(x.skeleton.update(),x.skeleton.frame=Qe.render.frame),!x.frustumCulled||Y.intersectsObject(x))){L&&$.setFromMatrixPosition(x.matrixWorld).applyMatrix4(je);const be=b.update(x),we=x.material;if(Array.isArray(we)){const Xe=be.groups;for(let st=0,Ze=Xe.length;st<Ze;st++){const Je=Xe[st],Ct=we[Je.materialIndex];Ct&&Ct.visible&&d.push(x,be,Ct,F,$.z,Je)}}else we.visible&&d.push(x,be,we,F,$.z,null)}const Fe=x.children;for(let be=0,we=Fe.length;be<we;be++)lC(Fe[be],P,F,L)}function cC(x,P,F,L){const G=x.opaque,Fe=x.transmissive,be=x.transparent;h.setupLightsView(F),Fe.length>0&&function oj(x,P,F){null===de&&(de=new(!0===s&&!0===le.isWebGL2?bD:io)(1024,1024,{generateMipmaps:!0,type:null!==j.convert(ta)?ta:Wr,minFilter:bd,magFilter:Fn,wrapS:Wn,wrapT:Wn}));const L=_.getRenderTarget();_.setRenderTarget(de),_.clear();const G=_.toneMapping;_.toneMapping=Uo,Kd(x,P,F),_.toneMapping=G,ct.updateMultisampleRenderTarget(de),ct.updateRenderTargetMipmap(de),_.setRenderTarget(L)}(G,P,F),L&&Se.viewport(C.copy(L)),G.length>0&&Kd(G,P,F),Fe.length>0&&Kd(Fe,P,F),be.length>0&&Kd(be,P,F)}function Kd(x,P,F){const L=!0===P.isScene?P.overrideMaterial:null;for(let G=0,Fe=x.length;G<Fe;G++){const be=x[G],we=be.object,Xe=be.geometry,st=null===L?be.material:L,Ze=be.group;we.layers.test(F.layers)&&sj(we,P,F,Xe,st,Ze)}}function sj(x,P,F,L,G,Fe){if(x.onBeforeRender(_,P,F,L,G,Fe),x.modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,x.matrixWorld),x.normalMatrix.getNormalMatrix(x.modelViewMatrix),G.onBeforeRender(_,P,F,L,x,Fe),x.isImmediateRenderObject){const be=dC(F,P,L,G,x);Se.setMaterial(G),ce.reset(),function Dr(x,P){x.render(function(F){_.renderBufferImmediate(F,P)})}(x,be)}else!0===G.transparent&&G.side===Js?(G.side=qt,G.needsUpdate=!0,_.renderBufferDirect(F,P,L,G,x,Fe),G.side=jl,G.needsUpdate=!0,_.renderBufferDirect(F,P,L,G,x,Fe),G.side=Js):_.renderBufferDirect(F,P,L,G,x,Fe);x.onAfterRender(_,P,F,L,G,Fe)}function l_(x,P,F){!0!==P.isScene&&(P=se);const L=Pe.get(x),G=h.state.lights,be=G.state.version,we=W.getParameters(x,G.state,h.state.shadowsArray,P,F),Xe=W.getProgramCacheKey(we);let st=L.programs;L.environment=x.isMeshStandardMaterial?P.environment:null,L.fog=P.fog,L.envMap=(x.isMeshStandardMaterial?Ci:Sn).get(x.envMap||L.environment),void 0===st&&(x.addEventListener("dispose",ao),st=new Map,L.programs=st);let Ze=st.get(Xe);if(void 0!==Ze){if(L.currentProgram===Ze&&L.lightsStateVersion===be)return uC(x,we),Ze}else we.uniforms=W.getUniforms(x),x.onBuild(we,_),x.onBeforeCompile(we,_),Ze=W.acquireProgram(we,Xe),st.set(Xe,Ze),L.uniforms=we.uniforms;const Je=L.uniforms;(!x.isShaderMaterial&&!x.isRawShaderMaterial||!0===x.clipping)&&(Je.clippingPlanes=ke.uniform),uC(x,we),L.needsLights=function lj(x){return x.isMeshLambertMaterial||x.isMeshToonMaterial||x.isMeshPhongMaterial||x.isMeshStandardMaterial||x.isShadowMaterial||x.isShaderMaterial&&!0===x.lights}(x),L.lightsStateVersion=be,L.needsLights&&(Je.ambientLightColor.value=G.state.ambient,Je.lightProbe.value=G.state.probe,Je.directionalLights.value=G.state.directional,Je.directionalLightShadows.value=G.state.directionalShadow,Je.spotLights.value=G.state.spot,Je.spotLightShadows.value=G.state.spotShadow,Je.rectAreaLights.value=G.state.rectArea,Je.ltc_1.value=G.state.rectAreaLTC1,Je.ltc_2.value=G.state.rectAreaLTC2,Je.pointLights.value=G.state.point,Je.pointLightShadows.value=G.state.pointShadow,Je.hemisphereLights.value=G.state.hemi,Je.directionalShadowMap.value=G.state.directionalShadowMap,Je.directionalShadowMatrix.value=G.state.directionalShadowMatrix,Je.spotShadowMap.value=G.state.spotShadowMap,Je.spotShadowMatrix.value=G.state.spotShadowMatrix,Je.pointShadowMap.value=G.state.pointShadowMap,Je.pointShadowMatrix.value=G.state.pointShadowMatrix);const Ct=Ze.getUniforms(),Xo=so.seqWithValue(Ct.seq,Je);return L.currentProgram=Ze,L.uniformsList=Xo,Ze}function uC(x,P){const F=Pe.get(x);F.outputEncoding=P.outputEncoding,F.instancing=P.instancing,F.skinning=P.skinning,F.morphTargets=P.morphTargets,F.morphNormals=P.morphNormals,F.morphTargetsCount=P.morphTargetsCount,F.numClippingPlanes=P.numClippingPlanes,F.numIntersection=P.numClipIntersection,F.vertexAlphas=P.vertexAlphas,F.vertexTangents=P.vertexTangents}function dC(x,P,F,L,G){!0!==P.isScene&&(P=se),ct.resetTextureUnits();const Fe=P.fog,we=null===y?_.outputEncoding:y.texture.encoding,Xe=(L.isMeshStandardMaterial?Ci:Sn).get(L.envMap||(L.isMeshStandardMaterial?P.environment:null)),st=!0===L.vertexColors&&!!F&&!!F.attributes.color&&4===F.attributes.color.itemSize,Ze=!!L.normalMap&&!!F&&!!F.attributes.tangent,Je=!!F&&!!F.morphAttributes.position,Ct=!!F&&!!F.morphAttributes.normal,Xo=F&&F.morphAttributes.position?F.morphAttributes.position.length:0,nt=Pe.get(L),rc=h.state.lights;!0!==me||!0!==Ee&&x===w||ke.setState(L,x,x===w&&L.id===M);let gt=!1;L.version===nt.__version?(nt.needsLights&&nt.lightsStateVersion!==rc.state.version||nt.outputEncoding!==we||G.isInstancedMesh&&!1===nt.instancing||!G.isInstancedMesh&&!0===nt.instancing||G.isSkinnedMesh&&!1===nt.skinning||!G.isSkinnedMesh&&!0===nt.skinning||nt.envMap!==Xe||L.fog&&nt.fog!==Fe||void 0!==nt.numClippingPlanes&&(nt.numClippingPlanes!==ke.numPlanes||nt.numIntersection!==ke.numIntersection)||nt.vertexAlphas!==st||nt.vertexTangents!==Ze||nt.morphTargets!==Je||nt.morphNormals!==Ct||!0===le.isWebGL2&&nt.morphTargetsCount!==Xo)&&(gt=!0):(gt=!0,nt.__version=L.version);let Yo=nt.currentProgram;!0===gt&&(Yo=l_(L,P,G));let Zo=!1,Ko=!1,lo=!1;const Tt=Yo.getUniforms(),oc=nt.uniforms;if(Se.useProgram(Yo.program)&&(Zo=!0,Ko=!0,lo=!0),L.id!==M&&(M=L.id,Ko=!0),Zo||w!==x){if(Tt.setValue(S,"projectionMatrix",x.projectionMatrix),le.logarithmicDepthBuffer&&Tt.setValue(S,"logDepthBufFC",2/(Math.log(x.far+1)/Math.LN2)),w!==x&&(w=x,Ko=!0,lo=!0),L.isShaderMaterial||L.isMeshPhongMaterial||L.isMeshToonMaterial||L.isMeshStandardMaterial||L.envMap){const Ti=Tt.map.cameraPosition;void 0!==Ti&&Ti.setValue(S,$.setFromMatrixPosition(x.matrixWorld))}(L.isMeshPhongMaterial||L.isMeshToonMaterial||L.isMeshLambertMaterial||L.isMeshBasicMaterial||L.isMeshStandardMaterial||L.isShaderMaterial)&&Tt.setValue(S,"isOrthographic",!0===x.isOrthographicCamera),(L.isMeshPhongMaterial||L.isMeshToonMaterial||L.isMeshLambertMaterial||L.isMeshBasicMaterial||L.isMeshStandardMaterial||L.isShaderMaterial||L.isShadowMaterial||G.isSkinnedMesh)&&Tt.setValue(S,"viewMatrix",x.matrixWorldInverse)}if(G.isSkinnedMesh){Tt.setOptional(S,G,"bindMatrix"),Tt.setOptional(S,G,"bindMatrixInverse");const Ti=G.skeleton;Ti&&(le.floatVertexTextures?(null===Ti.boneTexture&&Ti.computeBoneTexture(),Tt.setValue(S,"boneTexture",Ti.boneTexture,ct),Tt.setValue(S,"boneTextureSize",Ti.boneTextureSize)):Tt.setOptional(S,Ti,"boneMatrices"))}return F&&(void 0!==F.morphAttributes.position||void 0!==F.morphAttributes.normal)&&_e.update(G,F,L,Yo),(Ko||nt.receiveShadow!==G.receiveShadow)&&(nt.receiveShadow=G.receiveShadow,Tt.setValue(S,"receiveShadow",G.receiveShadow)),Ko&&(Tt.setValue(S,"toneMappingExposure",_.toneMappingExposure),nt.needsLights&&function aj(x,P){x.ambientLightColor.needsUpdate=P,x.lightProbe.needsUpdate=P,x.directionalLights.needsUpdate=P,x.directionalLightShadows.needsUpdate=P,x.pointLights.needsUpdate=P,x.pointLightShadows.needsUpdate=P,x.spotLights.needsUpdate=P,x.spotLightShadows.needsUpdate=P,x.rectAreaLights.needsUpdate=P,x.hemisphereLights.needsUpdate=P}(oc,lo),Fe&&L.fog&&te.refreshFogUniforms(oc,Fe),te.refreshMaterialUniforms(oc,L,R,H,de),so.upload(S,nt.uniformsList,oc,ct)),L.isShaderMaterial&&!0===L.uniformsNeedUpdate&&(so.upload(S,nt.uniformsList,oc,ct),L.uniformsNeedUpdate=!1),L.isSpriteMaterial&&Tt.setValue(S,"center",G.center),Tt.setValue(S,"modelViewMatrix",G.modelViewMatrix),Tt.setValue(S,"normalMatrix",G.normalMatrix),Tt.setValue(S,"modelMatrix",G.matrixWorld),Yo}qo.setAnimationLoop(function rj(x){a_&&a_(x)}),typeof window<"u"&&qo.setContext(window),this.setAnimationLoop=function(x){a_=x,Ye.setAnimationLoop(x),null===x?qo.stop():qo.start()},Ye.addEventListener("sessionstart",sC),Ye.addEventListener("sessionend",aC),this.render=function(x,P){if(void 0===P||!0===P.isCamera){if(!0!==v){if(!0===x.autoUpdate&&x.updateMatrixWorld(),null===P.parent&&P.updateMatrixWorld(),!0===Ye.enabled&&!0===Ye.isPresenting&&(!0===Ye.cameraAutoUpdate&&Ye.updateCamera(P),P=Ye.getCamera()),!0===x.isScene&&x.onBeforeRender(_,x,P,y),h=pe.get(x,g.length),h.init(),g.push(h),je.multiplyMatrices(P.projectionMatrix,P.matrixWorldInverse),Y.setFromProjectionMatrix(je),Ee=this.localClippingEnabled,me=ke.init(this.clippingPlanes,Ee,P),d=re.get(x,f.length),d.init(),f.push(d),lC(x,P,0,_.sortObjects),d.finish(),!0===_.sortObjects&&d.sort(ee,N),!0===me&&ke.beginShadows(),Le.render(h.state.shadowsArray,x,P),!0===me&&ke.endShadows(),!0===this.info.autoReset&&this.info.reset(),Ue.render(d,x),h.setupLights(_.physicallyCorrectLights),P.isArrayCamera){const L=P.cameras;for(let G=0,Fe=L.length;G<Fe;G++){const be=L[G];cC(d,x,be,be.viewport)}}else cC(d,x,P);null!==y&&(ct.updateMultisampleRenderTarget(y),ct.updateRenderTargetMipmap(y)),!0===x.isScene&&x.onAfterRender(_,x,P),Se.buffers.depth.setTest(!0),Se.buffers.depth.setMask(!0),Se.buffers.color.setMask(!0),Se.setPolygonOffset(!1),ce.resetDefaultState(),M=-1,w=null,g.pop(),h=g.length>0?g[g.length-1]:null,f.pop(),d=f.length>0?f[f.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return p},this.getActiveMipmapLevel=function(){return m},this.getRenderTarget=function(){return y},this.setRenderTarget=function(x,P=0,F=0){y=x,p=P,m=F,x&&void 0===Pe.get(x).__webglFramebuffer&&ct.setupRenderTarget(x);let L=null,G=!1,Fe=!1;if(x){const we=x.texture;(we.isDataTexture3D||we.isDataTexture2DArray)&&(Fe=!0);const Xe=Pe.get(x).__webglFramebuffer;x.isWebGLCubeRenderTarget?(L=Xe[P],G=!0):L=x.isWebGLMultisampleRenderTarget?Pe.get(x).__webglMultisampledFramebuffer:Xe,C.copy(x.viewport),E.copy(x.scissor),B=x.scissorTest}else C.copy(U).multiplyScalar(R).floor(),E.copy(z).multiplyScalar(R).floor(),B=O;if(Se.bindFramebuffer(S.FRAMEBUFFER,L)&&le.drawBuffers){let we=!1;if(x)if(x.isWebGLMultipleRenderTargets){const Xe=x.texture;if(k.length!==Xe.length||k[0]!==S.COLOR_ATTACHMENT0){for(let st=0,Ze=Xe.length;st<Ze;st++)k[st]=S.COLOR_ATTACHMENT0+st;k.length=Xe.length,we=!0}}else(1!==k.length||k[0]!==S.COLOR_ATTACHMENT0)&&(k[0]=S.COLOR_ATTACHMENT0,k.length=1,we=!0);else(1!==k.length||k[0]!==S.BACK)&&(k[0]=S.BACK,k.length=1,we=!0);we&&(le.isWebGL2?S.drawBuffers(k):He.get("WEBGL_draw_buffers").drawBuffersWEBGL(k))}if(Se.viewport(C),Se.scissor(E),Se.setScissorTest(B),G){const we=Pe.get(x.texture);S.framebufferTexture2D(S.FRAMEBUFFER,S.COLOR_ATTACHMENT0,S.TEXTURE_CUBE_MAP_POSITIVE_X+P,we.__webglTexture,F)}else if(Fe){const we=Pe.get(x.texture);S.framebufferTextureLayer(S.FRAMEBUFFER,S.COLOR_ATTACHMENT0,we.__webglTexture,F||0,P||0)}M=-1},this.readRenderTargetPixels=function(x,P,F,L,G,Fe,be){if(!x||!x.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let we=Pe.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&void 0!==be&&(we=we[be]),we){Se.bindFramebuffer(S.FRAMEBUFFER,we);try{const Xe=x.texture,st=Xe.format,Ze=Xe.type;if(st!==Mn&&j.convert(st)!==S.getParameter(S.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const Je=Ze===ta&&(He.has("EXT_color_buffer_half_float")||le.isWebGL2&&He.has("EXT_color_buffer_float"));if(!(Ze===Wr||j.convert(Ze)===S.getParameter(S.IMPLEMENTATION_COLOR_READ_TYPE)||Ze===$r&&(le.isWebGL2||He.has("OES_texture_float")||He.has("WEBGL_color_buffer_float"))||Je))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");S.checkFramebufferStatus(S.FRAMEBUFFER)===S.FRAMEBUFFER_COMPLETE?P>=0&&P<=x.width-L&&F>=0&&F<=x.height-G&&S.readPixels(P,F,L,G,j.convert(st),j.convert(Ze),Fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Xe=null!==y?Pe.get(y).__webglFramebuffer:null;Se.bindFramebuffer(S.FRAMEBUFFER,Xe)}}},this.copyFramebufferToTexture=function(x,P,F=0){const L=Math.pow(2,-F),G=Math.floor(P.image.width*L),Fe=Math.floor(P.image.height*L);let be=j.convert(P.format);le.isWebGL2&&(be===S.RGB&&(be=S.RGB8),be===S.RGBA&&(be=S.RGBA8)),ct.setTexture2D(P,0),S.copyTexImage2D(S.TEXTURE_2D,F,be,x.x,x.y,G,Fe,0),Se.unbindTexture()},this.copyTextureToTexture=function(x,P,F,L=0){const G=P.image.width,Fe=P.image.height,be=j.convert(F.format),we=j.convert(F.type);ct.setTexture2D(F,0),S.pixelStorei(S.UNPACK_FLIP_Y_WEBGL,F.flipY),S.pixelStorei(S.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),S.pixelStorei(S.UNPACK_ALIGNMENT,F.unpackAlignment),P.isDataTexture?S.texSubImage2D(S.TEXTURE_2D,L,x.x,x.y,G,Fe,be,we,P.image.data):P.isCompressedTexture?S.compressedTexSubImage2D(S.TEXTURE_2D,L,x.x,x.y,P.mipmaps[0].width,P.mipmaps[0].height,be,P.mipmaps[0].data):S.texSubImage2D(S.TEXTURE_2D,L,x.x,x.y,be,we,P.image),0===L&&F.generateMipmaps&&S.generateMipmap(S.TEXTURE_2D),Se.unbindTexture()},this.copyTextureToTexture3D=function(x,P,F,L,G=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Fe=x.max.x-x.min.x+1,be=x.max.y-x.min.y+1,we=x.max.z-x.min.z+1,Xe=j.convert(L.format),st=j.convert(L.type);let Ze;if(L.isDataTexture3D)ct.setTexture3D(L,0),Ze=S.TEXTURE_3D;else{if(!L.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ct.setTexture2DArray(L,0),Ze=S.TEXTURE_2D_ARRAY}S.pixelStorei(S.UNPACK_FLIP_Y_WEBGL,L.flipY),S.pixelStorei(S.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),S.pixelStorei(S.UNPACK_ALIGNMENT,L.unpackAlignment);const Je=S.getParameter(S.UNPACK_ROW_LENGTH),Ct=S.getParameter(S.UNPACK_IMAGE_HEIGHT),Xo=S.getParameter(S.UNPACK_SKIP_PIXELS),nt=S.getParameter(S.UNPACK_SKIP_ROWS),rc=S.getParameter(S.UNPACK_SKIP_IMAGES),gt=F.isCompressedTexture?F.mipmaps[0]:F.image;S.pixelStorei(S.UNPACK_ROW_LENGTH,gt.width),S.pixelStorei(S.UNPACK_IMAGE_HEIGHT,gt.height),S.pixelStorei(S.UNPACK_SKIP_PIXELS,x.min.x),S.pixelStorei(S.UNPACK_SKIP_ROWS,x.min.y),S.pixelStorei(S.UNPACK_SKIP_IMAGES,x.min.z),F.isDataTexture||F.isDataTexture3D?S.texSubImage3D(Ze,G,P.x,P.y,P.z,Fe,be,we,Xe,st,gt.data):F.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),S.compressedTexSubImage3D(Ze,G,P.x,P.y,P.z,Fe,be,we,Xe,gt.data)):S.texSubImage3D(Ze,G,P.x,P.y,P.z,Fe,be,we,Xe,st,gt),S.pixelStorei(S.UNPACK_ROW_LENGTH,Je),S.pixelStorei(S.UNPACK_IMAGE_HEIGHT,Ct),S.pixelStorei(S.UNPACK_SKIP_PIXELS,Xo),S.pixelStorei(S.UNPACK_SKIP_ROWS,nt),S.pixelStorei(S.UNPACK_SKIP_IMAGES,rc),0===G&&L.generateMipmaps&&S.generateMipmap(Ze),Se.unbindTexture()},this.initTexture=function(x){ct.setTexture2D(x,0),Se.unbindTexture()},this.resetState=function(){p=0,m=0,y=null,Se.reset(),ce.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class t4{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ZD(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=ZD();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ZD(){return(typeof performance>"u"?Date:performance).now()}class Jg extends oi{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}Jg.prototype.isScene=!0;const KD=1e-5;function e_(n,e=KD){return Math.abs(n)<e}function QD(n,e,t=KD){return e_(n-e,t)}var wn=(()=>{return(n=wn||(wn={}))[n.NONE=-1]="NONE",n[n.PAN=1]="PAN",n[n.TOUCH_PAN=2]="TOUCH_PAN",n[n.TOUCH_DOLLY_PAN=3]="TOUCH_DOLLY_PAN",wn;var n})();class n4{constructor(e,t,i,r,o,s,a,l){this.enabled=!0,this.minZoom=1,this.maxZoom=1/0,this.zoomSpeed=1,this.zoomTouchSpeed=3,this.panSpeed=1,this.initialPosition=new I,this.panOffset=new I,this.zoomOffset=new I,this.panStart=new Ce,this.panEnd=new Ce,this.panDelta=new Ce,this.dollyStart=new Ce,this.dollyEnd=new Ce,this.pointers=[],this.pointerPositions={},this.state=wn.NONE,this.zoomCursor=new Ce,this.dampingFactor=.25,this.mouseWheelEnabled=!1,this.update=(()=>{const c=new I,u=new I,d=new I,h=new Ce,f=new I;return g=>{const _=Math.min(this.dampingFactor*g*75,1),v=(this.zoomEnd-this.zoom)*_;if(this.zoom+=v,QD(this.zoom,this.minZoom,.01)&&(this.zoom=this.minZoom),this.camera.zoom!==this.zoom){e_(v)&&(this.zoom=this.zoomEnd);const p=this.zoom;h.subVectors(this.zoomCursor.clone().divideScalar(this.camera.zoom),this.zoomCursor.clone().divideScalar(p)),f.set(h.x,-h.y,0),this.zoomOffset.add(f),this.camera.zoom=p,this.camera.updateProjectionMatrix(),this.onZoomChange({value:this.zoom,ratio:(this.zoom-this.minZoom)/(this.maxZoom-this.minZoom)})}u.set(-this.minWidth,-this.minHeight,0).multiplyScalar((this.camera.zoom-this.minZoom)/2).divideScalar(this.camera.zoom),d.set(this.minWidth,this.minHeight,0).multiplyScalar((this.camera.zoom-this.minZoom)/2).divideScalar(this.camera.zoom),this.panOffset.clamp(u,d),this.zoomOffset.clamp(u,d),c.addVectors(this.panOffset,this.zoomOffset),c.clamp(u,d),this.camera.position.addVectors(this.initialPosition,c)}})(),this.dispose=()=>{this.domElement.removeEventListener("dblclick",this.onDoubleClick),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerCancel),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp);for(const c of this.pointers)this.domElement.releasePointerCapture(c.pointerId)},this.clickZoomIn=()=>this.zoomIn(1/1.5),this.clickZoomOut=()=>this.zoomOut(1/1.5),this.updateMinZoom=c=>{this.minZoom=c,this.zoom=Nt(this.camera.zoom,this.minZoom,this.maxZoom)},this.zoomReset=()=>{this.zoomEnd=this.minZoom},this.bind=()=>{this.domElement&&(this.domElement.style.touchAction="none"),this.domElement.addEventListener("dblclick",this.onDoubleClick),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1})},this.zoomTo=(c,u,d)=>{u?this.zoomCursor.copy(u):this.zoomCursor.set(0,0),this.zoomEnd=Nt(c,this.minZoom,this.maxZoom),d&&(this.zoom=this.zoomEnd)},this.panLeft=(()=>{const c=new I;return(u,d)=>{c.setFromMatrixColumn(d,0),c.multiplyScalar(-u),this.panOffset.add(c)}})(),this.panUp=(()=>{const c=new I;return(u,d)=>{c.setFromMatrixColumn(d,1),c.multiplyScalar(u),this.panOffset.add(c)}})(),this.pan=(c,u)=>{if(this.camera.zoom<=this.minZoom||QD(this.camera.zoom,this.minZoom))return void this.onAngleChange(c);const d=this.domElement,f=this.camera.top-this.camera.bottom;this.panLeft(c*(this.camera.right-this.camera.left)/this.camera.zoom/d.clientWidth,this.camera.matrix),this.panUp(u*f/this.camera.zoom/d.clientHeight,this.camera.matrix)},this.handleMouseDownPan=c=>{const{x:u,y:d}=this.getRelativeClient(c);this.panStart.set(u,d)},this.handleMouseMovePan=c=>{const{x:u,y:d}=this.getRelativeClient(c);this.panEnd.set(u,d),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(0)},this.handleMouseUp=()=>{},this.getRelativeClient=c=>{const u=this.domElement.getBoundingClientRect();return{x:c.clientX-u.x,y:c.clientY-u.y}},this.handleMouseWheel=c=>{const u=this.getRelativeClient(c),f=new Ce(u.x-(this.camera.right-this.camera.left)/2,u.y-(this.camera.top-this.camera.bottom)/2);c.deltaY<0?this.zoomIn(this.getZoomScale(),f,!0):c.deltaY>0&&this.zoomOut(this.getZoomScale(),f,!0),this.update(0)},this.handleTouchStartPan=()=>{1===this.pointers.length?this.panStart.set(this.pointers[0].pageX,this.pointers[0].pageY):this.panStart.set(.5*(this.pointers[0].pageX+this.pointers[1].pageX),.5*(this.pointers[0].pageY+this.pointers[1].pageY))},this.handleTouchStartDolly=()=>{const c=this.pointers[0].pageX-this.pointers[1].pageX,u=this.pointers[0].pageY-this.pointers[1].pageY,d=Math.sqrt(c*c+u*u);this.dollyStart.set(this.zoom,d)},this.handleTouchStartDollyPan=()=>{this.handleTouchStartDolly(),this.handleTouchStartPan()},this.handleTouchMovePan=c=>{if(1===this.pointers.length)this.panEnd.set(c.pageX,c.pageY);else{const u=this.getSecondPointerPosition(c);this.panEnd.set(.5*(c.pageX+u.x),.5*(c.pageY+u.y))}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)},this.handleTouchMoveDolly=c=>{const u=this.getSecondPointerPosition(c),d=c.pageX-u.x,h=c.pageY-u.y,f=Math.sqrt(d*d+h*h);this.dollyEnd.set(0,f),this.zoomTo(this.dollyEnd.y/this.dollyStart.y*this.dollyStart.x)},this.handleTouchMoveDollyPan=c=>{this.handleTouchMoveDolly(c),this.handleTouchMovePan(c)},this.handleTouchEnd=()=>{},this.onPointerDown=c=>{!1!==this.enabled&&(0===this.pointers.length&&(this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this.onPointerMove),this.domElement.addEventListener("pointerup",this.onPointerUp)),this.addPointer(c),"touch"===c.pointerType?this.onTouchStart(c):this.onMouseDown(c))},this.onPointerMove=c=>{!1!==this.enabled&&("touch"===c.pointerType?this.onTouchMove(c):this.onMouseMove(c))},this.onPointerUp=c=>{!1!==this.enabled&&("touch"===c.pointerType?this.onTouchEnd():this.onMouseUp(),this.removePointer(c),0===this.pointers.length&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)))},this.onPointerCancel=c=>{this.removePointer(c)},this.onMouseDown=c=>{this.handleMouseDownPan(c),this.state=wn.PAN},this.onMouseMove=c=>{!1!==this.enabled&&this.state===wn.PAN&&this.handleMouseMovePan(c)},this.onMouseUp=()=>{this.handleMouseUp(),this.state=wn.NONE},this.onMouseWheel=c=>{!1===this.enabled||!1===this.mouseWheelEnabled||this.state!==wn.NONE||(c.preventDefault(),this.handleMouseWheel(c))},this.onTouchStart=c=>{switch(this.trackPointer(c),this.pointers.length){case 1:this.handleTouchStartPan(),this.state=wn.TOUCH_PAN;break;case 2:this.handleTouchStartDollyPan(),this.state=wn.TOUCH_DOLLY_PAN;break;default:this.state=wn.NONE}},this.onTouchMove=c=>{switch(this.trackPointer(c),this.state){case wn.TOUCH_PAN:this.handleTouchMovePan(c),this.update(0);break;case wn.TOUCH_DOLLY_PAN:this.handleTouchMoveDollyPan(c),this.update(0);break;default:this.state=wn.NONE}},this.onTouchEnd=()=>{this.handleTouchEnd(),this.state=wn.NONE},this.onDoubleClick=c=>{const u=this.getRelativeClient(c),f=new Ce(u.x-(this.camera.right-this.camera.left)/2,u.y-(this.camera.top-this.camera.bottom)/2);this.zoom>this.minZoom?this.zoomReset():this.zoomIn(1/3,f)},this.addPointer=c=>{this.pointers.push(c)},this.removePointer=c=>{delete this.pointerPositions[c.pointerId];for(let u=0;u<this.pointers.length;u++)if(this.pointers[u].pointerId===c.pointerId)return void this.pointers.splice(u,1)},this.trackPointer=c=>{let u=this.pointerPositions[c.pointerId];void 0===u&&(u=new Ce,this.pointerPositions[c.pointerId]=u),u.set(c.pageX,c.pageY)},this.getSecondPointerPosition=c=>this.pointerPositions[(c.pointerId===this.pointers[0].pointerId?this.pointers[1]:this.pointers[0]).pointerId],this.setWheelEnabled=c=>{this.mouseWheelEnabled=c},this.camera=e,this.domElement=t,this.minZoom=i,this.maxZoom=r,this.minWidth=o,this.minHeight=s,this.onAngleChange=a,this.onZoomChange=l,this.zoom=this.camera.zoom,this.zoomEnd=this.camera.zoom,this.initialPosition.copy(this.camera.position),this.bind()}zoomOut(e,t,i){this.zoomTo(this.zoom*e,t,i)}zoomIn(e,t,i){this.zoomTo(this.zoom/e,t,i)}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}}class JD{constructor(e,t,i,r){this.tileLoader=e,this.renderer=t,this.callbacks=i,this.options=r}}class Sa extends Error{constructor(){super("Aborted tile loading")}}class r4{load(e,t){const i=document.createElement("img"),r=function i4(n){const e=[];function t(){for(const[i,r]of e)n.removeEventListener(i,r)}return{bind(...[i,r,o]){e.push([i,r]),n.addEventListener(i,(...a)=>{t(),"function"==typeof r&&r(...a)},o)},cancel:t}}(i);if(i.crossOrigin="anonymous",t){if(t.aborted)return Promise.reject(new Sa);t.addEventListener("abort",()=>{r.cancel(),i.src=""})}return fetch(e,{signal:t}).then(o=>{if(t?.aborted)throw new Sa;return o.blob()}).then(o=>{if(t?.aborted)throw new Sa;const s=URL.createObjectURL(o);return i.src=s,new Promise((a,l)=>{r.bind("load",()=>a(i),!1),r.bind("error",()=>l(new Sa),!1)}).finally(()=>URL.revokeObjectURL(s))}).catch(o=>{throw o instanceof DOMException&&o.code===DOMException.ABORT_ERR?new Sa:o})}}var er=(()=>{return(n=er||(er={}))[n.Error=0]="Error",n[n.InProgress=1]="InProgress",n[n.Success=2]="Success",n[n.Idle=3]="Idle",er;var n})();function s4(n){let e=null,t=null;const i=new Promise((o,s)=>{e=o,t=s}),r={state:er.Idle,execute:()=>{r.state=er.InProgress,n().then(o=>{if(r.state=er.Success,!e)throw new Error("Resolver not found");e?.(o)}).catch(o=>{r.state=er.Error,t?.(o)})},result:i};return r}class a4{constructor(e){this.jobList=new Map,this.textureCache=e}work(){const e=[...this.jobList.values()].filter(t=>t.task.state===er.Idle&&!t.abortController?.signal.aborted).slice(0,3);return Promise.all(e.map(({task:t})=>t.execute()))}load(e,t,i){const o=[e,t,`${function o4(n){return[n.level,n.x,n.y].join("_")}(i)}.jpg`].join("/"),s=this.jobList.get(o);if(null!=s&&s.task.state!==er.Error&&(!s.abortController?.signal.aborted||s.task.state===er.Success))return s;const a=new r4,l=new AbortController,u={abortController:l,task:s4(()=>{const d=new ai;return this.textureCache.set(o,d),a.load(o,l.signal).then(h=>(d.image=h,d.needsUpdate=!0,d))})};return this.jobList.set(o,u),u}cancelAll(){for(const e of this.jobList.values())e.abortController?.abort()}}let t_=(()=>{class n extends Ki{constructor(t,i,r,o){super(new ec(r.tileSize,r.tileSize)),this.variant=i,this.textureLoader=t,this.options=r,this.tilePosition=o,this.renderOrder=this.tilePosition.level,this.material=new ma({opacity:0,transparent:!0}),this.loadTextureMap()}loadTextureMap(){null!=this.textureAbortController&&this.textureAbortController.abort();const t=this.textureLoader.load(this.options.baseUrl,this.variant,this.tilePosition);this.textureAbortController=t.abortController,t.task.result.then(i=>{this.material instanceof ma&&(this.material.map=i,this.material.opacity=1,this.material.needsUpdate=!0)}).catch(i=>{if(!(i instanceof Sa))throw i})}divideSelf(){let t;if(!(this.children.length>0))for(const[i,r,o,s]of n.childTranslate)t=new n(this.textureLoader,this.variant,this.options,{level:this.tilePosition.level+1,x:2*this.tilePosition.x+i,y:2*this.tilePosition.y+r}),this.geometry instanceof ec&&(t.scale.set(.5,.5,1),t.position.set(o*this.geometry.parameters.width,s*this.geometry.parameters.width,this.options.zOffset??0)),this.add(t),t.updateMatrix(),t.updateMatrixWorld(!0),t.geometry.computeBoundingBox()}mergeChildren(){if(!(this.children.length<=0))for(let t=this.children.length-1;t>=0;t--)this.remove(this.children[t])}mergeSelf(){this.parent instanceof n&&this.parent.mergeChildren()}updateVariant(t){if(this.variant!==t){this.tilePosition.level>0&&this.material instanceof ma&&(this.material.opacity=0,this.material.needsUpdate=!0),this.variant=t,this.loadTextureMap();for(const i of this.children)i instanceof n&&i.updateVariant(t)}}requestLevel(t){this.tilePosition.level<t?this.divideSelf():this.tilePosition.level>t&&this.mergeSelf()}preload(t){const i=this.textureLoader.load(this.options.baseUrl,t??this.variant,this.tilePosition);return i.task.execute(),i.task.result}}return n.childTranslate=[[0,0,-.25,.25],[1,0,.25,.25],[0,1,-.25,-.25],[1,1,.25,-.25]],n})();class $o extends t_{constructor(e,t,i,r){super(e,r,{tileSize:t,baseUrl:i,zOffset:.01},{x:0,y:0,level:0}),this.plane=r}}class n_ extends t_{constructor(e,t,i,r,o=0,s=0){super(e,r,{tileSize:t,baseUrl:i},{x:o,y:s,level:0}),this.baseUrl=i}updateAngle(e){this.updateVariant(e)}}class l4 extends Wo{constructor(e,t,i,r,o){super(),this.data=r;const s=`${o}/exterior/${r.id}`,c=r.width/Math.pow(2,r.maxZoom)/t,u=r.height/Math.pow(2,r.maxZoom)/t;for(let d=0;d<c;++d)for(let h=0;h<u;++h){const f=new n_(e,t,s,r.photos[i],d,h);f.position.set(t*d,-t*h,0),this.add(f)}}updateAngle(e){for(const t of this.children)t instanceof n_&&t.updateAngle(this.data.photos[e])}preload(){const e=[];for(const t of this.data.photos)for(const i of this.children)i instanceof n_&&e.push(i.preload(t));return Promise.all(e)}}class eC{constructor(e,t){this.scene=e,this.camera=t,this.matrix4=new Yt,this.frustum=new bg}update(e){this.frustum.setFromProjectionMatrix(this.matrix4.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse));const t=new Set;this.scene.traverse(i=>{if(i instanceof t_){const r=new Bo;r.setFromObject(i),this.frustum.intersectsBox(r)&&t.add(i)}});for(const i of t)i.requestLevel(e)}containsPoint(e){return this.frustum.containsPoint(e)}}function i_(n,e,t){return"contain"===t.fit?Math.max(0,Math.min(t.width/n,t.height/e)):Math.max(0,Math.max(t.width/n,t.height/e))}class d4 extends JD{constructor(e,t,i,r,o,s){super(e,t,i,r),this.deltaX=0,this.maxDelta=0,this.minZoom=0,this.transitionProgress=0,this.transitionObjectFit=null,this.data=o,this.scene=new Jg,this.scene.background=null;const{clientWidth:a,clientHeight:l}=t.domElement;this.camera=new jg(a/-2,a/2,l/2,l/-2,1,1e3),this.deltaX=20*Math.floor(230/360*this.data.photos.length),this.maxDelta=20*this.data.photos.length;const c=this.data.width/Math.pow(2,this.data.maxZoom),u=this.data.height/Math.pow(2,this.data.maxZoom),d=this.data.tileSize;this.objectFit=r.objectFit,this.minZoom=i_(c,u,{width:a,height:l,fit:this.objectFit}),this.camera.zoom=this.minZoom,this.camera.up.set(0,0,0),this.camera.position.set(-d/2+c/2,d/2-u/2,1),this.camera.updateProjectionMatrix(),this.planeMap=new l4(e,d,Math.floor(this.deltaX/20),this.data,s),this.scene.add(this.planeMap),this.controls=new n4(this.camera,this.renderer.domElement,this.minZoom,Math.pow(2,this.data.maxZoom),c,u,f=>{this.callbacks.onActive(),this.deltaX-=f,this.deltaX<0&&(this.deltaX+=this.maxDelta),this.deltaX=this.deltaX%this.maxDelta},this.callbacks.onZoomChange),this.controls.update(0),this.frustum=new eC(this.scene,this.camera);const h=document.querySelector(".hotspots");h&&(h.style.opacity="0")}destroy(){this.controls.dispose()}zoomIn(){this.controls.clickZoomIn()}zoomOut(){this.controls.clickZoomOut()}zoomReset(){this.controls.zoomReset()}setObjectFit(e){null==this.transitionObjectFit&&(this.objectFit=e)}startTransition(e,t,i){this.transitionObjectFit={source:e,target:t,preserveZoom:i}}endTransition(){const e=this.transitionProgress>=1?this.transitionObjectFit?.target.fit:this.transitionObjectFit?.source.fit;null!=e&&(this.objectFit=e),this.transitionObjectFit=null}setTransitionProgress(e){this.transitionProgress=Nt(e,0,1)}onResize(e,t){this.camera.left=e/-2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=t/-2,this.camera.updateProjectionMatrix();const i=this.data.width/Math.pow(2,this.data.maxZoom),r=this.data.height/Math.pow(2,this.data.maxZoom);this.minZoom=null!=this.transitionObjectFit?function c4(n,e,t,i){const[r,o]=i.map(s=>i_(n,e,s));return r+(o-r)*t}(i,r,this.transitionProgress,[this.transitionObjectFit.source,this.transitionObjectFit.target]):i_(i,r,{width:e,height:t,fit:this.objectFit}),this.camera.zoom=Math.max(this.minZoom,this.camera.zoom),this.camera.updateProjectionMatrix(),this.controls.updateMinZoom(this.minZoom),(null==this.transitionObjectFit||!0!==this.transitionObjectFit.preserveZoom)&&this.controls.zoomReset(),this.renderer.setSize(e,t)}preload(){return this.planeMap.preload()}render(e){const t=Nt(Math.ceil(Math.log2(this.camera.zoom)),0,this.data.maxZoom);this.controls.update(e),this.frustum.update(t),this.renderer.render(this.scene,this.camera),this.planeMap.updateAngle(Math.floor(this.deltaX/20))}setWheelZoomEnabled(e){this.controls.setWheelEnabled(e)}}class tC{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(Nt(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const nC={type:"change"},r_={type:"start"},o_={type:"end"};class h4 extends Vo{constructor(e,t,i){super(),this.enabled=!0,this.target=new I,this.minFov=0,this.maxFov=100,this.minDistance=0,this.maxDistance=1/0,this.minPolarAngle=Xl(75),this.maxPolarAngle=Xl(102),this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.dampingZoomFactor=.25,this.enableZoom=!0,this.enableWheelZoom=!1,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=.35,this.autoRotate=!1,this.autoRotateSpeed=2,this.state=-1,this.spherical=new tC,this.sphericalDelta=new tC,this.panOffset=new I,this.zoomChanged=!1,this.rotateStart=new Ce,this.rotateEnd=new Ce,this.rotateDelta=new Ce,this.panStart=new Ce,this.panEnd=new Ce,this.panDelta=new Ce,this.dollyStart=new Ce,this.dollyEnd=new Ce,this.dollyDelta=new Ce,this.pointers=[],this.pointerPositions={},this.dispose=()=>{this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerCancel),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)},this.getPolarAngle=()=>this.spherical.phi,this.getAzimuthalAngle=()=>this.spherical.theta,this.getDistance=()=>this.camera.position.distanceTo(this.target),this.saveState=()=>{this.target0.copy(this.target),this.position0.copy(this.camera.position)},this.reset=()=>{this.target.copy(this.target0),this.camera.position.copy(this.position0),this.camera.updateProjectionMatrix(),this.dispatchEvent(nC),this.update(0),this.state=-1},this.getAutoRotationAngle=()=>2*Math.PI/60/60*this.autoRotateSpeed,this.getZoomScale=()=>Math.pow(.95,this.zoomSpeed),this.rotateLeft=r=>{this.sphericalDelta.theta+=r},this.rotateUp=r=>{this.sphericalDelta.phi+=r},this.zoomDelta=(r,o)=>{this.fovEnd=Nt(this.camera.fov+r,this.minFov,this.maxFov),o&&(this.fov=this.fovEnd)},this.zoomOut=()=>{this.fovEnd=Nt(1.5*this.camera.fov,this.minFov,this.maxFov)},this.zoomIn=()=>{this.fovEnd=Nt(this.camera.fov/1.5,this.minFov,this.maxFov)},this.zoomReset=()=>{this.fovEnd=Nt(75,this.maxFov,this.maxFov)},this.handleMouseDownRotate=r=>{this.rotateStart.set(r.clientX,r.clientY)},this.handleMouseMoveRotate=r=>{this.rotateEnd.set(r.clientX,r.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.fov/this.maxFov*this.rotateSpeed);const o=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/o.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/o.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update(0)},this.handleMouseUp=r=>{},this.handleMouseWheel=r=>{this.zoomDelta(Math.atan(r.deltaY),!0),this.update(0)},this.handleTouchStartRotate=()=>{1===this.pointers.length?this.rotateStart.set(this.pointers[0].pageX,this.pointers[0].pageY):this.rotateStart.set(.5*(this.pointers[0].pageX+this.pointers[1].pageX),.5*(this.pointers[0].pageY+this.pointers[1].pageY))},this.handleTouchStartDolly=()=>{const r=this.pointers[0].pageX-this.pointers[1].pageX,o=this.pointers[0].pageY-this.pointers[1].pageY,s=Math.sqrt(r*r+o*o);this.dollyStart.set(0,s)},this.handleTouchStartDollyPan=()=>{this.enableZoom&&this.handleTouchStartDolly()},this.handleTouchMoveRotate=r=>{if(1===this.pointers.length)this.rotateEnd.set(r.pageX,r.pageY);else{const s=this.getSecondPointerPosition(r);this.rotateEnd.set(.5*(r.pageX+s.x),.5*(r.pageY+s.y))}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.fov/this.maxFov*this.rotateSpeed);const o=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/o.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/o.clientHeight),this.rotateStart.copy(this.rotateEnd)},this.handleTouchMoveDolly=r=>{const o=this.getSecondPointerPosition(r),s=r.pageX-o.x,a=r.pageY-o.y,l=Math.sqrt(s*s+a*a);if(this.dollyEnd.set(0,l),this.dollyStart.y>0){const c=Math.atan(100*Math.pow(1-this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed));this.zoomDelta(c,!0)}this.dollyStart.copy(this.dollyEnd)},this.handleTouchMoveDollyPan=r=>{this.enableZoom&&this.handleTouchMoveDolly(r)},this.handleTouchEnd=r=>{},this.onPointerDown=r=>{!1!==this.enabled&&(0===this.pointers.length&&(this.domElement.setPointerCapture(r.pointerId),this.domElement.addEventListener("pointermove",this.onPointerMove),this.domElement.addEventListener("pointerup",this.onPointerUp)),this.addPointer(r),"touch"===r.pointerType?this.onTouchStart(r):this.onMouseDown(r))},this.onPointerMove=r=>{!1!==this.enabled&&("touch"===r.pointerType?this.onTouchMove(r):this.onMouseMove(r))},this.onPointerUp=r=>{!1!==this.enabled&&("touch"===r.pointerType?this.onTouchEnd(r):this.onMouseUp(r),this.removePointer(r),0===this.pointers.length&&(this.domElement.releasePointerCapture(r.pointerId),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)))},this.onPointerCancel=r=>{this.removePointer(r)},this.onMouseDown=r=>{!1!==this.enableRotate&&(this.handleMouseDownRotate(r),this.state=0,this.dispatchEvent(r_))},this.onMouseMove=r=>{if(!1!==this.enabled&&0===this.state){if(!1===this.enableRotate)return;this.handleMouseMoveRotate(r)}},this.onMouseUp=r=>{this.handleMouseUp(r),this.dispatchEvent(o_),this.state=-1},this.onMouseWheel=r=>{!1===this.enabled||!1===this.enableZoom||!1===this.enableWheelZoom||-1!==this.state&&0!==this.state||(r.preventDefault(),this.dispatchEvent(r_),this.handleMouseWheel(r),this.dispatchEvent(o_))},this.onTouchStart=r=>{switch(this.trackPointer(r),this.pointers.length){case 1:if(!1===this.enableRotate)return;this.handleTouchStartRotate(),this.state=3;break;case 2:if(!1===this.enableZoom)return;this.handleTouchStartDollyPan(),this.state=5;break;default:this.state=-1}-1!==this.state&&this.dispatchEvent(r_)},this.onTouchMove=r=>{switch(this.trackPointer(r),this.state){case 3:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(r),this.update(0);break;case 5:if(!1===this.enableZoom)return;this.handleTouchMoveDollyPan(r),this.update(0);break;default:this.state=-1}},this.onTouchEnd=r=>{this.handleTouchEnd(r),this.dispatchEvent(o_),this.state=-1},this.onContextMenu=r=>{!1!==this.enabled&&r.preventDefault()},this.addPointer=r=>{this.pointers.push(r)},this.removePointer=r=>{delete this.pointerPositions[r.pointerId];for(let o=0;o<this.pointers.length;o++)if(this.pointers[o].pointerId===r.pointerId)return void this.pointers.splice(o,1)},this.trackPointer=r=>{let o=this.pointerPositions[r.pointerId];void 0===o&&(o=new Ce,this.pointerPositions[r.pointerId]=o),o.set(r.pageX,r.pageY)},this.getSecondPointerPosition=r=>this.pointerPositions[(r.pointerId===this.pointers[0].pointerId?this.pointers[1]:this.pointers[0]).pointerId],this.setWheelEnabled=r=>{this.enableWheelZoom=r},this.camera=e,this.domElement=t,this.domElement.style.touchAction="none",this.onZoomChange=i,this.target0=this.target.clone(),this.position0=this.camera.position.clone(),this.fov=this.camera.fov,this.fovEnd=this.fov,this.update=(()=>{const r=new I,o=(new qr).setFromUnitVectors(this.camera.up,new I(0,1,0)),s=o.clone().invert(),a=new I,l=new qr,c=2*Math.PI;return u=>{const d=Math.min(this.dampingZoomFactor*u*75,1),h=(this.fovEnd-this.fov)*d;this.fov+=h,this.fov=Nt(this.fov,this.minFov,this.maxFov),this.camera.fov!==this.fov&&(e_(h)&&(this.fov=this.fovEnd),this.camera.fov=this.fov,this.camera.updateProjectionMatrix(),this.onZoomChange({value:this.fov,ratio:1-(this.fov-this.minFov)/(this.maxFov-this.minFov)}));const f=this.camera.position;r.copy(f).sub(this.target),r.applyQuaternion(o),this.spherical.setFromVector3(r),this.autoRotate&&-1===this.state&&this.rotateLeft(this.getAutoRotationAngle()),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 g=this.minAzimuthAngle,_=this.maxAzimuthAngle;isFinite(g)&&isFinite(_)&&(g<-Math.PI?g+=c:g>Math.PI&&(g-=c),_<-Math.PI?_+=c:_>Math.PI&&(_-=c),this.spherical.theta=g<=_?Math.max(g,Math.min(_,this.spherical.theta)):this.spherical.theta>(g+_)/2?Math.max(g,this.spherical.theta):Math.min(_,this.spherical.theta));const v=Xl(this.maxFov-this.camera.fov);return this.spherical.phi=Nt(this.spherical.phi,this.minPolarAngle-v/2,this.maxPolarAngle+v/2),this.spherical.makeSafe(),this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),!0===this.enableDamping?this.target.addScaledVector(this.panOffset,this.dampingFactor):this.target.add(this.panOffset),r.setFromSpherical(this.spherical),r.applyQuaternion(s),f.copy(this.target).add(r),this.camera.lookAt(this.target),!0===this.enableDamping?(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.zoomChanged||a.distanceToSquared(this.camera.position)>1e-6||8*(1-l.dot(this.camera.quaternion))>1e-6)&&(this.dispatchEvent(nC),a.copy(this.camera.position),l.copy(this.camera.quaternion),this.zoomChanged=!1,!0)}})(),this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update(0)}}class f4 extends Wo{constructor(e,t,i,r){super();const o=`${r}/interior/${i.id}`,s=new $o(e,t,o,"pz");s.position.set(0,0,-1).multiplyScalar(.5*t),s.rotation.set(0,0,0),s.scale.set(1,1,1),this.add(s);const a=new $o(e,t,o,"nz");a.position.set(0,0,1).multiplyScalar(.5*t),a.rotation.set(0,0,0),a.scale.set(-1,1,-1),this.add(a);const l=new $o(e,t,o,"py");l.position.set(0,1,0).multiplyScalar(.5*t),l.rotation.set(Math.PI/2,0,0),l.scale.set(1,1,1),this.add(l);const c=new $o(e,t,o,"ny");c.position.set(0,-1,0).multiplyScalar(.5*t),c.rotation.set(Math.PI/2,0,0),c.scale.set(1,-1,-1),this.add(c);const u=new $o(e,t,o,"px");u.position.set(1,0,0).multiplyScalar(.5*t),u.rotation.set(0,Math.PI/2,0),u.scale.set(-1,1,-1),this.add(u);const d=new $o(e,t,o,"nx");d.position.set(-1,0,0).multiplyScalar(.5*t),d.rotation.set(0,Math.PI/2,0),d.scale.set(1,1,1),this.add(d)}preload(){const e=[];for(const t of this.children)t instanceof $o&&e.push(t.preload());return Promise.all(e)}}class p4 extends JD{constructor(e,t,i,r,o,s){super(e,t,i,r),this.points=[],this.rendererSize={width:this.renderer.domElement.clientWidth,height:this.renderer.domElement.clientHeight},this.data=o,this.scene=new Jg,this.camera=new Xn(75,this.rendererSize.width/this.rendererSize.height,1,256),this.computeTopLeft=new I,this.computeBottomRight=new I,this.computeCamera=new Xn,this.computeCamera.copy(this.camera),this.camera.position.setFromSphericalCoords(1,Xl(75),Xl(145)),this.cubeMap=new f4(e,256,this.data,s),this.scene.add(this.cubeMap),this.controls=new h4(this.camera,this.renderer.domElement,this.callbacks.onZoomChange),this.updateMinZoom(),this.frustum=new eC(this.scene,this.camera);const a=document.querySelector(".hotspots");if(a){a.style.opacity="1";for(const l of a.children)if(l instanceof HTMLElement){const c=[l.dataset.x,l.dataset.y,l.dataset.z].filter(u=>null!=u).map(u=>Number.parseFloat(u));if(c.length<3)continue;this.points.push({element:l,screenCoords:new I,worldCoords:new I(...c)})}}}destroy(){this.controls.dispose()}preload(){return this.cubeMap.preload()}render(e){const t=this.getLevelFov(this.camera.fov);this.frustum.update(Math.min(t,this.data.maxZoom)),this.controls.update(e),this.renderer.render(this.scene,this.camera);for(const i of this.points){i.screenCoords.copy(i.worldCoords),i.screenCoords.project(this.camera);const r=(.5*i.screenCoords.x+.5)*this.renderer.domElement.clientWidth,o=(-.5*i.screenCoords.y+.5)*this.renderer.domElement.clientHeight,s=this.frustum.containsPoint(i.worldCoords);i.element.style.opacity=s?"1":"0",i.element.style.transform=`translate(${r}px, ${o}px)`}}getLevelFov(e){return this.computeCamera.fov=e,this.computeCamera.updateProjectionMatrix(),this.computeTopLeft.set(-1,1,-1).multiplyScalar(128),this.computeBottomRight.set(1,-1,-1).multiplyScalar(128),this.computeTopLeft.applyMatrix4(this.computeCamera.projectionMatrix),this.computeBottomRight.applyMatrix4(this.computeCamera.projectionMatrix),Math.ceil(Math.log2(Math.max(1,((1-this.computeBottomRight.y)/2*this.rendererSize.height-(1-this.computeTopLeft.y)/2*this.rendererSize.height)/this.data.tileSize)))}onResize(e,t){this.rendererSize.width=e,this.rendererSize.height=t,this.camera.aspect=e/t,this.updateMinZoom(),this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t)}updateMinZoom(){for(let e=75;e>=1&&this.getLevelFov(e)<=this.data.maxZoom;e-=.25)this.controls.minFov=e;this.controls.update(0)}zoomIn(){this.controls.zoomIn()}zoomOut(){this.controls.zoomOut()}zoomReset(){this.controls.zoomReset()}setWheelZoomEnabled(e){this.controls.setWheelEnabled(e)}}class m4{constructor(){this.data=new Map}get(e){return this.data.get(e)}set(e,t){this.data.set(e,t)}destroy(){for(const e of this.data.values())e.dispose();this.data.clear()}}function rC(n){return[n?.clientWidth??0,n?.clientHeight??0]}function s_(){return(s_=ng(function*(n,e){const t=yield fetch(`${n}/manifest.json`,{signal:e?.signal});if(!t.ok)throw new Error(`Failed to fetch manifest (${t.status})`);return{...yield t.json(),baseUrl:n}})).apply(this,arguments)}const v4=function(n){return{"close--mobile":n}};let y4=(()=>{class n{constructor(){this.clicked=new Xt}click(){this.clicked.emit(!0)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-close"]],inputs:{mobile:"mobile"},outputs:{clicked:"clicked"},decls:2,vars:3,consts:[["type","button",1,"close",3,"ngClass","click"],["svgIcon","close",1,"close__icon"]],template:function(t,i){1&t&&(yt(0,"button",0),_n("click",function(){return i.click()}),Vn(1,"mat-icon",1),Mt()),2&t&&Ge("ngClass",up(1,v4,i.mobile))},dependencies:[Nr,yd],styles:[".close[_ngcontent-%COMP%]{cursor:pointer;background-color:rgb(var(--white-color));width:38px;height:38px;transition:all var(--transition);border:0 none transparent;border-radius:var(--border-radius);box-shadow:0 4px 9px 0 rgba(var(--black-color),.2);display:flex;align-items:center;justify-content:center;position:absolute;top:18px;right:18px;z-index:1000}.close.close--mobile[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%}.close.close--mobile[_ngcontent-%COMP%]   .close__icon[_ngcontent-%COMP%]{width:16px;height:16px}.close[_ngcontent-%COMP%]:hover, .close[_ngcontent-%COMP%]:active{color:rgb(var(--primary-alt-color));transform:scale(1.1)}.close[_ngcontent-%COMP%]:active{color:rgb(var(--primary-color))}.close[_ngcontent-%COMP%]   .close__icon[_ngcontent-%COMP%]{width:20px;height:20px}"]}),n})();const M4=function(n,e){return{"controls--hidden":n,"controls--mobile":e}},x4=["*"];let oC=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-controls"]],inputs:{hidden:"hidden",mobile:"mobile"},ngContentSelectors:x4,decls:2,vars:4,consts:[[1,"controls",3,"ngClass"]],template:function(t,i){1&t&&(So(),yt(0,"div",0),Do(1),Mt()),2&t&&Ge("ngClass",ul(1,M4,i.hidden,i.mobile))},dependencies:[Nr],styles:[".controls[_ngcontent-%COMP%]{background-color:rgb(var(--white-color));overflow:hidden;transition:all var(--transition);transform:translate(-50%);border-radius:var(--border-radius);box-shadow:0 1px 3px rgba(var(--black-color),.3);display:flex;align-items:center;position:absolute;bottom:22px;left:50%;z-index:1000}.controls.controls--hidden[_ngcontent-%COMP%]{display:none}.controls.controls--mobile[_ngcontent-%COMP%]{background-color:transparent;transform:none;padding:0 18px;border-radius:0;box-shadow:none;justify-content:center;gap:8px;right:0;bottom:12px;left:0}"]}),n})();function E4(n,e){1&n&&Vn(0,"mat-icon",2),2&n&&Ge("svgIcon",_t().icon)}const b4=function(n,e){return{"controls-button--right":n,"controls-button--mobile":e}},w4=["*"];let S4=(()=>{class n{constructor(t){this.controlsComponent=t,this.clicked=new Xt}click(){this.clicked.emit(!0)}}return n.\u0275fac=function(t){return new(t||n)(he(oC))},n.\u0275cmp=Cn({type:n,selectors:[["app-controls-button"]],inputs:{icon:"icon",mobile:"mobile",align:"align"},outputs:{clicked:"clicked"},ngContentSelectors:w4,decls:3,vars:5,consts:[["type","button",1,"controls-button",3,"ngClass","click"],["class","controls-button__icon",3,"svgIcon",4,"ngIf"],[1,"controls-button__icon",3,"svgIcon"]],template:function(t,i){1&t&&(So(),yt(0,"button",0),_n("click",function(){return i.click()}),Gt(1,E4,1,1,"mat-icon",1),Do(2),Mt()),2&t&&(Ge("ngClass",ul(2,b4,"right"==i.align,i.controlsComponent.mobile)),Rt(1),Ge("ngIf",i.icon))},dependencies:[Nr,tm,yd],styles:[".controls-button[_ngcontent-%COMP%]{cursor:pointer;background-color:transparent;height:38px;font-size:13px;font-weight:600;white-space:nowrap;transition:all var(--transition);padding:8px 24px;border:0 none transparent;display:flex;align-items:center;justify-content:center;gap:8px}.controls-button[_ngcontent-%COMP%]:hover{color:rgb(var(--primary-alt-color))}.controls-button[_ngcontent-%COMP%]:active{color:rgb(var(--primary-color))}.controls-button.controls-button--mobile[_ngcontent-%COMP%]{background-color:rgba(var(--black-color),.25);height:35px;color:rgb(var(--white-color));border:0 none transparent!important;border-radius:18px;text-transform:none;padding:0 16px}.controls-button.controls-button--mobile[_ngcontent-%COMP%]:hover, .controls-button.controls-button--mobile[_ngcontent-%COMP%]:active{background-color:rgba(var(--black-color),.35);color:rgb(var(--white-color))}.controls-button[_ngcontent-%COMP%]   .controls-button__icon[_ngcontent-%COMP%]{height:20px}[_nghost-%COMP%]:not(:first-of-type)   .controls-button[_ngcontent-%COMP%]:not(.controls-button--mobile){border-left:1px solid rgb(var(--border-color))}[_nghost-%COMP%]:has(.controls-button--right){margin-left:auto}"]}),n})();const D4=function(n,e,t,i,r){return{"cursor--hidden":n,"cursor--mobile":e,"cursor--move":t,"cursor--active":i,"cursor--horizontal":r}};let C4=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-cursor"]],inputs:{position:"position",move:"move",active:"active",hidden:"hidden",mobile:"mobile",horizontal:"horizontal"},decls:7,vars:9,consts:[[1,"cursor",3,"ngClass"],[1,"cursor__main"],["svgIcon","arrow",1,"cursor__arrow"]],template:function(t,i){1&t&&(yt(0,"span",0)(1,"span",1),Lr(2,"360\xb0"),Mt(),Vn(3,"mat-icon",2)(4,"mat-icon",2)(5,"mat-icon",2)(6,"mat-icon",2),Mt()),2&t&&(Qf("transform",i.position),Ge("ngClass",mx(3,D4,i.hidden,i.mobile,i.move,i.active,i.horizontal)))},dependencies:[Nr,yd],styles:[".cursor[_ngcontent-%COMP%]{pointer-events:none;transition:opacity var(--transition);position:absolute;z-index:100}.cursor.cursor--mobile[_ngcontent-%COMP%]{display:none}.cursor[_ngcontent-%COMP%]:not(.cursor--move){transform:translate(-50%) scale(1)!important;bottom:120px;left:50%;animation:_ngcontent-%COMP%_cursorAnimation .25s linear}@keyframes _ngcontent-%COMP%_cursorAnimation{0%{transform:translate(-50%) scale(.5)}to{transform:translate(-50%) scale(1)}}.cursor[_ngcontent-%COMP%]:not(.cursor--move).cursor--horizontal{bottom:100px}.cursor.cursor--hidden[_ngcontent-%COMP%]{opacity:0;display:none}.cursor.cursor--move[_ngcontent-%COMP%]{top:0;left:0;animation:_ngcontent-%COMP%_cursorAnimation2 .25s linear}@keyframes _ngcontent-%COMP%_cursorAnimation2{0%{opacity:0}to{opacity:1}}.cursor.cursor--horizontal[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(2), .cursor.cursor--horizontal[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(4){display:none}.cursor.cursor--active[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(1){left:-46px}.cursor.cursor--active[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(2){top:-46px}.cursor.cursor--active[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(3){right:-46px}.cursor.cursor--active[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(4){bottom:-46px}.cursor.cursor--active[_ngcontent-%COMP%]   .cursor__main[_ngcontent-%COMP%]{width:32px;height:32px;font-size:5px;color:transparent;margin:-16px;box-shadow:0 0 0 3px #f0f8fa66}.cursor[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]{color:rgb(var(--primary-alt-color));transition:all var(--transition);position:absolute}.cursor[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(1){transform:translateY(-50%) rotate(180deg);top:50%;left:-54px}.cursor[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(2){transform:translate(-50%) rotate(270deg);top:-54px;left:50%}.cursor[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(3){transform:translateY(-50%);top:50%;right:-54px}.cursor[_ngcontent-%COMP%]   .cursor__arrow[_ngcontent-%COMP%]:nth-of-type(4){transform:translate(-50%) rotate(90deg);bottom:-54px;left:50%}.cursor[_ngcontent-%COMP%]   .cursor__main[_ngcontent-%COMP%]{background-color:rgb(var(--white-color));width:48px;height:48px;font-size:12px;font-weight:700;color:rgb(var(--primary-color));transition:all var(--transition);padding-top:2px;border-radius:50%;margin:-24px;box-shadow:0 0 0 4px #f0f8fa66;display:flex;align-items:center;justify-content:center}"]}),n})();const T4=function(n){return{"info-message--hidden":n}},A4=["*"];let I4=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-info-message"]],inputs:{hidden:"hidden"},ngContentSelectors:A4,decls:6,vars:3,consts:[[1,"info-message",3,"ngClass"],[1,"info-message__content"],["svgIcon","pointer",1,"info-message__content__pointer"],["svgIcon","pointer-cursor",1,"info-message__content__pointer-cursor"],[1,"info-message__text"]],template:function(t,i){1&t&&(So(),yt(0,"div",0)(1,"div",1),Vn(2,"mat-icon",2)(3,"mat-icon",3),yt(4,"span",4),Do(5),Mt()()()),2&t&&Ge("ngClass",up(1,T4,i.hidden))},dependencies:[Nr,yd],styles:[".info-message[_ngcontent-%COMP%]{pointer-events:none;transform:translate(-50%,-50%);transition:opacity var(--transition);position:absolute;top:50%;left:50%;z-index:1000}.info-message.info-message--hidden[_ngcontent-%COMP%]{opacity:0}.info-message[_ngcontent-%COMP%]   .info-message__content[_ngcontent-%COMP%]{color:rgb(var(--white-color));display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative}.info-message[_ngcontent-%COMP%]   .info-message__content[_ngcontent-%COMP%]   .info-message__content__pointer[_ngcontent-%COMP%]{width:285px;height:231px}.info-message[_ngcontent-%COMP%]   .info-message__content[_ngcontent-%COMP%]   .info-message__content__pointer-cursor[_ngcontent-%COMP%]{width:33px;height:40px;animation:_ngcontent-%COMP%_messageContentAnimation 5s ease;margin-left:-15px;position:absolute;top:90px;left:50%}@keyframes _ngcontent-%COMP%_messageContentAnimation{0%{opacity:0;transform:scale(.3)}25%{opacity:1;transform:scale(1.05)}35%{transform:scale(.9)}50%{transform:scale(1) translate(0)}57.5%{transform:translate(-25%) rotate(-5deg)}65%{transform:translate(20%) rotate(3deg)}72.5%{transform:translate(-15%) rotate(-3deg)}80%{transform:translate(10%) rotate(2deg)}82.5%{transform:translate(-5%) rotate(-1deg)}to{transform:translate(0)}}.info-message[_ngcontent-%COMP%]   .info-message__text[_ngcontent-%COMP%]{position:absolute;top:136px}"]}),n})();const R4=function(n,e){return{"loader--light":n,"loader--mobile":e}};let P4=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-loader"]],inputs:{light:"light",mobile:"mobile"},decls:1,vars:4,consts:[[1,"loader",3,"ngClass"]],template:function(t,i){1&t&&Vn(0,"div",0),2&t&&Ge("ngClass",ul(1,R4,i.light,i.mobile))},dependencies:[Nr],styles:['.loader[_ngcontent-%COMP%]{width:80px;height:80px;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;position:absolute;top:50%;left:50%;z-index:100}.loader.loader--mobile[_ngcontent-%COMP%]{top:calc(50% - 40px);left:50%}.loader.loader--light[_ngcontent-%COMP%]:after{border:6px solid rgb(var(--white-color));border-color:rgb(var(--white-color)) transparent transparent transparent}.loader[_ngcontent-%COMP%]:before{content:"";background-color:rgb(var(--black-color));width:80px;height:80px;transform:translate(-50%,-50%);border-radius:50%;opacity:.1;box-shadow:0 0 90px 180px rgb(var(--black-color));position:absolute;top:50%;left:50%}.loader[_ngcontent-%COMP%]:after{content:"";width:64px;height:64px;animation:_ngcontent-%COMP%_loaderAnimation 1.2s linear infinite;border:6px solid rgb(var(--white-color));border-color:rgb(var(--white-color)) transparent transparent transparent;border-radius:50%;display:block}@keyframes _ngcontent-%COMP%_loaderAnimation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}']}),n})();const L4=["*"];let F4=(()=>{class n{constructor(){this.touched=new Xt}touch(){this.touched.emit(!0)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-main"]],outputs:{touched:"touched"},ngContentSelectors:L4,decls:2,vars:0,consts:[[1,"main",3,"mousedown","touchstart"]],template:function(t,i){1&t&&(So(),yt(0,"div",0),_n("mousedown",function(){return i.touch()})("touchstart",function(){return i.touch()}),Do(1),Mt())}}),n})();const N4=function(n,e,t){return{"background-image":n,"width.px":e,"height.px":t}};function O4(n,e){if(1&n&&Vn(0,"span",3),2&n){const t=e.$implicit,i=_t();Ge("ngStyle",px(1,N4,t,i.size,i.size))}}let k4=(()=>{class n{constructor(){this.id="",this.size=0,this.images=[]}ngOnInit(){let t=0,i=0;for(let r=0;r<6;r++)this.images.push("url(https://cdn-360-dev-driverama.azureedge.net/public/"+this.id+"/exterior/001/001_024/0_"+i+"_"+t+".jpg)"),t=r-2==0?t+1:t,i=i-2==0?0:i+1}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Cn({type:n,selectors:[["app-preload"]],inputs:{id:"id",size:"size"},decls:3,vars:1,consts:[[1,"preload"],[1,"preload__content"],["class","preload__item",3,"ngStyle",4,"ngFor","ngForOf"],[1,"preload__item",3,"ngStyle"]],template:function(t,i){1&t&&(yt(0,"div",0)(1,"div",1),Gt(2,O4,1,5,"span",2),Mt()()),2&t&&(Rt(2),Ge("ngForOf",i.images))},dependencies:[HE,WE],styles:[".preload[_ngcontent-%COMP%]{background:no-repeat 50% 50%;background-size:cover;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;z-index:1}.preload[_ngcontent-%COMP%]   .preload__content[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr)}.preload[_ngcontent-%COMP%]   .preload__item[_ngcontent-%COMP%]{background-size:cover;width:20%;height:25%;display:block}"]}),n})();const U4=["canvasDiv"];function B4(n,e){if(1&n&&Vn(0,"app-loader",8),2&n){const t=_t();Ge("light",t.isFullScreen)("mobile",t.mobile)}}function z4(n,e){if(1&n){const t=Rr();yt(0,"app-close",9),_n("clicked",function(){return fi(t),pi(_t().closeFullscreen())}),Mt()}2&n&&Ge("mobile",_t().mobile)}function H4(n,e){1&n&&(bo(0),Lr(1,"Obr\xf3\u0107 samoch\xf3d"),wo())}function V4(n,e){1&n&&(bo(0),Lr(1,"Oto\u010di\u0165 auto"),wo())}function G4(n,e){1&n&&(bo(0),Lr(1,"Oto\u010dit auto"),wo())}function j4(n,e){if(1&n&&(yt(0,"app-info-message",10),Gt(1,H4,2,0,"ng-container",11),Gt(2,V4,2,0,"ng-container",11),Gt(3,G4,2,0,"ng-container",11),Mt()),2&n){const t=_t();Ge("hidden",!t.message),Rt(1),Ge("ngIf","pl"==t.lang),Rt(1),Ge("ngIf","sk"==t.lang),Rt(1),Ge("ngIf","pl"!=t.lang&&"sk"!=t.lang)}}const W4=function(n,e){return{"canvas--active":n,"canvas--mobile":e}};function $4(n,e){if(1&n){const t=Rr();yt(0,"div",12,13),_n("mousemove",function(r){return fi(t),pi(_t().canvasMouseMove(r))})("mouseout",function(){return fi(t),pi(_t().canvasMouseOut())})("mousedown",function(){return fi(t),pi(_t().canvasMouseDown())})("mouseup",function(){return fi(t),pi(_t().canvasMouseUp())}),Mt()}if(2&n){const t=_t();Ge("ngClass",ul(1,W4,!t.message,t.mobile))}}function q4(n,e){if(1&n&&Vn(0,"app-preload",14),2&n){const t=_t();Ge("id",t.id)("size",t.preloadSize)}}function X4(n,e){if(1&n&&Vn(0,"app-cursor",15),2&n){const t=_t();Ge("position",t.cursorPosition)("move",t.cursorMove)("active",t.cursorActive)("hidden",t.message)("mobile",t.mobile)("horizontal","exterior"==t.props.type)}}function Y4(n,e){if(1&n){const t=Rr();yt(0,"app-controls-button",19),_n("clicked",function(){return fi(t),pi(_t(2).changeType("exterior"))}),Lr(1),Mt()}if(2&n){const t=_t(2);Ge("icon","eye"),Rt(1),rl(" ","pl"==t.lang?"Zewn\u0119trzny":"Exteri\xe9r"," ")}}function Z4(n,e){if(1&n){const t=Rr();yt(0,"app-controls-button",19),_n("clicked",function(){return fi(t),pi(_t(2).changeType("interior"))}),Lr(1),Mt()}if(2&n){const t=_t(2);Ge("icon","eye"),Rt(1),rl(" ","pl"==t.lang?"Wn\u0119trze":"Interi\xe9r"," ")}}function K4(n,e){if(1&n){const t=Rr();yt(0,"app-controls-button",19),_n("clicked",function(){return fi(t),pi(_t(2).zoomOut())}),Mt()}2&n&&Ge("icon","minus")}function Q4(n,e){if(1&n){const t=Rr();yt(0,"app-controls-button",19),_n("clicked",function(){return fi(t),pi(_t(2).zoomIn())}),Mt()}2&n&&Ge("icon","plus")}function J4(n,e){if(1&n&&(bo(0),Lr(1),wo()),2&n){const t=_t(3);Rt(1),tp("pl"==t.lang?"Pe\u0142ny ekran":"Cel\xe1 obrazovka")}}function ej(n,e){if(1&n){const t=Rr();yt(0,"app-controls-button",20),_n("clicked",function(){return fi(t),pi(_t(2).openFullscreen())}),Gt(1,J4,2,1,"ng-container",11),Mt()}if(2&n){const t=_t(2);Ge("icon","expand")("align","right"),Rt(1),Ge("ngIf",!t.mobile)}}function tj(n,e){if(1&n&&(yt(0,"app-controls",16),Gt(1,Y4,2,2,"app-controls-button",17),Gt(2,Z4,2,2,"app-controls-button",17),Gt(3,K4,1,1,"app-controls-button",17),Gt(4,Q4,1,1,"app-controls-button",17),Gt(5,ej,2,3,"app-controls-button",18),Mt()),2&n){const t=_t();Ge("hidden",!t.buttons)("mobile",t.mobile),Rt(1),Ge("ngIf","exterior"!=t.props.type),Rt(1),Ge("ngIf","interior"!=t.props.type&&t.hasInterior),Rt(1),Ge("ngIf",t.isFullScreen),Rt(1),Ge("ngIf",t.isFullScreen),Rt(1),Ge("ngIf",!t.isFullScreen)}}const nj=[{path:"",component:(()=>{class n{constructor(t,i){this.renderer=t,this.route=i,this.id=this.route.snapshot.queryParamMap.get("id")||"",this.lang=this.route.snapshot.queryParamMap.get("lang")||"cs",this.mobile="true"==this.route.snapshot.queryParamMap.get("mobile"),this.size="contain"==this.route.snapshot.queryParamMap.get("mobile")?"contain":"cover",this.defaultSize="contain"==this.route.snapshot.queryParamMap.get("mobile")?"contain":"cover",this.customControls="true"==this.route.snapshot.queryParamMap.get("custom-controls"),this.props={url:"https://cdn-360-dev-driverama.azureedge.net/public/"+this.id,type:this.route.snapshot.queryParamMap.get("type")?this.route.snapshot.queryParamMap.get("type"):"exterior"},this.loading=!0,this.cursorPosition="translateX(0px) translateY(0px)",this.cursorMove=!1,this.cursorActive=!1,this.message=!0,this.isFullScreen="true"==this.route.snapshot.queryParamMap.get("fullscreen"),this.preload="true"==this.route.snapshot.queryParamMap.get("preload"),this.preloadSize=window.innerWidth/3,this.hasInterior=!1,this.buttons=!0}onRightClick(t){t.preventDefault()}onResize(){this.changeSize()}changeType(t){this.props.type=t,window.parent.postMessage({message:"threesixtyType",value:t},"*"),this.initCanvas()}zoomIn(){this.renderer360.onZoomIn(),window.parent.postMessage({message:"threesixtyZoomIn",value:!0},"*")}zoomOut(){this.renderer360.onZoomOut(),window.parent.postMessage({message:"threesixtyZoomOut",value:!0},"*")}canvasMouseMove(t){this.cursorPosition="translateX("+t.clientX+"px) translateY("+t.clientY+"px)",this.cursorMove=!0}canvasMouseOut(){this.cursorPosition="translateX(0px) translateY(0px)",this.cursorMove=!1}canvasMouseDown(){this.cursorActive=!0}canvasMouseUp(){this.cursorActive=!1}initCanvas(){if(!this.preload){this.renderer.setProperty(this.canvasDiv?.nativeElement,"innerHTML",""),this.renderer360=function _4(n){const e=new e4({alpha:!0}),t=new m4,i=new a4(t),r=new t4;let o;function a(){return(a=ng(function*(d,h,f,g){switch(o?.destroy(),d){case"exterior":if(0===h.exterior.length)throw new Error("No exterior panorama found");o=new d4(i,e,f,g,h.exterior[0],h.baseUrl);break;case"interior":if(0===h.interior.length)throw new Error("No interior panorama found");o=new p4(i,e,f,g,h.interior[0],h.baseUrl);break;default:throw new Error("Invalid renderer method")}yield o?.preload(),c()})).apply(this,arguments)}e.setPixelRatio(window.devicePixelRatio),e.setSize(...rC(n.container)),e.setClearColor(16777215,0),n.container.appendChild(e.domElement);let l=0;function c(){const[d,h]=rC(n.container);(e.domElement.clientWidth!==d||e.domElement.clientHeight!==h)&&o?.onResize(d,h),l=requestAnimationFrame(c);const f=r.getDelta();o?.render(f),i.work()}return{init:function s(d,h,f,g){return a.apply(this,arguments)},dispose:function u(){cancelAnimationFrame(l),i.cancelAll(),t.destroy(),o?.destroy(),e?.dispose(),e.domElement.remove()},onZoomOut(){o?.zoomOut()},onZoomIn(){o?.zoomIn()},onZoomReset(){o?.zoomReset()},startTransition:(d,h,f)=>{o?.startTransition?.(d,h,f)},endTransition:()=>{o?.endTransition?.()},setTransitionProgress:d=>{o?.setTransitionProgress?.(d)},setObjectFit:d=>{o?.setObjectFit?.(d)},setWheelZoomEnabled:d=>{o?.setWheelZoomEnabled?.(d)}}}({container:this.canvasDiv?.nativeElement,preload:!0}),this.loading=!0;const t=new AbortController;(function g4(n,e){return s_.apply(this,arguments)})(this.props.url,{signal:t.signal}).then(i=>(this.hasInterior=i.interior.length>0,window.parent.postMessage({message:"threesixtyLoaded",value:!0},"*"),window.parent.postMessage({message:"threesixtyHasInterior",value:this.hasInterior},"*"),this.renderer360.init(this.props.type,i,{onActive:()=>{},onZoomChange:r=>{}},{objectFit:this.size}))).then(()=>{this.loading=!1})}}changeSize(){const t=100/(window.innerWidth/window.innerHeight);let i;t<30?(i="contain",this.preloadSize=window.innerHeight/2):t>84?(i="contain",this.preloadSize=window.innerWidth/3):(i=this.defaultSize,this.preloadSize=window.innerWidth/3>window.innerHeight/2?window.innerWidth/3:window.innerHeight/2),i!=this.size&&(this.size=i,this.initCanvas())}hideMessage(){this.message=!1,window.parent.postMessage({message:"threesixtyMove",value:!0},"*")}openFullscreen(){window.parent.postMessage({message:"threesixtyFullscreen",value:!0},"*")}closeFullscreen(){window.parent.postMessage({message:"threesixtyFullscreen",value:!1},"*")}ngOnInit(){this.elem=document.documentElement,this.isFullScreen&&this.renderer.addClass(document.body,"dark"),window.addEventListener("message",t=>{t.data.message&&("buttons"==t.data.message?this.buttons="hide"!=t.data.value:"changeType"==t.data.message?this.changeType(t.data.value):"zoom"==t.data.message?"in"==t.data.value?this.zoomIn():this.zoomOut():"fullscreen"==t.data.message&&(1==t.data.value?this.openFullscreen():this.closeFullscreen()))},!1)}ngAfterViewInit(){setTimeout(()=>{this.changeSize(),this.initCanvas()})}}return n.\u0275fac=function(t){return new(t||n)(he(Qa),he(No))},n.\u0275cmp=Cn({type:n,selectors:[["app-homepage"]],viewQuery:function(t,i){if(1&t&&Dx(U4,5),2&t){let r;yp(r=function Mp(){return function xF(n,e){return n[Fi].queries[e].queryList}(V(),uv())}())&&(i.canvasDiv=r.first)}},hostBindings:function(t,i){1&t&&_n("contextmenu",function(o){return i.onRightClick(o)})("resize",function(o){return i.onResize(o)},!1,Vy)},decls:8,vars:7,consts:[[3,"light","mobile",4,"ngIf"],[3,"touched"],[3,"mobile","clicked",4,"ngIf"],[3,"hidden",4,"ngIf"],["class","canvas",3,"ngClass","mousemove","mouseout","mousedown","mouseup",4,"ngIf"],[3,"id","size",4,"ngIf"],[3,"position","move","active","hidden","mobile","horizontal",4,"ngIf"],[3,"hidden","mobile",4,"ngIf"],[3,"light","mobile"],[3,"mobile","clicked"],[3,"hidden"],[4,"ngIf"],[1,"canvas",3,"ngClass","mousemove","mouseout","mousedown","mouseup"],["canvasDiv",""],[3,"id","size"],[3,"position","move","active","hidden","mobile","horizontal"],[3,"hidden","mobile"],[3,"icon","clicked",4,"ngIf"],[3,"icon","align","clicked",4,"ngIf"],[3,"icon","clicked"],[3,"icon","align","clicked"]],template:function(t,i){1&t&&(Gt(0,B4,1,2,"app-loader",0),yt(1,"app-main",1),_n("touched",function(){return i.hideMessage()}),Gt(2,z4,1,1,"app-close",2),Gt(3,j4,4,4,"app-info-message",3),Gt(4,$4,2,4,"div",4),Gt(5,q4,1,2,"app-preload",5),Gt(6,X4,1,6,"app-cursor",6),Gt(7,tj,6,7,"app-controls",7),Mt()),2&t&&(Ge("ngIf",i.loading),Rt(2),Ge("ngIf",i.isFullScreen&&!i.customControls),Rt(1),Ge("ngIf",!i.loading&&!i.isFullScreen&&!i.preload),Rt(1),Ge("ngIf",!i.preload),Rt(1),Ge("ngIf","exterior"==i.props.type),Rt(1),Ge("ngIf",!i.loading&&!i.preload),Rt(1),Ge("ngIf",!i.customControls))},dependencies:[Nr,tm,y4,oC,S4,C4,I4,P4,F4,k4],encapsulation:2}),n})()}];let ij=(()=>{class n{constructor(t,i){t.addSvgIcon("arrow",i.bypassSecurityTrustResourceUrl("assets/icons/arrow.svg")),t.addSvgIcon("eye",i.bypassSecurityTrustResourceUrl("assets/icons/eye.svg")),t.addSvgIcon("expand",i.bypassSecurityTrustResourceUrl("assets/icons/expand.svg")),t.addSvgIcon("close",i.bypassSecurityTrustResourceUrl("assets/icons/close.svg")),t.addSvgIcon("minus",i.bypassSecurityTrustResourceUrl("assets/icons/minus.svg")),t.addSvgIcon("plus",i.bypassSecurityTrustResourceUrl("assets/icons/plus.svg")),t.addSvgIcon("pointer",i.bypassSecurityTrustResourceUrl("assets/icons/pointer.svg")),t.addSvgIcon("pointer-cursor",i.bypassSecurityTrustResourceUrl("assets/icons/pointer-cursor.svg"))}}return n.\u0275fac=function(t){return new(t||n)(K(Vl),K(Bu))},n.\u0275mod=Li({type:n,bootstrap:[cz]}),n.\u0275inj=ci({imports:[r3,q2,TB.forRoot(nj,{enableTracing:!1,scrollPositionRestoration:"enabled",anchorScrolling:"enabled"}),sz]}),n})();$2().bootstrapModule(ij).catch(n=>console.error(n))}},ut=>{ut(ut.s=516)}]);