diff --git a/web-app/build_log.txt b/web-app/build_log.txt new file mode 100644 index 0000000..02f0039 --- /dev/null +++ b/web-app/build_log.txt @@ -0,0 +1,5 @@ + +> web-app@0.0.0 build +> vue-tsc -b && vite build + +src/components/AddBuildingModal.vue(40,10): error TS6133: 'ref' is declared but its value is never read. diff --git a/web-app/dist/assets/index-BXWyap6F.js b/web-app/dist/assets/index-Bso7APm4.js similarity index 57% rename from web-app/dist/assets/index-BXWyap6F.js rename to web-app/dist/assets/index-Bso7APm4.js index 250749b..824debe 100644 --- a/web-app/dist/assets/index-BXWyap6F.js +++ b/web-app/dist/assets/index-Bso7APm4.js @@ -2,41 +2,41 @@ * @vue/shared v3.5.25 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Jl(n){const t=Object.create(null);for(const e of n.split(","))t[e]=1;return e=>e in t}const le={},xs=[],Dn=()=>{},kh=()=>!1,Go=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Ql=n=>n.startsWith("onUpdate:"),Fe=Object.assign,tc=(n,t)=>{const e=n.indexOf(t);e>-1&&n.splice(e,1)},Cd=Object.prototype.hasOwnProperty,ee=(n,t)=>Cd.call(n,t),Gt=Array.isArray,Ms=n=>br(n)==="[object Map]",Vh=n=>br(n)==="[object Set]",Vc=n=>br(n)==="[object Date]",Xt=n=>typeof n=="function",Ee=n=>typeof n=="string",Ln=n=>typeof n=="symbol",_e=n=>n!==null&&typeof n=="object",Gh=n=>(_e(n)||Xt(n))&&Xt(n.then)&&Xt(n.catch),Wh=Object.prototype.toString,br=n=>Wh.call(n),Pd=n=>br(n).slice(8,-1),Xh=n=>br(n)==="[object Object]",ec=n=>Ee(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,lr=Jl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Wo=n=>{const t=Object.create(null);return(e=>t[e]||(t[e]=n(e)))},Dd=/-\w/g,xi=Wo(n=>n.replace(Dd,t=>t.slice(1).toUpperCase())),Ld=/\B([A-Z])/g,ji=Wo(n=>n.replace(Ld,"-$1").toLowerCase()),Yh=Wo(n=>n.charAt(0).toUpperCase()+n.slice(1)),oa=Wo(n=>n?`on${Yh(n)}`:""),_i=(n,t)=>!Object.is(n,t),go=(n,...t)=>{for(let e=0;e{Object.defineProperty(n,t,{configurable:!0,enumerable:!1,writable:i,value:e})},nc=n=>{const t=parseFloat(n);return isNaN(t)?n:t};let Gc;const Xo=()=>Gc||(Gc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Yo(n){if(Gt(n)){const t={};for(let e=0;e{if(e){const i=e.split(Ud);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function mi(n){let t="";if(Ee(n))t=n;else if(Gt(n))for(let e=0;e!!(n&&n.__v_isRef===!0),Ue=n=>Ee(n)?n:n==null?"":Gt(n)||_e(n)&&(n.toString===Wh||!Xt(n.toString))?Zh(n)?Ue(n.value):JSON.stringify(n,$h,2):String(n),$h=(n,t)=>Zh(t)?$h(n,t.value):Ms(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[i,s],r)=>(e[aa(i,r)+" =>"]=s,e),{})}:Vh(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>aa(e))}:Ln(t)?aa(t):_e(t)&&!Gt(t)&&!Xh(t)?String(t):t,aa=(n,t="")=>{var e;return Ln(n)?`Symbol(${(e=n.description)!=null?e:t})`:n};/** +**/function ec(n){const t=Object.create(null);for(const e of n.split(","))t[e]=1;return e=>e in t}const le={},Es=[],Dn=()=>{},Xh=()=>!1,Xo=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),nc=n=>n.startsWith("onUpdate:"),Fe=Object.assign,ic=(n,t)=>{const e=n.indexOf(t);e>-1&&n.splice(e,1)},Dd=Object.prototype.hasOwnProperty,ee=(n,t)=>Dd.call(n,t),Vt=Array.isArray,bs=n=>Dr(n)==="[object Map]",Yo=n=>Dr(n)==="[object Set]",Xc=n=>Dr(n)==="[object Date]",Xt=n=>typeof n=="function",Ee=n=>typeof n=="string",Ln=n=>typeof n=="symbol",me=n=>n!==null&&typeof n=="object",Yh=n=>(me(n)||Xt(n))&&Xt(n.then)&&Xt(n.catch),qh=Object.prototype.toString,Dr=n=>qh.call(n),Ld=n=>Dr(n).slice(8,-1),jh=n=>Dr(n)==="[object Object]",sc=n=>Ee(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,pr=ec(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qo=n=>{const t=Object.create(null);return(e=>t[e]||(t[e]=n(e)))},Id=/-\w/g,yi=qo(n=>n.replace(Id,t=>t.slice(1).toUpperCase())),Ud=/\B([A-Z])/g,Zi=qo(n=>n.replace(Ud,"-$1").toLowerCase()),$h=qo(n=>n.charAt(0).toUpperCase()+n.slice(1)),ca=qo(n=>n?`on${$h(n)}`:""),xi=(n,t)=>!Object.is(n,t),yo=(n,...t)=>{for(let e=0;e{Object.defineProperty(n,t,{configurable:!0,enumerable:!1,writable:i,value:e})},jo=n=>{const t=parseFloat(n);return isNaN(t)?n:t};let Yc;const $o=()=>Yc||(Yc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Zo(n){if(Vt(n)){const t={};for(let e=0;e{if(e){const i=e.split(Od);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function vi(n){let t="";if(Ee(n))t=n;else if(Vt(n))for(let e=0;eLs(e,t))}const Jh=n=>!!(n&&n.__v_isRef===!0),Ue=n=>Ee(n)?n:n==null?"":Vt(n)||me(n)&&(n.toString===qh||!Xt(n.toString))?Jh(n)?Ue(n.value):JSON.stringify(n,Qh,2):String(n),Qh=(n,t)=>Jh(t)?Qh(n,t.value):bs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[i,s],r)=>(e[ua(i,r)+" =>"]=s,e),{})}:Yo(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ua(e))}:Ln(t)?ua(t):me(t)&&!Vt(t)&&!jh(t)?String(t):t,ua=(n,t="")=>{var e;return Ln(n)?`Symbol(${(e=n.description)!=null?e:t})`:n};/** * @vue/reactivity v3.5.25 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let je;class Hd{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=je,!t&&je&&(this.index=(je.scopes||(je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,e;if(this.scopes)for(t=0,e=this.scopes.length;t0&&--this._on===0&&(je=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let e,i;for(e=0,i=this.effects.length;e0)return;if(ur){let t=ur;for(ur=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;cr;){let t=cr;for(cr=void 0;t;){const e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){n||(n=i)}t=e}}if(n)throw n}function tf(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ef(n){let t,e=n.depsTail,i=e;for(;i;){const s=i.prevDep;i.version===-1?(i===e&&(e=s),rc(i),Vd(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=t,n.depsTail=e}function Ja(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(nf(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function nf(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===_r)||(n.globalVersion=_r,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Ja(n))))return;n.flags|=2;const t=n.dep,e=ue,i=vn;ue=n,vn=!0;try{tf(n);const s=n.fn(n._value);(t.version===0||_i(s,n._value))&&(n.flags|=128,n._value=s,t.version++)}catch(s){throw t.version++,s}finally{ue=e,vn=i,ef(n),n.flags&=-3}}function rc(n,t=!1){const{dep:e,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),e.subs===n&&(e.subs=i,!i&&e.computed)){e.computed.flags&=-5;for(let r=e.computed.deps;r;r=r.nextDep)rc(r,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Vd(n){const{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}let vn=!0;const sf=[];function $n(){sf.push(vn),vn=!1}function Kn(){const n=sf.pop();vn=n===void 0?!0:n}function Wc(n){const{cleanup:t}=n;if(n.cleanup=void 0,t){const e=ue;ue=void 0;try{t()}finally{ue=e}}}let _r=0;class Gd{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class oc{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ue||!vn||ue===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==ue)e=this.activeLink=new Gd(ue,this),ue.deps?(e.prevDep=ue.depsTail,ue.depsTail.nextDep=e,ue.depsTail=e):ue.deps=ue.depsTail=e,rf(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const i=e.nextDep;i.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=i),e.prevDep=ue.depsTail,e.nextDep=void 0,ue.depsTail.nextDep=e,ue.depsTail=e,ue.deps===e&&(ue.deps=i)}return e}trigger(t){this.version++,_r++,this.notify(t)}notify(t){ic();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{sc()}}}function rf(n){if(n.dep.sc++,n.sub.flags&4){const t=n.dep.computed;if(t&&!n.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)rf(i)}const e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}const Qa=new WeakMap,Wi=Symbol(""),tl=Symbol(""),gr=Symbol("");function Ne(n,t,e){if(vn&&ue){let i=Qa.get(n);i||Qa.set(n,i=new Map);let s=i.get(e);s||(i.set(e,s=new oc),s.map=i,s.key=e),s.track()}}function Yn(n,t,e,i,s,r){const o=Qa.get(n);if(!o){_r++;return}const a=l=>{l&&l.trigger()};if(ic(),t==="clear")o.forEach(a);else{const l=Gt(n),c=l&&ec(e);if(l&&e==="length"){const u=Number(i);o.forEach((h,d)=>{(d==="length"||d===gr||!Ln(d)&&d>=u)&&a(h)})}else switch((e!==void 0||o.has(void 0))&&a(o.get(e)),c&&a(o.get(gr)),t){case"add":l?c&&a(o.get("length")):(a(o.get(Wi)),Ms(n)&&a(o.get(tl)));break;case"delete":l||(a(o.get(Wi)),Ms(n)&&a(o.get(tl)));break;case"set":Ms(n)&&a(o.get(Wi));break}}sc()}function Ji(n){const t=te(n);return t===n?t:(Ne(t,"iterate",gr),xn(n)?t:t.map(Jn))}function ac(n){return Ne(n=te(n),"iterate",gr),n}function ui(n,t){return Mi(n)?Ss(n)?vr(Jn(t)):vr(t):Jn(t)}const Wd={__proto__:null,[Symbol.iterator](){return ca(this,Symbol.iterator,n=>ui(this,n))},concat(...n){return Ji(this).concat(...n.map(t=>Gt(t)?Ji(t):t))},entries(){return ca(this,"entries",n=>(n[1]=ui(this,n[1]),n))},every(n,t){return On(this,"every",n,t,void 0,arguments)},filter(n,t){return On(this,"filter",n,t,e=>e.map(i=>ui(this,i)),arguments)},find(n,t){return On(this,"find",n,t,e=>ui(this,e),arguments)},findIndex(n,t){return On(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return On(this,"findLast",n,t,e=>ui(this,e),arguments)},findLastIndex(n,t){return On(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return On(this,"forEach",n,t,void 0,arguments)},includes(...n){return ua(this,"includes",n)},indexOf(...n){return ua(this,"indexOf",n)},join(n){return Ji(this).join(n)},lastIndexOf(...n){return ua(this,"lastIndexOf",n)},map(n,t){return On(this,"map",n,t,void 0,arguments)},pop(){return Ws(this,"pop")},push(...n){return Ws(this,"push",n)},reduce(n,...t){return Xc(this,"reduce",n,t)},reduceRight(n,...t){return Xc(this,"reduceRight",n,t)},shift(){return Ws(this,"shift")},some(n,t){return On(this,"some",n,t,void 0,arguments)},splice(...n){return Ws(this,"splice",n)},toReversed(){return Ji(this).toReversed()},toSorted(n){return Ji(this).toSorted(n)},toSpliced(...n){return Ji(this).toSpliced(...n)},unshift(...n){return Ws(this,"unshift",n)},values(){return ca(this,"values",n=>ui(this,n))}};function ca(n,t,e){const i=ac(n),s=i[t]();return i!==n&&!xn(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=e(r.value)),r}),s}const Xd=Array.prototype;function On(n,t,e,i,s,r){const o=ac(n),a=o!==n&&!xn(n),l=o[t];if(l!==Xd[t]){const h=l.apply(n,r);return a?Jn(h):h}let c=e;o!==n&&(a?c=function(h,d){return e.call(this,ui(n,h),d,n)}:e.length>2&&(c=function(h,d){return e.call(this,h,d,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function Xc(n,t,e,i){const s=ac(n);let r=e;return s!==n&&(xn(n)?e.length>3&&(r=function(o,a,l){return e.call(this,o,a,l,n)}):r=function(o,a,l){return e.call(this,o,ui(n,a),l,n)}),s[t](r,...i)}function ua(n,t,e){const i=te(n);Ne(i,"iterate",gr);const s=i[t](...e);return(s===-1||s===!1)&&hc(e[0])?(e[0]=te(e[0]),i[t](...e)):s}function Ws(n,t,e=[]){$n(),ic();const i=te(n)[t].apply(n,e);return sc(),Kn(),i}const Yd=Jl("__proto__,__v_isRef,__isVue"),of=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ln));function qd(n){Ln(n)||(n=String(n));const t=te(this);return Ne(t,"has",n),t.hasOwnProperty(n)}class af{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,i){if(e==="__v_skip")return t.__v_skip;const s=this._isReadonly,r=this._isShallow;if(e==="__v_isReactive")return!s;if(e==="__v_isReadonly")return s;if(e==="__v_isShallow")return r;if(e==="__v_raw")return i===(s?r?ip:hf:r?uf:cf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const o=Gt(t);if(!s){let l;if(o&&(l=Wd[e]))return l;if(e==="hasOwnProperty")return qd}const a=Reflect.get(t,e,Oe(t)?t:i);if((Ln(e)?of.has(e):Yd(e))||(s||Ne(t,"get",e),r))return a;if(Oe(a)){const l=o&&ec(e)?a:a.value;return s&&_e(l)?nl(l):l}return _e(a)?s?nl(a):cc(a):a}}class lf extends af{constructor(t=!1){super(!1,t)}set(t,e,i,s){let r=t[e];const o=Gt(t)&&ec(e);if(!this._isShallow){const c=Mi(r);if(!xn(i)&&!Mi(i)&&(r=te(r),i=te(i)),!o&&Oe(r)&&!Oe(i))return c||(r.value=i),!0}const a=o?Number(e)n,Ir=n=>Reflect.getPrototypeOf(n);function Jd(n,t,e){return function(...i){const s=this.__v_raw,r=te(s),o=Ms(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=e?el:t?vr:Jn;return!t&&Ne(r,"iterate",l?tl:Wi),{next(){const{value:h,done:d}=c.next();return d?{value:h,done:d}:{value:a?[u(h[0]),u(h[1])]:u(h),done:d}},[Symbol.iterator](){return this}}}}function Ur(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function Qd(n,t){const e={get(s){const r=this.__v_raw,o=te(r),a=te(s);n||(_i(s,a)&&Ne(o,"get",s),Ne(o,"get",a));const{has:l}=Ir(o),c=t?el:n?vr:Jn;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&Ne(te(s),"iterate",Wi),s.size},has(s){const r=this.__v_raw,o=te(r),a=te(s);return n||(_i(s,a)&&Ne(o,"has",s),Ne(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=te(a),c=t?el:n?vr:Jn;return!n&&Ne(l,"iterate",Wi),a.forEach((u,h)=>s.call(r,c(u),c(h),o))}};return Fe(e,n?{add:Ur("add"),set:Ur("set"),delete:Ur("delete"),clear:Ur("clear")}:{add(s){!t&&!xn(s)&&!Mi(s)&&(s=te(s));const r=te(this);return Ir(r).has.call(r,s)||(r.add(s),Yn(r,"add",s,s)),this},set(s,r){!t&&!xn(r)&&!Mi(r)&&(r=te(r));const o=te(this),{has:a,get:l}=Ir(o);let c=a.call(o,s);c||(s=te(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?_i(r,u)&&Yn(o,"set",s,r):Yn(o,"add",s,r),this},delete(s){const r=te(this),{has:o,get:a}=Ir(r);let l=o.call(r,s);l||(s=te(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&Yn(r,"delete",s,void 0),c},clear(){const s=te(this),r=s.size!==0,o=s.clear();return r&&Yn(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Jd(s,n,t)}),e}function lc(n,t){const e=Qd(n,t);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(ee(e,s)&&s in i?e:i,s,r)}const tp={get:lc(!1,!1)},ep={get:lc(!1,!0)},np={get:lc(!0,!1)};const cf=new WeakMap,uf=new WeakMap,hf=new WeakMap,ip=new WeakMap;function sp(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function rp(n){return n.__v_skip||!Object.isExtensible(n)?0:sp(Pd(n))}function cc(n){return Mi(n)?n:uc(n,!1,Zd,tp,cf)}function op(n){return uc(n,!1,Kd,ep,uf)}function nl(n){return uc(n,!0,$d,np,hf)}function uc(n,t,e,i,s){if(!_e(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;const r=rp(n);if(r===0)return n;const o=s.get(n);if(o)return o;const a=new Proxy(n,r===2?i:e);return s.set(n,a),a}function Ss(n){return Mi(n)?Ss(n.__v_raw):!!(n&&n.__v_isReactive)}function Mi(n){return!!(n&&n.__v_isReadonly)}function xn(n){return!!(n&&n.__v_isShallow)}function hc(n){return n?!!n.__v_raw:!1}function te(n){const t=n&&n.__v_raw;return t?te(t):n}function ap(n){return!ee(n,"__v_skip")&&Object.isExtensible(n)&&qh(n,"__v_skip",!0),n}const Jn=n=>_e(n)?cc(n):n,vr=n=>_e(n)?nl(n):n;function Oe(n){return n?n.__v_isRef===!0:!1}function mn(n){return lp(n,!1)}function lp(n,t){return Oe(n)?n:new cp(n,t)}class cp{constructor(t,e){this.dep=new oc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:te(t),this._value=e?t:Jn(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,i=this.__v_isShallow||xn(t)||Mi(t);t=i?t:te(t),_i(t,e)&&(this._rawValue=t,this._value=i?t:Jn(t),this.dep.trigger())}}function Re(n){return Oe(n)?n.value:n}const up={get:(n,t,e)=>t==="__v_raw"?n:Re(Reflect.get(n,t,e)),set:(n,t,e,i)=>{const s=n[t];return Oe(s)&&!Oe(e)?(s.value=e,!0):Reflect.set(n,t,e,i)}};function ff(n){return Ss(n)?n:new Proxy(n,up)}class hp{constructor(t,e,i){this.fn=t,this.setter=e,this._value=void 0,this.dep=new oc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_r-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&ue!==this)return Qh(this,!0),!0}get value(){const t=this.dep.track();return nf(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function fp(n,t,e=!1){let i,s;return Xt(n)?i=n:(i=n.get,s=n.set),new hp(i,s,e)}const Nr={},Do=new WeakMap;let Ni;function dp(n,t=!1,e=Ni){if(e){let i=Do.get(e);i||Do.set(e,i=[]),i.push(n)}}function pp(n,t,e=le){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=e,c=S=>s?S:xn(S)||s===!1||s===0?qn(S,1):qn(S);let u,h,d,p,v=!1,M=!1;if(Oe(n)?(h=()=>n.value,v=xn(n)):Ss(n)?(h=()=>c(n),v=!0):Gt(n)?(M=!0,v=n.some(S=>Ss(S)||xn(S)),h=()=>n.map(S=>{if(Oe(S))return S.value;if(Ss(S))return c(S);if(Xt(S))return l?l(S,2):S()})):Xt(n)?t?h=l?()=>l(n,2):n:h=()=>{if(d){$n();try{d()}finally{Kn()}}const S=Ni;Ni=u;try{return l?l(n,3,[p]):n(p)}finally{Ni=S}}:h=Dn,t&&s){const S=h,U=s===!0?1/0:s;h=()=>qn(S(),U)}const m=kd(),f=()=>{u.stop(),m&&m.active&&tc(m.effects,u)};if(r&&t){const S=t;t=(...U)=>{S(...U),f()}}let T=M?new Array(n.length).fill(Nr):Nr;const b=S=>{if(!(!(u.flags&1)||!u.dirty&&!S))if(t){const U=u.run();if(s||v||(M?U.some((D,P)=>_i(D,T[P])):_i(U,T))){d&&d();const D=Ni;Ni=u;try{const P=[U,T===Nr?void 0:M&&T[0]===Nr?[]:T,p];T=U,l?l(t,3,P):t(...P)}finally{Ni=D}}}else u.run()};return a&&a(b),u=new Kh(h),u.scheduler=o?()=>o(b,!1):b,p=S=>dp(S,!1,u),d=u.onStop=()=>{const S=Do.get(u);if(S){if(l)l(S,4);else for(const U of S)U();Do.delete(u)}},t?i?b(!0):T=u.run():o?o(b.bind(null,!0),!0):u.run(),f.pause=u.pause.bind(u),f.resume=u.resume.bind(u),f.stop=f,f}function qn(n,t=1/0,e){if(t<=0||!_e(n)||n.__v_skip||(e=e||new Map,(e.get(n)||0)>=t))return n;if(e.set(n,t),t--,Oe(n))qn(n.value,t,e);else if(Gt(n))for(let i=0;i{qn(i,t,e)});else if(Xh(n)){for(const i in n)qn(n[i],t,e);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&qn(n[i],t,e)}return n}/** +**/let je;class Gd{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=je,!t&&je&&(this.index=(je.scopes||(je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,e;if(this.scopes)for(t=0,e=this.scopes.length;t0&&--this._on===0&&(je=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let e,i;for(e=0,i=this.effects.length;e0)return;if(_r){let t=_r;for(_r=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;mr;){let t=mr;for(mr=void 0;t;){const e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){n||(n=i)}t=e}}if(n)throw n}function sf(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function rf(n){let t,e=n.depsTail,i=e;for(;i;){const s=i.prevDep;i.version===-1?(i===e&&(e=s),ac(i),Xd(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=t,n.depsTail=e}function el(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(of(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function of(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===yr)||(n.globalVersion=yr,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!el(n))))return;n.flags|=2;const t=n.dep,e=he,i=vn;he=n,vn=!0;try{sf(n);const s=n.fn(n._value);(t.version===0||xi(s,n._value))&&(n.flags|=128,n._value=s,t.version++)}catch(s){throw t.version++,s}finally{he=e,vn=i,rf(n),n.flags&=-3}}function ac(n,t=!1){const{dep:e,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),e.subs===n&&(e.subs=i,!i&&e.computed)){e.computed.flags&=-5;for(let r=e.computed.deps;r;r=r.nextDep)ac(r,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Xd(n){const{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}let vn=!0;const af=[];function Jn(){af.push(vn),vn=!1}function Qn(){const n=af.pop();vn=n===void 0?!0:n}function qc(n){const{cleanup:t}=n;if(n.cleanup=void 0,t){const e=he;he=void 0;try{t()}finally{he=e}}}let yr=0;class Yd{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class lc{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!he||!vn||he===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==he)e=this.activeLink=new Yd(he,this),he.deps?(e.prevDep=he.depsTail,he.depsTail.nextDep=e,he.depsTail=e):he.deps=he.depsTail=e,lf(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const i=e.nextDep;i.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=i),e.prevDep=he.depsTail,e.nextDep=void 0,he.depsTail.nextDep=e,he.depsTail=e,he.deps===e&&(he.deps=i)}return e}trigger(t){this.version++,yr++,this.notify(t)}notify(t){rc();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{oc()}}}function lf(n){if(n.dep.sc++,n.sub.flags&4){const t=n.dep.computed;if(t&&!n.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)lf(i)}const e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}const nl=new WeakMap,Yi=Symbol(""),il=Symbol(""),Er=Symbol("");function Ne(n,t,e){if(vn&&he){let i=nl.get(n);i||nl.set(n,i=new Map);let s=i.get(e);s||(i.set(e,s=new lc),s.map=i,s.key=e),s.track()}}function qn(n,t,e,i,s,r){const o=nl.get(n);if(!o){yr++;return}const a=l=>{l&&l.trigger()};if(rc(),t==="clear")o.forEach(a);else{const l=Vt(n),c=l&&sc(e);if(l&&e==="length"){const u=Number(i);o.forEach((h,d)=>{(d==="length"||d===Er||!Ln(d)&&d>=u)&&a(h)})}else switch((e!==void 0||o.has(void 0))&&a(o.get(e)),c&&a(o.get(Er)),t){case"add":l?c&&a(o.get("length")):(a(o.get(Yi)),bs(n)&&a(o.get(il)));break;case"delete":l||(a(o.get(Yi)),bs(n)&&a(o.get(il)));break;case"set":bs(n)&&a(o.get(Yi));break}}oc()}function ns(n){const t=te(n);return t===n?t:(Ne(t,"iterate",Er),xn(n)?t:t.map(ti))}function cc(n){return Ne(n=te(n),"iterate",Er),n}function fi(n,t){return Ei(n)?Ts(n)?br(ti(t)):br(t):ti(t)}const qd={__proto__:null,[Symbol.iterator](){return fa(this,Symbol.iterator,n=>fi(this,n))},concat(...n){return ns(this).concat(...n.map(t=>Vt(t)?ns(t):t))},entries(){return fa(this,"entries",n=>(n[1]=fi(this,n[1]),n))},every(n,t){return On(this,"every",n,t,void 0,arguments)},filter(n,t){return On(this,"filter",n,t,e=>e.map(i=>fi(this,i)),arguments)},find(n,t){return On(this,"find",n,t,e=>fi(this,e),arguments)},findIndex(n,t){return On(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return On(this,"findLast",n,t,e=>fi(this,e),arguments)},findLastIndex(n,t){return On(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return On(this,"forEach",n,t,void 0,arguments)},includes(...n){return da(this,"includes",n)},indexOf(...n){return da(this,"indexOf",n)},join(n){return ns(this).join(n)},lastIndexOf(...n){return da(this,"lastIndexOf",n)},map(n,t){return On(this,"map",n,t,void 0,arguments)},pop(){return Zs(this,"pop")},push(...n){return Zs(this,"push",n)},reduce(n,...t){return jc(this,"reduce",n,t)},reduceRight(n,...t){return jc(this,"reduceRight",n,t)},shift(){return Zs(this,"shift")},some(n,t){return On(this,"some",n,t,void 0,arguments)},splice(...n){return Zs(this,"splice",n)},toReversed(){return ns(this).toReversed()},toSorted(n){return ns(this).toSorted(n)},toSpliced(...n){return ns(this).toSpliced(...n)},unshift(...n){return Zs(this,"unshift",n)},values(){return fa(this,"values",n=>fi(this,n))}};function fa(n,t,e){const i=cc(n),s=i[t]();return i!==n&&!xn(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=e(r.value)),r}),s}const jd=Array.prototype;function On(n,t,e,i,s,r){const o=cc(n),a=o!==n&&!xn(n),l=o[t];if(l!==jd[t]){const h=l.apply(n,r);return a?ti(h):h}let c=e;o!==n&&(a?c=function(h,d){return e.call(this,fi(n,h),d,n)}:e.length>2&&(c=function(h,d){return e.call(this,h,d,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function jc(n,t,e,i){const s=cc(n);let r=e;return s!==n&&(xn(n)?e.length>3&&(r=function(o,a,l){return e.call(this,o,a,l,n)}):r=function(o,a,l){return e.call(this,o,fi(n,a),l,n)}),s[t](r,...i)}function da(n,t,e){const i=te(n);Ne(i,"iterate",Er);const s=i[t](...e);return(s===-1||s===!1)&&fc(e[0])?(e[0]=te(e[0]),i[t](...e)):s}function Zs(n,t,e=[]){Jn(),rc();const i=te(n)[t].apply(n,e);return oc(),Qn(),i}const $d=ec("__proto__,__v_isRef,__isVue"),cf=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ln));function Zd(n){Ln(n)||(n=String(n));const t=te(this);return Ne(t,"has",n),t.hasOwnProperty(n)}class uf{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,i){if(e==="__v_skip")return t.__v_skip;const s=this._isReadonly,r=this._isShallow;if(e==="__v_isReactive")return!s;if(e==="__v_isReadonly")return s;if(e==="__v_isShallow")return r;if(e==="__v_raw")return i===(s?r?op:pf:r?df:ff).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const o=Vt(t);if(!s){let l;if(o&&(l=qd[e]))return l;if(e==="hasOwnProperty")return Zd}const a=Reflect.get(t,e,Oe(t)?t:i);if((Ln(e)?cf.has(e):$d(e))||(s||Ne(t,"get",e),r))return a;if(Oe(a)){const l=o&&sc(e)?a:a.value;return s&&me(l)?rl(l):l}return me(a)?s?rl(a):Ko(a):a}}class hf extends uf{constructor(t=!1){super(!1,t)}set(t,e,i,s){let r=t[e];const o=Vt(t)&&sc(e);if(!this._isShallow){const c=Ei(r);if(!xn(i)&&!Ei(i)&&(r=te(r),i=te(i)),!o&&Oe(r)&&!Oe(i))return c||(r.value=i),!0}const a=o?Number(e)n,zr=n=>Reflect.getPrototypeOf(n);function ep(n,t,e){return function(...i){const s=this.__v_raw,r=te(s),o=bs(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=e?sl:t?br:ti;return!t&&Ne(r,"iterate",l?il:Yi),{next(){const{value:h,done:d}=c.next();return d?{value:h,done:d}:{value:a?[u(h[0]),u(h[1])]:u(h),done:d}},[Symbol.iterator](){return this}}}}function Hr(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function np(n,t){const e={get(s){const r=this.__v_raw,o=te(r),a=te(s);n||(xi(s,a)&&Ne(o,"get",s),Ne(o,"get",a));const{has:l}=zr(o),c=t?sl:n?br:ti;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&Ne(te(s),"iterate",Yi),s.size},has(s){const r=this.__v_raw,o=te(r),a=te(s);return n||(xi(s,a)&&Ne(o,"has",s),Ne(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=te(a),c=t?sl:n?br:ti;return!n&&Ne(l,"iterate",Yi),a.forEach((u,h)=>s.call(r,c(u),c(h),o))}};return Fe(e,n?{add:Hr("add"),set:Hr("set"),delete:Hr("delete"),clear:Hr("clear")}:{add(s){!t&&!xn(s)&&!Ei(s)&&(s=te(s));const r=te(this);return zr(r).has.call(r,s)||(r.add(s),qn(r,"add",s,s)),this},set(s,r){!t&&!xn(r)&&!Ei(r)&&(r=te(r));const o=te(this),{has:a,get:l}=zr(o);let c=a.call(o,s);c||(s=te(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?xi(r,u)&&qn(o,"set",s,r):qn(o,"add",s,r),this},delete(s){const r=te(this),{has:o,get:a}=zr(r);let l=o.call(r,s);l||(s=te(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&qn(r,"delete",s,void 0),c},clear(){const s=te(this),r=s.size!==0,o=s.clear();return r&&qn(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=ep(s,n,t)}),e}function uc(n,t){const e=np(n,t);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(ee(e,s)&&s in i?e:i,s,r)}const ip={get:uc(!1,!1)},sp={get:uc(!1,!0)},rp={get:uc(!0,!1)};const ff=new WeakMap,df=new WeakMap,pf=new WeakMap,op=new WeakMap;function ap(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function lp(n){return n.__v_skip||!Object.isExtensible(n)?0:ap(Ld(n))}function Ko(n){return Ei(n)?n:hc(n,!1,Jd,ip,ff)}function cp(n){return hc(n,!1,tp,sp,df)}function rl(n){return hc(n,!0,Qd,rp,pf)}function hc(n,t,e,i,s){if(!me(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;const r=lp(n);if(r===0)return n;const o=s.get(n);if(o)return o;const a=new Proxy(n,r===2?i:e);return s.set(n,a),a}function Ts(n){return Ei(n)?Ts(n.__v_raw):!!(n&&n.__v_isReactive)}function Ei(n){return!!(n&&n.__v_isReadonly)}function xn(n){return!!(n&&n.__v_isShallow)}function fc(n){return n?!!n.__v_raw:!1}function te(n){const t=n&&n.__v_raw;return t?te(t):n}function up(n){return!ee(n,"__v_skip")&&Object.isExtensible(n)&&Zh(n,"__v_skip",!0),n}const ti=n=>me(n)?Ko(n):n,br=n=>me(n)?rl(n):n;function Oe(n){return n?n.__v_isRef===!0:!1}function ln(n){return hp(n,!1)}function hp(n,t){return Oe(n)?n:new fp(n,t)}class fp{constructor(t,e){this.dep=new lc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:te(t),this._value=e?t:ti(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,i=this.__v_isShallow||xn(t)||Ei(t);t=i?t:te(t),xi(t,e)&&(this._rawValue=t,this._value=i?t:ti(t),this.dep.trigger())}}function Re(n){return Oe(n)?n.value:n}const dp={get:(n,t,e)=>t==="__v_raw"?n:Re(Reflect.get(n,t,e)),set:(n,t,e,i)=>{const s=n[t];return Oe(s)&&!Oe(e)?(s.value=e,!0):Reflect.set(n,t,e,i)}};function mf(n){return Ts(n)?n:new Proxy(n,dp)}class pp{constructor(t,e,i){this.fn=t,this.setter=e,this._value=void 0,this.dep=new lc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=yr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&he!==this)return nf(this,!0),!0}get value(){const t=this.dep.track();return of(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function mp(n,t,e=!1){let i,s;return Xt(n)?i=n:(i=n.get,s=n.set),new pp(i,s,e)}const kr={},Uo=new WeakMap;let Bi;function _p(n,t=!1,e=Bi){if(e){let i=Uo.get(e);i||Uo.set(e,i=[]),i.push(n)}}function gp(n,t,e=le){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=e,c=S=>s?S:xn(S)||s===!1||s===0?jn(S,1):jn(S);let u,h,d,m,v=!1,M=!1;if(Oe(n)?(h=()=>n.value,v=xn(n)):Ts(n)?(h=()=>c(n),v=!0):Vt(n)?(M=!0,v=n.some(S=>Ts(S)||xn(S)),h=()=>n.map(S=>{if(Oe(S))return S.value;if(Ts(S))return c(S);if(Xt(S))return l?l(S,2):S()})):Xt(n)?t?h=l?()=>l(n,2):n:h=()=>{if(d){Jn();try{d()}finally{Qn()}}const S=Bi;Bi=u;try{return l?l(n,3,[m]):n(m)}finally{Bi=S}}:h=Dn,t&&s){const S=h,L=s===!0?1/0:s;h=()=>jn(S(),L)}const p=Wd(),f=()=>{u.stop(),p&&p.active&&ic(p.effects,u)};if(r&&t){const S=t;t=(...L)=>{S(...L),f()}}let b=M?new Array(n.length).fill(kr):kr;const T=S=>{if(!(!(u.flags&1)||!u.dirty&&!S))if(t){const L=u.run();if(s||v||(M?L.some((D,P)=>xi(D,b[P])):xi(L,b))){d&&d();const D=Bi;Bi=u;try{const P=[L,b===kr?void 0:M&&b[0]===kr?[]:b,m];b=L,l?l(t,3,P):t(...P)}finally{Bi=D}}}else u.run()};return a&&a(T),u=new tf(h),u.scheduler=o?()=>o(T,!1):T,m=S=>_p(S,!1,u),d=u.onStop=()=>{const S=Uo.get(u);if(S){if(l)l(S,4);else for(const L of S)L();Uo.delete(u)}},t?i?T(!0):b=u.run():o?o(T.bind(null,!0),!0):u.run(),f.pause=u.pause.bind(u),f.resume=u.resume.bind(u),f.stop=f,f}function jn(n,t=1/0,e){if(t<=0||!me(n)||n.__v_skip||(e=e||new Map,(e.get(n)||0)>=t))return n;if(e.set(n,t),t--,Oe(n))jn(n.value,t,e);else if(Vt(n))for(let i=0;i{jn(i,t,e)});else if(jh(n)){for(const i in n)jn(n[i],t,e);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&jn(n[i],t,e)}return n}/** * @vue/runtime-core v3.5.25 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Tr(n,t,e,i){try{return i?n(...i):n()}catch(s){qo(s,t,e)}}function In(n,t,e,i){if(Xt(n)){const s=Tr(n,t,e,i);return s&&Gh(s)&&s.catch(r=>{qo(r,t,e)}),s}if(Gt(n)){const s=[];for(let r=0;r>>1,s=ke[i],r=xr(s);r=xr(e)?ke.push(n):ke.splice(gp(t),0,n),n.flags|=1,pf()}}function pf(){Lo||(Lo=df.then(_f))}function vp(n){Gt(n)?ys.push(...n):hi&&n.id===-1?hi.splice(ms+1,0,n):n.flags&1||(ys.push(n),n.flags|=1),pf()}function Yc(n,t,e=Tn+1){for(;exr(e)-xr(i));if(ys.length=0,hi){hi.push(...t);return}for(hi=t,ms=0;msn.id==null?n.flags&2?-1:1/0:n.id;function _f(n){try{for(Tn=0;Tn{i._d&&nu(-1);const r=Io(t);let o;try{o=n(...s)}finally{Io(r),i._d&&nu(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Qi(n,t){if(cn===null)return n;const e=Jo(cn),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,yp=Symbol("_leaveCb");function dc(n,t){n.shapeFlag&6&&n.component?(n.transition=t,dc(n.component.subTree,t)):n.shapeFlag&128?(n.ssContent.transition=t.clone(n.ssContent),n.ssFallback.transition=t.clone(n.ssFallback)):n.transition=t}function wr(n,t){return Xt(n)?Fe({name:n.name},t,{setup:n}):n}function vf(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}const Uo=new WeakMap;function hr(n,t,e,i,s=!1){if(Gt(n)){n.forEach((v,M)=>hr(v,t&&(Gt(t)?t[M]:t),e,i,s));return}if(fr(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&hr(n,t,e,i.component.subTree);return}const r=i.shapeFlag&4?Jo(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=t&&t.r,u=a.refs===le?a.refs={}:a.refs,h=a.setupState,d=te(h),p=h===le?kh:v=>ee(d,v);if(c!=null&&c!==l){if(qc(t),Ee(c))u[c]=null,p(c)&&(h[c]=null);else if(Oe(c)){c.value=null;const v=t;v.k&&(u[v.k]=null)}}if(Xt(l))Tr(l,a,12,[o,u]);else{const v=Ee(l),M=Oe(l);if(v||M){const m=()=>{if(n.f){const f=v?p(l)?h[l]:u[l]:l.value;if(s)Gt(f)&&tc(f,r);else if(Gt(f))f.includes(r)||f.push(r);else if(v)u[l]=[r],p(l)&&(h[l]=u[l]);else{const T=[r];l.value=T,n.k&&(u[n.k]=T)}}else v?(u[l]=o,p(l)&&(h[l]=o)):M&&(l.value=o,n.k&&(u[n.k]=o))};if(o){const f=()=>{m(),Uo.delete(n)};f.id=-1,Uo.set(n,f),Qe(f,e)}else qc(n),m()}}}function qc(n){const t=Uo.get(n);t&&(t.flags|=8,Uo.delete(n))}Xo().requestIdleCallback;Xo().cancelIdleCallback;const fr=n=>!!n.type.__asyncLoader,xf=n=>n.type.__isKeepAlive;function Ep(n,t){Mf(n,"a",t)}function bp(n,t){Mf(n,"da",t)}function Mf(n,t,e=Ge){const i=n.__wdc||(n.__wdc=()=>{let s=e;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(jo(t,i,e),e){let s=e.parent;for(;s&&s.parent;)xf(s.parent.vnode)&&Tp(i,t,e,s),s=s.parent}}function Tp(n,t,e,i){const s=jo(t,n,i,!0);Zo(()=>{tc(i[t],s)},e)}function jo(n,t,e=Ge,i=!1){if(e){const s=e[n]||(e[n]=[]),r=t.__weh||(t.__weh=(...o)=>{$n();const a=Rr(e),l=In(t,e,n,o);return a(),Kn(),l});return i?s.unshift(r):s.push(r),r}}const ti=n=>(t,e=Ge)=>{(!Sr||n==="sp")&&jo(n,(...i)=>t(...i),e)},wp=ti("bm"),pc=ti("m"),Ap=ti("bu"),Rp=ti("u"),Cp=ti("bum"),Zo=ti("um"),Pp=ti("sp"),Dp=ti("rtg"),Lp=ti("rtc");function Ip(n,t=Ge){jo("ec",n,t)}const Up=Symbol.for("v-ndc"),il=n=>n?Vf(n)?Jo(n):il(n.parent):null,dr=Fe(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>il(n.parent),$root:n=>il(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>yf(n),$forceUpdate:n=>n.f||(n.f=()=>{fc(n.update)}),$nextTick:n=>n.n||(n.n=_p.bind(n.proxy)),$watch:n=>Yp.bind(n)}),ha=(n,t)=>n!==le&&!n.__isScriptSetup&&ee(n,t),Np={get({_:n},t){if(t==="__v_skip")return!0;const{ctx:e,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;if(t[0]!=="$"){const d=o[t];if(d!==void 0)switch(d){case 1:return i[t];case 2:return s[t];case 4:return e[t];case 3:return r[t]}else{if(ha(i,t))return o[t]=1,i[t];if(s!==le&&ee(s,t))return o[t]=2,s[t];if(ee(r,t))return o[t]=3,r[t];if(e!==le&&ee(e,t))return o[t]=4,e[t];sl&&(o[t]=0)}}const c=dr[t];let u,h;if(c)return t==="$attrs"&&Ne(n.attrs,"get",""),c(n);if((u=a.__cssModules)&&(u=u[t]))return u;if(e!==le&&ee(e,t))return o[t]=4,e[t];if(h=l.config.globalProperties,ee(h,t))return h[t]},set({_:n},t,e){const{data:i,setupState:s,ctx:r}=n;return ha(s,t)?(s[t]=e,!0):i!==le&&ee(i,t)?(i[t]=e,!0):ee(n.props,t)||t[0]==="$"&&t.slice(1)in n?!1:(r[t]=e,!0)},has({_:{data:n,setupState:t,accessCache:e,ctx:i,appContext:s,props:r,type:o}},a){let l;return!!(e[a]||n!==le&&a[0]!=="$"&&ee(n,a)||ha(t,a)||ee(r,a)||ee(i,a)||ee(dr,a)||ee(s.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(n,t,e){return e.get!=null?n._.accessCache[t]=0:ee(e,"value")&&this.set(n,t,e.value,null),Reflect.defineProperty(n,t,e)}};function jc(n){return Gt(n)?n.reduce((t,e)=>(t[e]=null,t),{}):n}let sl=!0;function Op(n){const t=yf(n),e=n.proxy,i=n.ctx;sl=!1,t.beforeCreate&&Zc(t.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:d,beforeUpdate:p,updated:v,activated:M,deactivated:m,beforeDestroy:f,beforeUnmount:T,destroyed:b,unmounted:S,render:U,renderTracked:D,renderTriggered:P,errorCaptured:y,serverPrefetch:_,expose:g,inheritAttrs:C,components:N,directives:F,filters:J}=t;if(c&&Fp(c,i,null),o)for(const W in o){const B=o[W];Xt(B)&&(i[W]=B.bind(e))}if(s){const W=s.call(e,e);_e(W)&&(n.data=cc(W))}if(sl=!0,r)for(const W in r){const B=r[W],et=Xt(B)?B.bind(e,e):Xt(B.get)?B.get.bind(e,e):Dn,gt=!Xt(B)&&Xt(B.set)?B.set.bind(e):Dn,X=yr({get:et,set:gt});Object.defineProperty(i,W,{enumerable:!0,configurable:!0,get:()=>X.value,set:ot=>X.value=ot})}if(a)for(const W in a)Sf(a[W],i,e,W);if(l){const W=Xt(l)?l.call(e):l;Reflect.ownKeys(W).forEach(B=>{Gp(B,W[B])})}u&&Zc(u,n,"c");function Q(W,B){Gt(B)?B.forEach(et=>W(et.bind(e))):B&&W(B.bind(e))}if(Q(wp,h),Q(pc,d),Q(Ap,p),Q(Rp,v),Q(Ep,M),Q(bp,m),Q(Ip,y),Q(Lp,D),Q(Dp,P),Q(Cp,T),Q(Zo,S),Q(Pp,_),Gt(g))if(g.length){const W=n.exposed||(n.exposed={});g.forEach(B=>{Object.defineProperty(W,B,{get:()=>e[B],set:et=>e[B]=et,enumerable:!0})})}else n.exposed||(n.exposed={});U&&n.render===Dn&&(n.render=U),C!=null&&(n.inheritAttrs=C),N&&(n.components=N),F&&(n.directives=F),_&&vf(n)}function Fp(n,t,e=Dn){Gt(n)&&(n=rl(n));for(const i in n){const s=n[i];let r;_e(s)?"default"in s?r=vo(s.from||i,s.default,!0):r=vo(s.from||i):r=vo(s),Oe(r)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[i]=r}}function Zc(n,t,e){In(Gt(n)?n.map(i=>i.bind(t.proxy)):n.bind(t.proxy),t,e)}function Sf(n,t,e,i){let s=i.includes(".")?Tf(e,i):()=>e[i];if(Ee(n)){const r=t[n];Xt(r)&&xo(s,r)}else if(Xt(n))xo(s,n.bind(e));else if(_e(n))if(Gt(n))n.forEach(r=>Sf(r,t,e,i));else{const r=Xt(n.handler)?n.handler.bind(e):t[n.handler];Xt(r)&&xo(s,r,n)}}function yf(n){const t=n.type,{mixins:e,extends:i}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(t);let l;return a?l=a:!s.length&&!e&&!i?l=t:(l={},s.length&&s.forEach(c=>No(l,c,o,!0)),No(l,t,o)),_e(t)&&r.set(t,l),l}function No(n,t,e,i=!1){const{mixins:s,extends:r}=t;r&&No(n,r,e,!0),s&&s.forEach(o=>No(n,o,e,!0));for(const o in t)if(!(i&&o==="expose")){const a=Bp[o]||e&&e[o];n[o]=a?a(n[o],t[o]):t[o]}return n}const Bp={data:$c,props:Kc,emits:Kc,methods:ir,computed:ir,beforeCreate:ze,created:ze,beforeMount:ze,mounted:ze,beforeUpdate:ze,updated:ze,beforeDestroy:ze,beforeUnmount:ze,destroyed:ze,unmounted:ze,activated:ze,deactivated:ze,errorCaptured:ze,serverPrefetch:ze,components:ir,directives:ir,watch:Hp,provide:$c,inject:zp};function $c(n,t){return t?n?function(){return Fe(Xt(n)?n.call(this,this):n,Xt(t)?t.call(this,this):t)}:t:n}function zp(n,t){return ir(rl(n),rl(t))}function rl(n){if(Gt(n)){const t={};for(let e=0;e1)return e&&Xt(t)?t.call(i&&i.proxy):t}}const Wp=Symbol.for("v-scx"),Xp=()=>vo(Wp);function xo(n,t,e){return bf(n,t,e)}function bf(n,t,e=le){const{immediate:i,deep:s,flush:r,once:o}=e,a=Fe({},e),l=t&&i||!t&&r!=="post";let c;if(Sr){if(r==="sync"){const p=Xp();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!l){const p=()=>{};return p.stop=Dn,p.resume=Dn,p.pause=Dn,p}}const u=Ge;a.call=(p,v,M)=>In(p,u,v,M);let h=!1;r==="post"?a.scheduler=p=>{Qe(p,u&&u.suspense)}:r!=="sync"&&(h=!0,a.scheduler=(p,v)=>{v?p():fc(p)}),a.augmentJob=p=>{t&&(p.flags|=4),h&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const d=pp(n,t,a);return Sr&&(c?c.push(d):l&&d()),d}function Yp(n,t,e){const i=this.proxy,s=Ee(n)?n.includes(".")?Tf(i,n):()=>i[n]:n.bind(i,i);let r;Xt(t)?r=t:(r=t.handler,e=t);const o=Rr(this),a=bf(s,r.bind(i),e);return o(),a}function Tf(n,t){const e=t.split(".");return()=>{let i=n;for(let s=0;st==="modelValue"||t==="model-value"?n.modelModifiers:n[`${t}Modifiers`]||n[`${xi(t)}Modifiers`]||n[`${ji(t)}Modifiers`];function jp(n,t,...e){if(n.isUnmounted)return;const i=n.vnode.props||le;let s=e;const r=t.startsWith("update:"),o=r&&qp(i,t.slice(7));o&&(o.trim&&(s=e.map(u=>Ee(u)?u.trim():u)),o.number&&(s=e.map(nc)));let a,l=i[a=oa(t)]||i[a=oa(xi(t))];!l&&r&&(l=i[a=oa(ji(t))]),l&&In(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,In(c,n,6,s)}}const Zp=new WeakMap;function wf(n,t,e=!1){const i=e?Zp:t.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!Xt(n)){const l=c=>{const u=wf(c,t,!0);u&&(a=!0,Fe(o,u))};!e&&t.mixins.length&&t.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(_e(n)&&i.set(n,null),null):(Gt(r)?r.forEach(l=>o[l]=null):Fe(o,r),_e(n)&&i.set(n,o),o)}function $o(n,t){return!n||!Go(t)?!1:(t=t.slice(2).replace(/Once$/,""),ee(n,t[0].toLowerCase()+t.slice(1))||ee(n,ji(t))||ee(n,t))}function Jc(n){const{type:t,vnode:e,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:d,setupState:p,ctx:v,inheritAttrs:M}=n,m=Io(n);let f,T;try{if(e.shapeFlag&4){const S=s||i,U=S;f=An(c.call(U,S,u,h,p,d,v)),T=a}else{const S=t;f=An(S.length>1?S(h,{attrs:a,slots:o,emit:l}):S(h,null)),T=t.props?a:$p(a)}}catch(S){pr.length=0,qo(S,n,1),f=nn(Si)}let b=f;if(T&&M!==!1){const S=Object.keys(T),{shapeFlag:U}=b;S.length&&U&7&&(r&&S.some(Ql)&&(T=Kp(T,r)),b=Rs(b,T,!1,!0))}return e.dirs&&(b=Rs(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(e.dirs):e.dirs),e.transition&&dc(b,e.transition),f=b,Io(m),f}const $p=n=>{let t;for(const e in n)(e==="class"||e==="style"||Go(e))&&((t||(t={}))[e]=n[e]);return t},Kp=(n,t)=>{const e={};for(const i in n)(!Ql(i)||!(i.slice(9)in t))&&(e[i]=n[i]);return e};function Jp(n,t,e){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(e&&l>=0){if(l&1024)return!0;if(l&16)return i?Qc(i,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let h=0;hObject.create(Af),Cf=n=>Object.getPrototypeOf(n)===Af;function tm(n,t,e,i=!1){const s={},r=Rf();n.propsDefaults=Object.create(null),Pf(n,t,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);e?n.props=i?s:op(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function em(n,t,e,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=te(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let h=0;h{l=!0;const[d,p]=Df(h,t,!0);Fe(o,d),p&&a.push(...p)};!e&&t.mixins.length&&t.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!l)return _e(n)&&i.set(n,xs),xs;if(Gt(r))for(let u=0;un==="_"||n==="_ctx"||n==="$stable",_c=n=>Gt(n)?n.map(An):[An(n)],im=(n,t,e)=>{if(t._n)return t;const i=xp((...s)=>_c(t(...s)),e);return i._c=!1,i},Lf=(n,t,e)=>{const i=n._ctx;for(const s in n){if(mc(s))continue;const r=n[s];if(Xt(r))t[s]=im(s,r,i);else if(r!=null){const o=_c(r);t[s]=()=>o}}},If=(n,t)=>{const e=_c(t);n.slots.default=()=>e},Uf=(n,t,e)=>{for(const i in t)(e||!mc(i))&&(n[i]=t[i])},sm=(n,t,e)=>{const i=n.slots=Rf();if(n.vnode.shapeFlag&32){const s=t._;s?(Uf(i,t,e),e&&qh(i,"_",s,!0)):Lf(t,i)}else t&&If(n,t)},rm=(n,t,e)=>{const{vnode:i,slots:s}=n;let r=!0,o=le;if(i.shapeFlag&32){const a=t._;a?e&&a===1?r=!1:Uf(s,t,e):(r=!t.$stable,Lf(t,s)),o=t}else t&&(If(n,t),o={default:1});if(r)for(const a in s)!mc(a)&&o[a]==null&&delete s[a]},Qe=um;function om(n){return am(n)}function am(n,t){const e=Xo();e.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:d,setScopeId:p=Dn,insertStaticContent:v}=n,M=(R,L,w,tt=null,H=null,j=null,Y=void 0,rt=null,$=!!L.dynamicChildren)=>{if(R===L)return;R&&!Xs(R,L)&&(tt=ut(R),ot(R,H,j,!0),R=null),L.patchFlag===-2&&($=!1,L.dynamicChildren=null);const{type:E,ref:x,shapeFlag:I}=L;switch(E){case Ko:m(R,L,w,tt);break;case Si:f(R,L,w,tt);break;case da:R==null&&T(L,w,tt,Y);break;case wn:N(R,L,w,tt,H,j,Y,rt,$);break;default:I&1?U(R,L,w,tt,H,j,Y,rt,$):I&6?F(R,L,w,tt,H,j,Y,rt,$):(I&64||I&128)&&E.process(R,L,w,tt,H,j,Y,rt,$,yt)}x!=null&&H?hr(x,R&&R.ref,j,L||R,!L):x==null&&R&&R.ref!=null&&hr(R.ref,null,j,R,!0)},m=(R,L,w,tt)=>{if(R==null)i(L.el=a(L.children),w,tt);else{const H=L.el=R.el;L.children!==R.children&&c(H,L.children)}},f=(R,L,w,tt)=>{R==null?i(L.el=l(L.children||""),w,tt):L.el=R.el},T=(R,L,w,tt)=>{[R.el,R.anchor]=v(R.children,L,w,tt,R.el,R.anchor)},b=({el:R,anchor:L},w,tt)=>{let H;for(;R&&R!==L;)H=d(R),i(R,w,tt),R=H;i(L,w,tt)},S=({el:R,anchor:L})=>{let w;for(;R&&R!==L;)w=d(R),s(R),R=w;s(L)},U=(R,L,w,tt,H,j,Y,rt,$)=>{if(L.type==="svg"?Y="svg":L.type==="math"&&(Y="mathml"),R==null)D(L,w,tt,H,j,Y,rt,$);else{const E=R.el&&R.el._isVueCE?R.el:null;try{E&&E._beginPatch(),_(R,L,H,j,Y,rt,$)}finally{E&&E._endPatch()}}},D=(R,L,w,tt,H,j,Y,rt)=>{let $,E;const{props:x,shapeFlag:I,transition:k,dirs:K}=R;if($=R.el=o(R.type,j,x&&x.is,x),I&8?u($,R.children):I&16&&y(R.children,$,null,tt,H,fa(R,j),Y,rt),K&&wi(R,null,tt,"created"),P($,R,R.scopeId,Y,tt),x){for(const _t in x)_t!=="value"&&!lr(_t)&&r($,_t,null,x[_t],j,tt);"value"in x&&r($,"value",null,x.value,j),(E=x.onVnodeBeforeMount)&&En(E,tt,R)}K&&wi(R,null,tt,"beforeMount");const q=lm(H,k);q&&k.beforeEnter($),i($,L,w),((E=x&&x.onVnodeMounted)||q||K)&&Qe(()=>{E&&En(E,tt,R),q&&k.enter($),K&&wi(R,null,tt,"mounted")},H)},P=(R,L,w,tt,H)=>{if(w&&p(R,w),tt)for(let j=0;j{for(let E=$;E{const rt=L.el=R.el;let{patchFlag:$,dynamicChildren:E,dirs:x}=L;$|=R.patchFlag&16;const I=R.props||le,k=L.props||le;let K;if(w&&Ai(w,!1),(K=k.onVnodeBeforeUpdate)&&En(K,w,L,R),x&&wi(L,R,w,"beforeUpdate"),w&&Ai(w,!0),(I.innerHTML&&k.innerHTML==null||I.textContent&&k.textContent==null)&&u(rt,""),E?g(R.dynamicChildren,E,rt,w,tt,fa(L,H),j):Y||B(R,L,rt,null,w,tt,fa(L,H),j,!1),$>0){if($&16)C(rt,I,k,w,H);else if($&2&&I.class!==k.class&&r(rt,"class",null,k.class,H),$&4&&r(rt,"style",I.style,k.style,H),$&8){const q=L.dynamicProps;for(let _t=0;_t{K&&En(K,w,L,R),x&&wi(L,R,w,"updated")},tt)},g=(R,L,w,tt,H,j,Y)=>{for(let rt=0;rt{if(L!==w){if(L!==le)for(const j in L)!lr(j)&&!(j in w)&&r(R,j,L[j],null,H,tt);for(const j in w){if(lr(j))continue;const Y=w[j],rt=L[j];Y!==rt&&j!=="value"&&r(R,j,rt,Y,H,tt)}"value"in w&&r(R,"value",L.value,w.value,H)}},N=(R,L,w,tt,H,j,Y,rt,$)=>{const E=L.el=R?R.el:a(""),x=L.anchor=R?R.anchor:a("");let{patchFlag:I,dynamicChildren:k,slotScopeIds:K}=L;K&&(rt=rt?rt.concat(K):K),R==null?(i(E,w,tt),i(x,w,tt),y(L.children||[],w,x,H,j,Y,rt,$)):I>0&&I&64&&k&&R.dynamicChildren?(g(R.dynamicChildren,k,w,H,j,Y,rt),(L.key!=null||H&&L===H.subTree)&&Nf(R,L,!0)):B(R,L,w,x,H,j,Y,rt,$)},F=(R,L,w,tt,H,j,Y,rt,$)=>{L.slotScopeIds=rt,R==null?L.shapeFlag&512?H.ctx.activate(L,w,tt,Y,$):J(L,w,tt,H,j,Y,$):st(R,L,$)},J=(R,L,w,tt,H,j,Y)=>{const rt=R.component=vm(R,tt,H);if(xf(R)&&(rt.ctx.renderer=yt),Mm(rt,!1,Y),rt.asyncDep){if(H&&H.registerDep(rt,Q,Y),!R.el){const $=rt.subTree=nn(Si);f(null,$,L,w),R.placeholder=$.el}}else Q(rt,R,L,w,H,j,Y)},st=(R,L,w)=>{const tt=L.component=R.component;if(Jp(R,L,w))if(tt.asyncDep&&!tt.asyncResolved){W(tt,L,w);return}else tt.next=L,tt.update();else L.el=R.el,tt.vnode=L},Q=(R,L,w,tt,H,j,Y)=>{const rt=()=>{if(R.isMounted){let{next:I,bu:k,u:K,parent:q,vnode:_t}=R;{const xt=Of(R);if(xt){I&&(I.el=_t.el,W(R,I,Y)),xt.asyncDep.then(()=>{R.isUnmounted||rt()});return}}let ht=I,St;Ai(R,!1),I?(I.el=_t.el,W(R,I,Y)):I=_t,k&&go(k),(St=I.props&&I.props.onVnodeBeforeUpdate)&&En(St,q,I,_t),Ai(R,!0);const Ft=Jc(R),pt=R.subTree;R.subTree=Ft,M(pt,Ft,h(pt.el),ut(pt),R,H,j),I.el=Ft.el,ht===null&&Qp(R,Ft.el),K&&Qe(K,H),(St=I.props&&I.props.onVnodeUpdated)&&Qe(()=>En(St,q,I,_t),H)}else{let I;const{el:k,props:K}=L,{bm:q,m:_t,parent:ht,root:St,type:Ft}=R,pt=fr(L);Ai(R,!1),q&&go(q),!pt&&(I=K&&K.onVnodeBeforeMount)&&En(I,ht,L),Ai(R,!0);{St.ce&&St.ce._def.shadowRoot!==!1&&St.ce._injectChildStyle(Ft);const xt=R.subTree=Jc(R);M(null,xt,w,tt,R,H,j),L.el=xt.el}if(_t&&Qe(_t,H),!pt&&(I=K&&K.onVnodeMounted)){const xt=L;Qe(()=>En(I,ht,xt),H)}(L.shapeFlag&256||ht&&fr(ht.vnode)&&ht.vnode.shapeFlag&256)&&R.a&&Qe(R.a,H),R.isMounted=!0,L=w=tt=null}};R.scope.on();const $=R.effect=new Kh(rt);R.scope.off();const E=R.update=$.run.bind($),x=R.job=$.runIfDirty.bind($);x.i=R,x.id=R.uid,$.scheduler=()=>fc(x),Ai(R,!0),E()},W=(R,L,w)=>{L.component=R;const tt=R.vnode.props;R.vnode=L,R.next=null,em(R,L.props,tt,w),rm(R,L.children,w),$n(),Yc(R),Kn()},B=(R,L,w,tt,H,j,Y,rt,$=!1)=>{const E=R&&R.children,x=R?R.shapeFlag:0,I=L.children,{patchFlag:k,shapeFlag:K}=L;if(k>0){if(k&128){gt(E,I,w,tt,H,j,Y,rt,$);return}else if(k&256){et(E,I,w,tt,H,j,Y,rt,$);return}}K&8?(x&16&&mt(E,H,j),I!==E&&u(w,I)):x&16?K&16?gt(E,I,w,tt,H,j,Y,rt,$):mt(E,H,j,!0):(x&8&&u(w,""),K&16&&y(I,w,tt,H,j,Y,rt,$))},et=(R,L,w,tt,H,j,Y,rt,$)=>{R=R||xs,L=L||xs;const E=R.length,x=L.length,I=Math.min(E,x);let k;for(k=0;kx?mt(R,H,j,!0,!1,I):y(L,w,tt,H,j,Y,rt,$,I)},gt=(R,L,w,tt,H,j,Y,rt,$)=>{let E=0;const x=L.length;let I=R.length-1,k=x-1;for(;E<=I&&E<=k;){const K=R[E],q=L[E]=$?fi(L[E]):An(L[E]);if(Xs(K,q))M(K,q,w,null,H,j,Y,rt,$);else break;E++}for(;E<=I&&E<=k;){const K=R[I],q=L[k]=$?fi(L[k]):An(L[k]);if(Xs(K,q))M(K,q,w,null,H,j,Y,rt,$);else break;I--,k--}if(E>I){if(E<=k){const K=k+1,q=Kk)for(;E<=I;)ot(R[E],H,j,!0),E++;else{const K=E,q=E,_t=new Map;for(E=q;E<=k;E++){const Et=L[E]=$?fi(L[E]):An(L[E]);Et.key!=null&&_t.set(Et.key,E)}let ht,St=0;const Ft=k-q+1;let pt=!1,xt=0;const Lt=new Array(Ft);for(E=0;E=Ft){ot(Et,H,j,!0);continue}let kt;if(Et.key!=null)kt=_t.get(Et.key);else for(ht=q;ht<=k;ht++)if(Lt[ht-q]===0&&Xs(Et,L[ht])){kt=ht;break}kt===void 0?ot(Et,H,j,!0):(Lt[kt-q]=E+1,kt>=xt?xt=kt:pt=!0,M(Et,L[kt],w,null,H,j,Y,rt,$),St++)}const Bt=pt?cm(Lt):xs;for(ht=Bt.length-1,E=Ft-1;E>=0;E--){const Et=q+E,kt=L[Et],Wt=L[Et+1],ne=Et+1{const{el:j,type:Y,transition:rt,children:$,shapeFlag:E}=R;if(E&6){X(R.component.subTree,L,w,tt);return}if(E&128){R.suspense.move(L,w,tt);return}if(E&64){Y.move(R,L,w,yt);return}if(Y===wn){i(j,L,w);for(let I=0;I<$.length;I++)X($[I],L,w,tt);i(R.anchor,L,w);return}if(Y===da){b(R,L,w);return}if(tt!==2&&E&1&&rt)if(tt===0)rt.beforeEnter(j),i(j,L,w),Qe(()=>rt.enter(j),H);else{const{leave:I,delayLeave:k,afterLeave:K}=rt,q=()=>{R.ctx.isUnmounted?s(j):i(j,L,w)},_t=()=>{j._isLeaving&&j[yp](!0),I(j,()=>{q(),K&&K()})};k?k(j,q,_t):_t()}else i(j,L,w)},ot=(R,L,w,tt=!1,H=!1)=>{const{type:j,props:Y,ref:rt,children:$,dynamicChildren:E,shapeFlag:x,patchFlag:I,dirs:k,cacheIndex:K}=R;if(I===-2&&(H=!1),rt!=null&&($n(),hr(rt,null,w,R,!0),Kn()),K!=null&&(L.renderCache[K]=void 0),x&256){L.ctx.deactivate(R);return}const q=x&1&&k,_t=!fr(R);let ht;if(_t&&(ht=Y&&Y.onVnodeBeforeUnmount)&&En(ht,L,R),x&6)at(R.component,w,tt);else{if(x&128){R.suspense.unmount(w,tt);return}q&&wi(R,null,L,"beforeUnmount"),x&64?R.type.remove(R,L,w,yt,tt):E&&!E.hasOnce&&(j!==wn||I>0&&I&64)?mt(E,L,w,!1,!0):(j===wn&&I&384||!H&&x&16)&&mt($,L,w),tt&<(R)}(_t&&(ht=Y&&Y.onVnodeUnmounted)||q)&&Qe(()=>{ht&&En(ht,L,R),q&&wi(R,null,L,"unmounted")},w)},lt=R=>{const{type:L,el:w,anchor:tt,transition:H}=R;if(L===wn){Z(w,tt);return}if(L===da){S(R);return}const j=()=>{s(w),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(R.shapeFlag&1&&H&&!H.persisted){const{leave:Y,delayLeave:rt}=H,$=()=>Y(w,j);rt?rt(R.el,j,$):$()}else j()},Z=(R,L)=>{let w;for(;R!==L;)w=d(R),s(R),R=w;s(L)},at=(R,L,w)=>{const{bum:tt,scope:H,job:j,subTree:Y,um:rt,m:$,a:E}=R;eu($),eu(E),tt&&go(tt),H.stop(),j&&(j.flags|=8,ot(Y,R,L,w)),rt&&Qe(rt,L),Qe(()=>{R.isUnmounted=!0},L)},mt=(R,L,w,tt=!1,H=!1,j=0)=>{for(let Y=j;Y{if(R.shapeFlag&6)return ut(R.component.subTree);if(R.shapeFlag&128)return R.suspense.next();const L=d(R.anchor||R.el),w=L&&L[Mp];return w?d(w):L};let ft=!1;const vt=(R,L,w)=>{R==null?L._vnode&&ot(L._vnode,null,null,!0):M(L._vnode||null,R,L,null,null,null,w),L._vnode=R,ft||(ft=!0,Yc(),mf(),ft=!1)},yt={p:M,um:ot,m:X,r:lt,mt:J,mc:y,pc:B,pbc:g,n:ut,o:n};return{render:vt,hydrate:void 0,createApp:Vp(vt)}}function fa({type:n,props:t},e){return e==="svg"&&n==="foreignObject"||e==="mathml"&&n==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:e}function Ai({effect:n,job:t},e){e?(n.flags|=32,t.flags|=4):(n.flags&=-33,t.flags&=-5)}function lm(n,t){return(!n||n&&!n.pendingBranch)&&t&&!t.persisted}function Nf(n,t,e=!1){const i=n.children,s=t.children;if(Gt(i)&&Gt(s))for(let r=0;r>1,n[e[a]]0&&(t[i]=e[r-1]),e[r]=i)}}for(r=e.length,o=e[r-1];r-- >0;)e[r]=o,o=t[o];return e}function Of(n){const t=n.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Of(t)}function eu(n){if(n)for(let t=0;tn.__isSuspense;function um(n,t){t&&t.pendingBranch?Gt(n)?t.effects.push(...n):t.effects.push(n):vp(n)}const wn=Symbol.for("v-fgt"),Ko=Symbol.for("v-txt"),Si=Symbol.for("v-cmt"),da=Symbol.for("v-stc"),pr=[];let en=null;function Ns(n=!1){pr.push(en=n?null:[])}function hm(){pr.pop(),en=pr[pr.length-1]||null}let Mr=1;function nu(n,t=!1){Mr+=n,n<0&&en&&t&&(en.hasOnce=!0)}function Bf(n){return n.dynamicChildren=Mr>0?en||xs:null,hm(),Mr>0&&en&&en.push(n),n}function Ar(n,t,e,i,s,r){return Bf(Dt(n,t,e,i,s,r,!0))}function fm(n,t,e,i,s){return Bf(nn(n,t,e,i,s,!0))}function zf(n){return n?n.__v_isVNode===!0:!1}function Xs(n,t){return n.type===t.type&&n.key===t.key}const Hf=({key:n})=>n??null,Mo=({ref:n,ref_key:t,ref_for:e})=>(typeof n=="number"&&(n=""+n),n!=null?Ee(n)||Oe(n)||Xt(n)?{i:cn,r:n,k:t,f:!!e}:n:null);function Dt(n,t=null,e=null,i=0,s=null,r=n===wn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:t,key:t&&Hf(t),ref:t&&Mo(t),scopeId:gf,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:cn};return a?(gc(l,e),r&128&&n.normalize(l)):e&&(l.shapeFlag|=Ee(e)?8:16),Mr>0&&!o&&en&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&en.push(l),l}const nn=dm;function dm(n,t=null,e=null,i=0,s=null,r=!1){if((!n||n===Up)&&(n=Si),zf(n)){const a=Rs(n,t,!0);return e&&gc(a,e),Mr>0&&!r&&en&&(a.shapeFlag&6?en[en.indexOf(n)]=a:en.push(a)),a.patchFlag=-2,a}if(bm(n)&&(n=n.__vccOpts),t){t=pm(t);let{class:a,style:l}=t;a&&!Ee(a)&&(t.class=mi(a)),_e(l)&&(hc(l)&&!Gt(l)&&(l=Fe({},l)),t.style=Yo(l))}const o=Ee(n)?1:Ff(n)?128:Sp(n)?64:_e(n)?4:Xt(n)?2:0;return Dt(n,t,e,i,s,o,r,!0)}function pm(n){return n?hc(n)||Cf(n)?Fe({},n):n:null}function Rs(n,t,e=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=t?mm(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&Hf(c),ref:t&&t.ref?e&&r?Gt(r)?r.concat(Mo(t)):[r,Mo(t)]:Mo(t):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:t&&n.type!==wn?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Rs(n.ssContent),ssFallback:n.ssFallback&&Rs(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&dc(u,l.clone(u)),u}function al(n=" ",t=0){return nn(Ko,null,n,t)}function kf(n="",t=!1){return t?(Ns(),fm(Si,null,n)):nn(Si,null,n)}function An(n){return n==null||typeof n=="boolean"?nn(Si):Gt(n)?nn(wn,null,n.slice()):zf(n)?fi(n):nn(Ko,null,String(n))}function fi(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Rs(n)}function gc(n,t){let e=0;const{shapeFlag:i}=n;if(t==null)t=null;else if(Gt(t))e=16;else if(typeof t=="object")if(i&65){const s=t.default;s&&(s._c&&(s._d=!1),gc(n,s()),s._c&&(s._d=!0));return}else{e=32;const s=t._;!s&&!Cf(t)?t._ctx=cn:s===3&&cn&&(cn.slots._===1?t._=1:(t._=2,n.patchFlag|=1024))}else Xt(t)?(t={default:t,_ctx:cn},e=32):(t=String(t),i&64?(e=16,t=[al(t)]):e=8);n.children=t,n.shapeFlag|=e}function mm(...n){const t={};for(let e=0;eGe||cn;let Oo,ll;{const n=Xo(),t=(e,i)=>{let s;return(s=n[e])||(s=n[e]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};Oo=t("__VUE_INSTANCE_SETTERS__",e=>Ge=e),ll=t("__VUE_SSR_SETTERS__",e=>Sr=e)}const Rr=n=>{const t=Ge;return Oo(n),n.scope.on(),()=>{n.scope.off(),Oo(t)}},iu=()=>{Ge&&Ge.scope.off(),Oo(null)};function Vf(n){return n.vnode.shapeFlag&4}let Sr=!1;function Mm(n,t=!1,e=!1){t&&ll(t);const{props:i,children:s}=n.vnode,r=Vf(n);tm(n,i,r,t),sm(n,s,e||t);const o=r?Sm(n,t):void 0;return t&&ll(!1),o}function Sm(n,t){const e=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,Np);const{setup:i}=e;if(i){$n();const s=n.setupContext=i.length>1?Em(n):null,r=Rr(n),o=Tr(i,n,0,[n.props,s]),a=Gh(o);if(Kn(),r(),(a||n.sp)&&!fr(n)&&vf(n),a){if(o.then(iu,iu),t)return o.then(l=>{su(n,l)}).catch(l=>{qo(l,n,0)});n.asyncDep=o}else su(n,o)}else Gf(n)}function su(n,t,e){Xt(t)?n.type.__ssrInlineRender?n.ssrRender=t:n.render=t:_e(t)&&(n.setupState=ff(t)),Gf(n)}function Gf(n,t,e){const i=n.type;n.render||(n.render=i.render||Dn);{const s=Rr(n);$n();try{Op(n)}finally{Kn(),s()}}}const ym={get(n,t){return Ne(n,"get",""),n[t]}};function Em(n){const t=e=>{n.exposed=e||{}};return{attrs:new Proxy(n.attrs,ym),slots:n.slots,emit:n.emit,expose:t}}function Jo(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(ff(ap(n.exposed)),{get(t,e){if(e in t)return t[e];if(e in dr)return dr[e](n)},has(t,e){return e in t||e in dr}})):n.proxy}function bm(n){return Xt(n)&&"__vccOpts"in n}const yr=(n,t)=>fp(n,t,Sr),Tm="3.5.25";/** +**/function Lr(n,t,e,i){try{return i?n(...i):n()}catch(s){Jo(s,t,e)}}function In(n,t,e,i){if(Xt(n)){const s=Lr(n,t,e,i);return s&&Yh(s)&&s.catch(r=>{Jo(r,t,e)}),s}if(Vt(n)){const s=[];for(let r=0;r>>1,s=He[i],r=Tr(s);r=Tr(e)?He.push(n):He.splice(xp(t),0,n),n.flags|=1,vf()}}function vf(){No||(No=_f.then(Mf))}function Mp(n){Vt(n)?ws.push(...n):di&&n.id===-1?di.splice(vs+1,0,n):n.flags&1||(ws.push(n),n.flags|=1),vf()}function $c(n,t,e=Tn+1){for(;eTr(e)-Tr(i));if(ws.length=0,di){di.push(...t);return}for(di=t,vs=0;vsn.id==null?n.flags&2?-1:1/0:n.id;function Mf(n){try{for(Tn=0;Tn{i._d&&ru(-1);const r=Oo(t);let o;try{o=n(...s)}finally{Oo(r),i._d&&ru(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Yn(n,t){if(un===null)return n;const e=ia(un),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,bp=Symbol("_leaveCb");function pc(n,t){n.shapeFlag&6&&n.component?(n.transition=t,pc(n.component.subTree,t)):n.shapeFlag&128?(n.ssContent.transition=t.clone(n.ssContent),n.ssFallback.transition=t.clone(n.ssFallback)):n.transition=t}function ks(n,t){return Xt(n)?Fe({name:n.name},t,{setup:n}):n}function yf(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}const Fo=new WeakMap;function gr(n,t,e,i,s=!1){if(Vt(n)){n.forEach((v,M)=>gr(v,t&&(Vt(t)?t[M]:t),e,i,s));return}if(vr(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&gr(n,t,e,i.component.subTree);return}const r=i.shapeFlag&4?ia(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=t&&t.r,u=a.refs===le?a.refs={}:a.refs,h=a.setupState,d=te(h),m=h===le?Xh:v=>ee(d,v);if(c!=null&&c!==l){if(Zc(t),Ee(c))u[c]=null,m(c)&&(h[c]=null);else if(Oe(c)){c.value=null;const v=t;v.k&&(u[v.k]=null)}}if(Xt(l))Lr(l,a,12,[o,u]);else{const v=Ee(l),M=Oe(l);if(v||M){const p=()=>{if(n.f){const f=v?m(l)?h[l]:u[l]:l.value;if(s)Vt(f)&&ic(f,r);else if(Vt(f))f.includes(r)||f.push(r);else if(v)u[l]=[r],m(l)&&(h[l]=u[l]);else{const b=[r];l.value=b,n.k&&(u[n.k]=b)}}else v?(u[l]=o,m(l)&&(h[l]=o)):M&&(l.value=o,n.k&&(u[n.k]=o))};if(o){const f=()=>{p(),Fo.delete(n)};f.id=-1,Fo.set(n,f),tn(f,e)}else Zc(n),p()}}}function Zc(n){const t=Fo.get(n);t&&(t.flags|=8,Fo.delete(n))}$o().requestIdleCallback;$o().cancelIdleCallback;const vr=n=>!!n.type.__asyncLoader,Ef=n=>n.type.__isKeepAlive;function Tp(n,t){bf(n,"a",t)}function wp(n,t){bf(n,"da",t)}function bf(n,t,e=Ve){const i=n.__wdc||(n.__wdc=()=>{let s=e;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(Qo(t,i,e),e){let s=e.parent;for(;s&&s.parent;)Ef(s.parent.vnode)&&Ap(i,t,e,s),s=s.parent}}function Ap(n,t,e,i){const s=Qo(t,n,i,!0);ta(()=>{ic(i[t],s)},e)}function Qo(n,t,e=Ve,i=!1){if(e){const s=e[n]||(e[n]=[]),r=t.__weh||(t.__weh=(...o)=>{Jn();const a=Ir(e),l=In(t,e,n,o);return a(),Qn(),l});return i?s.unshift(r):s.push(r),r}}const ni=n=>(t,e=Ve)=>{(!Ar||n==="sp")&&Qo(n,(...i)=>t(...i),e)},Rp=ni("bm"),mc=ni("m"),Cp=ni("bu"),Pp=ni("u"),Dp=ni("bum"),ta=ni("um"),Lp=ni("sp"),Ip=ni("rtg"),Up=ni("rtc");function Np(n,t=Ve){Qo("ec",n,t)}const Op=Symbol.for("v-ndc"),ol=n=>n?Xf(n)?ia(n):ol(n.parent):null,xr=Fe(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>ol(n.parent),$root:n=>ol(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>wf(n),$forceUpdate:n=>n.f||(n.f=()=>{dc(n.update)}),$nextTick:n=>n.n||(n.n=gf.bind(n.proxy)),$watch:n=>jp.bind(n)}),pa=(n,t)=>n!==le&&!n.__isScriptSetup&&ee(n,t),Fp={get({_:n},t){if(t==="__v_skip")return!0;const{ctx:e,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;if(t[0]!=="$"){const d=o[t];if(d!==void 0)switch(d){case 1:return i[t];case 2:return s[t];case 4:return e[t];case 3:return r[t]}else{if(pa(i,t))return o[t]=1,i[t];if(s!==le&&ee(s,t))return o[t]=2,s[t];if(ee(r,t))return o[t]=3,r[t];if(e!==le&&ee(e,t))return o[t]=4,e[t];al&&(o[t]=0)}}const c=xr[t];let u,h;if(c)return t==="$attrs"&&Ne(n.attrs,"get",""),c(n);if((u=a.__cssModules)&&(u=u[t]))return u;if(e!==le&&ee(e,t))return o[t]=4,e[t];if(h=l.config.globalProperties,ee(h,t))return h[t]},set({_:n},t,e){const{data:i,setupState:s,ctx:r}=n;return pa(s,t)?(s[t]=e,!0):i!==le&&ee(i,t)?(i[t]=e,!0):ee(n.props,t)||t[0]==="$"&&t.slice(1)in n?!1:(r[t]=e,!0)},has({_:{data:n,setupState:t,accessCache:e,ctx:i,appContext:s,props:r,type:o}},a){let l;return!!(e[a]||n!==le&&a[0]!=="$"&&ee(n,a)||pa(t,a)||ee(r,a)||ee(i,a)||ee(xr,a)||ee(s.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(n,t,e){return e.get!=null?n._.accessCache[t]=0:ee(e,"value")&&this.set(n,t,e.value,null),Reflect.defineProperty(n,t,e)}};function Kc(n){return Vt(n)?n.reduce((t,e)=>(t[e]=null,t),{}):n}let al=!0;function Bp(n){const t=wf(n),e=n.proxy,i=n.ctx;al=!1,t.beforeCreate&&Jc(t.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:d,beforeUpdate:m,updated:v,activated:M,deactivated:p,beforeDestroy:f,beforeUnmount:b,destroyed:T,unmounted:S,render:L,renderTracked:D,renderTriggered:P,errorCaptured:y,serverPrefetch:_,expose:g,inheritAttrs:C,components:N,directives:F,filters:K}=t;if(c&&zp(c,i,null),o)for(const W in o){const B=o[W];Xt(B)&&(i[W]=B.bind(e))}if(s){const W=s.call(e,e);me(W)&&(n.data=Ko(W))}if(al=!0,r)for(const W in r){const B=r[W],et=Xt(B)?B.bind(e,e):Xt(B.get)?B.get.bind(e,e):Dn,gt=!Xt(B)&&Xt(B.set)?B.set.bind(e):Dn,X=Rr({get:et,set:gt});Object.defineProperty(i,W,{enumerable:!0,configurable:!0,get:()=>X.value,set:ot=>X.value=ot})}if(a)for(const W in a)Tf(a[W],i,e,W);if(l){const W=Xt(l)?l.call(e):l;Reflect.ownKeys(W).forEach(B=>{Xp(B,W[B])})}u&&Jc(u,n,"c");function Q(W,B){Vt(B)?B.forEach(et=>W(et.bind(e))):B&&W(B.bind(e))}if(Q(Rp,h),Q(mc,d),Q(Cp,m),Q(Pp,v),Q(Tp,M),Q(wp,p),Q(Np,y),Q(Up,D),Q(Ip,P),Q(Dp,b),Q(ta,S),Q(Lp,_),Vt(g))if(g.length){const W=n.exposed||(n.exposed={});g.forEach(B=>{Object.defineProperty(W,B,{get:()=>e[B],set:et=>e[B]=et,enumerable:!0})})}else n.exposed||(n.exposed={});L&&n.render===Dn&&(n.render=L),C!=null&&(n.inheritAttrs=C),N&&(n.components=N),F&&(n.directives=F),_&&yf(n)}function zp(n,t,e=Dn){Vt(n)&&(n=ll(n));for(const i in n){const s=n[i];let r;me(s)?"default"in s?r=Eo(s.from||i,s.default,!0):r=Eo(s.from||i):r=Eo(s),Oe(r)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[i]=r}}function Jc(n,t,e){In(Vt(n)?n.map(i=>i.bind(t.proxy)):n.bind(t.proxy),t,e)}function Tf(n,t,e,i){let s=i.includes(".")?Cf(e,i):()=>e[i];if(Ee(n)){const r=t[n];Xt(r)&&Rs(s,r)}else if(Xt(n))Rs(s,n.bind(e));else if(me(n))if(Vt(n))n.forEach(r=>Tf(r,t,e,i));else{const r=Xt(n.handler)?n.handler.bind(e):t[n.handler];Xt(r)&&Rs(s,r,n)}}function wf(n){const t=n.type,{mixins:e,extends:i}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(t);let l;return a?l=a:!s.length&&!e&&!i?l=t:(l={},s.length&&s.forEach(c=>Bo(l,c,o,!0)),Bo(l,t,o)),me(t)&&r.set(t,l),l}function Bo(n,t,e,i=!1){const{mixins:s,extends:r}=t;r&&Bo(n,r,e,!0),s&&s.forEach(o=>Bo(n,o,e,!0));for(const o in t)if(!(i&&o==="expose")){const a=Hp[o]||e&&e[o];n[o]=a?a(n[o],t[o]):t[o]}return n}const Hp={data:Qc,props:tu,emits:tu,methods:cr,computed:cr,beforeCreate:Be,created:Be,beforeMount:Be,mounted:Be,beforeUpdate:Be,updated:Be,beforeDestroy:Be,beforeUnmount:Be,destroyed:Be,unmounted:Be,activated:Be,deactivated:Be,errorCaptured:Be,serverPrefetch:Be,components:cr,directives:cr,watch:Vp,provide:Qc,inject:kp};function Qc(n,t){return t?n?function(){return Fe(Xt(n)?n.call(this,this):n,Xt(t)?t.call(this,this):t)}:t:n}function kp(n,t){return cr(ll(n),ll(t))}function ll(n){if(Vt(n)){const t={};for(let e=0;e1)return e&&Xt(t)?t.call(i&&i.proxy):t}}const Yp=Symbol.for("v-scx"),qp=()=>Eo(Yp);function Rs(n,t,e){return Rf(n,t,e)}function Rf(n,t,e=le){const{immediate:i,deep:s,flush:r,once:o}=e,a=Fe({},e),l=t&&i||!t&&r!=="post";let c;if(Ar){if(r==="sync"){const m=qp();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!l){const m=()=>{};return m.stop=Dn,m.resume=Dn,m.pause=Dn,m}}const u=Ve;a.call=(m,v,M)=>In(m,u,v,M);let h=!1;r==="post"?a.scheduler=m=>{tn(m,u&&u.suspense)}:r!=="sync"&&(h=!0,a.scheduler=(m,v)=>{v?m():dc(m)}),a.augmentJob=m=>{t&&(m.flags|=4),h&&(m.flags|=2,u&&(m.id=u.uid,m.i=u))};const d=gp(n,t,a);return Ar&&(c?c.push(d):l&&d()),d}function jp(n,t,e){const i=this.proxy,s=Ee(n)?n.includes(".")?Cf(i,n):()=>i[n]:n.bind(i,i);let r;Xt(t)?r=t:(r=t.handler,e=t);const o=Ir(this),a=Rf(s,r.bind(i),e);return o(),a}function Cf(n,t){const e=t.split(".");return()=>{let i=n;for(let s=0;st==="modelValue"||t==="model-value"?n.modelModifiers:n[`${t}Modifiers`]||n[`${yi(t)}Modifiers`]||n[`${Zi(t)}Modifiers`];function Zp(n,t,...e){if(n.isUnmounted)return;const i=n.vnode.props||le;let s=e;const r=t.startsWith("update:"),o=r&&$p(i,t.slice(7));o&&(o.trim&&(s=e.map(u=>Ee(u)?u.trim():u)),o.number&&(s=e.map(jo)));let a,l=i[a=ca(t)]||i[a=ca(yi(t))];!l&&r&&(l=i[a=ca(Zi(t))]),l&&In(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,In(c,n,6,s)}}const Kp=new WeakMap;function Pf(n,t,e=!1){const i=e?Kp:t.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!Xt(n)){const l=c=>{const u=Pf(c,t,!0);u&&(a=!0,Fe(o,u))};!e&&t.mixins.length&&t.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(me(n)&&i.set(n,null),null):(Vt(r)?r.forEach(l=>o[l]=null):Fe(o,r),me(n)&&i.set(n,o),o)}function ea(n,t){return!n||!Xo(t)?!1:(t=t.slice(2).replace(/Once$/,""),ee(n,t[0].toLowerCase()+t.slice(1))||ee(n,Zi(t))||ee(n,t))}function eu(n){const{type:t,vnode:e,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:d,setupState:m,ctx:v,inheritAttrs:M}=n,p=Oo(n);let f,b;try{if(e.shapeFlag&4){const S=s||i,L=S;f=An(c.call(L,S,u,h,m,d,v)),b=a}else{const S=t;f=An(S.length>1?S(h,{attrs:a,slots:o,emit:l}):S(h,null)),b=t.props?a:Jp(a)}}catch(S){Mr.length=0,Jo(S,n,1),f=$e(bi)}let T=f;if(b&&M!==!1){const S=Object.keys(b),{shapeFlag:L}=T;S.length&&L&7&&(r&&S.some(nc)&&(b=Qp(b,r)),T=Is(T,b,!1,!0))}return e.dirs&&(T=Is(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(e.dirs):e.dirs),e.transition&&pc(T,e.transition),f=T,Oo(p),f}const Jp=n=>{let t;for(const e in n)(e==="class"||e==="style"||Xo(e))&&((t||(t={}))[e]=n[e]);return t},Qp=(n,t)=>{const e={};for(const i in n)(!nc(i)||!(i.slice(9)in t))&&(e[i]=n[i]);return e};function tm(n,t,e){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(e&&l>=0){if(l&1024)return!0;if(l&16)return i?nu(i,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let h=0;hObject.create(Df),If=n=>Object.getPrototypeOf(n)===Df;function nm(n,t,e,i=!1){const s={},r=Lf();n.propsDefaults=Object.create(null),Uf(n,t,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);e?n.props=i?s:cp(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function im(n,t,e,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=te(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let h=0;h{l=!0;const[d,m]=Nf(h,t,!0);Fe(o,d),m&&a.push(...m)};!e&&t.mixins.length&&t.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!l)return me(n)&&i.set(n,Es),Es;if(Vt(r))for(let u=0;un==="_"||n==="_ctx"||n==="$stable",gc=n=>Vt(n)?n.map(An):[An(n)],rm=(n,t,e)=>{if(t._n)return t;const i=Sp((...s)=>gc(t(...s)),e);return i._c=!1,i},Of=(n,t,e)=>{const i=n._ctx;for(const s in n){if(_c(s))continue;const r=n[s];if(Xt(r))t[s]=rm(s,r,i);else if(r!=null){const o=gc(r);t[s]=()=>o}}},Ff=(n,t)=>{const e=gc(t);n.slots.default=()=>e},Bf=(n,t,e)=>{for(const i in t)(e||!_c(i))&&(n[i]=t[i])},om=(n,t,e)=>{const i=n.slots=Lf();if(n.vnode.shapeFlag&32){const s=t._;s?(Bf(i,t,e),e&&Zh(i,"_",s,!0)):Of(t,i)}else t&&Ff(n,t)},am=(n,t,e)=>{const{vnode:i,slots:s}=n;let r=!0,o=le;if(i.shapeFlag&32){const a=t._;a?e&&a===1?r=!1:Bf(s,t,e):(r=!t.$stable,Of(t,s)),o=t}else t&&(Ff(n,t),o={default:1});if(r)for(const a in s)!_c(a)&&o[a]==null&&delete s[a]},tn=fm;function lm(n){return cm(n)}function cm(n,t){const e=$o();e.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:d,setScopeId:m=Dn,insertStaticContent:v}=n,M=(R,I,w,tt=null,H=null,j=null,Y=void 0,rt=null,Z=!!I.dynamicChildren)=>{if(R===I)return;R&&!Ks(R,I)&&(tt=ut(R),ot(R,H,j,!0),R=null),I.patchFlag===-2&&(Z=!1,I.dynamicChildren=null);const{type:E,ref:x,shapeFlag:U}=I;switch(E){case na:p(R,I,w,tt);break;case bi:f(R,I,w,tt);break;case _a:R==null&&b(I,w,tt,Y);break;case wn:N(R,I,w,tt,H,j,Y,rt,Z);break;default:U&1?L(R,I,w,tt,H,j,Y,rt,Z):U&6?F(R,I,w,tt,H,j,Y,rt,Z):(U&64||U&128)&&E.process(R,I,w,tt,H,j,Y,rt,Z,Et)}x!=null&&H?gr(x,R&&R.ref,j,I||R,!I):x==null&&R&&R.ref!=null&&gr(R.ref,null,j,R,!0)},p=(R,I,w,tt)=>{if(R==null)i(I.el=a(I.children),w,tt);else{const H=I.el=R.el;I.children!==R.children&&c(H,I.children)}},f=(R,I,w,tt)=>{R==null?i(I.el=l(I.children||""),w,tt):I.el=R.el},b=(R,I,w,tt)=>{[R.el,R.anchor]=v(R.children,I,w,tt,R.el,R.anchor)},T=({el:R,anchor:I},w,tt)=>{let H;for(;R&&R!==I;)H=d(R),i(R,w,tt),R=H;i(I,w,tt)},S=({el:R,anchor:I})=>{let w;for(;R&&R!==I;)w=d(R),s(R),R=w;s(I)},L=(R,I,w,tt,H,j,Y,rt,Z)=>{if(I.type==="svg"?Y="svg":I.type==="math"&&(Y="mathml"),R==null)D(I,w,tt,H,j,Y,rt,Z);else{const E=R.el&&R.el._isVueCE?R.el:null;try{E&&E._beginPatch(),_(R,I,H,j,Y,rt,Z)}finally{E&&E._endPatch()}}},D=(R,I,w,tt,H,j,Y,rt)=>{let Z,E;const{props:x,shapeFlag:U,transition:k,dirs:J}=R;if(Z=R.el=o(R.type,j,x&&x.is,x),U&8?u(Z,R.children):U&16&&y(R.children,Z,null,tt,H,ma(R,j),Y,rt),J&&Ci(R,null,tt,"created"),P(Z,R,R.scopeId,Y,tt),x){for(const _t in x)_t!=="value"&&!pr(_t)&&r(Z,_t,null,x[_t],j,tt);"value"in x&&r(Z,"value",null,x.value,j),(E=x.onVnodeBeforeMount)&&En(E,tt,R)}J&&Ci(R,null,tt,"beforeMount");const q=um(H,k);q&&k.beforeEnter(Z),i(Z,I,w),((E=x&&x.onVnodeMounted)||q||J)&&tn(()=>{E&&En(E,tt,R),q&&k.enter(Z),J&&Ci(R,null,tt,"mounted")},H)},P=(R,I,w,tt,H)=>{if(w&&m(R,w),tt)for(let j=0;j{for(let E=Z;E{const rt=I.el=R.el;let{patchFlag:Z,dynamicChildren:E,dirs:x}=I;Z|=R.patchFlag&16;const U=R.props||le,k=I.props||le;let J;if(w&&Pi(w,!1),(J=k.onVnodeBeforeUpdate)&&En(J,w,I,R),x&&Ci(I,R,w,"beforeUpdate"),w&&Pi(w,!0),(U.innerHTML&&k.innerHTML==null||U.textContent&&k.textContent==null)&&u(rt,""),E?g(R.dynamicChildren,E,rt,w,tt,ma(I,H),j):Y||B(R,I,rt,null,w,tt,ma(I,H),j,!1),Z>0){if(Z&16)C(rt,U,k,w,H);else if(Z&2&&U.class!==k.class&&r(rt,"class",null,k.class,H),Z&4&&r(rt,"style",U.style,k.style,H),Z&8){const q=I.dynamicProps;for(let _t=0;_t{J&&En(J,w,I,R),x&&Ci(I,R,w,"updated")},tt)},g=(R,I,w,tt,H,j,Y)=>{for(let rt=0;rt{if(I!==w){if(I!==le)for(const j in I)!pr(j)&&!(j in w)&&r(R,j,I[j],null,H,tt);for(const j in w){if(pr(j))continue;const Y=w[j],rt=I[j];Y!==rt&&j!=="value"&&r(R,j,rt,Y,H,tt)}"value"in w&&r(R,"value",I.value,w.value,H)}},N=(R,I,w,tt,H,j,Y,rt,Z)=>{const E=I.el=R?R.el:a(""),x=I.anchor=R?R.anchor:a("");let{patchFlag:U,dynamicChildren:k,slotScopeIds:J}=I;J&&(rt=rt?rt.concat(J):J),R==null?(i(E,w,tt),i(x,w,tt),y(I.children||[],w,x,H,j,Y,rt,Z)):U>0&&U&64&&k&&R.dynamicChildren?(g(R.dynamicChildren,k,w,H,j,Y,rt),(I.key!=null||H&&I===H.subTree)&&zf(R,I,!0)):B(R,I,w,x,H,j,Y,rt,Z)},F=(R,I,w,tt,H,j,Y,rt,Z)=>{I.slotScopeIds=rt,R==null?I.shapeFlag&512?H.ctx.activate(I,w,tt,Y,Z):K(I,w,tt,H,j,Y,Z):st(R,I,Z)},K=(R,I,w,tt,H,j,Y)=>{const rt=R.component=Mm(R,tt,H);if(Ef(R)&&(rt.ctx.renderer=Et),ym(rt,!1,Y),rt.asyncDep){if(H&&H.registerDep(rt,Q,Y),!R.el){const Z=rt.subTree=$e(bi);f(null,Z,I,w),R.placeholder=Z.el}}else Q(rt,R,I,w,H,j,Y)},st=(R,I,w)=>{const tt=I.component=R.component;if(tm(R,I,w))if(tt.asyncDep&&!tt.asyncResolved){W(tt,I,w);return}else tt.next=I,tt.update();else I.el=R.el,tt.vnode=I},Q=(R,I,w,tt,H,j,Y)=>{const rt=()=>{if(R.isMounted){let{next:U,bu:k,u:J,parent:q,vnode:_t}=R;{const Mt=Hf(R);if(Mt){U&&(U.el=_t.el,W(R,U,Y)),Mt.asyncDep.then(()=>{R.isUnmounted||rt()});return}}let ht=U,yt;Pi(R,!1),U?(U.el=_t.el,W(R,U,Y)):U=_t,k&&yo(k),(yt=U.props&&U.props.onVnodeBeforeUpdate)&&En(yt,q,U,_t),Pi(R,!0);const Ft=eu(R),pt=R.subTree;R.subTree=Ft,M(pt,Ft,h(pt.el),ut(pt),R,H,j),U.el=Ft.el,ht===null&&em(R,Ft.el),J&&tn(J,H),(yt=U.props&&U.props.onVnodeUpdated)&&tn(()=>En(yt,q,U,_t),H)}else{let U;const{el:k,props:J}=I,{bm:q,m:_t,parent:ht,root:yt,type:Ft}=R,pt=vr(I);Pi(R,!1),q&&yo(q),!pt&&(U=J&&J.onVnodeBeforeMount)&&En(U,ht,I),Pi(R,!0);{yt.ce&&yt.ce._def.shadowRoot!==!1&&yt.ce._injectChildStyle(Ft);const Mt=R.subTree=eu(R);M(null,Mt,w,tt,R,H,j),I.el=Mt.el}if(_t&&tn(_t,H),!pt&&(U=J&&J.onVnodeMounted)){const Mt=I;tn(()=>En(U,ht,Mt),H)}(I.shapeFlag&256||ht&&vr(ht.vnode)&&ht.vnode.shapeFlag&256)&&R.a&&tn(R.a,H),R.isMounted=!0,I=w=tt=null}};R.scope.on();const Z=R.effect=new tf(rt);R.scope.off();const E=R.update=Z.run.bind(Z),x=R.job=Z.runIfDirty.bind(Z);x.i=R,x.id=R.uid,Z.scheduler=()=>dc(x),Pi(R,!0),E()},W=(R,I,w)=>{I.component=R;const tt=R.vnode.props;R.vnode=I,R.next=null,im(R,I.props,tt,w),am(R,I.children,w),Jn(),$c(R),Qn()},B=(R,I,w,tt,H,j,Y,rt,Z=!1)=>{const E=R&&R.children,x=R?R.shapeFlag:0,U=I.children,{patchFlag:k,shapeFlag:J}=I;if(k>0){if(k&128){gt(E,U,w,tt,H,j,Y,rt,Z);return}else if(k&256){et(E,U,w,tt,H,j,Y,rt,Z);return}}J&8?(x&16&&mt(E,H,j),U!==E&&u(w,U)):x&16?J&16?gt(E,U,w,tt,H,j,Y,rt,Z):mt(E,H,j,!0):(x&8&&u(w,""),J&16&&y(U,w,tt,H,j,Y,rt,Z))},et=(R,I,w,tt,H,j,Y,rt,Z)=>{R=R||Es,I=I||Es;const E=R.length,x=I.length,U=Math.min(E,x);let k;for(k=0;kx?mt(R,H,j,!0,!1,U):y(I,w,tt,H,j,Y,rt,Z,U)},gt=(R,I,w,tt,H,j,Y,rt,Z)=>{let E=0;const x=I.length;let U=R.length-1,k=x-1;for(;E<=U&&E<=k;){const J=R[E],q=I[E]=Z?pi(I[E]):An(I[E]);if(Ks(J,q))M(J,q,w,null,H,j,Y,rt,Z);else break;E++}for(;E<=U&&E<=k;){const J=R[U],q=I[k]=Z?pi(I[k]):An(I[k]);if(Ks(J,q))M(J,q,w,null,H,j,Y,rt,Z);else break;U--,k--}if(E>U){if(E<=k){const J=k+1,q=Jk)for(;E<=U;)ot(R[E],H,j,!0),E++;else{const J=E,q=E,_t=new Map;for(E=q;E<=k;E++){const bt=I[E]=Z?pi(I[E]):An(I[E]);bt.key!=null&&_t.set(bt.key,E)}let ht,yt=0;const Ft=k-q+1;let pt=!1,Mt=0;const Lt=new Array(Ft);for(E=0;E=Ft){ot(bt,H,j,!0);continue}let Ht;if(bt.key!=null)Ht=_t.get(bt.key);else for(ht=q;ht<=k;ht++)if(Lt[ht-q]===0&&Ks(bt,I[ht])){Ht=ht;break}Ht===void 0?ot(bt,H,j,!0):(Lt[Ht-q]=E+1,Ht>=Mt?Mt=Ht:pt=!0,M(bt,I[Ht],w,null,H,j,Y,rt,Z),yt++)}const Bt=pt?hm(Lt):Es;for(ht=Bt.length-1,E=Ft-1;E>=0;E--){const bt=q+E,Ht=I[bt],Wt=I[bt+1],ne=bt+1{const{el:j,type:Y,transition:rt,children:Z,shapeFlag:E}=R;if(E&6){X(R.component.subTree,I,w,tt);return}if(E&128){R.suspense.move(I,w,tt);return}if(E&64){Y.move(R,I,w,Et);return}if(Y===wn){i(j,I,w);for(let U=0;Urt.enter(j),H);else{const{leave:U,delayLeave:k,afterLeave:J}=rt,q=()=>{R.ctx.isUnmounted?s(j):i(j,I,w)},_t=()=>{j._isLeaving&&j[bp](!0),U(j,()=>{q(),J&&J()})};k?k(j,q,_t):_t()}else i(j,I,w)},ot=(R,I,w,tt=!1,H=!1)=>{const{type:j,props:Y,ref:rt,children:Z,dynamicChildren:E,shapeFlag:x,patchFlag:U,dirs:k,cacheIndex:J}=R;if(U===-2&&(H=!1),rt!=null&&(Jn(),gr(rt,null,w,R,!0),Qn()),J!=null&&(I.renderCache[J]=void 0),x&256){I.ctx.deactivate(R);return}const q=x&1&&k,_t=!vr(R);let ht;if(_t&&(ht=Y&&Y.onVnodeBeforeUnmount)&&En(ht,I,R),x&6)at(R.component,w,tt);else{if(x&128){R.suspense.unmount(w,tt);return}q&&Ci(R,null,I,"beforeUnmount"),x&64?R.type.remove(R,I,w,Et,tt):E&&!E.hasOnce&&(j!==wn||U>0&&U&64)?mt(E,I,w,!1,!0):(j===wn&&U&384||!H&&x&16)&&mt(Z,I,w),tt&<(R)}(_t&&(ht=Y&&Y.onVnodeUnmounted)||q)&&tn(()=>{ht&&En(ht,I,R),q&&Ci(R,null,I,"unmounted")},w)},lt=R=>{const{type:I,el:w,anchor:tt,transition:H}=R;if(I===wn){$(w,tt);return}if(I===_a){S(R);return}const j=()=>{s(w),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(R.shapeFlag&1&&H&&!H.persisted){const{leave:Y,delayLeave:rt}=H,Z=()=>Y(w,j);rt?rt(R.el,j,Z):Z()}else j()},$=(R,I)=>{let w;for(;R!==I;)w=d(R),s(R),R=w;s(I)},at=(R,I,w)=>{const{bum:tt,scope:H,job:j,subTree:Y,um:rt,m:Z,a:E}=R;su(Z),su(E),tt&&yo(tt),H.stop(),j&&(j.flags|=8,ot(Y,R,I,w)),rt&&tn(rt,I),tn(()=>{R.isUnmounted=!0},I)},mt=(R,I,w,tt=!1,H=!1,j=0)=>{for(let Y=j;Y{if(R.shapeFlag&6)return ut(R.component.subTree);if(R.shapeFlag&128)return R.suspense.next();const I=d(R.anchor||R.el),w=I&&I[yp];return w?d(w):I};let ft=!1;const vt=(R,I,w)=>{R==null?I._vnode&&ot(I._vnode,null,null,!0):M(I._vnode||null,R,I,null,null,null,w),I._vnode=R,ft||(ft=!0,$c(),xf(),ft=!1)},Et={p:M,um:ot,m:X,r:lt,mt:K,mc:y,pc:B,pbc:g,n:ut,o:n};return{render:vt,hydrate:void 0,createApp:Wp(vt)}}function ma({type:n,props:t},e){return e==="svg"&&n==="foreignObject"||e==="mathml"&&n==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:e}function Pi({effect:n,job:t},e){e?(n.flags|=32,t.flags|=4):(n.flags&=-33,t.flags&=-5)}function um(n,t){return(!n||n&&!n.pendingBranch)&&t&&!t.persisted}function zf(n,t,e=!1){const i=n.children,s=t.children;if(Vt(i)&&Vt(s))for(let r=0;r>1,n[e[a]]0&&(t[i]=e[r-1]),e[r]=i)}}for(r=e.length,o=e[r-1];r-- >0;)e[r]=o,o=t[o];return e}function Hf(n){const t=n.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Hf(t)}function su(n){if(n)for(let t=0;tn.__isSuspense;function fm(n,t){t&&t.pendingBranch?Vt(n)?t.effects.push(...n):t.effects.push(n):Mp(n)}const wn=Symbol.for("v-fgt"),na=Symbol.for("v-txt"),bi=Symbol.for("v-cmt"),_a=Symbol.for("v-stc"),Mr=[];let nn=null;function Ki(n=!1){Mr.push(nn=n?null:[])}function dm(){Mr.pop(),nn=Mr[Mr.length-1]||null}let wr=1;function ru(n,t=!1){wr+=n,n<0&&nn&&t&&(nn.hasOnce=!0)}function Vf(n){return n.dynamicChildren=wr>0?nn||Es:null,dm(),wr>0&&nn&&nn.push(n),n}function Vs(n,t,e,i,s,r){return Vf(xt(n,t,e,i,s,r,!0))}function pm(n,t,e,i,s){return Vf($e(n,t,e,i,s,!0))}function Gf(n){return n?n.__v_isVNode===!0:!1}function Ks(n,t){return n.type===t.type&&n.key===t.key}const Wf=({key:n})=>n??null,bo=({ref:n,ref_key:t,ref_for:e})=>(typeof n=="number"&&(n=""+n),n!=null?Ee(n)||Oe(n)||Xt(n)?{i:un,r:n,k:t,f:!!e}:n:null);function xt(n,t=null,e=null,i=0,s=null,r=n===wn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:t,key:t&&Wf(t),ref:t&&bo(t),scopeId:Sf,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:un};return a?(xc(l,e),r&128&&n.normalize(l)):e&&(l.shapeFlag|=Ee(e)?8:16),wr>0&&!o&&nn&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&nn.push(l),l}const $e=mm;function mm(n,t=null,e=null,i=0,s=null,r=!1){if((!n||n===Op)&&(n=bi),Gf(n)){const a=Is(n,t,!0);return e&&xc(a,e),wr>0&&!r&&nn&&(a.shapeFlag&6?nn[nn.indexOf(n)]=a:nn.push(a)),a.patchFlag=-2,a}if(wm(n)&&(n=n.__vccOpts),t){t=_m(t);let{class:a,style:l}=t;a&&!Ee(a)&&(t.class=vi(a)),me(l)&&(fc(l)&&!Vt(l)&&(l=Fe({},l)),t.style=Zo(l))}const o=Ee(n)?1:kf(n)?128:Ep(n)?64:me(n)?4:Xt(n)?2:0;return xt(n,t,e,i,s,o,r,!0)}function _m(n){return n?fc(n)||If(n)?Fe({},n):n:null}function Is(n,t,e=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=t?gm(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&Wf(c),ref:t&&t.ref?e&&r?Vt(r)?r.concat(bo(t)):[r,bo(t)]:bo(t):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:t&&n.type!==wn?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Is(n.ssContent),ssFallback:n.ssFallback&&Is(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&pc(u,l.clone(u)),u}function ul(n=" ",t=0){return $e(na,null,n,t)}function vc(n="",t=!1){return t?(Ki(),pm(bi,null,n)):$e(bi,null,n)}function An(n){return n==null||typeof n=="boolean"?$e(bi):Vt(n)?$e(wn,null,n.slice()):Gf(n)?pi(n):$e(na,null,String(n))}function pi(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Is(n)}function xc(n,t){let e=0;const{shapeFlag:i}=n;if(t==null)t=null;else if(Vt(t))e=16;else if(typeof t=="object")if(i&65){const s=t.default;s&&(s._c&&(s._d=!1),xc(n,s()),s._c&&(s._d=!0));return}else{e=32;const s=t._;!s&&!If(t)?t._ctx=un:s===3&&un&&(un.slots._===1?t._=1:(t._=2,n.patchFlag|=1024))}else Xt(t)?(t={default:t,_ctx:un},e=32):(t=String(t),i&64?(e=16,t=[ul(t)]):e=8);n.children=t,n.shapeFlag|=e}function gm(...n){const t={};for(let e=0;eVe||un;let zo,hl;{const n=$o(),t=(e,i)=>{let s;return(s=n[e])||(s=n[e]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};zo=t("__VUE_INSTANCE_SETTERS__",e=>Ve=e),hl=t("__VUE_SSR_SETTERS__",e=>Ar=e)}const Ir=n=>{const t=Ve;return zo(n),n.scope.on(),()=>{n.scope.off(),zo(t)}},ou=()=>{Ve&&Ve.scope.off(),zo(null)};function Xf(n){return n.vnode.shapeFlag&4}let Ar=!1;function ym(n,t=!1,e=!1){t&&hl(t);const{props:i,children:s}=n.vnode,r=Xf(n);nm(n,i,r,t),om(n,s,e||t);const o=r?Em(n,t):void 0;return t&&hl(!1),o}function Em(n,t){const e=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,Fp);const{setup:i}=e;if(i){Jn();const s=n.setupContext=i.length>1?Tm(n):null,r=Ir(n),o=Lr(i,n,0,[n.props,s]),a=Yh(o);if(Qn(),r(),(a||n.sp)&&!vr(n)&&yf(n),a){if(o.then(ou,ou),t)return o.then(l=>{au(n,l)}).catch(l=>{Jo(l,n,0)});n.asyncDep=o}else au(n,o)}else Yf(n)}function au(n,t,e){Xt(t)?n.type.__ssrInlineRender?n.ssrRender=t:n.render=t:me(t)&&(n.setupState=mf(t)),Yf(n)}function Yf(n,t,e){const i=n.type;n.render||(n.render=i.render||Dn);{const s=Ir(n);Jn();try{Bp(n)}finally{Qn(),s()}}}const bm={get(n,t){return Ne(n,"get",""),n[t]}};function Tm(n){const t=e=>{n.exposed=e||{}};return{attrs:new Proxy(n.attrs,bm),slots:n.slots,emit:n.emit,expose:t}}function ia(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(mf(up(n.exposed)),{get(t,e){if(e in t)return t[e];if(e in xr)return xr[e](n)},has(t,e){return e in t||e in xr}})):n.proxy}function wm(n){return Xt(n)&&"__vccOpts"in n}const Rr=(n,t)=>mp(n,t,Ar),Am="3.5.25";/** * @vue/runtime-dom v3.5.25 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let cl;const ru=typeof window<"u"&&window.trustedTypes;if(ru)try{cl=ru.createPolicy("vue",{createHTML:n=>n})}catch{}const Wf=cl?n=>cl.createHTML(n):n=>n,wm="http://www.w3.org/2000/svg",Am="http://www.w3.org/1998/Math/MathML",Xn=typeof document<"u"?document:null,ou=Xn&&Xn.createElement("template"),Rm={insert:(n,t,e)=>{t.insertBefore(n,e||null)},remove:n=>{const t=n.parentNode;t&&t.removeChild(n)},createElement:(n,t,e,i)=>{const s=t==="svg"?Xn.createElementNS(wm,n):t==="mathml"?Xn.createElementNS(Am,n):e?Xn.createElement(n,{is:e}):Xn.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>Xn.createTextNode(n),createComment:n=>Xn.createComment(n),setText:(n,t)=>{n.nodeValue=t},setElementText:(n,t)=>{n.textContent=t},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Xn.querySelector(n),setScopeId(n,t){n.setAttribute(t,"")},insertStaticContent(n,t,e,i,s,r){const o=e?e.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),e),!(s===r||!(s=s.nextSibling)););else{ou.innerHTML=Wf(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=ou.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,e)}return[o?o.nextSibling:t.firstChild,e?e.previousSibling:t.lastChild]}},Cm=Symbol("_vtc");function Pm(n,t,e){const i=n[Cm];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?n.removeAttribute("class"):e?n.setAttribute("class",t):n.className=t}const au=Symbol("_vod"),Dm=Symbol("_vsh"),Lm=Symbol(""),Im=/(?:^|;)\s*display\s*:/;function Um(n,t,e){const i=n.style,s=Ee(e);let r=!1;if(e&&!s){if(t)if(Ee(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();e[a]==null&&So(i,a,"")}else for(const o in t)e[o]==null&&So(i,o,"");for(const o in e)o==="display"&&(r=!0),So(i,o,e[o])}else if(s){if(t!==e){const o=i[Lm];o&&(e+=";"+o),i.cssText=e,r=Im.test(e)}}else t&&n.removeAttribute("style");au in n&&(n[au]=r?i.display:"",n[Dm]&&(i.display="none"))}const lu=/\s*!important$/;function So(n,t,e){if(Gt(e))e.forEach(i=>So(n,t,i));else if(e==null&&(e=""),t.startsWith("--"))n.setProperty(t,e);else{const i=Nm(n,t);lu.test(e)?n.setProperty(ji(i),e.replace(lu,""),"important"):n[i]=e}}const cu=["Webkit","Moz","ms"],pa={};function Nm(n,t){const e=pa[t];if(e)return e;let i=xi(t);if(i!=="filter"&&i in n)return pa[t]=i;i=Yh(i);for(let s=0;sma||(zm.then(()=>ma=0),ma=Date.now());function km(n,t){const e=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=e.attached)return;In(Vm(i,e.value),t,5,[i])};return e.value=n,e.attached=Hm(),e}function Vm(n,t){if(Gt(t)){const e=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{e.call(n),n._stopped=!0},t.map(i=>s=>!s._stopped&&i&&i(s))}else return t}const mu=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,Gm=(n,t,e,i,s,r)=>{const o=s==="svg";t==="class"?Pm(n,i,o):t==="style"?Um(n,e,i):Go(t)?Ql(t)||Fm(n,t,e,i,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Wm(n,t,i,o))?(fu(n,t,i),!n.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&hu(n,t,i,o,r,t!=="value")):n._isVueCE&&(/[A-Z]/.test(t)||!Ee(i))?fu(n,xi(t),i,r,t):(t==="true-value"?n._trueValue=i:t==="false-value"&&(n._falseValue=i),hu(n,t,i,o))};function Wm(n,t,e,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in n&&mu(t)&&Xt(e));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&n.tagName==="IFRAME"||t==="form"||t==="list"&&n.tagName==="INPUT"||t==="type"&&n.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return mu(t)&&Ee(e)?!1:t in n}const Fo=n=>{const t=n.props["onUpdate:modelValue"]||!1;return Gt(t)?e=>go(t,e):t};function Xm(n){n.target.composing=!0}function _u(n){const t=n.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bs=Symbol("_assign");function gu(n,t,e){return t&&(n=n.trim()),e&&(n=nc(n)),n}const Or={created(n,{modifiers:{lazy:t,trim:e,number:i}},s){n[bs]=Fo(s);const r=i||s.props&&s.props.type==="number";Bi(n,t?"change":"input",o=>{o.target.composing||n[bs](gu(n.value,e,r))}),(e||r)&&Bi(n,"change",()=>{n.value=gu(n.value,e,r)}),t||(Bi(n,"compositionstart",Xm),Bi(n,"compositionend",_u),Bi(n,"change",_u))},mounted(n,{value:t}){n.value=t??""},beforeUpdate(n,{value:t,oldValue:e,modifiers:{lazy:i,trim:s,number:r}},o){if(n[bs]=Fo(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?nc(n.value):n.value,l=t??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&t===e||s&&n.value.trim()===l)||(n.value=l))}},vu={created(n,{value:t},e){n.checked=Po(t,e.props.value),n[bs]=Fo(e),Bi(n,"change",()=>{n[bs](Ym(n))})},beforeUpdate(n,{value:t,oldValue:e},i){n[bs]=Fo(i),t!==e&&(n.checked=Po(t,i.props.value))}};function Ym(n){return"_value"in n?n._value:n.value}const qm=Fe({patchProp:Gm},Rm);let xu;function jm(){return xu||(xu=om(qm))}const Zm=((...n)=>{const t=jm().createApp(...n),{mount:e}=t;return t.mount=i=>{const s=Km(i);if(!s)return;const r=t._component;!Xt(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=e(s,!1,$m(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function $m(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function Km(n){return Ee(n)?document.querySelector(n):n}function Xf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var yo={exports:{}};/* @license +**/let fl;const lu=typeof window<"u"&&window.trustedTypes;if(lu)try{fl=lu.createPolicy("vue",{createHTML:n=>n})}catch{}const qf=fl?n=>fl.createHTML(n):n=>n,Rm="http://www.w3.org/2000/svg",Cm="http://www.w3.org/1998/Math/MathML",Xn=typeof document<"u"?document:null,cu=Xn&&Xn.createElement("template"),Pm={insert:(n,t,e)=>{t.insertBefore(n,e||null)},remove:n=>{const t=n.parentNode;t&&t.removeChild(n)},createElement:(n,t,e,i)=>{const s=t==="svg"?Xn.createElementNS(Rm,n):t==="mathml"?Xn.createElementNS(Cm,n):e?Xn.createElement(n,{is:e}):Xn.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>Xn.createTextNode(n),createComment:n=>Xn.createComment(n),setText:(n,t)=>{n.nodeValue=t},setElementText:(n,t)=>{n.textContent=t},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Xn.querySelector(n),setScopeId(n,t){n.setAttribute(t,"")},insertStaticContent(n,t,e,i,s,r){const o=e?e.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),e),!(s===r||!(s=s.nextSibling)););else{cu.innerHTML=qf(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=cu.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,e)}return[o?o.nextSibling:t.firstChild,e?e.previousSibling:t.lastChild]}},Dm=Symbol("_vtc");function Lm(n,t,e){const i=n[Dm];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?n.removeAttribute("class"):e?n.setAttribute("class",t):n.className=t}const uu=Symbol("_vod"),Im=Symbol("_vsh"),Um=Symbol(""),Nm=/(?:^|;)\s*display\s*:/;function Om(n,t,e){const i=n.style,s=Ee(e);let r=!1;if(e&&!s){if(t)if(Ee(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();e[a]==null&&To(i,a,"")}else for(const o in t)e[o]==null&&To(i,o,"");for(const o in e)o==="display"&&(r=!0),To(i,o,e[o])}else if(s){if(t!==e){const o=i[Um];o&&(e+=";"+o),i.cssText=e,r=Nm.test(e)}}else t&&n.removeAttribute("style");uu in n&&(n[uu]=r?i.display:"",n[Im]&&(i.display="none"))}const hu=/\s*!important$/;function To(n,t,e){if(Vt(e))e.forEach(i=>To(n,t,i));else if(e==null&&(e=""),t.startsWith("--"))n.setProperty(t,e);else{const i=Fm(n,t);hu.test(e)?n.setProperty(Zi(i),e.replace(hu,""),"important"):n[i]=e}}const fu=["Webkit","Moz","ms"],ga={};function Fm(n,t){const e=ga[t];if(e)return e;let i=yi(t);if(i!=="filter"&&i in n)return ga[t]=i;i=$h(i);for(let s=0;sva||(km.then(()=>va=0),va=Date.now());function Gm(n,t){const e=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=e.attached)return;In(Wm(i,e.value),t,5,[i])};return e.value=n,e.attached=Vm(),e}function Wm(n,t){if(Vt(t)){const e=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{e.call(n),n._stopped=!0},t.map(i=>s=>!s._stopped&&i&&i(s))}else return t}const vu=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,Xm=(n,t,e,i,s,r)=>{const o=s==="svg";t==="class"?Lm(n,i,o):t==="style"?Om(n,e,i):Xo(t)?nc(t)||zm(n,t,e,i,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Ym(n,t,i,o))?(mu(n,t,i),!n.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&pu(n,t,i,o,r,t!=="value")):n._isVueCE&&(/[A-Z]/.test(t)||!Ee(i))?mu(n,yi(t),i,r,t):(t==="true-value"?n._trueValue=i:t==="false-value"&&(n._falseValue=i),pu(n,t,i,o))};function Ym(n,t,e,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in n&&vu(t)&&Xt(e));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&n.tagName==="IFRAME"||t==="form"||t==="list"&&n.tagName==="INPUT"||t==="type"&&n.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return vu(t)&&Ee(e)?!1:t in n}const Us=n=>{const t=n.props["onUpdate:modelValue"]||!1;return Vt(t)?e=>yo(t,e):t};function qm(n){n.target.composing=!0}function xu(n){const t=n.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Zn=Symbol("_assign");function Mu(n,t,e){return t&&(n=n.trim()),e&&(n=jo(n)),n}const xs={created(n,{modifiers:{lazy:t,trim:e,number:i}},s){n[Zn]=Us(s);const r=i||s.props&&s.props.type==="number";_i(n,t?"change":"input",o=>{o.target.composing||n[Zn](Mu(n.value,e,r))}),(e||r)&&_i(n,"change",()=>{n.value=Mu(n.value,e,r)}),t||(_i(n,"compositionstart",qm),_i(n,"compositionend",xu),_i(n,"change",xu))},mounted(n,{value:t}){n.value=t??""},beforeUpdate(n,{value:t,oldValue:e,modifiers:{lazy:i,trim:s,number:r}},o){if(n[Zn]=Us(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?jo(n.value):n.value,l=t??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&t===e||s&&n.value.trim()===l)||(n.value=l))}},Su={created(n,{value:t},e){n.checked=Ls(t,e.props.value),n[Zn]=Us(e),_i(n,"change",()=>{n[Zn](Cr(n))})},beforeUpdate(n,{value:t,oldValue:e},i){n[Zn]=Us(i),t!==e&&(n.checked=Ls(t,i.props.value))}},jm={deep:!0,created(n,{value:t,modifiers:{number:e}},i){const s=Yo(t);_i(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>e?jo(Cr(o)):Cr(o));n[Zn](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,gf(()=>{n._assigning=!1})}),n[Zn]=Us(i)},mounted(n,{value:t}){yu(n,t)},beforeUpdate(n,t,e){n[Zn]=Us(e)},updated(n,{value:t}){n._assigning||yu(n,t)}};function yu(n,t){const e=n.multiple,i=Vt(t);if(!(e&&!i&&!Yo(t))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=Vd(t,a)>-1}else o.selected=t.has(a);else if(Ls(Cr(o),t)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!e&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function Cr(n){return"_value"in n?n._value:n.value}const $m=Fe({patchProp:Xm},Pm);let Eu;function Zm(){return Eu||(Eu=lm($m))}const Km=((...n)=>{const t=Zm().createApp(...n),{mount:e}=t;return t.mount=i=>{const s=Qm(i);if(!s)return;const r=t._component;!Xt(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=e(s,!1,Jm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function Jm(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function Qm(n){return Ee(n)?document.querySelector(n):n}function jf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wo={exports:{}};/* @license Papa Parse v5.5.3 https://github.com/mholt/PapaParse License: MIT -*/var Jm=yo.exports,Mu;function Qm(){return Mu||(Mu=1,(function(n,t){((e,i)=>{n.exports=i()})(Jm,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(y){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(_){var g=U(_);g.chunkSize=parseInt(g.chunkSize),_.step||_.chunk||(g.chunkSize=null),this._handle=new M(g),(this._handle.streamer=this)._config=g}).call(this,y),this.parseChunk=function(_,g){var C=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview),o)i.postMessage({results:N,workerId:c.WORKER_ID,finished:C});else if(P(this._config.chunk)&&!g){if(this._config.chunk(N,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=N=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(N.data),this._completeResults.errors=this._completeResults.errors.concat(N.errors),this._completeResults.meta=N.meta),this._completed||!C||!P(this._config.complete)||N&&N.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),C||N&&N.meta.paused||this._nextChunk(),N}this._halted=!0},this._sendError=function(_){P(this._config.error)?this._config.error(_):o&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:_,finished:!1})}}function h(y){var _;(y=y||{}).chunkSize||(y.chunkSize=c.RemoteChunkSize),u.call(this,y),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(g){this._input=g,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),r||(_.onload=D(this._chunkLoaded,this),_.onerror=D(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var g,C=this._config.downloadRequestHeaders;for(g in C)_.setRequestHeader(g,C[g])}var N;this._config.chunkSize&&(N=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+N));try{_.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}r&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize||_.responseText.length,this._finished=!this._config.chunkSize||this._start>=(g=>(g=g.getResponseHeader("Content-Range"))!==null?parseInt(g.substring(g.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(g){g=_.statusText||g,this._sendError(new Error(g))}}function d(y){(y=y||{}).chunkSize||(y.chunkSize=c.LocalChunkSize),u.call(this,y);var _,g,C=typeof FileReader<"u";this.stream=function(N){this._input=N,g=N.slice||N.webkitSlice||N.mozSlice,C?((_=new FileReader).onload=D(this._chunkLoaded,this),_.onerror=D(this._chunkError,this)):_=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(N.target.result)},this._chunkError=function(){this._sendError(_.error)}}function p(y){var _;u.call(this,y=y||{}),this.stream=function(g){return _=g,this._nextChunk()},this._nextChunk=function(){var g,C;if(!this._finished)return g=this._config.chunkSize,_=g?(C=_.substring(0,g),_.substring(g)):(C=_,""),this._finished=!_,this.parseChunk(C)}}function v(y){u.call(this,y=y||{});var _=[],g=!0,C=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(N){this._input=N,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){C&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):g=!0},this._streamData=D(function(N){try{_.push(typeof N=="string"?N:N.toString(this._config.encoding)),g&&(g=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(F){this._streamError(F)}},this),this._streamError=D(function(N){this._streamCleanUp(),this._sendError(N)},this),this._streamEnd=D(function(){this._streamCleanUp(),C=!0,this._streamData("")},this),this._streamCleanUp=D(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function M(y){var _,g,C,N,F=Math.pow(2,53),J=-F,st=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,W=this,B=0,et=0,gt=!1,X=!1,ot=[],lt={data:[],errors:[],meta:{}};function Z(ft){return y.skipEmptyLines==="greedy"?ft.join("").trim()==="":ft.length===1&&ft[0].length===0}function at(){if(lt&&C&&(ut("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),C=!1),y.skipEmptyLines&&(lt.data=lt.data.filter(function(R){return!Z(R)})),mt()){let R=function(L,w){P(y.transformHeader)&&(L=y.transformHeader(L,w)),ot.push(L)};var Tt=R;if(lt)if(Array.isArray(lt.data[0])){for(var ft=0;mt()&&ft($=>(y.dynamicTypingFunction&&y.dynamicTyping[$]===void 0&&(y.dynamicTyping[$]=y.dynamicTypingFunction($)),(y.dynamicTyping[$]||y.dynamicTyping)===!0))(Y)?rt==="true"||rt==="TRUE"||rt!=="false"&&rt!=="FALSE"&&(($=>{if(st.test($)&&($=parseFloat($),J<$&&$=ot.length?"__parsed_extra":ot[tt]:H,j=y.transform?y.transform(j,H):j);H==="__parsed_extra"?(w[H]=w[H]||[],w[H].push(j)):w[H]=j}return y.header&&(tt>ot.length?ut("FieldMismatch","TooManyFields","Too many fields: expected "+ot.length+" fields but parsed "+tt,et+L):tty.preview?g.abort():(lt.data=lt.data[0],N(lt,W))))}),this.parse=function(ft,vt,yt){var Tt=y.quoteChar||'"',Tt=(y.newline||(y.newline=this.guessLineEndings(ft,Tt)),C=!1,y.delimiter?P(y.delimiter)&&(y.delimiter=y.delimiter(ft),lt.meta.delimiter=y.delimiter):((Tt=((R,L,w,tt,H)=>{var j,Y,rt,$;H=H||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var E=0;E=yt.length/2?`\r -`:"\r"}}function m(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function f(y){var _=(y=y||{}).delimiter,g=y.newline,C=y.comments,N=y.step,F=y.preview,J=y.fastMode,st=null,Q=!1,W=y.quoteChar==null?'"':y.quoteChar,B=W;if(y.escapeChar!==void 0&&(B=y.escapeChar),(typeof _!="string"||-1{n.exports=i()})(t_,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(y){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(_){var g=L(_);g.chunkSize=parseInt(g.chunkSize),_.step||_.chunk||(g.chunkSize=null),this._handle=new M(g),(this._handle.streamer=this)._config=g}).call(this,y),this.parseChunk=function(_,g){var C=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview),o)i.postMessage({results:N,workerId:c.WORKER_ID,finished:C});else if(P(this._config.chunk)&&!g){if(this._config.chunk(N,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=N=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(N.data),this._completeResults.errors=this._completeResults.errors.concat(N.errors),this._completeResults.meta=N.meta),this._completed||!C||!P(this._config.complete)||N&&N.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),C||N&&N.meta.paused||this._nextChunk(),N}this._halted=!0},this._sendError=function(_){P(this._config.error)?this._config.error(_):o&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:_,finished:!1})}}function h(y){var _;(y=y||{}).chunkSize||(y.chunkSize=c.RemoteChunkSize),u.call(this,y),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(g){this._input=g,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),r||(_.onload=D(this._chunkLoaded,this),_.onerror=D(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var g,C=this._config.downloadRequestHeaders;for(g in C)_.setRequestHeader(g,C[g])}var N;this._config.chunkSize&&(N=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+N));try{_.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}r&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize||_.responseText.length,this._finished=!this._config.chunkSize||this._start>=(g=>(g=g.getResponseHeader("Content-Range"))!==null?parseInt(g.substring(g.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(g){g=_.statusText||g,this._sendError(new Error(g))}}function d(y){(y=y||{}).chunkSize||(y.chunkSize=c.LocalChunkSize),u.call(this,y);var _,g,C=typeof FileReader<"u";this.stream=function(N){this._input=N,g=N.slice||N.webkitSlice||N.mozSlice,C?((_=new FileReader).onload=D(this._chunkLoaded,this),_.onerror=D(this._chunkError,this)):_=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(N.target.result)},this._chunkError=function(){this._sendError(_.error)}}function m(y){var _;u.call(this,y=y||{}),this.stream=function(g){return _=g,this._nextChunk()},this._nextChunk=function(){var g,C;if(!this._finished)return g=this._config.chunkSize,_=g?(C=_.substring(0,g),_.substring(g)):(C=_,""),this._finished=!_,this.parseChunk(C)}}function v(y){u.call(this,y=y||{});var _=[],g=!0,C=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(N){this._input=N,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){C&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):g=!0},this._streamData=D(function(N){try{_.push(typeof N=="string"?N:N.toString(this._config.encoding)),g&&(g=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(F){this._streamError(F)}},this),this._streamError=D(function(N){this._streamCleanUp(),this._sendError(N)},this),this._streamEnd=D(function(){this._streamCleanUp(),C=!0,this._streamData("")},this),this._streamCleanUp=D(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function M(y){var _,g,C,N,F=Math.pow(2,53),K=-F,st=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,W=this,B=0,et=0,gt=!1,X=!1,ot=[],lt={data:[],errors:[],meta:{}};function $(ft){return y.skipEmptyLines==="greedy"?ft.join("").trim()==="":ft.length===1&&ft[0].length===0}function at(){if(lt&&C&&(ut("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),C=!1),y.skipEmptyLines&&(lt.data=lt.data.filter(function(R){return!$(R)})),mt()){let R=function(I,w){P(y.transformHeader)&&(I=y.transformHeader(I,w)),ot.push(I)};var wt=R;if(lt)if(Array.isArray(lt.data[0])){for(var ft=0;mt()&&ft(Z=>(y.dynamicTypingFunction&&y.dynamicTyping[Z]===void 0&&(y.dynamicTyping[Z]=y.dynamicTypingFunction(Z)),(y.dynamicTyping[Z]||y.dynamicTyping)===!0))(Y)?rt==="true"||rt==="TRUE"||rt!=="false"&&rt!=="FALSE"&&((Z=>{if(st.test(Z)&&(Z=parseFloat(Z),K=ot.length?"__parsed_extra":ot[tt]:H,j=y.transform?y.transform(j,H):j);H==="__parsed_extra"?(w[H]=w[H]||[],w[H].push(j)):w[H]=j}return y.header&&(tt>ot.length?ut("FieldMismatch","TooManyFields","Too many fields: expected "+ot.length+" fields but parsed "+tt,et+I):tty.preview?g.abort():(lt.data=lt.data[0],N(lt,W))))}),this.parse=function(ft,vt,Et){var wt=y.quoteChar||'"',wt=(y.newline||(y.newline=this.guessLineEndings(ft,wt)),C=!1,y.delimiter?P(y.delimiter)&&(y.delimiter=y.delimiter(ft),lt.meta.delimiter=y.delimiter):((wt=((R,I,w,tt,H)=>{var j,Y,rt,Z;H=H||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var E=0;E=Et.length/2?`\r +`:"\r"}}function p(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function f(y){var _=(y=y||{}).delimiter,g=y.newline,C=y.comments,N=y.step,F=y.preview,K=y.fastMode,st=null,Q=!1,W=y.quoteChar==null?'"':y.quoteChar,B=W;if(y.escapeChar!==void 0&&(B=y.escapeChar),(typeof _!="string"||-1=F)return k(!0);break}yt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:vt.length,index:et}),Y++}}else if(C&&Tt.length===0&&X.substring(et,et+ut)===C){if(H===-1)return k();et=H+mt,H=X.indexOf(g,et),tt=X.indexOf(_,et)}else if(tt!==-1&&(tt=F)return k(!0)}return x();function $(q){vt.push(q),R=et}function E(q){var _t=0;return _t=q!==-1&&(q=X.substring(Y+1,q))&&q.trim()===""?q.length:_t}function x(q){return lt||(q===void 0&&(q=X.substring(et)),Tt.push(q),et=Z,$(Tt),ft&&K()),k()}function I(q){et=q,$(Tt),Tt=[],H=X.indexOf(g,et)}function k(q){if(y.header&&!ot&&vt.length&&!Q){var _t=vt[0],ht=Object.create(null),St=new Set(_t);let Ft=!1;for(let pt=0;pt<_t.length;pt++){let xt=_t[pt];if(ht[xt=P(y.transformHeader)?y.transformHeader(xt,pt):xt]){let Lt,Bt=ht[xt];for(;Lt=xt+"_"+Bt,Bt++,St.has(Lt););St.add(Lt),_t[pt]=Lt,ht[xt]++,Ft=!0,(st=st===null?{}:st)[Lt]=xt}else ht[xt]=1,_t[pt]=xt;St.add(xt)}Ft&&console.warn("Duplicate headers found and renamed."),Q=!0}return{data:vt,errors:yt,meta:{delimiter:_,linebreak:g,aborted:gt,truncated:!!q,cursor:R+(ot||0),renamedHeaders:st}}}function K(){N(k()),vt=[],yt=[]}},this.abort=function(){gt=!0},this.getCharIndex=function(){return et}}function T(y){var _=y.data,g=a[_.workerId],C=!1;if(_.error)g.userError(_.error,_.file);else if(_.results&&_.results.data){var N={abort:function(){C=!0,b(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(P(g.userStep)){for(var F=0;F<_.results.data.length&&(g.userStep({data:_.results.data[F],errors:_.results.errors,meta:_.results.meta},N),!C);F++);delete _.results}else P(g.userChunk)&&(g.userChunk(_.results,N,_.file),delete _.results)}_.finished&&!C&&b(_.workerId,_.results)}function b(y,_){var g=a[y];P(g.userComplete)&&g.userComplete(_),g.terminate(),delete a[y]}function S(){throw new Error("Not implemented.")}function U(y){if(typeof y!="object"||y===null)return y;var _,g=Array.isArray(y)?[]:{};for(_ in y)g[_]=U(y[_]);return g}function D(y,_){return function(){y.apply(_,arguments)}}function P(y){return typeof y=="function"}return c.parse=function(y,_){var g=(_=_||{}).dynamicTyping||!1;if(P(g)&&(_.dynamicTypingFunction=g,g={}),_.dynamicTyping=g,_.transform=!!P(_.transform)&&_.transform,!_.worker||!c.WORKERS_SUPPORTED)return g=null,c.NODE_STREAM_INPUT,typeof y=="string"?(y=(C=>C.charCodeAt(0)!==65279?C:C.slice(1))(y),g=new(_.download?h:p)(_)):y.readable===!0&&P(y.read)&&P(y.on)?g=new v(_):(i.File&&y instanceof File||y instanceof Object)&&(g=new d(_)),g.stream(y);(g=(()=>{var C;return!!c.WORKERS_SUPPORTED&&(C=(()=>{var N=i.URL||i.webkitURL||null,F=e.toString();return c.BLOB_URL||(c.BLOB_URL=N.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",F,")();"],{type:"text/javascript"})))})(),(C=new i.Worker(C)).onmessage=T,C.id=l++,a[C.id]=C)})()).userStep=_.step,g.userChunk=_.chunk,g.userComplete=_.complete,g.userError=_.error,_.step=P(_.step),_.chunk=P(_.chunk),_.complete=P(_.complete),_.error=P(_.error),delete _.worker,g.postMessage({input:y,config:_,workerId:g.id})},c.unparse=function(y,_){var g=!1,C=!0,N=",",F=`\r -`,J='"',st=J+J,Q=!1,W=null,B=!1,et=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||c.BAD_DELIMITERS.filter(function(ot){return _.delimiter.indexOf(ot)!==-1}).length||(N=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(g=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(Q=_.skipEmptyLines),typeof _.newline=="string"&&(F=_.newline),typeof _.quoteChar=="string"&&(J=_.quoteChar),typeof _.header=="boolean"&&(C=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");W=_.columns}_.escapeChar!==void 0&&(st=_.escapeChar+J),_.escapeFormulae instanceof RegExp?B=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(B=/^[=+\-@\t\r].*$/)}})(),new RegExp(m(J),"g"));if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return gt(null,y,Q);if(typeof y[0]=="object")return gt(W||Object.keys(y[0]),y,Q)}else if(typeof y=="object")return typeof y.data=="string"&&(y.data=JSON.parse(y.data)),Array.isArray(y.data)&&(y.fields||(y.fields=y.meta&&y.meta.fields||W),y.fields||(y.fields=Array.isArray(y.data[0])?y.fields:typeof y.data[0]=="object"?Object.keys(y.data[0]):[]),Array.isArray(y.data[0])||typeof y.data[0]=="object"||(y.data=[y.data])),gt(y.fields||[],y.data||[],Q);throw new Error("Unable to serialize unrecognized input");function gt(ot,lt,Z){var at="",mt=(typeof ot=="string"&&(ot=JSON.parse(ot)),typeof lt=="string"&&(lt=JSON.parse(lt)),Array.isArray(ot)&&0{for(var ft=0;ft({state:me,selectedBuilding:o_,togglePlay:()=>{me.value.isPlaying=!me.value.isPlaying},setSpeed:c=>{me.value.speed=c},loadBuildingData:(c,u)=>{let h=u;return me.value.dataBaseUrl&&(h=(me.value.dataBaseUrl.endsWith("/")?me.value.dataBaseUrl:me.value.dataBaseUrl+"/")+u),new Promise((d,p)=>{e_.parse(h,{download:!0,header:!0,dynamicTyping:!0,complete:v=>{d(v.data)},error:v=>{p(v)}})})},updateTime:c=>{if(me.value.simulationMode==="live"){const p=new Date;me.value.currentTime=p.getHours()+p.getMinutes()/60+p.getSeconds()/3600}else{if(!me.value.isPlaying)return;me.value.currentTime+=c*me.value.speed,me.value.currentTime>=24&&(me.value.currentTime=0,me.value.day++)}const u=me.value.currentTime;let h=4e3;u>17&&u<23&&(h+=2e3*Math.sin((u-17)/6*Math.PI)),u>6&&u<9&&(h+=1e3*Math.sin((u-6)/3*Math.PI));let d=0;u>6&&u<18&&(d=3500*Math.sin((u-6)/12*Math.PI)),me.value.totalConsumption=Math.floor(h),me.value.totalGeneration=Math.floor(d)},setDataBaseUrl:c=>{me.value.dataBaseUrl=c},setBrightness:c=>{me.value.brightness=c},setSimulationMode:c=>{me.value.simulationMode=c,c==="live"&&(me.value.isPlaying=!0)},setMaxZoom:c=>{me.value.maxZoom=c},setZoomSensitivity:c=>{me.value.zoomSensitivity=c}});/** +`);var et=0,gt=!1;this.parse=function(X,ot,lt){if(typeof X!="string")throw new Error("Input must be a string");var $=X.length,at=_.length,mt=g.length,ut=C.length,ft=P(N),vt=[],Et=[],wt=[],R=et=0;if(!X)return k();if(K||K!==!1&&X.indexOf(W)===-1){for(var I=X.split(g),w=0;w=F)return k(!0);break}Et.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:vt.length,index:et}),Y++}}else if(C&&wt.length===0&&X.substring(et,et+ut)===C){if(H===-1)return k();et=H+mt,H=X.indexOf(g,et),tt=X.indexOf(_,et)}else if(tt!==-1&&(tt=F)return k(!0)}return x();function Z(q){vt.push(q),R=et}function E(q){var _t=0;return _t=q!==-1&&(q=X.substring(Y+1,q))&&q.trim()===""?q.length:_t}function x(q){return lt||(q===void 0&&(q=X.substring(et)),wt.push(q),et=$,Z(wt),ft&&J()),k()}function U(q){et=q,Z(wt),wt=[],H=X.indexOf(g,et)}function k(q){if(y.header&&!ot&&vt.length&&!Q){var _t=vt[0],ht=Object.create(null),yt=new Set(_t);let Ft=!1;for(let pt=0;pt<_t.length;pt++){let Mt=_t[pt];if(ht[Mt=P(y.transformHeader)?y.transformHeader(Mt,pt):Mt]){let Lt,Bt=ht[Mt];for(;Lt=Mt+"_"+Bt,Bt++,yt.has(Lt););yt.add(Lt),_t[pt]=Lt,ht[Mt]++,Ft=!0,(st=st===null?{}:st)[Lt]=Mt}else ht[Mt]=1,_t[pt]=Mt;yt.add(Mt)}Ft&&console.warn("Duplicate headers found and renamed."),Q=!0}return{data:vt,errors:Et,meta:{delimiter:_,linebreak:g,aborted:gt,truncated:!!q,cursor:R+(ot||0),renamedHeaders:st}}}function J(){N(k()),vt=[],Et=[]}},this.abort=function(){gt=!0},this.getCharIndex=function(){return et}}function b(y){var _=y.data,g=a[_.workerId],C=!1;if(_.error)g.userError(_.error,_.file);else if(_.results&&_.results.data){var N={abort:function(){C=!0,T(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(P(g.userStep)){for(var F=0;F<_.results.data.length&&(g.userStep({data:_.results.data[F],errors:_.results.errors,meta:_.results.meta},N),!C);F++);delete _.results}else P(g.userChunk)&&(g.userChunk(_.results,N,_.file),delete _.results)}_.finished&&!C&&T(_.workerId,_.results)}function T(y,_){var g=a[y];P(g.userComplete)&&g.userComplete(_),g.terminate(),delete a[y]}function S(){throw new Error("Not implemented.")}function L(y){if(typeof y!="object"||y===null)return y;var _,g=Array.isArray(y)?[]:{};for(_ in y)g[_]=L(y[_]);return g}function D(y,_){return function(){y.apply(_,arguments)}}function P(y){return typeof y=="function"}return c.parse=function(y,_){var g=(_=_||{}).dynamicTyping||!1;if(P(g)&&(_.dynamicTypingFunction=g,g={}),_.dynamicTyping=g,_.transform=!!P(_.transform)&&_.transform,!_.worker||!c.WORKERS_SUPPORTED)return g=null,c.NODE_STREAM_INPUT,typeof y=="string"?(y=(C=>C.charCodeAt(0)!==65279?C:C.slice(1))(y),g=new(_.download?h:m)(_)):y.readable===!0&&P(y.read)&&P(y.on)?g=new v(_):(i.File&&y instanceof File||y instanceof Object)&&(g=new d(_)),g.stream(y);(g=(()=>{var C;return!!c.WORKERS_SUPPORTED&&(C=(()=>{var N=i.URL||i.webkitURL||null,F=e.toString();return c.BLOB_URL||(c.BLOB_URL=N.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",F,")();"],{type:"text/javascript"})))})(),(C=new i.Worker(C)).onmessage=b,C.id=l++,a[C.id]=C)})()).userStep=_.step,g.userChunk=_.chunk,g.userComplete=_.complete,g.userError=_.error,_.step=P(_.step),_.chunk=P(_.chunk),_.complete=P(_.complete),_.error=P(_.error),delete _.worker,g.postMessage({input:y,config:_,workerId:g.id})},c.unparse=function(y,_){var g=!1,C=!0,N=",",F=`\r +`,K='"',st=K+K,Q=!1,W=null,B=!1,et=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||c.BAD_DELIMITERS.filter(function(ot){return _.delimiter.indexOf(ot)!==-1}).length||(N=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(g=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(Q=_.skipEmptyLines),typeof _.newline=="string"&&(F=_.newline),typeof _.quoteChar=="string"&&(K=_.quoteChar),typeof _.header=="boolean"&&(C=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");W=_.columns}_.escapeChar!==void 0&&(st=_.escapeChar+K),_.escapeFormulae instanceof RegExp?B=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(B=/^[=+\-@\t\r].*$/)}})(),new RegExp(p(K),"g"));if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return gt(null,y,Q);if(typeof y[0]=="object")return gt(W||Object.keys(y[0]),y,Q)}else if(typeof y=="object")return typeof y.data=="string"&&(y.data=JSON.parse(y.data)),Array.isArray(y.data)&&(y.fields||(y.fields=y.meta&&y.meta.fields||W),y.fields||(y.fields=Array.isArray(y.data[0])?y.fields:typeof y.data[0]=="object"?Object.keys(y.data[0]):[]),Array.isArray(y.data[0])||typeof y.data[0]=="object"||(y.data=[y.data])),gt(y.fields||[],y.data||[],Q);throw new Error("Unable to serialize unrecognized input");function gt(ot,lt,$){var at="",mt=(typeof ot=="string"&&(ot=JSON.parse(ot)),typeof lt=="string"&&(lt=JSON.parse(lt)),Array.isArray(ot)&&0{for(var ft=0;ft({state:ue,selectedBuilding:l_,togglePlay:()=>{ue.value.isPlaying=!ue.value.isPlaying},setSpeed:u=>{ue.value.speed=u},loadBuildingData:(u,h)=>{let d=h;return ue.value.dataBaseUrl&&(d=(ue.value.dataBaseUrl.endsWith("/")?ue.value.dataBaseUrl:ue.value.dataBaseUrl+"/")+h),new Promise((m,v)=>{i_.parse(d,{download:!0,header:!0,dynamicTyping:!0,complete:M=>{m(M.data)},error:M=>{v(M)}})})},updateTime:u=>{if(ue.value.simulationMode==="live"){const v=new Date;ue.value.currentTime=v.getHours()+v.getMinutes()/60+v.getSeconds()/3600}else{if(!ue.value.isPlaying)return;ue.value.currentTime+=u*ue.value.speed,ue.value.currentTime>=24&&(ue.value.currentTime=0,ue.value.day++)}const h=ue.value.currentTime;let d=4e3;h>17&&h<23&&(d+=2e3*Math.sin((h-17)/6*Math.PI)),h>6&&h<9&&(d+=1e3*Math.sin((h-6)/3*Math.PI));let m=0;h>6&&h<18&&(m=3500*Math.sin((h-6)/12*Math.PI)),ue.value.totalConsumption=Math.floor(d),ue.value.totalGeneration=Math.floor(m)},setDataBaseUrl:u=>{ue.value.dataBaseUrl=u},setBrightness:u=>{ue.value.brightness=u},setSimulationMode:u=>{ue.value.simulationMode=u,u==="live"&&(ue.value.isPlaying=!0)},setMaxZoom:u=>{ue.value.maxZoom=u},setZoomSensitivity:u=>{ue.value.zoomSensitivity=u},addBuilding:u=>{ue.value.buildings.push(u)}});/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const vc="170",Xi={ROTATE:0,DOLLY:1,PAN:2},_s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},a_=0,Su=1,l_=2,Yf=1,c_=2,Gn=3,yi=0,Ze=1,_n=2,gi=0,Ts=1,yu=2,Eu=3,bu=4,u_=5,zi=100,h_=101,f_=102,d_=103,p_=104,m_=200,__=201,g_=202,v_=203,ul=204,hl=205,x_=206,M_=207,S_=208,y_=209,E_=210,b_=211,T_=212,w_=213,A_=214,fl=0,dl=1,pl=2,Cs=3,ml=4,_l=5,gl=6,vl=7,xc=0,R_=1,C_=2,vi=0,P_=1,D_=2,L_=3,I_=4,U_=5,N_=6,O_=7,qf=300,Ps=301,Ds=302,xl=303,Ml=304,Qo=306,Sl=1e3,Vi=1001,yl=1002,sn=1003,F_=1004,Fr=1005,Cn=1006,_a=1007,Gi=1008,Qn=1009,jf=1010,Zf=1011,Er=1012,Mc=1013,Yi=1014,Pn=1015,Cr=1016,Sc=1017,yc=1018,Ls=1020,$f=35902,Kf=1021,Jf=1022,gn=1023,Qf=1024,td=1025,ws=1026,Is=1027,Ec=1028,bc=1029,ed=1030,Tc=1031,wc=1033,Eo=33776,bo=33777,To=33778,wo=33779,El=35840,bl=35841,Tl=35842,wl=35843,Al=36196,Rl=37492,Cl=37496,Pl=37808,Dl=37809,Ll=37810,Il=37811,Ul=37812,Nl=37813,Ol=37814,Fl=37815,Bl=37816,zl=37817,Hl=37818,kl=37819,Vl=37820,Gl=37821,Ao=36492,Wl=36494,Xl=36495,nd=36283,Yl=36284,ql=36285,jl=36286,B_=3200,z_=3201,id=0,H_=1,pi="",tn="srgb",Fs="srgb-linear",ta="linear",re="srgb",ts=7680,Tu=519,k_=512,V_=513,G_=514,sd=515,W_=516,X_=517,Y_=518,q_=519,wu=35044,Au="300 es",jn=2e3,zo=2001;class Zi{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+De[n>>16&255]+De[n>>24&255]+"-"+De[t&255]+De[t>>8&255]+"-"+De[t>>16&15|64]+De[t>>24&255]+"-"+De[e&63|128]+De[e>>8&255]+"-"+De[e>>16&255]+De[e>>24&255]+De[i&255]+De[i>>8&255]+De[i>>16&255]+De[i>>24&255]).toLowerCase()}function Ve(n,t,e){return Math.max(t,Math.min(e,n))}function j_(n,t){return(n%t+t)%t}function ga(n,t,e){return(1-e)*n+e*t}function Ys(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ye(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Z_={DEG2RAD:mr};class Ht{constructor(t=0,e=0){Ht.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Ve(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*s+t.x,this.y=r*s+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class jt{constructor(t,e,i,s,r,o,a,l,c){jt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,o,a,l,c)}set(t,e,i,s,r,o,a,l,c){const u=this.elements;return u[0]=t,u[1]=s,u[2]=a,u[3]=e,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],p=i[5],v=i[8],M=s[0],m=s[3],f=s[6],T=s[1],b=s[4],S=s[7],U=s[2],D=s[5],P=s[8];return r[0]=o*M+a*T+l*U,r[3]=o*m+a*b+l*D,r[6]=o*f+a*S+l*P,r[1]=c*M+u*T+h*U,r[4]=c*m+u*b+h*D,r[7]=c*f+u*S+h*P,r[2]=d*M+p*T+v*U,r[5]=d*m+p*b+v*D,r[8]=d*f+p*S+v*P,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*o-a*c,d=a*l-u*r,p=c*r-o*l,v=e*h+i*d+s*p;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/v;return t[0]=h*M,t[1]=(s*c-u*i)*M,t[2]=(a*i-s*o)*M,t[3]=d*M,t[4]=(u*e-s*l)*M,t[5]=(s*r-a*e)*M,t[6]=p*M,t[7]=(i*l-c*e)*M,t[8]=(o*e-i*r)*M,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+t,-s*c,s*l,-s*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(va.makeScale(t,e)),this}rotate(t){return this.premultiply(va.makeRotation(-t)),this}translate(t,e){return this.premultiply(va.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<9;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const va=new jt;function rd(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Ho(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function $_(){const n=Ho("canvas");return n.style.display="block",n}const Ru={};function sr(n){n in Ru||(Ru[n]=!0,console.warn(n))}function K_(n,t,e){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:i()}}setTimeout(r,e)})}function J_(n){const t=n.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function Q_(n){const t=n.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const $t={enabled:!0,workingColorSpace:Fs,spaces:{},convert:function(n,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===re&&(n.r=Zn(n.r),n.g=Zn(n.g),n.b=Zn(n.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(n.applyMatrix3(this.spaces[t].toXYZ),n.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===re&&(n.r=As(n.r),n.g=As(n.g),n.b=As(n.b))),n},fromWorkingColorSpace:function(n,t){return this.convert(n,this.workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===pi?ta:this.spaces[n].transfer},getLuminanceCoefficients:function(n,t=this.workingColorSpace){return n.fromArray(this.spaces[t].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,t,e){return n.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace}};function Zn(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function As(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const Cu=[.64,.33,.3,.6,.15,.06],Pu=[.2126,.7152,.0722],Du=[.3127,.329],Lu=new jt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Iu=new jt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);$t.define({[Fs]:{primaries:Cu,whitePoint:Du,transfer:ta,toXYZ:Lu,fromXYZ:Iu,luminanceCoefficients:Pu,workingColorSpaceConfig:{unpackColorSpace:tn},outputColorSpaceConfig:{drawingBufferColorSpace:tn}},[tn]:{primaries:Cu,whitePoint:Du,transfer:re,toXYZ:Lu,fromXYZ:Iu,luminanceCoefficients:Pu,outputColorSpaceConfig:{drawingBufferColorSpace:tn}}});let es;class tg{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{es===void 0&&(es=Ho("canvas")),es.width=t.width,es.height=t.height;const i=es.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=es}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Ho("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==qf)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Sl:t.x=t.x-Math.floor(t.x);break;case Vi:t.x=t.x<0?0:1;break;case yl:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Sl:t.y=t.y-Math.floor(t.y);break;case Vi:t.y=t.y<0?0:1;break;case yl:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}We.DEFAULT_IMAGE=null;We.DEFAULT_MAPPING=qf;We.DEFAULT_ANISOTROPY=1;class xe{constructor(t=0,e=0,i=0,s=1){xe.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*s+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,r;const l=t.elements,c=l[0],u=l[4],h=l[8],d=l[1],p=l[5],v=l[9],M=l[2],m=l[6],f=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-M)<.01&&Math.abs(v-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+M)<.1&&Math.abs(v+m)<.1&&Math.abs(c+p+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,S=(p+1)/2,U=(f+1)/2,D=(u+d)/4,P=(h+M)/4,y=(v+m)/4;return b>S&&b>U?b<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(b),s=D/i,r=P/i):S>U?S<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),i=D/s,r=y/s):U<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(U),i=P/r,s=y/r),this.set(i,s,r,e),this}let T=Math.sqrt((m-v)*(m-v)+(h-M)*(h-M)+(d-u)*(d-u));return Math.abs(T)<.001&&(T=1),this.x=(m-v)/T,this.y=(h-M)/T,this.z=(d-u)/T,this.w=Math.acos((c+p+f-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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}}class ig extends Zi{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new xe(0,0,t,e),this.scissorTest=!1,this.viewport=new xe(0,0,t,e);const s={width:t,height:e,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Cn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new We(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,b=1-f*f;if(b>Number.EPSILON){const U=Math.sqrt(b),D=Math.atan2(U,f*T);m=Math.sin(m*D)/U,a=Math.sin(a*D)/U}const S=a*T;if(l=l*m+d*S,c=c*m+p*S,u=u*m+v*S,h=h*m+M*S,m===1-a){const U=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=U,c*=U,u*=U,h*=U}}t[e]=l,t[e+1]=c,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],h=r[o],d=r[o+1],p=r[o+2],v=r[o+3];return t[e]=a*v+u*h+l*p-c*d,t[e+1]=l*v+u*d+c*h-a*p,t[e+2]=c*v+u*p+a*d-l*h,t[e+3]=u*v-a*h-l*d-c*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),h=a(r/2),d=l(i/2),p=l(s/2),v=l(r/2);switch(o){case"XYZ":this._x=d*u*h+c*p*v,this._y=c*p*h-d*u*v,this._z=c*u*v+d*p*h,this._w=c*u*h-d*p*v;break;case"YXZ":this._x=d*u*h+c*p*v,this._y=c*p*h-d*u*v,this._z=c*u*v-d*p*h,this._w=c*u*h+d*p*v;break;case"ZXY":this._x=d*u*h-c*p*v,this._y=c*p*h+d*u*v,this._z=c*u*v+d*p*h,this._w=c*u*h-d*p*v;break;case"ZYX":this._x=d*u*h-c*p*v,this._y=c*p*h+d*u*v,this._z=c*u*v-d*p*h,this._w=c*u*h+d*p*v;break;case"YZX":this._x=d*u*h+c*p*v,this._y=c*p*h+d*u*v,this._z=c*u*v-d*p*h,this._w=c*u*h-d*p*v;break;case"XZY":this._x=d*u*h-c*p*v,this._y=c*p*h-d*u*v,this._z=c*u*v+d*p*h,this._w=c*u*h+d*p*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=e[8],o=e[1],a=e[5],l=e[9],c=e[2],u=e[6],h=e[10],d=i+a+h;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(u-l)*p,this._y=(r-c)*p,this._z=(o-s)*p}else if(i>a&&i>h){const p=2*Math.sqrt(1+i-a-h);this._w=(u-l)/p,this._x=.25*p,this._y=(s+o)/p,this._z=(r+c)/p}else if(a>h){const p=2*Math.sqrt(1+a-i-h);this._w=(r-c)/p,this._x=(s+o)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+h-i-a);this._w=(o-s)/p,this._x=(r+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Ve(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,s=t._y,r=t._z,o=t._w,a=e._x,l=e._y,c=e._z,u=e._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*t._w+i*t._x+s*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const p=1-e;return this._w=p*o+e*this._w,this._x=p*i+e*this._x,this._y=p*s+e*this._y,this._z=p*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-e)*u)/c,d=Math.sin(e*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=s*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class O{constructor(t=0,e=0,i=0){O.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Uu.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Uu.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*s-a*i),u=2*(a*e-r*s),h=2*(r*i-o*e);return this.x=e+l*c+o*h-a*u,this.y=i+l*u+a*c-r*h,this.z=s+l*h+r*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,r=t.z,o=e.x,a=e.y,l=e.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ma.copy(this).projectOnVector(t),this.sub(Ma)}reflect(t){return this.sub(Ma.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Ve(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ma=new O,Uu=new Ce;class bi{constructor(t=new O(1/0,1/0,1/0),e=new O(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,fn),fn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(qs),zr.subVectors(this.max,qs),ns.subVectors(t.a,qs),is.subVectors(t.b,qs),ss.subVectors(t.c,qs),ii.subVectors(is,ns),si.subVectors(ss,is),Ri.subVectors(ns,ss);let e=[0,-ii.z,ii.y,0,-si.z,si.y,0,-Ri.z,Ri.y,ii.z,0,-ii.x,si.z,0,-si.x,Ri.z,0,-Ri.x,-ii.y,ii.x,0,-si.y,si.x,0,-Ri.y,Ri.x,0];return!Sa(e,ns,is,ss,zr)||(e=[1,0,0,0,1,0,0,0,1],!Sa(e,ns,is,ss,zr))?!1:(Hr.crossVectors(ii,si),e=[Hr.x,Hr.y,Hr.z],Sa(e,ns,is,ss,zr))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,fn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(fn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Fn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Fn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Fn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Fn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Fn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Fn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Fn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Fn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Fn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Fn=[new O,new O,new O,new O,new O,new O,new O,new O],fn=new O,Br=new bi,ns=new O,is=new O,ss=new O,ii=new O,si=new O,Ri=new O,qs=new O,zr=new O,Hr=new O,Ci=new O;function Sa(n,t,e,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Ci.fromArray(n,r);const a=s.x*Math.abs(Ci.x)+s.y*Math.abs(Ci.y)+s.z*Math.abs(Ci.z),l=t.dot(Ci),c=e.dot(Ci),u=i.dot(Ci);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const rg=new bi,js=new O,ya=new O;class Bs{constructor(t=new O,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):rg.setFromPoints(t).getCenter(i);let s=0;for(let r=0,o=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;js.subVectors(t,this.center);const e=js.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(js,s/i),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ya.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(js.copy(t.center).add(ya)),this.expandByPoint(js.copy(t.center).sub(ya))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Bn=new O,Ea=new O,kr=new O,ri=new O,ba=new O,Vr=new O,Ta=new O;class ea{constructor(t=new O,e=new O(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Bn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Bn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Bn.copy(this.origin).addScaledVector(this.direction,e),Bn.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){Ea.copy(t).add(e).multiplyScalar(.5),kr.copy(e).sub(t).normalize(),ri.copy(this.origin).sub(Ea);const r=t.distanceTo(e)*.5,o=-this.direction.dot(kr),a=ri.dot(this.direction),l=-ri.dot(kr),c=ri.lengthSq(),u=Math.abs(1-o*o);let h,d,p,v;if(u>0)if(h=o*l-a,d=o*a-l,v=r*u,h>=0)if(d>=-v)if(d<=v){const M=1/u;h*=M,d*=M,p=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;else d=-r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;else d<=-v?(h=Math.max(0,-(-o*r+a)),d=h>0?-r:Math.min(Math.max(-r,-l),r),p=-h*h+d*(d+2*l)+c):d<=v?(h=0,d=Math.min(Math.max(-r,-l),r),p=d*(d+2*l)+c):(h=Math.max(0,-(o*r+a)),d=h>0?r:Math.min(Math.max(-r,-l),r),p=-h*h+d*(d+2*l)+c);else d=o>0?-r:r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),s&&s.copy(Ea).addScaledVector(kr,d),p}intersectSphere(t,e){Bn.subVectors(t.center,this.origin);const i=Bn.dot(this.direction),s=Bn.dot(Bn)-i*i,r=t.radius*t.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(t.min.x-d.x)*c,s=(t.max.x-d.x)*c):(i=(t.max.x-d.x)*c,s=(t.min.x-d.x)*c),u>=0?(r=(t.min.y-d.y)*u,o=(t.max.y-d.y)*u):(r=(t.max.y-d.y)*u,o=(t.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(t.min.z-d.z)*h,l=(t.max.z-d.z)*h):(a=(t.max.z-d.z)*h,l=(t.min.z-d.z)*h),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,Bn)!==null}intersectTriangle(t,e,i,s,r){ba.subVectors(e,t),Vr.subVectors(i,t),Ta.crossVectors(ba,Vr);let o=this.direction.dot(Ta),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ri.subVectors(this.origin,t);const l=a*this.direction.dot(Vr.crossVectors(ri,Vr));if(l<0)return null;const c=a*this.direction.dot(ba.cross(ri));if(c<0||l+c>o)return null;const u=-a*ri.dot(Ta);return u<0?null:this.at(u/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class se{constructor(t,e,i,s,r,o,a,l,c,u,h,d,p,v,M,m){se.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,o,a,l,c,u,h,d,p,v,M,m)}set(t,e,i,s,r,o,a,l,c,u,h,d,p,v,M,m){const f=this.elements;return f[0]=t,f[4]=e,f[8]=i,f[12]=s,f[1]=r,f[5]=o,f[9]=a,f[13]=l,f[2]=c,f[6]=u,f[10]=h,f[14]=d,f[3]=p,f[7]=v,f[11]=M,f[15]=m,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 se().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,s=1/rs.setFromMatrixColumn(t,0).length(),r=1/rs.setFromMatrixColumn(t,1).length(),o=1/rs.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,s=t.y,r=t.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),h=Math.sin(r);if(t.order==="XYZ"){const d=o*u,p=o*h,v=a*u,M=a*h;e[0]=l*u,e[4]=-l*h,e[8]=c,e[1]=p+v*c,e[5]=d-M*c,e[9]=-a*l,e[2]=M-d*c,e[6]=v+p*c,e[10]=o*l}else if(t.order==="YXZ"){const d=l*u,p=l*h,v=c*u,M=c*h;e[0]=d+M*a,e[4]=v*a-p,e[8]=o*c,e[1]=o*h,e[5]=o*u,e[9]=-a,e[2]=p*a-v,e[6]=M+d*a,e[10]=o*l}else if(t.order==="ZXY"){const d=l*u,p=l*h,v=c*u,M=c*h;e[0]=d-M*a,e[4]=-o*h,e[8]=v+p*a,e[1]=p+v*a,e[5]=o*u,e[9]=M-d*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){const d=o*u,p=o*h,v=a*u,M=a*h;e[0]=l*u,e[4]=v*c-p,e[8]=d*c+M,e[1]=l*h,e[5]=M*c+d,e[9]=p*c-v,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){const d=o*l,p=o*c,v=a*l,M=a*c;e[0]=l*u,e[4]=M-d*h,e[8]=v*h+p,e[1]=h,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=p*h+v,e[10]=d-M*h}else if(t.order==="XZY"){const d=o*l,p=o*c,v=a*l,M=a*c;e[0]=l*u,e[4]=-h,e[8]=c*u,e[1]=d*h+M,e[5]=o*u,e[9]=p*h-v,e[2]=v*h-p,e[6]=a*u,e[10]=M*h+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(og,t,ag)}lookAt(t,e,i){const s=this.elements;return Ke.subVectors(t,e),Ke.lengthSq()===0&&(Ke.z=1),Ke.normalize(),oi.crossVectors(i,Ke),oi.lengthSq()===0&&(Math.abs(i.z)===1?Ke.x+=1e-4:Ke.z+=1e-4,Ke.normalize(),oi.crossVectors(i,Ke)),oi.normalize(),Gr.crossVectors(Ke,oi),s[0]=oi.x,s[4]=Gr.x,s[8]=Ke.x,s[1]=oi.y,s[5]=Gr.y,s[9]=Ke.y,s[2]=oi.z,s[6]=Gr.z,s[10]=Ke.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],p=i[13],v=i[2],M=i[6],m=i[10],f=i[14],T=i[3],b=i[7],S=i[11],U=i[15],D=s[0],P=s[4],y=s[8],_=s[12],g=s[1],C=s[5],N=s[9],F=s[13],J=s[2],st=s[6],Q=s[10],W=s[14],B=s[3],et=s[7],gt=s[11],X=s[15];return r[0]=o*D+a*g+l*J+c*B,r[4]=o*P+a*C+l*st+c*et,r[8]=o*y+a*N+l*Q+c*gt,r[12]=o*_+a*F+l*W+c*X,r[1]=u*D+h*g+d*J+p*B,r[5]=u*P+h*C+d*st+p*et,r[9]=u*y+h*N+d*Q+p*gt,r[13]=u*_+h*F+d*W+p*X,r[2]=v*D+M*g+m*J+f*B,r[6]=v*P+M*C+m*st+f*et,r[10]=v*y+M*N+m*Q+f*gt,r[14]=v*_+M*F+m*W+f*X,r[3]=T*D+b*g+S*J+U*B,r[7]=T*P+b*C+S*st+U*et,r[11]=T*y+b*N+S*Q+U*gt,r[15]=T*_+b*F+S*W+U*X,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],o=t[1],a=t[5],l=t[9],c=t[13],u=t[2],h=t[6],d=t[10],p=t[14],v=t[3],M=t[7],m=t[11],f=t[15];return v*(+r*l*h-s*c*h-r*a*d+i*c*d+s*a*p-i*l*p)+M*(+e*l*p-e*c*d+r*o*d-s*o*p+s*c*u-r*l*u)+m*(+e*c*h-e*a*p-r*o*h+i*o*p+r*a*u-i*c*u)+f*(-s*a*u-e*l*h+e*a*d+s*o*h-i*o*d+i*l*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],v=t[12],M=t[13],m=t[14],f=t[15],T=h*m*c-M*d*c+M*l*p-a*m*p-h*l*f+a*d*f,b=v*d*c-u*m*c-v*l*p+o*m*p+u*l*f-o*d*f,S=u*M*c-v*h*c+v*a*p-o*M*p-u*a*f+o*h*f,U=v*h*l-u*M*l-v*a*d+o*M*d+u*a*m-o*h*m,D=e*T+i*b+s*S+r*U;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/D;return t[0]=T*P,t[1]=(M*d*r-h*m*r-M*s*p+i*m*p+h*s*f-i*d*f)*P,t[2]=(a*m*r-M*l*r+M*s*c-i*m*c-a*s*f+i*l*f)*P,t[3]=(h*l*r-a*d*r-h*s*c+i*d*c+a*s*p-i*l*p)*P,t[4]=b*P,t[5]=(u*m*r-v*d*r+v*s*p-e*m*p-u*s*f+e*d*f)*P,t[6]=(v*l*r-o*m*r-v*s*c+e*m*c+o*s*f-e*l*f)*P,t[7]=(o*d*r-u*l*r+u*s*c-e*d*c-o*s*p+e*l*p)*P,t[8]=S*P,t[9]=(v*h*r-u*M*r-v*i*p+e*M*p+u*i*f-e*h*f)*P,t[10]=(o*M*r-v*a*r+v*i*c-e*M*c-o*i*f+e*a*f)*P,t[11]=(u*a*r-o*h*r-u*i*c+e*h*c+o*i*p-e*a*p)*P,t[12]=U*P,t[13]=(u*M*s-v*h*s+v*i*d-e*M*d-u*i*m+e*h*m)*P,t[14]=(v*a*s-o*M*s-v*i*l+e*M*l+o*i*m-e*a*m)*P,t[15]=(o*h*s-u*a*s+u*i*l-e*h*l-o*i*d+e*a*d)*P,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),s=Math.sin(e),r=1-i,o=t.x,a=t.y,l=t.z,c=r*o,u=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+i,u*l-s*o,0,c*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,o){return this.set(1,i,r,0,t,1,o,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,o=e._y,a=e._z,l=e._w,c=r+r,u=o+o,h=a+a,d=r*c,p=r*u,v=r*h,M=o*u,m=o*h,f=a*h,T=l*c,b=l*u,S=l*h,U=i.x,D=i.y,P=i.z;return s[0]=(1-(M+f))*U,s[1]=(p+S)*U,s[2]=(v-b)*U,s[3]=0,s[4]=(p-S)*D,s[5]=(1-(d+f))*D,s[6]=(m+T)*D,s[7]=0,s[8]=(v+b)*P,s[9]=(m-T)*P,s[10]=(1-(d+M))*P,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=rs.set(s[0],s[1],s[2]).length();const o=rs.set(s[4],s[5],s[6]).length(),a=rs.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],dn.copy(this);const c=1/r,u=1/o,h=1/a;return dn.elements[0]*=c,dn.elements[1]*=c,dn.elements[2]*=c,dn.elements[4]*=u,dn.elements[5]*=u,dn.elements[6]*=u,dn.elements[8]*=h,dn.elements[9]*=h,dn.elements[10]*=h,e.setFromRotationMatrix(dn),i.x=r,i.y=o,i.z=a,this}makePerspective(t,e,i,s,r,o,a=jn){const l=this.elements,c=2*r/(e-t),u=2*r/(i-s),h=(e+t)/(e-t),d=(i+s)/(i-s);let p,v;if(a===jn)p=-(o+r)/(o-r),v=-2*o*r/(o-r);else if(a===zo)p=-o/(o-r),v=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,s,r,o,a=jn){const l=this.elements,c=1/(e-t),u=1/(i-s),h=1/(o-r),d=(e+t)*c,p=(i+s)*u;let v,M;if(a===jn)v=(o+r)*h,M=-2*h;else if(a===zo)v=r*h,M=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=M,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<16;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const rs=new O,dn=new se,og=new O(0,0,0),ag=new O(1,1,1),oi=new O,Gr=new O,Ke=new O,Nu=new se,Ou=new Ce;class Sn{constructor(t=0,e=0,i=0,s=Sn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],h=s[2],d=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(Ve(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ve(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ve(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Ve(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ve(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Ve(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Nu.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Nu,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Ou.setFromEuler(this),this.setFromQuaternion(Ou,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Sn.DEFAULT_ORDER="XYZ";class Ac{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),p.length>0&&(i.animations=p),v.length>0&&(i.nodes=v)}return i.object=s,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){pn.subVectors(s,e),Hn.subVectors(i,e),Aa.subVectors(t,e);const o=pn.dot(pn),a=pn.dot(Hn),l=pn.dot(Aa),c=Hn.dot(Hn),u=Hn.dot(Aa),h=o*c-a*a;if(h===0)return r.set(0,0,0),null;const d=1/h,p=(c*l-a*u)*d,v=(o*u-a*l)*d;return r.set(1-p-v,v,p)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,kn)===null?!1:kn.x>=0&&kn.y>=0&&kn.x+kn.y<=1}static getInterpolation(t,e,i,s,r,o,a,l){return this.getBarycoord(t,e,i,s,kn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,kn.x),l.addScaledVector(o,kn.y),l.addScaledVector(a,kn.z),l)}static getInterpolatedAttribute(t,e,i,s,r,o){return Da.setScalar(0),La.setScalar(0),Ia.setScalar(0),Da.fromBufferAttribute(t,e),La.fromBufferAttribute(t,i),Ia.fromBufferAttribute(t,s),o.setScalar(0),o.addScaledVector(Da,r.x),o.addScaledVector(La,r.y),o.addScaledVector(Ia,r.z),o}static isFrontFacing(t,e,i,s){return pn.subVectors(i,e),Hn.subVectors(t,e),pn.cross(Hn).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return pn.subVectors(this.c,this.b),Hn.subVectors(this.a,this.b),pn.cross(Hn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ln.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ln.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return ln.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return ln.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ln.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,r=this.c;let o,a;ls.subVectors(s,i),cs.subVectors(r,i),Ra.subVectors(t,i);const l=ls.dot(Ra),c=cs.dot(Ra);if(l<=0&&c<=0)return e.copy(i);Ca.subVectors(t,s);const u=ls.dot(Ca),h=cs.dot(Ca);if(u>=0&&h<=u)return e.copy(s);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),e.copy(i).addScaledVector(ls,o);Pa.subVectors(t,r);const p=ls.dot(Pa),v=cs.dot(Pa);if(v>=0&&p<=v)return e.copy(r);const M=p*c-l*v;if(M<=0&&c>=0&&v<=0)return a=c/(c-v),e.copy(i).addScaledVector(cs,a);const m=u*v-p*h;if(m<=0&&h-u>=0&&p-v>=0)return Vu.subVectors(r,s),a=(h-u)/(h-u+(p-v)),e.copy(s).addScaledVector(Vu,a);const f=1/(m+M+d);return o=M*f,a=d*f,e.copy(i).addScaledVector(ls,o).addScaledVector(cs,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const ld={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},ai={h:0,s:0,l:0},Xr={h:0,s:0,l:0};function Ua(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class zt{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(e===void 0&&i===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=tn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,$t.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=$t.workingColorSpace){return this.r=t,this.g=e,this.b=i,$t.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=$t.workingColorSpace){if(t=j_(t,1),e=Ve(e,0,1),i=Ve(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,o=2*i-r;this.r=Ua(o,r,t+1/3),this.g=Ua(o,r,t),this.b=Ua(o,r,t-1/3)}return $t.toWorkingColorSpace(this,s),this}setStyle(t,e=tn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=tn){const i=ld[t.toLowerCase()];return i!==void 0?this.setHex(i,e):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}copySRGBToLinear(t){return this.r=Zn(t.r),this.g=Zn(t.g),this.b=Zn(t.b),this}copyLinearToSRGB(t){return this.r=As(t.r),this.g=As(t.g),this.b=As(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=tn){return $t.fromWorkingColorSpace(Le.copy(this),t),Math.round(Ve(Le.r*255,0,255))*65536+Math.round(Ve(Le.g*255,0,255))*256+Math.round(Ve(Le.b*255,0,255))}getHexString(t=tn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=$t.workingColorSpace){$t.fromWorkingColorSpace(Le.copy(this),e);const i=Le.r,s=Le.g,r=Le.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(s-r)/h+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ts&&(i.blending=this.blending),this.side!==yi&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==ul&&(i.blendSrc=this.blendSrc),this.blendDst!==hl&&(i.blendDst=this.blendDst),this.blendEquation!==zi&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Cs&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Tu&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ts&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ts&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ts&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(e){const r=s(t.textures),o=s(t.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(e!==null){const s=e.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Hs extends zs{static get type(){return"MeshBasicMaterial"}constructor(t){super(),this.isMeshBasicMaterial=!0,this.color=new zt(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.envMapRotation=new Sn,this.combine=xc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Se=new O,Yr=new Ht;class Mn{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=wu,this.updateRanges=[],this.gpuType=Pn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bi);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new O(-1/0,-1/0,-1/0),new O(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,s=e.length;i0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(s[l]=u,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const s=t.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(e))}const r=t.morphAttributes;for(const c in r){const u=[],h=r[c];for(let d=0,p=h.length;d0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(t.far-t.near)**2))&&(Gu.copy(r).invert(),Pi.copy(t.ray).applyMatrix4(Gu),!(i.boundingBox!==null&&Pi.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,Pi)))}_computeIntersections(t,e,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,d=r.groups,p=r.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,M=d.length;ve.far?null:{distance:c,point:Jr.clone(),object:n}}function Qr(n,t,e,i,s,r,o,a,l,c){n.getVertexPosition(a,jr),n.getVertexPosition(l,Zr),n.getVertexPosition(c,$r);const u=pg(n,t,e,i,jr,Zr,$r,Xu);if(u){const h=new O;ln.getBarycoord(Xu,jr,Zr,$r,h),s&&(u.uv=ln.getInterpolatedAttribute(s,a,l,c,h,new Ht)),r&&(u.uv1=ln.getInterpolatedAttribute(r,a,l,c,h,new Ht)),o&&(u.normal=ln.getInterpolatedAttribute(o,a,l,c,h,new O),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new O,materialIndex:0};ln.getNormal(jr,Zr,$r,d.normal),u.face=d,u.barycoord=h}return u}class he extends Be{constructor(t=1,e=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],h=[];let d=0,p=0;v("z","y","x",-1,-1,i,e,t,o,r,0),v("z","y","x",1,-1,i,e,-t,o,r,1),v("x","z","y",1,1,t,i,e,s,o,2),v("x","z","y",1,-1,t,i,-e,s,o,3),v("x","y","z",1,-1,t,e,i,s,r,4),v("x","y","z",-1,-1,t,e,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new fe(c,3)),this.setAttribute("normal",new fe(u,3)),this.setAttribute("uv",new fe(h,2));function v(M,m,f,T,b,S,U,D,P,y,_){const g=S/P,C=U/y,N=S/2,F=U/2,J=D/2,st=P+1,Q=y+1;let W=0,B=0;const et=new O;for(let gt=0;gt0?1:-1,u.push(et.x,et.y,et.z),h.push(ot/P),h.push(1-gt/y),W+=1}}for(let gt=0;gt>8&255]+De[n>>16&255]+De[n>>24&255]+"-"+De[t&255]+De[t>>8&255]+"-"+De[t>>16&15|64]+De[t>>24&255]+"-"+De[e&63|128]+De[e>>8&255]+"-"+De[e>>16&255]+De[e>>24&255]+De[i&255]+De[i>>8&255]+De[i>>16&255]+De[i>>24&255]).toLowerCase()}function ke(n,t,e){return Math.max(t,Math.min(e,n))}function Z_(n,t){return(n%t+t)%t}function Ma(n,t,e){return(1-e)*n+e*t}function Js(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ye(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const K_={DEG2RAD:Sr};class zt{constructor(t=0,e=0){zt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ke(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*s+t.x,this.y=r*s+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class jt{constructor(t,e,i,s,r,o,a,l,c){jt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,o,a,l,c)}set(t,e,i,s,r,o,a,l,c){const u=this.elements;return u[0]=t,u[1]=s,u[2]=a,u[3]=e,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],m=i[5],v=i[8],M=s[0],p=s[3],f=s[6],b=s[1],T=s[4],S=s[7],L=s[2],D=s[5],P=s[8];return r[0]=o*M+a*b+l*L,r[3]=o*p+a*T+l*D,r[6]=o*f+a*S+l*P,r[1]=c*M+u*b+h*L,r[4]=c*p+u*T+h*D,r[7]=c*f+u*S+h*P,r[2]=d*M+m*b+v*L,r[5]=d*p+m*T+v*D,r[8]=d*f+m*S+v*P,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*o-a*c,d=a*l-u*r,m=c*r-o*l,v=e*h+i*d+s*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/v;return t[0]=h*M,t[1]=(s*c-u*i)*M,t[2]=(a*i-s*o)*M,t[3]=d*M,t[4]=(u*e-s*l)*M,t[5]=(s*r-a*e)*M,t[6]=m*M,t[7]=(i*l-c*e)*M,t[8]=(o*e-i*r)*M,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+t,-s*c,s*l,-s*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Sa.makeScale(t,e)),this}rotate(t){return this.premultiply(Sa.makeRotation(-t)),this}translate(t,e){return this.premultiply(Sa.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<9;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Sa=new jt;function ld(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Vo(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function J_(){const n=Vo("canvas");return n.style.display="block",n}const Lu={};function ur(n){n in Lu||(Lu[n]=!0,console.warn(n))}function Q_(n,t,e){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:i()}}setTimeout(r,e)})}function tg(n){const t=n.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function eg(n){const t=n.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const Zt={enabled:!0,workingColorSpace:Gs,spaces:{},convert:function(n,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===re&&(n.r=Kn(n.r),n.g=Kn(n.g),n.b=Kn(n.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(n.applyMatrix3(this.spaces[t].toXYZ),n.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===re&&(n.r=Ds(n.r),n.g=Ds(n.g),n.b=Ds(n.b))),n},fromWorkingColorSpace:function(n,t){return this.convert(n,this.workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===gi?ra:this.spaces[n].transfer},getLuminanceCoefficients:function(n,t=this.workingColorSpace){return n.fromArray(this.spaces[t].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,t,e){return n.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace}};function Kn(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ds(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const Iu=[.64,.33,.3,.6,.15,.06],Uu=[.2126,.7152,.0722],Nu=[.3127,.329],Ou=new jt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Fu=new jt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);Zt.define({[Gs]:{primaries:Iu,whitePoint:Nu,transfer:ra,toXYZ:Ou,fromXYZ:Fu,luminanceCoefficients:Uu,workingColorSpaceConfig:{unpackColorSpace:en},outputColorSpaceConfig:{drawingBufferColorSpace:en}},[en]:{primaries:Iu,whitePoint:Nu,transfer:re,toXYZ:Ou,fromXYZ:Fu,luminanceCoefficients:Uu,outputColorSpaceConfig:{drawingBufferColorSpace:en}}});let ss;class ng{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{ss===void 0&&(ss=Vo("canvas")),ss.width=t.width,ss.height=t.height;const i=ss.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=ss}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Vo("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Zf)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case bl:t.x=t.x-Math.floor(t.x);break;case Wi:t.x=t.x<0?0:1;break;case Tl:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case bl:t.y=t.y-Math.floor(t.y);break;case Wi:t.y=t.y<0?0:1;break;case Tl:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Ge.DEFAULT_IMAGE=null;Ge.DEFAULT_MAPPING=Zf;Ge.DEFAULT_ANISOTROPY=1;class xe{constructor(t=0,e=0,i=0,s=1){xe.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*s+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,r;const l=t.elements,c=l[0],u=l[4],h=l[8],d=l[1],m=l[5],v=l[9],M=l[2],p=l[6],f=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-M)<.01&&Math.abs(v-p)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+M)<.1&&Math.abs(v+p)<.1&&Math.abs(c+m+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const T=(c+1)/2,S=(m+1)/2,L=(f+1)/2,D=(u+d)/4,P=(h+M)/4,y=(v+p)/4;return T>S&&T>L?T<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(T),s=D/i,r=P/i):S>L?S<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),i=D/s,r=y/s):L<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(L),i=P/r,s=y/r),this.set(i,s,r,e),this}let b=Math.sqrt((p-v)*(p-v)+(h-M)*(h-M)+(d-u)*(d-u));return Math.abs(b)<.001&&(b=1),this.x=(p-v)/b,this.y=(h-M)/b,this.z=(d-u)/b,this.w=Math.acos((c+m+f-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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}}class rg extends Qi{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new xe(0,0,t,e),this.scissorTest=!1,this.viewport=new xe(0,0,t,e);const s={width:t,height:e,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Cn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new Ge(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,T=1-f*f;if(T>Number.EPSILON){const L=Math.sqrt(T),D=Math.atan2(L,f*b);p=Math.sin(p*D)/L,a=Math.sin(a*D)/L}const S=a*b;if(l=l*p+d*S,c=c*p+m*S,u=u*p+v*S,h=h*p+M*S,p===1-a){const L=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=L,c*=L,u*=L,h*=L}}t[e]=l,t[e+1]=c,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],h=r[o],d=r[o+1],m=r[o+2],v=r[o+3];return t[e]=a*v+u*h+l*m-c*d,t[e+1]=l*v+u*d+c*h-a*m,t[e+2]=c*v+u*m+a*d-l*h,t[e+3]=u*v-a*h-l*d-c*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),h=a(r/2),d=l(i/2),m=l(s/2),v=l(r/2);switch(o){case"XYZ":this._x=d*u*h+c*m*v,this._y=c*m*h-d*u*v,this._z=c*u*v+d*m*h,this._w=c*u*h-d*m*v;break;case"YXZ":this._x=d*u*h+c*m*v,this._y=c*m*h-d*u*v,this._z=c*u*v-d*m*h,this._w=c*u*h+d*m*v;break;case"ZXY":this._x=d*u*h-c*m*v,this._y=c*m*h+d*u*v,this._z=c*u*v+d*m*h,this._w=c*u*h-d*m*v;break;case"ZYX":this._x=d*u*h-c*m*v,this._y=c*m*h+d*u*v,this._z=c*u*v-d*m*h,this._w=c*u*h+d*m*v;break;case"YZX":this._x=d*u*h+c*m*v,this._y=c*m*h+d*u*v,this._z=c*u*v-d*m*h,this._w=c*u*h-d*m*v;break;case"XZY":this._x=d*u*h-c*m*v,this._y=c*m*h-d*u*v,this._z=c*u*v+d*m*h,this._w=c*u*h+d*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=e[8],o=e[1],a=e[5],l=e[9],c=e[2],u=e[6],h=e[10],d=i+a+h;if(d>0){const m=.5/Math.sqrt(d+1);this._w=.25/m,this._x=(u-l)*m,this._y=(r-c)*m,this._z=(o-s)*m}else if(i>a&&i>h){const m=2*Math.sqrt(1+i-a-h);this._w=(u-l)/m,this._x=.25*m,this._y=(s+o)/m,this._z=(r+c)/m}else if(a>h){const m=2*Math.sqrt(1+a-i-h);this._w=(r-c)/m,this._x=(s+o)/m,this._y=.25*m,this._z=(l+u)/m}else{const m=2*Math.sqrt(1+h-i-a);this._w=(o-s)/m,this._x=(r+c)/m,this._y=(l+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ke(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,s=t._y,r=t._z,o=t._w,a=e._x,l=e._y,c=e._z,u=e._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*t._w+i*t._x+s*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-e;return this._w=m*o+e*this._w,this._x=m*i+e*this._x,this._y=m*s+e*this._y,this._z=m*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-e)*u)/c,d=Math.sin(e*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=s*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class O{constructor(t=0,e=0,i=0){O.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Bu.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Bu.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*s-a*i),u=2*(a*e-r*s),h=2*(r*i-o*e);return this.x=e+l*c+o*h-a*u,this.y=i+l*u+a*c-r*h,this.z=s+l*h+r*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,r=t.z,o=e.x,a=e.y,l=e.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ea.copy(this).projectOnVector(t),this.sub(Ea)}reflect(t){return this.sub(Ea.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ke(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ea=new O,Bu=new Ce;class Ai{constructor(t=new O(1/0,1/0,1/0),e=new O(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,dn),dn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Qs),Wr.subVectors(this.max,Qs),rs.subVectors(t.a,Qs),os.subVectors(t.b,Qs),as.subVectors(t.c,Qs),ri.subVectors(os,rs),oi.subVectors(as,os),Di.subVectors(rs,as);let e=[0,-ri.z,ri.y,0,-oi.z,oi.y,0,-Di.z,Di.y,ri.z,0,-ri.x,oi.z,0,-oi.x,Di.z,0,-Di.x,-ri.y,ri.x,0,-oi.y,oi.x,0,-Di.y,Di.x,0];return!ba(e,rs,os,as,Wr)||(e=[1,0,0,0,1,0,0,0,1],!ba(e,rs,os,as,Wr))?!1:(Xr.crossVectors(ri,oi),e=[Xr.x,Xr.y,Xr.z],ba(e,rs,os,as,Wr))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,dn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(dn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Fn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Fn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Fn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Fn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Fn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Fn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Fn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Fn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Fn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Fn=[new O,new O,new O,new O,new O,new O,new O,new O],dn=new O,Gr=new Ai,rs=new O,os=new O,as=new O,ri=new O,oi=new O,Di=new O,Qs=new O,Wr=new O,Xr=new O,Li=new O;function ba(n,t,e,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Li.fromArray(n,r);const a=s.x*Math.abs(Li.x)+s.y*Math.abs(Li.y)+s.z*Math.abs(Li.z),l=t.dot(Li),c=e.dot(Li),u=i.dot(Li);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const ag=new Ai,tr=new O,Ta=new O;class Ws{constructor(t=new O,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):ag.setFromPoints(t).getCenter(i);let s=0;for(let r=0,o=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;tr.subVectors(t,this.center);const e=tr.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(tr,s/i),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Ta.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(tr.copy(t.center).add(Ta)),this.expandByPoint(tr.copy(t.center).sub(Ta))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Bn=new O,wa=new O,Yr=new O,ai=new O,Aa=new O,qr=new O,Ra=new O;class oa{constructor(t=new O,e=new O(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Bn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Bn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Bn.copy(this.origin).addScaledVector(this.direction,e),Bn.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){wa.copy(t).add(e).multiplyScalar(.5),Yr.copy(e).sub(t).normalize(),ai.copy(this.origin).sub(wa);const r=t.distanceTo(e)*.5,o=-this.direction.dot(Yr),a=ai.dot(this.direction),l=-ai.dot(Yr),c=ai.lengthSq(),u=Math.abs(1-o*o);let h,d,m,v;if(u>0)if(h=o*l-a,d=o*a-l,v=r*u,h>=0)if(d>=-v)if(d<=v){const M=1/u;h*=M,d*=M,m=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=r,h=Math.max(0,-(o*d+a)),m=-h*h+d*(d+2*l)+c;else d=-r,h=Math.max(0,-(o*d+a)),m=-h*h+d*(d+2*l)+c;else d<=-v?(h=Math.max(0,-(-o*r+a)),d=h>0?-r:Math.min(Math.max(-r,-l),r),m=-h*h+d*(d+2*l)+c):d<=v?(h=0,d=Math.min(Math.max(-r,-l),r),m=d*(d+2*l)+c):(h=Math.max(0,-(o*r+a)),d=h>0?r:Math.min(Math.max(-r,-l),r),m=-h*h+d*(d+2*l)+c);else d=o>0?-r:r,h=Math.max(0,-(o*d+a)),m=-h*h+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),s&&s.copy(wa).addScaledVector(Yr,d),m}intersectSphere(t,e){Bn.subVectors(t.center,this.origin);const i=Bn.dot(this.direction),s=Bn.dot(Bn)-i*i,r=t.radius*t.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(t.min.x-d.x)*c,s=(t.max.x-d.x)*c):(i=(t.max.x-d.x)*c,s=(t.min.x-d.x)*c),u>=0?(r=(t.min.y-d.y)*u,o=(t.max.y-d.y)*u):(r=(t.max.y-d.y)*u,o=(t.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(t.min.z-d.z)*h,l=(t.max.z-d.z)*h):(a=(t.max.z-d.z)*h,l=(t.min.z-d.z)*h),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,Bn)!==null}intersectTriangle(t,e,i,s,r){Aa.subVectors(e,t),qr.subVectors(i,t),Ra.crossVectors(Aa,qr);let o=this.direction.dot(Ra),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ai.subVectors(this.origin,t);const l=a*this.direction.dot(qr.crossVectors(ai,qr));if(l<0)return null;const c=a*this.direction.dot(Aa.cross(ai));if(c<0||l+c>o)return null;const u=-a*ai.dot(Ra);return u<0?null:this.at(u/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class se{constructor(t,e,i,s,r,o,a,l,c,u,h,d,m,v,M,p){se.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,o,a,l,c,u,h,d,m,v,M,p)}set(t,e,i,s,r,o,a,l,c,u,h,d,m,v,M,p){const f=this.elements;return f[0]=t,f[4]=e,f[8]=i,f[12]=s,f[1]=r,f[5]=o,f[9]=a,f[13]=l,f[2]=c,f[6]=u,f[10]=h,f[14]=d,f[3]=m,f[7]=v,f[11]=M,f[15]=p,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 se().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,s=1/ls.setFromMatrixColumn(t,0).length(),r=1/ls.setFromMatrixColumn(t,1).length(),o=1/ls.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,s=t.y,r=t.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),h=Math.sin(r);if(t.order==="XYZ"){const d=o*u,m=o*h,v=a*u,M=a*h;e[0]=l*u,e[4]=-l*h,e[8]=c,e[1]=m+v*c,e[5]=d-M*c,e[9]=-a*l,e[2]=M-d*c,e[6]=v+m*c,e[10]=o*l}else if(t.order==="YXZ"){const d=l*u,m=l*h,v=c*u,M=c*h;e[0]=d+M*a,e[4]=v*a-m,e[8]=o*c,e[1]=o*h,e[5]=o*u,e[9]=-a,e[2]=m*a-v,e[6]=M+d*a,e[10]=o*l}else if(t.order==="ZXY"){const d=l*u,m=l*h,v=c*u,M=c*h;e[0]=d-M*a,e[4]=-o*h,e[8]=v+m*a,e[1]=m+v*a,e[5]=o*u,e[9]=M-d*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){const d=o*u,m=o*h,v=a*u,M=a*h;e[0]=l*u,e[4]=v*c-m,e[8]=d*c+M,e[1]=l*h,e[5]=M*c+d,e[9]=m*c-v,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){const d=o*l,m=o*c,v=a*l,M=a*c;e[0]=l*u,e[4]=M-d*h,e[8]=v*h+m,e[1]=h,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=m*h+v,e[10]=d-M*h}else if(t.order==="XZY"){const d=o*l,m=o*c,v=a*l,M=a*c;e[0]=l*u,e[4]=-h,e[8]=c*u,e[1]=d*h+M,e[5]=o*u,e[9]=m*h-v,e[2]=v*h-m,e[6]=a*u,e[10]=M*h+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(lg,t,cg)}lookAt(t,e,i){const s=this.elements;return Je.subVectors(t,e),Je.lengthSq()===0&&(Je.z=1),Je.normalize(),li.crossVectors(i,Je),li.lengthSq()===0&&(Math.abs(i.z)===1?Je.x+=1e-4:Je.z+=1e-4,Je.normalize(),li.crossVectors(i,Je)),li.normalize(),jr.crossVectors(Je,li),s[0]=li.x,s[4]=jr.x,s[8]=Je.x,s[1]=li.y,s[5]=jr.y,s[9]=Je.y,s[2]=li.z,s[6]=jr.z,s[10]=Je.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],m=i[13],v=i[2],M=i[6],p=i[10],f=i[14],b=i[3],T=i[7],S=i[11],L=i[15],D=s[0],P=s[4],y=s[8],_=s[12],g=s[1],C=s[5],N=s[9],F=s[13],K=s[2],st=s[6],Q=s[10],W=s[14],B=s[3],et=s[7],gt=s[11],X=s[15];return r[0]=o*D+a*g+l*K+c*B,r[4]=o*P+a*C+l*st+c*et,r[8]=o*y+a*N+l*Q+c*gt,r[12]=o*_+a*F+l*W+c*X,r[1]=u*D+h*g+d*K+m*B,r[5]=u*P+h*C+d*st+m*et,r[9]=u*y+h*N+d*Q+m*gt,r[13]=u*_+h*F+d*W+m*X,r[2]=v*D+M*g+p*K+f*B,r[6]=v*P+M*C+p*st+f*et,r[10]=v*y+M*N+p*Q+f*gt,r[14]=v*_+M*F+p*W+f*X,r[3]=b*D+T*g+S*K+L*B,r[7]=b*P+T*C+S*st+L*et,r[11]=b*y+T*N+S*Q+L*gt,r[15]=b*_+T*F+S*W+L*X,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],o=t[1],a=t[5],l=t[9],c=t[13],u=t[2],h=t[6],d=t[10],m=t[14],v=t[3],M=t[7],p=t[11],f=t[15];return v*(+r*l*h-s*c*h-r*a*d+i*c*d+s*a*m-i*l*m)+M*(+e*l*m-e*c*d+r*o*d-s*o*m+s*c*u-r*l*u)+p*(+e*c*h-e*a*m-r*o*h+i*o*m+r*a*u-i*c*u)+f*(-s*a*u-e*l*h+e*a*d+s*o*h-i*o*d+i*l*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],m=t[11],v=t[12],M=t[13],p=t[14],f=t[15],b=h*p*c-M*d*c+M*l*m-a*p*m-h*l*f+a*d*f,T=v*d*c-u*p*c-v*l*m+o*p*m+u*l*f-o*d*f,S=u*M*c-v*h*c+v*a*m-o*M*m-u*a*f+o*h*f,L=v*h*l-u*M*l-v*a*d+o*M*d+u*a*p-o*h*p,D=e*b+i*T+s*S+r*L;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/D;return t[0]=b*P,t[1]=(M*d*r-h*p*r-M*s*m+i*p*m+h*s*f-i*d*f)*P,t[2]=(a*p*r-M*l*r+M*s*c-i*p*c-a*s*f+i*l*f)*P,t[3]=(h*l*r-a*d*r-h*s*c+i*d*c+a*s*m-i*l*m)*P,t[4]=T*P,t[5]=(u*p*r-v*d*r+v*s*m-e*p*m-u*s*f+e*d*f)*P,t[6]=(v*l*r-o*p*r-v*s*c+e*p*c+o*s*f-e*l*f)*P,t[7]=(o*d*r-u*l*r+u*s*c-e*d*c-o*s*m+e*l*m)*P,t[8]=S*P,t[9]=(v*h*r-u*M*r-v*i*m+e*M*m+u*i*f-e*h*f)*P,t[10]=(o*M*r-v*a*r+v*i*c-e*M*c-o*i*f+e*a*f)*P,t[11]=(u*a*r-o*h*r-u*i*c+e*h*c+o*i*m-e*a*m)*P,t[12]=L*P,t[13]=(u*M*s-v*h*s+v*i*d-e*M*d-u*i*p+e*h*p)*P,t[14]=(v*a*s-o*M*s-v*i*l+e*M*l+o*i*p-e*a*p)*P,t[15]=(o*h*s-u*a*s+u*i*l-e*h*l-o*i*d+e*a*d)*P,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),s=Math.sin(e),r=1-i,o=t.x,a=t.y,l=t.z,c=r*o,u=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+i,u*l-s*o,0,c*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,o){return this.set(1,i,r,0,t,1,o,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,o=e._y,a=e._z,l=e._w,c=r+r,u=o+o,h=a+a,d=r*c,m=r*u,v=r*h,M=o*u,p=o*h,f=a*h,b=l*c,T=l*u,S=l*h,L=i.x,D=i.y,P=i.z;return s[0]=(1-(M+f))*L,s[1]=(m+S)*L,s[2]=(v-T)*L,s[3]=0,s[4]=(m-S)*D,s[5]=(1-(d+f))*D,s[6]=(p+b)*D,s[7]=0,s[8]=(v+T)*P,s[9]=(p-b)*P,s[10]=(1-(d+M))*P,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=ls.set(s[0],s[1],s[2]).length();const o=ls.set(s[4],s[5],s[6]).length(),a=ls.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],pn.copy(this);const c=1/r,u=1/o,h=1/a;return pn.elements[0]*=c,pn.elements[1]*=c,pn.elements[2]*=c,pn.elements[4]*=u,pn.elements[5]*=u,pn.elements[6]*=u,pn.elements[8]*=h,pn.elements[9]*=h,pn.elements[10]*=h,e.setFromRotationMatrix(pn),i.x=r,i.y=o,i.z=a,this}makePerspective(t,e,i,s,r,o,a=$n){const l=this.elements,c=2*r/(e-t),u=2*r/(i-s),h=(e+t)/(e-t),d=(i+s)/(i-s);let m,v;if(a===$n)m=-(o+r)/(o-r),v=-2*o*r/(o-r);else if(a===ko)m=-o/(o-r),v=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,s,r,o,a=$n){const l=this.elements,c=1/(e-t),u=1/(i-s),h=1/(o-r),d=(e+t)*c,m=(i+s)*u;let v,M;if(a===$n)v=(o+r)*h,M=-2*h;else if(a===ko)v=r*h,M=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=M,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<16;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const ls=new O,pn=new se,lg=new O(0,0,0),cg=new O(1,1,1),li=new O,jr=new O,Je=new O,zu=new se,Hu=new Ce;class Sn{constructor(t=0,e=0,i=0,s=Sn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],h=s[2],d=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(ke(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-ke(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(ke(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-ke(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(ke(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-ke(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return zu.makeRotationFromQuaternion(t),this.setFromRotationMatrix(zu,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Hu.setFromEuler(this),this.setFromQuaternion(Hu,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Sn.DEFAULT_ORDER="XYZ";class Cc{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),m.length>0&&(i.animations=m),v.length>0&&(i.nodes=v)}return i.object=s,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){mn.subVectors(s,e),Hn.subVectors(i,e),Pa.subVectors(t,e);const o=mn.dot(mn),a=mn.dot(Hn),l=mn.dot(Pa),c=Hn.dot(Hn),u=Hn.dot(Pa),h=o*c-a*a;if(h===0)return r.set(0,0,0),null;const d=1/h,m=(c*l-a*u)*d,v=(o*u-a*l)*d;return r.set(1-m-v,v,m)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,kn)===null?!1:kn.x>=0&&kn.y>=0&&kn.x+kn.y<=1}static getInterpolation(t,e,i,s,r,o,a,l){return this.getBarycoord(t,e,i,s,kn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,kn.x),l.addScaledVector(o,kn.y),l.addScaledVector(a,kn.z),l)}static getInterpolatedAttribute(t,e,i,s,r,o){return Ua.setScalar(0),Na.setScalar(0),Oa.setScalar(0),Ua.fromBufferAttribute(t,e),Na.fromBufferAttribute(t,i),Oa.fromBufferAttribute(t,s),o.setScalar(0),o.addScaledVector(Ua,r.x),o.addScaledVector(Na,r.y),o.addScaledVector(Oa,r.z),o}static isFrontFacing(t,e,i,s){return mn.subVectors(i,e),Hn.subVectors(t,e),mn.cross(Hn).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return mn.subVectors(this.c,this.b),Hn.subVectors(this.a,this.b),mn.cross(Hn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return cn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return cn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return cn.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return cn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return cn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,r=this.c;let o,a;hs.subVectors(s,i),fs.subVectors(r,i),Da.subVectors(t,i);const l=hs.dot(Da),c=fs.dot(Da);if(l<=0&&c<=0)return e.copy(i);La.subVectors(t,s);const u=hs.dot(La),h=fs.dot(La);if(u>=0&&h<=u)return e.copy(s);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),e.copy(i).addScaledVector(hs,o);Ia.subVectors(t,r);const m=hs.dot(Ia),v=fs.dot(Ia);if(v>=0&&m<=v)return e.copy(r);const M=m*c-l*v;if(M<=0&&c>=0&&v<=0)return a=c/(c-v),e.copy(i).addScaledVector(fs,a);const p=u*v-m*h;if(p<=0&&h-u>=0&&m-v>=0)return Yu.subVectors(r,s),a=(h-u)/(h-u+(m-v)),e.copy(s).addScaledVector(Yu,a);const f=1/(p+M+d);return o=M*f,a=d*f,e.copy(i).addScaledVector(hs,o).addScaledVector(fs,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const hd={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},ci={h:0,s:0,l:0},Zr={h:0,s:0,l:0};function Fa(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class kt{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(e===void 0&&i===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=en){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Zt.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=Zt.workingColorSpace){return this.r=t,this.g=e,this.b=i,Zt.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=Zt.workingColorSpace){if(t=Z_(t,1),e=ke(e,0,1),i=ke(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,o=2*i-r;this.r=Fa(o,r,t+1/3),this.g=Fa(o,r,t),this.b=Fa(o,r,t-1/3)}return Zt.toWorkingColorSpace(this,s),this}setStyle(t,e=en){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=en){const i=hd[t.toLowerCase()];return i!==void 0?this.setHex(i,e):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}copySRGBToLinear(t){return this.r=Kn(t.r),this.g=Kn(t.g),this.b=Kn(t.b),this}copyLinearToSRGB(t){return this.r=Ds(t.r),this.g=Ds(t.g),this.b=Ds(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=en){return Zt.fromWorkingColorSpace(Le.copy(this),t),Math.round(ke(Le.r*255,0,255))*65536+Math.round(ke(Le.g*255,0,255))*256+Math.round(ke(Le.b*255,0,255))}getHexString(t=en){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Zt.workingColorSpace){Zt.fromWorkingColorSpace(Le.copy(this),e);const i=Le.r,s=Le.g,r=Le.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(s-r)/h+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Cs&&(i.blending=this.blending),this.side!==Ti&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==dl&&(i.blendSrc=this.blendSrc),this.blendDst!==pl&&(i.blendDst=this.blendDst),this.blendEquation!==ki&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ns&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Cu&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==is&&(i.stencilFail=this.stencilFail),this.stencilZFail!==is&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==is&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(e){const r=s(t.textures),o=s(t.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(e!==null){const s=e.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Ys extends Xs{static get type(){return"MeshBasicMaterial"}constructor(t){super(),this.isMeshBasicMaterial=!0,this.color=new kt(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.envMapRotation=new Sn,this.combine=Sc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Se=new O,Kr=new zt;class Mn{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=Pu,this.updateRanges=[],this.gpuType=Pn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ai);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new O(-1/0,-1/0,-1/0),new O(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,s=e.length;i0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(s[l]=u,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const s=t.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(e))}const r=t.morphAttributes;for(const c in r){const u=[],h=r[c];for(let d=0,m=h.length;d0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(t.far-t.near)**2))&&(qu.copy(r).invert(),Ii.copy(t.ray).applyMatrix4(qu),!(i.boundingBox!==null&&Ii.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,Ii)))}_computeIntersections(t,e,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,d=r.groups,m=r.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,M=d.length;ve.far?null:{distance:c,point:io.clone(),object:n}}function so(n,t,e,i,s,r,o,a,l,c){n.getVertexPosition(a,Qr),n.getVertexPosition(l,to),n.getVertexPosition(c,eo);const u=_g(n,t,e,i,Qr,to,eo,$u);if(u){const h=new O;cn.getBarycoord($u,Qr,to,eo,h),s&&(u.uv=cn.getInterpolatedAttribute(s,a,l,c,h,new zt)),r&&(u.uv1=cn.getInterpolatedAttribute(r,a,l,c,h,new zt)),o&&(u.normal=cn.getInterpolatedAttribute(o,a,l,c,h,new O),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new O,materialIndex:0};cn.getNormal(Qr,to,eo,d.normal),u.face=d,u.barycoord=h}return u}class fe extends We{constructor(t=1,e=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],h=[];let d=0,m=0;v("z","y","x",-1,-1,i,e,t,o,r,0),v("z","y","x",1,-1,i,e,-t,o,r,1),v("x","z","y",1,1,t,i,e,s,o,2),v("x","z","y",1,-1,t,i,-e,s,o,3),v("x","y","z",1,-1,t,e,i,s,r,4),v("x","y","z",-1,-1,t,e,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new ge(c,3)),this.setAttribute("normal",new ge(u,3)),this.setAttribute("uv",new ge(h,2));function v(M,p,f,b,T,S,L,D,P,y,_){const g=S/P,C=L/y,N=S/2,F=L/2,K=D/2,st=P+1,Q=y+1;let W=0,B=0;const et=new O;for(let gt=0;gt0?1:-1,u.push(et.x,et.y,et.z),h.push(ot/P),h.push(1-gt/y),W+=1}}for(let gt=0;gt0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class fd extends Me{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new se,this.projectionMatrix=new se,this.projectionMatrixInverse=new se,this.coordinateSystem=jn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const li=new O,Yu=new Ht,qu=new Ht;class an extends fd{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Zl*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(mr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Zl*2*Math.atan(Math.tan(mr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){li.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(li.x,li.y).multiplyScalar(-t/li.z),li.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(li.x,li.y).multiplyScalar(-t/li.z)}getViewSize(t,e){return this.getViewBounds(t,Yu,qu),e.subVectors(qu,Yu)}setViewOffset(t,e,i,s,r,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(mr*.5*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,e-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const hs=-90,fs=1;class xg extends Me{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new an(hs,fs,t,e);s.layers=this.layers,this.add(s);const r=new an(hs,fs,t,e);r.layers=this.layers,this.add(r);const o=new an(hs,fs,t,e);o.layers=this.layers,this.add(o);const a=new an(hs,fs,t,e);a.layers=this.layers,this.add(a);const l=new an(hs,fs,t,e);l.layers=this.layers,this.add(l);const c=new an(hs,fs,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[i,s,r,o,a,l]=e;for(const c of e)this.remove(c);if(t===jn)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===zo)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,h=t.getRenderTarget(),d=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),v=t.xr.enabled;t.xr.enabled=!1;const M=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,s),t.render(e,r),t.setRenderTarget(i,1,s),t.render(e,o),t.setRenderTarget(i,2,s),t.render(e,a),t.setRenderTarget(i,3,s),t.render(e,l),t.setRenderTarget(i,4,s),t.render(e,c),i.texture.generateMipmaps=M,t.setRenderTarget(i,5,s),t.render(e,u),t.setRenderTarget(h,d,p),t.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class dd extends We{constructor(t,e,i,s,r,o,a,l,c,u){t=t!==void 0?t:[],e=e!==void 0?e:Ps,super(t,e,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Mg extends qi{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},s=[i,i,i,i,i,i];this.texture=new dd(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:Cn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class wi extends Xs{static get type(){return"ShaderMaterial"}constructor(t){super(),this.isShaderMaterial=!0,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=xg,this.fragmentShader=Mg,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Hs(t.uniforms),this.uniformsGroups=gg(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?e.uniforms[s]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[s]={type:"m4",value:o.toArray()}:e.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class md extends Me{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new se,this.projectionMatrix=new se,this.projectionMatrixInverse=new se,this.coordinateSystem=$n}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const ui=new O,Zu=new zt,Ku=new zt;class an extends md{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Jl*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Sr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Jl*2*Math.atan(Math.tan(Sr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){ui.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(ui.x,ui.y).multiplyScalar(-t/ui.z),ui.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ui.x,ui.y).multiplyScalar(-t/ui.z)}getViewSize(t,e){return this.getViewBounds(t,Zu,Ku),e.subVectors(Ku,Zu)}setViewOffset(t,e,i,s,r,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Sr*.5*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,e-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const ps=-90,ms=1;class Sg extends Me{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new an(ps,ms,t,e);s.layers=this.layers,this.add(s);const r=new an(ps,ms,t,e);r.layers=this.layers,this.add(r);const o=new an(ps,ms,t,e);o.layers=this.layers,this.add(o);const a=new an(ps,ms,t,e);a.layers=this.layers,this.add(a);const l=new an(ps,ms,t,e);l.layers=this.layers,this.add(l);const c=new an(ps,ms,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[i,s,r,o,a,l]=e;for(const c of e)this.remove(c);if(t===$n)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===ko)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,h=t.getRenderTarget(),d=t.getActiveCubeFace(),m=t.getActiveMipmapLevel(),v=t.xr.enabled;t.xr.enabled=!1;const M=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,s),t.render(e,r),t.setRenderTarget(i,1,s),t.render(e,o),t.setRenderTarget(i,2,s),t.render(e,a),t.setRenderTarget(i,3,s),t.render(e,l),t.setRenderTarget(i,4,s),t.render(e,c),i.texture.generateMipmaps=M,t.setRenderTarget(i,5,s),t.render(e,u),t.setRenderTarget(h,d,m),t.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class _d extends Ge{constructor(t,e,i,s,r,o,a,l,c,u){t=t!==void 0?t:[],e=e!==void 0?e:Os,super(t,e,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class yg extends $i{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},s=[i,i,i,i,i,i];this.texture=new _d(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:Cn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -71,9 +71,9 @@ License: MIT gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},s=new he(5,5,5),r=new Ei({name:"CubemapFromEquirect",uniforms:Us(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Ze,blending:gi});r.uniforms.tEquirect.value=e;const o=new wt(s,r),a=e.minFilter;return e.minFilter===Gi&&(e.minFilter=Cn),new xg(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,i,s){const r=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,i,s);t.setRenderTarget(r)}}const Fa=new O,Sg=new O,yg=new jt;class di{constructor(t=new O(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,s){return this.normal.set(t,e,i),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const s=Fa.subVectors(i,e).cross(Sg.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const i=t.delta(Fa),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:e.copy(t.start).addScaledVector(i,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||yg.getNormalMatrix(t),s=this.coplanarPoint(Fa).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Di=new Bs,to=new O;class Rc{constructor(t=new di,e=new di,i=new di,s=new di,r=new di,o=new di){this.planes=[t,e,i,s,r,o]}set(t,e,i,s,r,o){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=jn){const i=this.planes,s=t.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],u=s[5],h=s[6],d=s[7],p=s[8],v=s[9],M=s[10],m=s[11],f=s[12],T=s[13],b=s[14],S=s[15];if(i[0].setComponents(l-r,d-c,m-p,S-f).normalize(),i[1].setComponents(l+r,d+c,m+p,S+f).normalize(),i[2].setComponents(l+o,d+u,m+v,S+T).normalize(),i[3].setComponents(l-o,d-u,m-v,S-T).normalize(),i[4].setComponents(l-a,d-h,m-M,S-b).normalize(),e===jn)i[5].setComponents(l+a,d+h,m+M,S+b).normalize();else if(e===zo)i[5].setComponents(a,h,M,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Di.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Di.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Di)}intersectsSprite(t){return Di.center.set(0,0,0),Di.radius=.7071067811865476,Di.applyMatrix4(t.matrixWorld),this.intersectsSphere(Di)}intersectsSphere(t){const e=this.planes,i=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(i)0?t.max.x:t.min.x,to.y=s.normal.y>0?t.max.y:t.min.y,to.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(to)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function pd(){let n=null,t=!1,e=null,i=null;function s(r,o){e(r,o),i=n.requestAnimationFrame(s)}return{start:function(){t!==!0&&e!==null&&(i=n.requestAnimationFrame(s),t=!0)},stop:function(){n.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(r){e=r},setContext:function(r){n=r}}}function Eg(n){const t=new WeakMap;function e(a,l){const c=a.array,u=a.usage,h=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let p;if(c instanceof Float32Array)p=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?p=n.HALF_FLOAT:p=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)p=n.SHORT;else if(c instanceof Uint32Array)p=n.UNSIGNED_INT;else if(c instanceof Int32Array)p=n.INT;else if(c instanceof Int8Array)p=n.BYTE;else if(c instanceof Uint8Array)p=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)p=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:p,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const u=l.array,h=l.updateRanges;if(n.bindBuffer(c,a),h.length===0)n.bufferSubData(c,0,u);else{h.sort((p,v)=>p.start-v.start);let d=0;for(let p=1;p1?null:e.copy(t.start).addScaledVector(i,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||bg.getNormalMatrix(t),s=this.coplanarPoint(Ha).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ui=new Ws,ro=new O;class Pc{constructor(t=new mi,e=new mi,i=new mi,s=new mi,r=new mi,o=new mi){this.planes=[t,e,i,s,r,o]}set(t,e,i,s,r,o){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=$n){const i=this.planes,s=t.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],u=s[5],h=s[6],d=s[7],m=s[8],v=s[9],M=s[10],p=s[11],f=s[12],b=s[13],T=s[14],S=s[15];if(i[0].setComponents(l-r,d-c,p-m,S-f).normalize(),i[1].setComponents(l+r,d+c,p+m,S+f).normalize(),i[2].setComponents(l+o,d+u,p+v,S+b).normalize(),i[3].setComponents(l-o,d-u,p-v,S-b).normalize(),i[4].setComponents(l-a,d-h,p-M,S-T).normalize(),e===$n)i[5].setComponents(l+a,d+h,p+M,S+T).normalize();else if(e===ko)i[5].setComponents(a,h,M,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Ui.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Ui.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Ui)}intersectsSprite(t){return Ui.center.set(0,0,0),Ui.radius=.7071067811865476,Ui.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ui)}intersectsSphere(t){const e=this.planes,i=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(i)0?t.max.x:t.min.x,ro.y=s.normal.y>0?t.max.y:t.min.y,ro.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(ro)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function gd(){let n=null,t=!1,e=null,i=null;function s(r,o){e(r,o),i=n.requestAnimationFrame(s)}return{start:function(){t!==!0&&e!==null&&(i=n.requestAnimationFrame(s),t=!0)},stop:function(){n.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(r){e=r},setContext:function(r){n=r}}}function Tg(n){const t=new WeakMap;function e(a,l){const c=a.array,u=a.usage,h=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let m;if(c instanceof Float32Array)m=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?m=n.HALF_FLOAT:m=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=n.SHORT;else if(c instanceof Uint32Array)m=n.UNSIGNED_INT;else if(c instanceof Int32Array)m=n.INT;else if(c instanceof Int8Array)m=n.BYTE;else if(c instanceof Uint8Array)m=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const u=l.array,h=l.updateRanges;if(n.bindBuffer(c,a),h.length===0)n.bufferSubData(c,0,u);else{h.sort((m,v)=>m.start-v.start);let d=0;for(let m=1;m 0 +#endif`,kg=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -323,26 +323,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,Hg=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Vg=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,kg=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Gg=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,Vg=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Wg=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Gg=`#if defined( USE_COLOR_ALPHA ) +#endif`,Xg=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,Wg=`#if defined( USE_COLOR_ALPHA ) +#endif`,Yg=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,Xg=`#if defined( USE_COLOR_ALPHA ) +#endif`,qg=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,Yg=`#if defined( USE_COLOR_ALPHA ) +#endif`,jg=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); @@ -356,7 +356,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,qg=`#define PI 3.141592653589793 +#endif`,$g=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -430,7 +430,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,jg=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,Zg=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -523,7 +523,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Zg=`vec3 transformedNormal = objectNormal; +#endif`,Kg=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -552,21 +552,21 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,$g=`#ifdef USE_DISPLACEMENTMAP +#endif`,Jg=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,Kg=`#ifdef USE_DISPLACEMENTMAP +#endif`,Qg=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,Jg=`#ifdef USE_EMISSIVEMAP +#endif`,t0=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Qg=`#ifdef USE_EMISSIVEMAP +#endif`,e0=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,t0="gl_FragColor = linearToOutputTexel( gl_FragColor );",e0=`vec4 LinearTransferOETF( in vec4 value ) { +#endif`,n0="gl_FragColor = linearToOutputTexel( gl_FragColor );",i0=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( in vec4 value ) { @@ -574,7 +574,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) { } vec4 sRGBTransferOETF( in vec4 value ) { return 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 ); -}`,n0=`#ifdef USE_ENVMAP +}`,s0=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -603,7 +603,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,i0=`#ifdef USE_ENVMAP +#endif`,r0=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -613,7 +613,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,s0=`#ifdef USE_ENVMAP +#endif`,o0=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -624,7 +624,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,r0=`#ifdef USE_ENVMAP +#endif`,a0=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -635,7 +635,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,o0=`#ifdef USE_ENVMAP +#endif`,l0=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -652,18 +652,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,a0=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,l0=`#ifdef USE_FOG - varying float vFogDepth; #endif`,c0=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,u0=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,h0=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,u0=`#ifdef USE_FOG +#endif`,f0=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -672,7 +672,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,h0=`#ifdef USE_GRADIENTMAP +#endif`,d0=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -684,12 +684,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,f0=`#ifdef USE_LIGHTMAP +}`,p0=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,d0=`LambertMaterial material; +#endif`,m0=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,p0=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,_0=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -703,7 +703,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,m0=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,g0=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -819,7 +819,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,_0=`#ifdef USE_ENVMAP +#endif`,v0=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -852,8 +852,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,g0=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,v0=`varying vec3 vViewPosition; +#endif`,x0=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,M0=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -865,11 +865,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,x0=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,S0=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,M0=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,y0=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -886,7 +886,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,S0=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,E0=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -972,7 +972,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,y0=`struct PhysicalMaterial { +#endif`,b0=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1273,7 +1273,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,E0=` +}`,T0=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1388,7 +1388,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,b0=`#if defined( RE_IndirectDiffuse ) +#endif`,w0=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1407,32 +1407,32 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,T0=`#if defined( RE_IndirectDiffuse ) +#endif`,A0=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,w0=`#if defined( USE_LOGDEPTHBUF ) +#endif`,R0=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,A0=`#if defined( USE_LOGDEPTHBUF ) +#endif`,C0=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,R0=`#ifdef USE_LOGDEPTHBUF +#endif`,P0=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; -#endif`,C0=`#ifdef USE_LOGDEPTHBUF +#endif`,D0=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,P0=`#ifdef USE_MAP +#endif`,L0=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,D0=`#ifdef USE_MAP +#endif`,I0=`#ifdef USE_MAP uniform sampler2D map; -#endif`,L0=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,U0=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1444,7 +1444,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,I0=`#if defined( USE_POINTS_UV ) +#endif`,N0=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1456,19 +1456,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,U0=`float metalnessFactor = metalness; +#endif`,O0=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,N0=`#ifdef USE_METALNESSMAP +#endif`,F0=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,O0=`#ifdef USE_INSTANCING_MORPH +#endif`,B0=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,F0=`#if defined( USE_MORPHCOLORS ) +#endif`,z0=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1477,12 +1477,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,B0=`#ifdef USE_MORPHNORMALS +#endif`,H0=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,z0=`#ifdef USE_MORPHTARGETS +#endif`,k0=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1496,12 +1496,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,H0=`#ifdef USE_MORPHTARGETS +#endif`,V0=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,k0=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,G0=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1542,7 +1542,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,V0=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,W0=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1557,25 +1557,25 @@ vec3 nonPerturbedNormal = normal;`,V0=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,G0=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,W0=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif #endif`,X0=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Y0=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,q0=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,Y0=`#ifdef USE_NORMALMAP +#endif`,j0=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1597,13 +1597,13 @@ vec3 nonPerturbedNormal = normal;`,V0=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,q0=`#ifdef USE_CLEARCOAT +#endif`,$0=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,j0=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,Z0=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Z0=`#ifdef USE_CLEARCOATMAP +#endif`,K0=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1612,18 +1612,18 @@ vec3 nonPerturbedNormal = normal;`,V0=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,$0=`#ifdef USE_IRIDESCENCEMAP +#endif`,J0=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,K0=`#ifdef OPAQUE +#endif`,Q0=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,J0=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,tv=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1692,9 +1692,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,Q0=`#ifdef PREMULTIPLIED_ALPHA +}`,ev=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,tv=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,nv=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1702,22 +1702,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,iv=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,nv=`#ifdef DITHERING +#endif`,sv=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,iv=`float roughnessFactor = roughness; +#endif`,rv=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,sv=`#ifdef USE_ROUGHNESSMAP +#endif`,ov=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,rv=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,av=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1903,7 +1903,7 @@ gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,ov=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,lv=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1944,7 +1944,7 @@ gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,av=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,cv=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -1976,7 +1976,7 @@ gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,lv=`float getShadowMask() { +#endif`,uv=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2008,12 +2008,12 @@ gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING #endif #endif return shadow; -}`,cv=`#ifdef USE_SKINNING +}`,hv=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,uv=`#ifdef USE_SKINNING +#endif`,fv=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2028,7 +2028,7 @@ gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,hv=`#ifdef USE_SKINNING +#endif`,dv=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2036,7 +2036,7 @@ gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,fv=`#ifdef USE_SKINNING +#endif`,pv=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2047,17 +2047,17 @@ gl_Position = projectionMatrix * mvPosition;`,ev=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,dv=`float specularStrength; +#endif`,mv=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,pv=`#ifdef USE_SPECULARMAP +#endif`,_v=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,mv=`#if defined( TONE_MAPPING ) +#endif`,gv=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,_v=`#ifndef saturate +#endif`,vv=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2154,7 +2154,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,gv=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,xv=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2175,7 +2175,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gv=`#ifdef USE_TRANSMISS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,vv=`#ifdef USE_TRANSMISSION +#endif`,Mv=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2306,7 +2306,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gv=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,xv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Sv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2376,7 +2376,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gv=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,Mv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,yv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2470,7 +2470,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gv=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,Sv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Ev=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2541,7 +2541,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gv=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,yv=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,bv=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2550,12 +2550,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gv=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const Ev=`varying vec2 vUv; +#endif`;const Tv=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,bv=`uniform sampler2D t2D; +}`,wv=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2567,14 +2567,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Tv=`varying vec3 vWorldDirection; +}`,Av=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,wv=`#ifdef ENVMAP_TYPE_CUBE +}`,Rv=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2597,14 +2597,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Av=`varying vec3 vWorldDirection; +}`,Cv=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,Rv=`uniform samplerCube tCube; +}`,Pv=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2614,7 +2614,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,Cv=`#include +}`,Dv=`#include #include #include #include @@ -2641,7 +2641,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,Pv=`#if DEPTH_PACKING == 3200 +}`,Lv=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2675,7 +2675,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,Dv=`#define DISTANCE +}`,Iv=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2702,7 +2702,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,Lv=`#define DISTANCE +}`,Uv=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2726,13 +2726,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,Iv=`varying vec3 vWorldDirection; +}`,Nv=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,Uv=`uniform sampler2D tEquirect; +}`,Ov=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2741,7 +2741,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,Nv=`uniform float scale; +}`,Fv=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2763,7 +2763,7 @@ void main() { #include #include #include -}`,Ov=`uniform vec3 diffuse; +}`,Bv=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2791,7 +2791,7 @@ void main() { #include #include #include -}`,Fv=`#include +}`,zv=`#include #include #include #include @@ -2823,7 +2823,7 @@ void main() { #include #include #include -}`,Bv=`uniform vec3 diffuse; +}`,Hv=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2871,7 +2871,7 @@ void main() { #include #include #include -}`,zv=`#define LAMBERT +}`,kv=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2910,7 +2910,7 @@ void main() { #include #include #include -}`,Hv=`#define LAMBERT +}`,Vv=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2967,7 +2967,7 @@ void main() { #include #include #include -}`,kv=`#define MATCAP +}`,Gv=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3001,7 +3001,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,Vv=`#define MATCAP +}`,Wv=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3047,7 +3047,7 @@ void main() { #include #include #include -}`,Gv=`#define NORMAL +}`,Xv=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3080,7 +3080,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,Wv=`#define NORMAL +}`,Yv=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3102,7 +3102,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,Xv=`#define PHONG +}`,qv=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3141,7 +3141,7 @@ void main() { #include #include #include -}`,Yv=`#define PHONG +}`,jv=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3200,7 +3200,7 @@ void main() { #include #include #include -}`,qv=`#define STANDARD +}`,$v=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3243,7 +3243,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,jv=`#define STANDARD +}`,Zv=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3368,7 +3368,7 @@ void main() { #include #include #include -}`,Zv=`#define TOON +}`,Kv=`#define TOON varying vec3 vViewPosition; #include #include @@ -3405,7 +3405,7 @@ void main() { #include #include #include -}`,$v=`#define TOON +}`,Jv=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3458,7 +3458,7 @@ void main() { #include #include #include -}`,Kv=`uniform float size; +}`,Qv=`uniform float size; uniform float scale; #include #include @@ -3489,7 +3489,7 @@ void main() { #include #include #include -}`,Jv=`uniform vec3 diffuse; +}`,tx=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3514,7 +3514,7 @@ void main() { #include #include #include -}`,Qv=`#include +}`,ex=`#include #include #include #include @@ -3537,7 +3537,7 @@ void main() { #include #include #include -}`,tx=`uniform vec3 color; +}`,nx=`uniform vec3 color; uniform float opacity; #include #include @@ -3553,7 +3553,7 @@ void main() { #include #include #include -}`,ex=`uniform float rotation; +}`,ix=`uniform float rotation; uniform vec2 center; #include #include @@ -3577,7 +3577,7 @@ void main() { #include #include #include -}`,nx=`uniform vec3 diffuse; +}`,sx=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3602,7 +3602,7 @@ void main() { #include #include #include -}`,Zt={alphahash_fragment:bg,alphahash_pars_fragment:Tg,alphamap_fragment:wg,alphamap_pars_fragment:Ag,alphatest_fragment:Rg,alphatest_pars_fragment:Cg,aomap_fragment:Pg,aomap_pars_fragment:Dg,batching_pars_vertex:Lg,batching_vertex:Ig,begin_vertex:Ug,beginnormal_vertex:Ng,bsdfs:Og,iridescence_fragment:Fg,bumpmap_pars_fragment:Bg,clipping_planes_fragment:zg,clipping_planes_pars_fragment:Hg,clipping_planes_pars_vertex:kg,clipping_planes_vertex:Vg,color_fragment:Gg,color_pars_fragment:Wg,color_pars_vertex:Xg,color_vertex:Yg,common:qg,cube_uv_reflection_fragment:jg,defaultnormal_vertex:Zg,displacementmap_pars_vertex:$g,displacementmap_vertex:Kg,emissivemap_fragment:Jg,emissivemap_pars_fragment:Qg,colorspace_fragment:t0,colorspace_pars_fragment:e0,envmap_fragment:n0,envmap_common_pars_fragment:i0,envmap_pars_fragment:s0,envmap_pars_vertex:r0,envmap_physical_pars_fragment:_0,envmap_vertex:o0,fog_vertex:a0,fog_pars_vertex:l0,fog_fragment:c0,fog_pars_fragment:u0,gradientmap_pars_fragment:h0,lightmap_pars_fragment:f0,lights_lambert_fragment:d0,lights_lambert_pars_fragment:p0,lights_pars_begin:m0,lights_toon_fragment:g0,lights_toon_pars_fragment:v0,lights_phong_fragment:x0,lights_phong_pars_fragment:M0,lights_physical_fragment:S0,lights_physical_pars_fragment:y0,lights_fragment_begin:E0,lights_fragment_maps:b0,lights_fragment_end:T0,logdepthbuf_fragment:w0,logdepthbuf_pars_fragment:A0,logdepthbuf_pars_vertex:R0,logdepthbuf_vertex:C0,map_fragment:P0,map_pars_fragment:D0,map_particle_fragment:L0,map_particle_pars_fragment:I0,metalnessmap_fragment:U0,metalnessmap_pars_fragment:N0,morphinstance_vertex:O0,morphcolor_vertex:F0,morphnormal_vertex:B0,morphtarget_pars_vertex:z0,morphtarget_vertex:H0,normal_fragment_begin:k0,normal_fragment_maps:V0,normal_pars_fragment:G0,normal_pars_vertex:W0,normal_vertex:X0,normalmap_pars_fragment:Y0,clearcoat_normal_fragment_begin:q0,clearcoat_normal_fragment_maps:j0,clearcoat_pars_fragment:Z0,iridescence_pars_fragment:$0,opaque_fragment:K0,packing:J0,premultiplied_alpha_fragment:Q0,project_vertex:tv,dithering_fragment:ev,dithering_pars_fragment:nv,roughnessmap_fragment:iv,roughnessmap_pars_fragment:sv,shadowmap_pars_fragment:rv,shadowmap_pars_vertex:ov,shadowmap_vertex:av,shadowmask_pars_fragment:lv,skinbase_vertex:cv,skinning_pars_vertex:uv,skinning_vertex:hv,skinnormal_vertex:fv,specularmap_fragment:dv,specularmap_pars_fragment:pv,tonemapping_fragment:mv,tonemapping_pars_fragment:_v,transmission_fragment:gv,transmission_pars_fragment:vv,uv_pars_fragment:xv,uv_pars_vertex:Mv,uv_vertex:Sv,worldpos_vertex:yv,background_vert:Ev,background_frag:bv,backgroundCube_vert:Tv,backgroundCube_frag:wv,cube_vert:Av,cube_frag:Rv,depth_vert:Cv,depth_frag:Pv,distanceRGBA_vert:Dv,distanceRGBA_frag:Lv,equirect_vert:Iv,equirect_frag:Uv,linedashed_vert:Nv,linedashed_frag:Ov,meshbasic_vert:Fv,meshbasic_frag:Bv,meshlambert_vert:zv,meshlambert_frag:Hv,meshmatcap_vert:kv,meshmatcap_frag:Vv,meshnormal_vert:Gv,meshnormal_frag:Wv,meshphong_vert:Xv,meshphong_frag:Yv,meshphysical_vert:qv,meshphysical_frag:jv,meshtoon_vert:Zv,meshtoon_frag:$v,points_vert:Kv,points_frag:Jv,shadow_vert:Qv,shadow_frag:tx,sprite_vert:ex,sprite_frag:nx},bt={common:{diffuse:{value:new zt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new jt}},envmap:{envMap:{value:null},envMapRotation:{value:new jt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new jt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new jt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new jt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new jt},normalScale:{value:new Ht(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new jt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new jt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new jt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new jt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new zt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 zt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0},uvTransform:{value:new jt}},sprite:{diffuse:{value:new zt(16777215)},opacity:{value:1},center:{value:new Ht(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}}},Rn={basic:{uniforms:He([bt.common,bt.specularmap,bt.envmap,bt.aomap,bt.lightmap,bt.fog]),vertexShader:Zt.meshbasic_vert,fragmentShader:Zt.meshbasic_frag},lambert:{uniforms:He([bt.common,bt.specularmap,bt.envmap,bt.aomap,bt.lightmap,bt.emissivemap,bt.bumpmap,bt.normalmap,bt.displacementmap,bt.fog,bt.lights,{emissive:{value:new zt(0)}}]),vertexShader:Zt.meshlambert_vert,fragmentShader:Zt.meshlambert_frag},phong:{uniforms:He([bt.common,bt.specularmap,bt.envmap,bt.aomap,bt.lightmap,bt.emissivemap,bt.bumpmap,bt.normalmap,bt.displacementmap,bt.fog,bt.lights,{emissive:{value:new zt(0)},specular:{value:new zt(1118481)},shininess:{value:30}}]),vertexShader:Zt.meshphong_vert,fragmentShader:Zt.meshphong_frag},standard:{uniforms:He([bt.common,bt.envmap,bt.aomap,bt.lightmap,bt.emissivemap,bt.bumpmap,bt.normalmap,bt.displacementmap,bt.roughnessmap,bt.metalnessmap,bt.fog,bt.lights,{emissive:{value:new zt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Zt.meshphysical_vert,fragmentShader:Zt.meshphysical_frag},toon:{uniforms:He([bt.common,bt.aomap,bt.lightmap,bt.emissivemap,bt.bumpmap,bt.normalmap,bt.displacementmap,bt.gradientmap,bt.fog,bt.lights,{emissive:{value:new zt(0)}}]),vertexShader:Zt.meshtoon_vert,fragmentShader:Zt.meshtoon_frag},matcap:{uniforms:He([bt.common,bt.bumpmap,bt.normalmap,bt.displacementmap,bt.fog,{matcap:{value:null}}]),vertexShader:Zt.meshmatcap_vert,fragmentShader:Zt.meshmatcap_frag},points:{uniforms:He([bt.points,bt.fog]),vertexShader:Zt.points_vert,fragmentShader:Zt.points_frag},dashed:{uniforms:He([bt.common,bt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Zt.linedashed_vert,fragmentShader:Zt.linedashed_frag},depth:{uniforms:He([bt.common,bt.displacementmap]),vertexShader:Zt.depth_vert,fragmentShader:Zt.depth_frag},normal:{uniforms:He([bt.common,bt.bumpmap,bt.normalmap,bt.displacementmap,{opacity:{value:1}}]),vertexShader:Zt.meshnormal_vert,fragmentShader:Zt.meshnormal_frag},sprite:{uniforms:He([bt.sprite,bt.fog]),vertexShader:Zt.sprite_vert,fragmentShader:Zt.sprite_frag},background:{uniforms:{uvTransform:{value:new jt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Zt.background_vert,fragmentShader:Zt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new jt}},vertexShader:Zt.backgroundCube_vert,fragmentShader:Zt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Zt.cube_vert,fragmentShader:Zt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Zt.equirect_vert,fragmentShader:Zt.equirect_frag},distanceRGBA:{uniforms:He([bt.common,bt.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Zt.distanceRGBA_vert,fragmentShader:Zt.distanceRGBA_frag},shadow:{uniforms:He([bt.lights,bt.fog,{color:{value:new zt(0)},opacity:{value:1}}]),vertexShader:Zt.shadow_vert,fragmentShader:Zt.shadow_frag}};Rn.physical={uniforms:He([Rn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new jt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new jt},clearcoatNormalScale:{value:new Ht(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new jt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new jt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new jt},sheen:{value:0},sheenColor:{value:new zt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new jt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new jt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new jt},transmissionSamplerSize:{value:new Ht},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new jt},attenuationDistance:{value:0},attenuationColor:{value:new zt(0)},specularColor:{value:new zt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new jt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new jt},anisotropyVector:{value:new Ht},anisotropyMap:{value:null},anisotropyMapTransform:{value:new jt}}]),vertexShader:Zt.meshphysical_vert,fragmentShader:Zt.meshphysical_frag};const eo={r:0,b:0,g:0},Li=new Sn,ix=new se;function sx(n,t,e,i,s,r,o){const a=new zt(0);let l=r===!0?0:1,c,u,h=null,d=0,p=null;function v(T){let b=T.isScene===!0?T.background:null;return b&&b.isTexture&&(b=(T.backgroundBlurriness>0?e:t).get(b)),b}function M(T){let b=!1;const S=v(T);S===null?f(a,l):S&&S.isColor&&(f(S,1),b=!0);const U=n.xr.getEnvironmentBlendMode();U==="additive"?i.buffers.color.setClear(0,0,0,1,o):U==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||b)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function m(T,b){const S=v(b);S&&(S.isCubeTexture||S.mapping===Qo)?(u===void 0&&(u=new wt(new he(1,1,1),new Ei({name:"BackgroundCubeMaterial",uniforms:Us(Rn.backgroundCube.uniforms),vertexShader:Rn.backgroundCube.vertexShader,fragmentShader:Rn.backgroundCube.fragmentShader,side:Ze,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(U,D,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Li.copy(b.backgroundRotation),Li.x*=-1,Li.y*=-1,Li.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Li.y*=-1,Li.z*=-1),u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(ix.makeRotationFromEuler(Li)),u.material.toneMapped=$t.getTransfer(S.colorSpace)!==re,(h!==S||d!==S.version||p!==n.toneMapping)&&(u.material.needsUpdate=!0,h=S,d=S.version,p=n.toneMapping),u.layers.enableAll(),T.unshift(u,u.geometry,u.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new wt(new $i(2,2),new Ei({name:"BackgroundMaterial",uniforms:Us(Rn.background.uniforms),vertexShader:Rn.background.vertexShader,fragmentShader:Rn.background.fragmentShader,side:yi,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=$t.getTransfer(S.colorSpace)!==re,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(h!==S||d!==S.version||p!==n.toneMapping)&&(c.material.needsUpdate=!0,h=S,d=S.version,p=n.toneMapping),c.layers.enableAll(),T.unshift(c,c.geometry,c.material,0,0,null))}function f(T,b){T.getRGB(eo,hd(n)),i.buffers.color.setClear(eo.r,eo.g,eo.b,b,o)}return{getClearColor:function(){return a},setClearColor:function(T,b=1){a.set(T),l=b,f(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(T){l=T,f(a,l)},render:M,addToRenderList:m}}function rx(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=d(null);let r=s,o=!1;function a(g,C,N,F,J){let st=!1;const Q=h(F,N,C);r!==Q&&(r=Q,c(r.object)),st=p(g,F,N,J),st&&v(g,F,N,J),J!==null&&t.update(J,n.ELEMENT_ARRAY_BUFFER),(st||o)&&(o=!1,S(g,C,N,F),J!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(J).buffer))}function l(){return n.createVertexArray()}function c(g){return n.bindVertexArray(g)}function u(g){return n.deleteVertexArray(g)}function h(g,C,N){const F=N.wireframe===!0;let J=i[g.id];J===void 0&&(J={},i[g.id]=J);let st=J[C.id];st===void 0&&(st={},J[C.id]=st);let Q=st[F];return Q===void 0&&(Q=d(l()),st[F]=Q),Q}function d(g){const C=[],N=[],F=[];for(let J=0;J=0){const gt=J[B];let X=st[B];if(X===void 0&&(B==="instanceMatrix"&&g.instanceMatrix&&(X=g.instanceMatrix),B==="instanceColor"&&g.instanceColor&&(X=g.instanceColor)),gt===void 0||gt.attribute!==X||X&>.data!==X.data)return!0;Q++}return r.attributesNum!==Q||r.index!==F}function v(g,C,N,F){const J={},st=C.attributes;let Q=0;const W=N.getAttributes();for(const B in W)if(W[B].location>=0){let gt=st[B];gt===void 0&&(B==="instanceMatrix"&&g.instanceMatrix&&(gt=g.instanceMatrix),B==="instanceColor"&&g.instanceColor&&(gt=g.instanceColor));const X={};X.attribute=gt,gt&>.data&&(X.data=gt.data),J[B]=X,Q++}r.attributes=J,r.attributesNum=Q,r.index=F}function M(){const g=r.newAttributes;for(let C=0,N=g.length;C=0){let et=J[W];if(et===void 0&&(W==="instanceMatrix"&&g.instanceMatrix&&(et=g.instanceMatrix),W==="instanceColor"&&g.instanceColor&&(et=g.instanceColor)),et!==void 0){const gt=et.normalized,X=et.itemSize,ot=t.get(et);if(ot===void 0)continue;const lt=ot.buffer,Z=ot.type,at=ot.bytesPerElement,mt=Z===n.INT||Z===n.UNSIGNED_INT||et.gpuType===Mc;if(et.isInterleavedBufferAttribute){const ut=et.data,ft=ut.stride,vt=et.offset;if(ut.isInstancedInterleavedBuffer){for(let yt=0;yt0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=e.logarithmicDepthBuffer===!0,d=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),M=n.getParameter(n.MAX_TEXTURE_SIZE),m=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),f=n.getParameter(n.MAX_VERTEX_ATTRIBS),T=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),b=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),U=v>0,D=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,reverseDepthBuffer:d,maxTextures:p,maxVertexTextures:v,maxTextureSize:M,maxCubemapSize:m,maxAttributes:f,maxVertexUniforms:T,maxVaryings:b,maxFragmentUniforms:S,vertexTextures:U,maxSamples:D}}function lx(n){const t=this;let e=null,i=0,s=!1,r=!1;const o=new di,a=new jt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const p=h.length!==0||d||i!==0||s;return s=d,i=h.length,p},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,d){e=u(h,d,0)},this.setState=function(h,d,p){const v=h.clippingPlanes,M=h.clipIntersection,m=h.clipShadows,f=n.get(h);if(!s||v===null||v.length===0||r&&!m)r?u(null):c();else{const T=r?0:i,b=T*4;let S=f.clippingState||null;l.value=S,S=u(v,d,b,p);for(let U=0;U!==b;++U)S[U]=e[U];f.clippingState=S,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=T}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(h,d,p,v){const M=h!==null?h.length:0;let m=null;if(M!==0){if(m=l.value,v!==!0||m===null){const f=p+M*4,T=d.matrixWorldInverse;a.getNormalMatrix(T),(m===null||m.length0){const c=new Mg(l.height);return c.fromEquirectangularTexture(n,o),t.set(o,c),o.addEventListener("dispose",s),e(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function r(){t=new WeakMap}return{get:i,dispose:r}}class md extends fd{constructor(t=-1,e=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,i,s,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-t,o=i+t,a=s+e,l=s-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,o=r+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}const gs=4,ju=[.125,.215,.35,.446,.526,.582],Hi=20,Ba=new md,Zu=new zt;let za=null,Ha=0,ka=0,Va=!1;const Oi=(1+Math.sqrt(5))/2,ds=1/Oi,$u=[new O(-Oi,ds,0),new O(Oi,ds,0),new O(-ds,0,Oi),new O(ds,0,Oi),new O(0,Oi,-ds),new O(0,Oi,ds),new O(-1,1,-1),new O(1,1,-1),new O(-1,1,1),new O(1,1,1)];class Ku{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,s=100){za=this._renderer.getRenderTarget(),Ha=this._renderer.getActiveCubeFace(),ka=this._renderer.getActiveMipmapLevel(),Va=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=th(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Qu(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),u.setRenderTarget(s),M&&u.render(v,a),u.render(t,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=d,u.autoClear=h,t.background=m}_textureToCubeUV(t,e){const i=this._renderer,s=t.mapping===Ps||t.mapping===Ds;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=th()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Qu());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new wt(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=t;const l=this._cubeSize;no(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(o,Ba)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rHi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Hi}`);const f=[];let T=0;for(let P=0;Pb-gs?s-b+gs:0),D=4*(this._cubeSize-S);no(e,U,D,3*S,2*S),l.setRenderTarget(e),l.render(h,Ba)}}function ux(n){const t=[],e=[],i=[];let s=n;const r=n-gs+1+ju.length;for(let o=0;on-gs?l=ju[o-n+gs-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],p=6,v=6,M=3,m=2,f=1,T=new Float32Array(M*v*p),b=new Float32Array(m*v*p),S=new Float32Array(f*v*p);for(let D=0;D2?0:-1,_=[P,y,0,P+2/3,y,0,P+2/3,y+1,0,P,y,0,P+2/3,y+1,0,P,y+1,0];T.set(_,M*v*D),b.set(d,m*v*D);const g=[D,D,D,D,D,D];S.set(g,f*v*D)}const U=new Be;U.setAttribute("position",new Mn(T,M)),U.setAttribute("uv",new Mn(b,m)),U.setAttribute("faceIndex",new Mn(S,f)),t.push(U),s>gs&&s--}return{lodPlanes:t,sizeLods:e,sigmas:i}}function Ju(n,t,e){const i=new qi(n,t,e);return i.texture.mapping=Qo,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function no(n,t,e,i,s){n.viewport.set(t,e,i,s),n.scissor.set(t,e,i,s)}function hx(n,t,e){const i=new Float32Array(Hi),s=new O(0,1,0);return new Ei({name:"SphericalGaussianBlur",defines:{n:Hi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Cc(),fragmentShader:` +}`,$t={alphahash_fragment:wg,alphahash_pars_fragment:Ag,alphamap_fragment:Rg,alphamap_pars_fragment:Cg,alphatest_fragment:Pg,alphatest_pars_fragment:Dg,aomap_fragment:Lg,aomap_pars_fragment:Ig,batching_pars_vertex:Ug,batching_vertex:Ng,begin_vertex:Og,beginnormal_vertex:Fg,bsdfs:Bg,iridescence_fragment:zg,bumpmap_pars_fragment:Hg,clipping_planes_fragment:kg,clipping_planes_pars_fragment:Vg,clipping_planes_pars_vertex:Gg,clipping_planes_vertex:Wg,color_fragment:Xg,color_pars_fragment:Yg,color_pars_vertex:qg,color_vertex:jg,common:$g,cube_uv_reflection_fragment:Zg,defaultnormal_vertex:Kg,displacementmap_pars_vertex:Jg,displacementmap_vertex:Qg,emissivemap_fragment:t0,emissivemap_pars_fragment:e0,colorspace_fragment:n0,colorspace_pars_fragment:i0,envmap_fragment:s0,envmap_common_pars_fragment:r0,envmap_pars_fragment:o0,envmap_pars_vertex:a0,envmap_physical_pars_fragment:v0,envmap_vertex:l0,fog_vertex:c0,fog_pars_vertex:u0,fog_fragment:h0,fog_pars_fragment:f0,gradientmap_pars_fragment:d0,lightmap_pars_fragment:p0,lights_lambert_fragment:m0,lights_lambert_pars_fragment:_0,lights_pars_begin:g0,lights_toon_fragment:x0,lights_toon_pars_fragment:M0,lights_phong_fragment:S0,lights_phong_pars_fragment:y0,lights_physical_fragment:E0,lights_physical_pars_fragment:b0,lights_fragment_begin:T0,lights_fragment_maps:w0,lights_fragment_end:A0,logdepthbuf_fragment:R0,logdepthbuf_pars_fragment:C0,logdepthbuf_pars_vertex:P0,logdepthbuf_vertex:D0,map_fragment:L0,map_pars_fragment:I0,map_particle_fragment:U0,map_particle_pars_fragment:N0,metalnessmap_fragment:O0,metalnessmap_pars_fragment:F0,morphinstance_vertex:B0,morphcolor_vertex:z0,morphnormal_vertex:H0,morphtarget_pars_vertex:k0,morphtarget_vertex:V0,normal_fragment_begin:G0,normal_fragment_maps:W0,normal_pars_fragment:X0,normal_pars_vertex:Y0,normal_vertex:q0,normalmap_pars_fragment:j0,clearcoat_normal_fragment_begin:$0,clearcoat_normal_fragment_maps:Z0,clearcoat_pars_fragment:K0,iridescence_pars_fragment:J0,opaque_fragment:Q0,packing:tv,premultiplied_alpha_fragment:ev,project_vertex:nv,dithering_fragment:iv,dithering_pars_fragment:sv,roughnessmap_fragment:rv,roughnessmap_pars_fragment:ov,shadowmap_pars_fragment:av,shadowmap_pars_vertex:lv,shadowmap_vertex:cv,shadowmask_pars_fragment:uv,skinbase_vertex:hv,skinning_pars_vertex:fv,skinning_vertex:dv,skinnormal_vertex:pv,specularmap_fragment:mv,specularmap_pars_fragment:_v,tonemapping_fragment:gv,tonemapping_pars_fragment:vv,transmission_fragment:xv,transmission_pars_fragment:Mv,uv_pars_fragment:Sv,uv_pars_vertex:yv,uv_vertex:Ev,worldpos_vertex:bv,background_vert:Tv,background_frag:wv,backgroundCube_vert:Av,backgroundCube_frag:Rv,cube_vert:Cv,cube_frag:Pv,depth_vert:Dv,depth_frag:Lv,distanceRGBA_vert:Iv,distanceRGBA_frag:Uv,equirect_vert:Nv,equirect_frag:Ov,linedashed_vert:Fv,linedashed_frag:Bv,meshbasic_vert:zv,meshbasic_frag:Hv,meshlambert_vert:kv,meshlambert_frag:Vv,meshmatcap_vert:Gv,meshmatcap_frag:Wv,meshnormal_vert:Xv,meshnormal_frag:Yv,meshphong_vert:qv,meshphong_frag:jv,meshphysical_vert:$v,meshphysical_frag:Zv,meshtoon_vert:Kv,meshtoon_frag:Jv,points_vert:Qv,points_frag:tx,shadow_vert:ex,shadow_frag:nx,sprite_vert:ix,sprite_frag:sx},Tt={common:{diffuse:{value:new kt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new jt}},envmap:{envMap:{value:null},envMapRotation:{value:new jt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new jt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new jt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new jt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new jt},normalScale:{value:new zt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new jt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new jt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new jt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new jt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new kt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 kt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0},uvTransform:{value:new jt}},sprite:{diffuse:{value:new kt(16777215)},opacity:{value:1},center:{value:new zt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}}},Rn={basic:{uniforms:ze([Tt.common,Tt.specularmap,Tt.envmap,Tt.aomap,Tt.lightmap,Tt.fog]),vertexShader:$t.meshbasic_vert,fragmentShader:$t.meshbasic_frag},lambert:{uniforms:ze([Tt.common,Tt.specularmap,Tt.envmap,Tt.aomap,Tt.lightmap,Tt.emissivemap,Tt.bumpmap,Tt.normalmap,Tt.displacementmap,Tt.fog,Tt.lights,{emissive:{value:new kt(0)}}]),vertexShader:$t.meshlambert_vert,fragmentShader:$t.meshlambert_frag},phong:{uniforms:ze([Tt.common,Tt.specularmap,Tt.envmap,Tt.aomap,Tt.lightmap,Tt.emissivemap,Tt.bumpmap,Tt.normalmap,Tt.displacementmap,Tt.fog,Tt.lights,{emissive:{value:new kt(0)},specular:{value:new kt(1118481)},shininess:{value:30}}]),vertexShader:$t.meshphong_vert,fragmentShader:$t.meshphong_frag},standard:{uniforms:ze([Tt.common,Tt.envmap,Tt.aomap,Tt.lightmap,Tt.emissivemap,Tt.bumpmap,Tt.normalmap,Tt.displacementmap,Tt.roughnessmap,Tt.metalnessmap,Tt.fog,Tt.lights,{emissive:{value:new kt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:$t.meshphysical_vert,fragmentShader:$t.meshphysical_frag},toon:{uniforms:ze([Tt.common,Tt.aomap,Tt.lightmap,Tt.emissivemap,Tt.bumpmap,Tt.normalmap,Tt.displacementmap,Tt.gradientmap,Tt.fog,Tt.lights,{emissive:{value:new kt(0)}}]),vertexShader:$t.meshtoon_vert,fragmentShader:$t.meshtoon_frag},matcap:{uniforms:ze([Tt.common,Tt.bumpmap,Tt.normalmap,Tt.displacementmap,Tt.fog,{matcap:{value:null}}]),vertexShader:$t.meshmatcap_vert,fragmentShader:$t.meshmatcap_frag},points:{uniforms:ze([Tt.points,Tt.fog]),vertexShader:$t.points_vert,fragmentShader:$t.points_frag},dashed:{uniforms:ze([Tt.common,Tt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:$t.linedashed_vert,fragmentShader:$t.linedashed_frag},depth:{uniforms:ze([Tt.common,Tt.displacementmap]),vertexShader:$t.depth_vert,fragmentShader:$t.depth_frag},normal:{uniforms:ze([Tt.common,Tt.bumpmap,Tt.normalmap,Tt.displacementmap,{opacity:{value:1}}]),vertexShader:$t.meshnormal_vert,fragmentShader:$t.meshnormal_frag},sprite:{uniforms:ze([Tt.sprite,Tt.fog]),vertexShader:$t.sprite_vert,fragmentShader:$t.sprite_frag},background:{uniforms:{uvTransform:{value:new jt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:$t.background_vert,fragmentShader:$t.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new jt}},vertexShader:$t.backgroundCube_vert,fragmentShader:$t.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:$t.cube_vert,fragmentShader:$t.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:$t.equirect_vert,fragmentShader:$t.equirect_frag},distanceRGBA:{uniforms:ze([Tt.common,Tt.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:$t.distanceRGBA_vert,fragmentShader:$t.distanceRGBA_frag},shadow:{uniforms:ze([Tt.lights,Tt.fog,{color:{value:new kt(0)},opacity:{value:1}}]),vertexShader:$t.shadow_vert,fragmentShader:$t.shadow_frag}};Rn.physical={uniforms:ze([Rn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new jt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new jt},clearcoatNormalScale:{value:new zt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new jt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new jt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new jt},sheen:{value:0},sheenColor:{value:new kt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new jt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new jt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new jt},transmissionSamplerSize:{value:new zt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new jt},attenuationDistance:{value:0},attenuationColor:{value:new kt(0)},specularColor:{value:new kt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new jt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new jt},anisotropyVector:{value:new zt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new jt}}]),vertexShader:$t.meshphysical_vert,fragmentShader:$t.meshphysical_frag};const oo={r:0,b:0,g:0},Ni=new Sn,rx=new se;function ox(n,t,e,i,s,r,o){const a=new kt(0);let l=r===!0?0:1,c,u,h=null,d=0,m=null;function v(b){let T=b.isScene===!0?b.background:null;return T&&T.isTexture&&(T=(b.backgroundBlurriness>0?e:t).get(T)),T}function M(b){let T=!1;const S=v(b);S===null?f(a,l):S&&S.isColor&&(f(S,1),T=!0);const L=n.xr.getEnvironmentBlendMode();L==="additive"?i.buffers.color.setClear(0,0,0,1,o):L==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||T)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function p(b,T){const S=v(T);S&&(S.isCubeTexture||S.mapping===sa)?(u===void 0&&(u=new At(new fe(1,1,1),new wi({name:"BackgroundCubeMaterial",uniforms:Hs(Rn.backgroundCube.uniforms),vertexShader:Rn.backgroundCube.vertexShader,fragmentShader:Rn.backgroundCube.fragmentShader,side:Ze,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(L,D,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Ni.copy(T.backgroundRotation),Ni.x*=-1,Ni.y*=-1,Ni.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Ni.y*=-1,Ni.z*=-1),u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=T.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(rx.makeRotationFromEuler(Ni)),u.material.toneMapped=Zt.getTransfer(S.colorSpace)!==re,(h!==S||d!==S.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,h=S,d=S.version,m=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new At(new ts(2,2),new wi({name:"BackgroundMaterial",uniforms:Hs(Rn.background.uniforms),vertexShader:Rn.background.vertexShader,fragmentShader:Rn.background.fragmentShader,side:Ti,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,c.material.toneMapped=Zt.getTransfer(S.colorSpace)!==re,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(h!==S||d!==S.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,h=S,d=S.version,m=n.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function f(b,T){b.getRGB(oo,pd(n)),i.buffers.color.setClear(oo.r,oo.g,oo.b,T,o)}return{getClearColor:function(){return a},setClearColor:function(b,T=1){a.set(b),l=T,f(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,f(a,l)},render:M,addToRenderList:p}}function ax(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=d(null);let r=s,o=!1;function a(g,C,N,F,K){let st=!1;const Q=h(F,N,C);r!==Q&&(r=Q,c(r.object)),st=m(g,F,N,K),st&&v(g,F,N,K),K!==null&&t.update(K,n.ELEMENT_ARRAY_BUFFER),(st||o)&&(o=!1,S(g,C,N,F),K!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(K).buffer))}function l(){return n.createVertexArray()}function c(g){return n.bindVertexArray(g)}function u(g){return n.deleteVertexArray(g)}function h(g,C,N){const F=N.wireframe===!0;let K=i[g.id];K===void 0&&(K={},i[g.id]=K);let st=K[C.id];st===void 0&&(st={},K[C.id]=st);let Q=st[F];return Q===void 0&&(Q=d(l()),st[F]=Q),Q}function d(g){const C=[],N=[],F=[];for(let K=0;K=0){const gt=K[B];let X=st[B];if(X===void 0&&(B==="instanceMatrix"&&g.instanceMatrix&&(X=g.instanceMatrix),B==="instanceColor"&&g.instanceColor&&(X=g.instanceColor)),gt===void 0||gt.attribute!==X||X&>.data!==X.data)return!0;Q++}return r.attributesNum!==Q||r.index!==F}function v(g,C,N,F){const K={},st=C.attributes;let Q=0;const W=N.getAttributes();for(const B in W)if(W[B].location>=0){let gt=st[B];gt===void 0&&(B==="instanceMatrix"&&g.instanceMatrix&&(gt=g.instanceMatrix),B==="instanceColor"&&g.instanceColor&&(gt=g.instanceColor));const X={};X.attribute=gt,gt&>.data&&(X.data=gt.data),K[B]=X,Q++}r.attributes=K,r.attributesNum=Q,r.index=F}function M(){const g=r.newAttributes;for(let C=0,N=g.length;C=0){let et=K[W];if(et===void 0&&(W==="instanceMatrix"&&g.instanceMatrix&&(et=g.instanceMatrix),W==="instanceColor"&&g.instanceColor&&(et=g.instanceColor)),et!==void 0){const gt=et.normalized,X=et.itemSize,ot=t.get(et);if(ot===void 0)continue;const lt=ot.buffer,$=ot.type,at=ot.bytesPerElement,mt=$===n.INT||$===n.UNSIGNED_INT||et.gpuType===yc;if(et.isInterleavedBufferAttribute){const ut=et.data,ft=ut.stride,vt=et.offset;if(ut.isInstancedInterleavedBuffer){for(let Et=0;Et0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=e.logarithmicDepthBuffer===!0,d=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),m=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),M=n.getParameter(n.MAX_TEXTURE_SIZE),p=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),f=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),T=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),L=v>0,D=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,reverseDepthBuffer:d,maxTextures:m,maxVertexTextures:v,maxTextureSize:M,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:b,maxVaryings:T,maxFragmentUniforms:S,vertexTextures:L,maxSamples:D}}function ux(n){const t=this;let e=null,i=0,s=!1,r=!1;const o=new mi,a=new jt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const m=h.length!==0||d||i!==0||s;return s=d,i=h.length,m},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,d){e=u(h,d,0)},this.setState=function(h,d,m){const v=h.clippingPlanes,M=h.clipIntersection,p=h.clipShadows,f=n.get(h);if(!s||v===null||v.length===0||r&&!p)r?u(null):c();else{const b=r?0:i,T=b*4;let S=f.clippingState||null;l.value=S,S=u(v,d,T,m);for(let L=0;L!==T;++L)S[L]=e[L];f.clippingState=S,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(h,d,m,v){const M=h!==null?h.length:0;let p=null;if(M!==0){if(p=l.value,v!==!0||p===null){const f=m+M*4,b=d.matrixWorldInverse;a.getNormalMatrix(b),(p===null||p.length0){const c=new yg(l.height);return c.fromEquirectangularTexture(n,o),t.set(o,c),o.addEventListener("dispose",s),e(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function r(){t=new WeakMap}return{get:i,dispose:r}}class vd extends md{constructor(t=-1,e=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,i,s,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-t,o=i+t,a=s+e,l=s-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,o=r+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}const Ss=4,Ju=[.125,.215,.35,.446,.526,.582],Vi=20,ka=new vd,Qu=new kt;let Va=null,Ga=0,Wa=0,Xa=!1;const zi=(1+Math.sqrt(5))/2,_s=1/zi,th=[new O(-zi,_s,0),new O(zi,_s,0),new O(-_s,0,zi),new O(_s,0,zi),new O(0,zi,-_s),new O(0,zi,_s),new O(-1,1,-1),new O(1,1,-1),new O(-1,1,1),new O(1,1,1)];class eh{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,s=100){Va=this._renderer.getRenderTarget(),Ga=this._renderer.getActiveCubeFace(),Wa=this._renderer.getActiveMipmapLevel(),Xa=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ih(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?T:0,T,T),u.setRenderTarget(s),M&&u.render(v,a),u.render(t,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=d,u.autoClear=h,t.background=p}_textureToCubeUV(t,e){const i=this._renderer,s=t.mapping===Os||t.mapping===Fs;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=sh()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ih());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new At(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=t;const l=this._cubeSize;ao(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(o,ka)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rVi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${Vi}`);const f=[];let b=0;for(let P=0;PT-Ss?s-T+Ss:0),D=4*(this._cubeSize-S);ao(e,L,D,3*S,2*S),l.setRenderTarget(e),l.render(h,ka)}}function fx(n){const t=[],e=[],i=[];let s=n;const r=n-Ss+1+Ju.length;for(let o=0;on-Ss?l=Ju[o-n+Ss-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],m=6,v=6,M=3,p=2,f=1,b=new Float32Array(M*v*m),T=new Float32Array(p*v*m),S=new Float32Array(f*v*m);for(let D=0;D2?0:-1,_=[P,y,0,P+2/3,y,0,P+2/3,y+1,0,P,y,0,P+2/3,y+1,0,P,y+1,0];b.set(_,M*v*D),T.set(d,p*v*D);const g=[D,D,D,D,D,D];S.set(g,f*v*D)}const L=new We;L.setAttribute("position",new Mn(b,M)),L.setAttribute("uv",new Mn(T,p)),L.setAttribute("faceIndex",new Mn(S,f)),t.push(L),s>Ss&&s--}return{lodPlanes:t,sizeLods:e,sigmas:i}}function nh(n,t,e){const i=new $i(n,t,e);return i.texture.mapping=sa,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ao(n,t,e,i,s){n.viewport.set(t,e,i,s),n.scissor.set(t,e,i,s)}function dx(n,t,e){const i=new Float32Array(Vi),s=new O(0,1,0);return new wi({name:"SphericalGaussianBlur",defines:{n:Vi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Dc(),fragmentShader:` precision mediump float; precision mediump int; @@ -3662,7 +3662,7 @@ void main() { } } - `,blending:gi,depthTest:!1,depthWrite:!1})}function Qu(){return new Ei({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Cc(),fragmentShader:` + `,blending:Mi,depthTest:!1,depthWrite:!1})}function ih(){return new wi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Dc(),fragmentShader:` precision mediump float; precision mediump int; @@ -3681,7 +3681,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:gi,depthTest:!1,depthWrite:!1})}function th(){return new Ei({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Cc(),fragmentShader:` + `,blending:Mi,depthTest:!1,depthWrite:!1})}function sh(){return new wi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Dc(),fragmentShader:` precision mediump float; precision mediump int; @@ -3697,7 +3697,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:gi,depthTest:!1,depthWrite:!1})}function Cc(){return` + `,blending:Mi,depthTest:!1,depthWrite:!1})}function Dc(){return` precision mediump float; precision mediump int; @@ -3752,17 +3752,17 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function fx(n){let t=new WeakMap,e=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===xl||l===Ml,u=l===Ps||l===Ds;if(c||u){let h=t.get(a);const d=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return e===null&&(e=new Ku(n)),h=c?e.fromEquirectangular(a,h):e.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),h.texture;if(h!==void 0)return h.texture;{const p=a.image;return c&&p&&p.height>0||u&&p&&s(p)?(e===null&&(e=new Ku(n)),h=c?e.fromEquirectangular(a):e.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),a.addEventListener("dispose",r),h.texture):null}}}return a}function s(a){let l=0;const c=6;for(let u=0;ut.maxTextureSize&&(D=Math.ceil(U/t.maxTextureSize),U=t.maxTextureSize);const P=new Float32Array(U*D*4*h),y=new ad(P,U,D,h);y.type=Pn,y.needsUpdate=!0;const _=S*4;for(let C=0;C0)return n;const s=t*e;let r=nh[s];if(r===void 0&&(r=new Float32Array(s),nh[s]=r),t!==0){i.toArray(r,0);for(let o=1,a=0;o!==t;++o)a+=e,n[o].toArray(r,a)}return r}function be(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e0||u&&m&&s(m)?(e===null&&(e=new eh(n)),h=c?e.fromEquirectangular(a):e.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),a.addEventListener("dispose",r),h.texture):null}}}return a}function s(a){let l=0;const c=6;for(let u=0;ut.maxTextureSize&&(D=Math.ceil(L/t.maxTextureSize),L=t.maxTextureSize);const P=new Float32Array(L*D*4*h),y=new ud(P,L,D,h);y.type=Pn,y.needsUpdate=!0;const _=S*4;for(let C=0;C0)return n;const s=t*e;let r=oh[s];if(r===void 0&&(r=new Float32Array(s),oh[s]=r),t!==0){i.toArray(r,0);for(let o=1,a=0;o!==t;++o)a+=e,n[o].toArray(r,a)}return r}function be(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e":" "} ${a}: ${e[o]}`)}return i.join(` -`)}const ch=new jt;function fM(n){$t._getMatrix(ch,$t.workingColorSpace,n);const t=`mat3( ${ch.elements.map(e=>e.toFixed(4))} )`;switch($t.getTransfer(n)){case ta:return[t,"LinearTransferOETF"];case re:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function uh(n,t,e){const i=n.getShaderParameter(t,n.COMPILE_STATUS),s=n.getShaderInfoLog(t).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return e.toUpperCase()+` +`)}const dh=new jt;function pM(n){Zt._getMatrix(dh,Zt.workingColorSpace,n);const t=`mat3( ${dh.elements.map(e=>e.toFixed(4))} )`;switch(Zt.getTransfer(n)){case ra:return[t,"LinearTransferOETF"];case re:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function ph(n,t,e){const i=n.getShaderParameter(t,n.COMPILE_STATUS),s=n.getShaderInfoLog(t).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return e.toUpperCase()+` `+s+` -`+hM(n.getShaderSource(t),o)}else return s}function dM(n,t){const e=fM(t);return[`vec4 ${n}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` -`)}function pM(n,t){let e;switch(t){case P_:e="Linear";break;case D_:e="Reinhard";break;case L_:e="Cineon";break;case I_:e="ACESFilmic";break;case N_:e="AgX";break;case O_:e="Neutral";break;case U_:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+n+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const io=new O;function mM(){$t.getLuminanceCoefficients(io);const n=io.x.toFixed(4),t=io.y.toFixed(4),e=io.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` -`)}function _M(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(rr).join(` -`)}function gM(n){const t=[];for(const e in n){const i=n[e];i!==!1&&t.push("#define "+e+" "+i)}return t.join(` -`)}function vM(n,t){const e={},i=n.getProgramParameter(t,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function $l(n){return n.replace(xM,SM)}const MM=new Map;function SM(n,t){let e=Zt[t];if(e===void 0){const i=MM.get(t);if(i!==void 0)e=Zt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,i);else throw new Error("Can not resolve #include <"+t+">")}return $l(e)}const yM=/#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 dh(n){return n.replace(yM,EM)}function EM(n,t,e,i){let s="";for(let r=parseInt(t);r/gm;function Ql(n){return n.replace(SM,EM)}const yM=new Map;function EM(n,t){let e=$t[t];if(e===void 0){const i=yM.get(t);if(i!==void 0)e=$t[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,i);else throw new Error("Can not resolve #include <"+t+">")}return Ql(e)}const bM=/#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 gh(n){return n.replace(bM,TM)}function TM(n,t,e,i){let s="";for(let r=parseInt(t);r0&&(m+=` -`),f=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v].filter(rr).join(` +#define LOW_PRECISION`),t}function wM(n){let t="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===$f?t="SHADOWMAP_TYPE_PCF":n.shadowMapType===h_?t="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Gn&&(t="SHADOWMAP_TYPE_VSM"),t}function AM(n){let t="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Os:case Fs:t="ENVMAP_TYPE_CUBE";break;case sa:t="ENVMAP_TYPE_CUBE_UV";break}return t}function RM(n){let t="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Fs:t="ENVMAP_MODE_REFRACTION";break}return t}function CM(n){let t="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case Sc:t="ENVMAP_BLENDING_MULTIPLY";break;case P_:t="ENVMAP_BLENDING_MIX";break;case D_:t="ENVMAP_BLENDING_ADD";break}return t}function PM(n){const t=n.envMapCubeUVHeight;if(t===null)return null;const e=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:i,maxMip:e}}function DM(n,t,e,i){const s=n.getContext(),r=e.defines;let o=e.vertexShader,a=e.fragmentShader;const l=wM(e),c=AM(e),u=RM(e),h=CM(e),d=PM(e),m=vM(e),v=xM(r),M=s.createProgram();let p,f,b=e.glslVersion?"#version "+e.glslVersion+` +`:"";e.isRawShaderMaterial?(p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v].filter(hr).join(` +`),p.length>0&&(p+=` +`),f=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v].filter(hr).join(` `),f.length>0&&(f+=` -`)):(m=[ph(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+u:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(rr).join(` -`),f=[ph(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+u:"",e.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==vi?"#define TONE_MAPPING":"",e.toneMapping!==vi?Zt.tonemapping_pars_fragment:"",e.toneMapping!==vi?pM("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Zt.colorspace_pars_fragment,dM("linearToOutputTexel",e.outputColorSpace),mM(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` -`].filter(rr).join(` -`)),o=$l(o),o=hh(o,e),o=fh(o,e),a=$l(a),a=hh(a,e),a=fh(a,e),o=dh(o),a=dh(a),e.isRawShaderMaterial!==!0&&(T=`#version 300 es -`,m=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)):(p=[vh(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+u:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(hr).join(` +`),f=[vh(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+u:"",e.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Si?"#define TONE_MAPPING":"",e.toneMapping!==Si?$t.tonemapping_pars_fragment:"",e.toneMapping!==Si?_M("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",$t.colorspace_pars_fragment,mM("linearToOutputTexel",e.outputColorSpace),gM(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(hr).join(` +`)),o=Ql(o),o=mh(o,e),o=_h(o,e),a=Ql(a),a=mh(a,e),a=_h(a,e),o=gh(o),a=gh(a),e.isRawShaderMaterial!==!0&&(b=`#version 300 es +`,p=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+m,f=["#define varying in",e.glslVersion===Au?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Au?"":"#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(` +`+p,f=["#define varying in",e.glslVersion===Du?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Du?"":"#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(` `)+` -`+f);const b=T+m+o,S=T+f+a,U=lh(s,s.VERTEX_SHADER,b),D=lh(s,s.FRAGMENT_SHADER,S);s.attachShader(M,U),s.attachShader(M,D),e.index0AttributeName!==void 0?s.bindAttribLocation(M,0,e.index0AttributeName):e.morphTargets===!0&&s.bindAttribLocation(M,0,"position"),s.linkProgram(M);function P(C){if(n.debug.checkShaderErrors){const N=s.getProgramInfoLog(M).trim(),F=s.getShaderInfoLog(U).trim(),J=s.getShaderInfoLog(D).trim();let st=!0,Q=!0;if(s.getProgramParameter(M,s.LINK_STATUS)===!1)if(st=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,M,U,D);else{const W=uh(s,U,"vertex"),B=uh(s,D,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(M,s.VALIDATE_STATUS)+` +`+f);const T=b+p+o,S=b+f+a,L=fh(s,s.VERTEX_SHADER,T),D=fh(s,s.FRAGMENT_SHADER,S);s.attachShader(M,L),s.attachShader(M,D),e.index0AttributeName!==void 0?s.bindAttribLocation(M,0,e.index0AttributeName):e.morphTargets===!0&&s.bindAttribLocation(M,0,"position"),s.linkProgram(M);function P(C){if(n.debug.checkShaderErrors){const N=s.getProgramInfoLog(M).trim(),F=s.getShaderInfoLog(L).trim(),K=s.getShaderInfoLog(D).trim();let st=!0,Q=!0;if(s.getProgramParameter(M,s.LINK_STATUS)===!1)if(st=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,M,L,D);else{const W=ph(s,L,"vertex"),B=ph(s,D,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(M,s.VALIDATE_STATUS)+` Material Name: `+C.name+` Material Type: `+C.type+` Program Info Log: `+N+` `+W+` -`+B)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(F===""||J==="")&&(Q=!1);Q&&(C.diagnostics={runnable:st,programLog:N,vertexShader:{log:F,prefix:m},fragmentShader:{log:J,prefix:f}})}s.deleteShader(U),s.deleteShader(D),y=new Ro(s,M),_=vM(s,M)}let y;this.getUniforms=function(){return y===void 0&&P(this),y};let _;this.getAttributes=function(){return _===void 0&&P(this),_};let g=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return g===!1&&(g=s.getProgramParameter(M,cM)),g},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(M),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=uM++,this.cacheKey=t,this.usedTimes=1,this.program=M,this.vertexShader=U,this.fragmentShader=D,this}let PM=0;class DM{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(t);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const i of e)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let i=e.get(t);return i===void 0&&(i=new Set,e.set(t,i)),i}_getShaderStage(t){const e=this.shaderCache;let i=e.get(t);return i===void 0&&(i=new LM(t),e.set(t,i)),i}}class LM{constructor(t){this.id=PM++,this.code=t,this.usedTimes=0}}function IM(n,t,e,i,s,r,o){const a=new Ac,l=new DM,c=new Set,u=[],h=s.logarithmicDepthBuffer,d=s.vertexTextures;let p=s.precision;const v={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"};function M(_){return c.add(_),_===0?"uv":`uv${_}`}function m(_,g,C,N,F){const J=N.fog,st=F.geometry,Q=_.isMeshStandardMaterial?N.environment:null,W=(_.isMeshStandardMaterial?e:t).get(_.envMap||Q),B=W&&W.mapping===Qo?W.image.height:null,et=v[_.type];_.precision!==null&&(p=s.getMaxPrecision(_.precision),p!==_.precision&&console.warn("THREE.WebGLProgram.getParameters:",_.precision,"not supported, using",p,"instead."));const gt=st.morphAttributes.position||st.morphAttributes.normal||st.morphAttributes.color,X=gt!==void 0?gt.length:0;let ot=0;st.morphAttributes.position!==void 0&&(ot=1),st.morphAttributes.normal!==void 0&&(ot=2),st.morphAttributes.color!==void 0&&(ot=3);let lt,Z,at,mt;if(et){const ie=Rn[et];lt=ie.vertexShader,Z=ie.fragmentShader}else lt=_.vertexShader,Z=_.fragmentShader,l.update(_),at=l.getVertexShaderID(_),mt=l.getFragmentShaderID(_);const ut=n.getRenderTarget(),ft=n.state.buffers.depth.getReversed(),vt=F.isInstancedMesh===!0,yt=F.isBatchedMesh===!0,Tt=!!_.map,R=!!_.matcap,L=!!W,w=!!_.aoMap,tt=!!_.lightMap,H=!!_.bumpMap,j=!!_.normalMap,Y=!!_.displacementMap,rt=!!_.emissiveMap,$=!!_.metalnessMap,E=!!_.roughnessMap,x=_.anisotropy>0,I=_.clearcoat>0,k=_.dispersion>0,K=_.iridescence>0,q=_.sheen>0,_t=_.transmission>0,ht=x&&!!_.anisotropyMap,St=I&&!!_.clearcoatMap,Ft=I&&!!_.clearcoatNormalMap,pt=I&&!!_.clearcoatRoughnessMap,xt=K&&!!_.iridescenceMap,Lt=K&&!!_.iridescenceThicknessMap,Bt=q&&!!_.sheenColorMap,Et=q&&!!_.sheenRoughnessMap,kt=!!_.specularMap,Wt=!!_.specularColorMap,ne=!!_.specularIntensityMap,z=_t&&!!_.transmissionMap,At=_t&&!!_.thicknessMap,ct=!!_.gradientMap,dt=!!_.alphaMap,Pt=_.alphaTest>0,Rt=!!_.alphaHash,Yt=!!_.extensions;let ve=vi;_.toneMapped&&(ut===null||ut.isXRRenderTarget===!0)&&(ve=n.toneMapping);const Pe={shaderID:et,shaderType:_.type,shaderName:_.name,vertexShader:lt,fragmentShader:Z,defines:_.defines,customVertexShaderID:at,customFragmentShaderID:mt,isRawShaderMaterial:_.isRawShaderMaterial===!0,glslVersion:_.glslVersion,precision:p,batching:yt,batchingColor:yt&&F._colorsTexture!==null,instancing:vt,instancingColor:vt&&F.instanceColor!==null,instancingMorph:vt&&F.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:ut===null?n.outputColorSpace:ut.isXRRenderTarget===!0?ut.texture.colorSpace:Fs,alphaToCoverage:!!_.alphaToCoverage,map:Tt,matcap:R,envMap:L,envMapMode:L&&W.mapping,envMapCubeUVHeight:B,aoMap:w,lightMap:tt,bumpMap:H,normalMap:j,displacementMap:d&&Y,emissiveMap:rt,normalMapObjectSpace:j&&_.normalMapType===H_,normalMapTangentSpace:j&&_.normalMapType===id,metalnessMap:$,roughnessMap:E,anisotropy:x,anisotropyMap:ht,clearcoat:I,clearcoatMap:St,clearcoatNormalMap:Ft,clearcoatRoughnessMap:pt,dispersion:k,iridescence:K,iridescenceMap:xt,iridescenceThicknessMap:Lt,sheen:q,sheenColorMap:Bt,sheenRoughnessMap:Et,specularMap:kt,specularColorMap:Wt,specularIntensityMap:ne,transmission:_t,transmissionMap:z,thicknessMap:At,gradientMap:ct,opaque:_.transparent===!1&&_.blending===Ts&&_.alphaToCoverage===!1,alphaMap:dt,alphaTest:Pt,alphaHash:Rt,combine:_.combine,mapUv:Tt&&M(_.map.channel),aoMapUv:w&&M(_.aoMap.channel),lightMapUv:tt&&M(_.lightMap.channel),bumpMapUv:H&&M(_.bumpMap.channel),normalMapUv:j&&M(_.normalMap.channel),displacementMapUv:Y&&M(_.displacementMap.channel),emissiveMapUv:rt&&M(_.emissiveMap.channel),metalnessMapUv:$&&M(_.metalnessMap.channel),roughnessMapUv:E&&M(_.roughnessMap.channel),anisotropyMapUv:ht&&M(_.anisotropyMap.channel),clearcoatMapUv:St&&M(_.clearcoatMap.channel),clearcoatNormalMapUv:Ft&&M(_.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pt&&M(_.clearcoatRoughnessMap.channel),iridescenceMapUv:xt&&M(_.iridescenceMap.channel),iridescenceThicknessMapUv:Lt&&M(_.iridescenceThicknessMap.channel),sheenColorMapUv:Bt&&M(_.sheenColorMap.channel),sheenRoughnessMapUv:Et&&M(_.sheenRoughnessMap.channel),specularMapUv:kt&&M(_.specularMap.channel),specularColorMapUv:Wt&&M(_.specularColorMap.channel),specularIntensityMapUv:ne&&M(_.specularIntensityMap.channel),transmissionMapUv:z&&M(_.transmissionMap.channel),thicknessMapUv:At&&M(_.thicknessMap.channel),alphaMapUv:dt&&M(_.alphaMap.channel),vertexTangents:!!st.attributes.tangent&&(j||x),vertexColors:_.vertexColors,vertexAlphas:_.vertexColors===!0&&!!st.attributes.color&&st.attributes.color.itemSize===4,pointsUvs:F.isPoints===!0&&!!st.attributes.uv&&(Tt||dt),fog:!!J,useFog:_.fog===!0,fogExp2:!!J&&J.isFogExp2,flatShading:_.flatShading===!0,sizeAttenuation:_.sizeAttenuation===!0,logarithmicDepthBuffer:h,reverseDepthBuffer:ft,skinning:F.isSkinnedMesh===!0,morphTargets:st.morphAttributes.position!==void 0,morphNormals:st.morphAttributes.normal!==void 0,morphColors:st.morphAttributes.color!==void 0,morphTargetsCount:X,morphTextureStride:ot,numDirLights:g.directional.length,numPointLights:g.point.length,numSpotLights:g.spot.length,numSpotLightMaps:g.spotLightMap.length,numRectAreaLights:g.rectArea.length,numHemiLights:g.hemi.length,numDirLightShadows:g.directionalShadowMap.length,numPointLightShadows:g.pointShadowMap.length,numSpotLightShadows:g.spotShadowMap.length,numSpotLightShadowsWithMaps:g.numSpotLightShadowsWithMaps,numLightProbes:g.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:_.dithering,shadowMapEnabled:n.shadowMap.enabled&&C.length>0,shadowMapType:n.shadowMap.type,toneMapping:ve,decodeVideoTexture:Tt&&_.map.isVideoTexture===!0&&$t.getTransfer(_.map.colorSpace)===re,decodeVideoTextureEmissive:rt&&_.emissiveMap.isVideoTexture===!0&&$t.getTransfer(_.emissiveMap.colorSpace)===re,premultipliedAlpha:_.premultipliedAlpha,doubleSided:_.side===_n,flipSided:_.side===Ze,useDepthPacking:_.depthPacking>=0,depthPacking:_.depthPacking||0,index0AttributeName:_.index0AttributeName,extensionClipCullDistance:Yt&&_.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Yt&&_.extensions.multiDraw===!0||yt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:_.customProgramCacheKey()};return Pe.vertexUv1s=c.has(1),Pe.vertexUv2s=c.has(2),Pe.vertexUv3s=c.has(3),c.clear(),Pe}function f(_){const g=[];if(_.shaderID?g.push(_.shaderID):(g.push(_.customVertexShaderID),g.push(_.customFragmentShaderID)),_.defines!==void 0)for(const C in _.defines)g.push(C),g.push(_.defines[C]);return _.isRawShaderMaterial===!1&&(T(g,_),b(g,_),g.push(n.outputColorSpace)),g.push(_.customProgramCacheKey),g.join()}function T(_,g){_.push(g.precision),_.push(g.outputColorSpace),_.push(g.envMapMode),_.push(g.envMapCubeUVHeight),_.push(g.mapUv),_.push(g.alphaMapUv),_.push(g.lightMapUv),_.push(g.aoMapUv),_.push(g.bumpMapUv),_.push(g.normalMapUv),_.push(g.displacementMapUv),_.push(g.emissiveMapUv),_.push(g.metalnessMapUv),_.push(g.roughnessMapUv),_.push(g.anisotropyMapUv),_.push(g.clearcoatMapUv),_.push(g.clearcoatNormalMapUv),_.push(g.clearcoatRoughnessMapUv),_.push(g.iridescenceMapUv),_.push(g.iridescenceThicknessMapUv),_.push(g.sheenColorMapUv),_.push(g.sheenRoughnessMapUv),_.push(g.specularMapUv),_.push(g.specularColorMapUv),_.push(g.specularIntensityMapUv),_.push(g.transmissionMapUv),_.push(g.thicknessMapUv),_.push(g.combine),_.push(g.fogExp2),_.push(g.sizeAttenuation),_.push(g.morphTargetsCount),_.push(g.morphAttributeCount),_.push(g.numDirLights),_.push(g.numPointLights),_.push(g.numSpotLights),_.push(g.numSpotLightMaps),_.push(g.numHemiLights),_.push(g.numRectAreaLights),_.push(g.numDirLightShadows),_.push(g.numPointLightShadows),_.push(g.numSpotLightShadows),_.push(g.numSpotLightShadowsWithMaps),_.push(g.numLightProbes),_.push(g.shadowMapType),_.push(g.toneMapping),_.push(g.numClippingPlanes),_.push(g.numClipIntersection),_.push(g.depthPacking)}function b(_,g){a.disableAll(),g.supportsVertexTextures&&a.enable(0),g.instancing&&a.enable(1),g.instancingColor&&a.enable(2),g.instancingMorph&&a.enable(3),g.matcap&&a.enable(4),g.envMap&&a.enable(5),g.normalMapObjectSpace&&a.enable(6),g.normalMapTangentSpace&&a.enable(7),g.clearcoat&&a.enable(8),g.iridescence&&a.enable(9),g.alphaTest&&a.enable(10),g.vertexColors&&a.enable(11),g.vertexAlphas&&a.enable(12),g.vertexUv1s&&a.enable(13),g.vertexUv2s&&a.enable(14),g.vertexUv3s&&a.enable(15),g.vertexTangents&&a.enable(16),g.anisotropy&&a.enable(17),g.alphaHash&&a.enable(18),g.batching&&a.enable(19),g.dispersion&&a.enable(20),g.batchingColor&&a.enable(21),_.push(a.mask),a.disableAll(),g.fog&&a.enable(0),g.useFog&&a.enable(1),g.flatShading&&a.enable(2),g.logarithmicDepthBuffer&&a.enable(3),g.reverseDepthBuffer&&a.enable(4),g.skinning&&a.enable(5),g.morphTargets&&a.enable(6),g.morphNormals&&a.enable(7),g.morphColors&&a.enable(8),g.premultipliedAlpha&&a.enable(9),g.shadowMapEnabled&&a.enable(10),g.doubleSided&&a.enable(11),g.flipSided&&a.enable(12),g.useDepthPacking&&a.enable(13),g.dithering&&a.enable(14),g.transmission&&a.enable(15),g.sheen&&a.enable(16),g.opaque&&a.enable(17),g.pointsUvs&&a.enable(18),g.decodeVideoTexture&&a.enable(19),g.decodeVideoTextureEmissive&&a.enable(20),g.alphaToCoverage&&a.enable(21),_.push(a.mask)}function S(_){const g=v[_.type];let C;if(g){const N=Rn[g];C=_g.clone(N.uniforms)}else C=_.uniforms;return C}function U(_,g){let C;for(let N=0,F=u.length;N0?i.push(f):p.transparent===!0?s.push(f):e.push(f)}function l(h,d,p,v,M,m){const f=o(h,d,p,v,M,m);p.transmission>0?i.unshift(f):p.transparent===!0?s.unshift(f):e.unshift(f)}function c(h,d){e.length>1&&e.sort(h||NM),i.length>1&&i.sort(d||mh),s.length>1&&s.sort(d||mh)}function u(){for(let h=t,d=n.length;h=r.length?(o=new _h,r.push(o)):o=r[s],o}function e(){n=new WeakMap}return{get:t,dispose:e}}function FM(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new O,color:new zt};break;case"SpotLight":e={position:new O,direction:new O,color:new zt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new O,color:new zt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new O,skyColor:new zt,groundColor:new zt};break;case"RectAreaLight":e={color:new zt,position:new O,halfWidth:new O,halfHeight:new O};break}return n[t.id]=e,e}}}function BM(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ht,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let zM=0;function HM(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function kM(n){const t=new FM,e=BM(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new O);const s=new O,r=new se,o=new se;function a(c){let u=0,h=0,d=0;for(let _=0;_<9;_++)i.probe[_].set(0,0,0);let p=0,v=0,M=0,m=0,f=0,T=0,b=0,S=0,U=0,D=0,P=0;c.sort(HM);for(let _=0,g=c.length;_0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=bt.LTC_FLOAT_1,i.rectAreaLTC2=bt.LTC_FLOAT_2):(i.rectAreaLTC1=bt.LTC_HALF_1,i.rectAreaLTC2=bt.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=d;const y=i.hash;(y.directionalLength!==p||y.pointLength!==v||y.spotLength!==M||y.rectAreaLength!==m||y.hemiLength!==f||y.numDirectionalShadows!==T||y.numPointShadows!==b||y.numSpotShadows!==S||y.numSpotMaps!==U||y.numLightProbes!==P)&&(i.directional.length=p,i.spot.length=M,i.rectArea.length=m,i.point.length=v,i.hemi.length=f,i.directionalShadow.length=T,i.directionalShadowMap.length=T,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=T,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=S+U-D,i.spotLightMap.length=U,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=P,y.directionalLength=p,y.pointLength=v,y.spotLength=M,y.rectAreaLength=m,y.hemiLength=f,y.numDirectionalShadows=T,y.numPointShadows=b,y.numSpotShadows=S,y.numSpotMaps=U,y.numLightProbes=P,i.version=zM++)}function l(c,u){let h=0,d=0,p=0,v=0,M=0;const m=u.matrixWorldInverse;for(let f=0,T=c.length;f=o.length?(a=new gh(n),o.push(a)):a=o[r],a}function i(){t=new WeakMap}return{get:e,dispose:i}}class GM extends zs{static get type(){return"MeshDepthMaterial"}constructor(t){super(),this.isMeshDepthMaterial=!0,this.depthPacking=B_,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class WM extends zs{static get type(){return"MeshDistanceMaterial"}constructor(t){super(),this.isMeshDistanceMaterial=!0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const XM=`void main() { +`+B)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(F===""||K==="")&&(Q=!1);Q&&(C.diagnostics={runnable:st,programLog:N,vertexShader:{log:F,prefix:p},fragmentShader:{log:K,prefix:f}})}s.deleteShader(L),s.deleteShader(D),y=new Lo(s,M),_=MM(s,M)}let y;this.getUniforms=function(){return y===void 0&&P(this),y};let _;this.getAttributes=function(){return _===void 0&&P(this),_};let g=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return g===!1&&(g=s.getProgramParameter(M,hM)),g},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(M),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=fM++,this.cacheKey=t,this.usedTimes=1,this.program=M,this.vertexShader=L,this.fragmentShader=D,this}let LM=0;class IM{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(t);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const i of e)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let i=e.get(t);return i===void 0&&(i=new Set,e.set(t,i)),i}_getShaderStage(t){const e=this.shaderCache;let i=e.get(t);return i===void 0&&(i=new UM(t),e.set(t,i)),i}}class UM{constructor(t){this.id=LM++,this.code=t,this.usedTimes=0}}function NM(n,t,e,i,s,r,o){const a=new Cc,l=new IM,c=new Set,u=[],h=s.logarithmicDepthBuffer,d=s.vertexTextures;let m=s.precision;const v={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"};function M(_){return c.add(_),_===0?"uv":`uv${_}`}function p(_,g,C,N,F){const K=N.fog,st=F.geometry,Q=_.isMeshStandardMaterial?N.environment:null,W=(_.isMeshStandardMaterial?e:t).get(_.envMap||Q),B=W&&W.mapping===sa?W.image.height:null,et=v[_.type];_.precision!==null&&(m=s.getMaxPrecision(_.precision),m!==_.precision&&console.warn("THREE.WebGLProgram.getParameters:",_.precision,"not supported, using",m,"instead."));const gt=st.morphAttributes.position||st.morphAttributes.normal||st.morphAttributes.color,X=gt!==void 0?gt.length:0;let ot=0;st.morphAttributes.position!==void 0&&(ot=1),st.morphAttributes.normal!==void 0&&(ot=2),st.morphAttributes.color!==void 0&&(ot=3);let lt,$,at,mt;if(et){const ie=Rn[et];lt=ie.vertexShader,$=ie.fragmentShader}else lt=_.vertexShader,$=_.fragmentShader,l.update(_),at=l.getVertexShaderID(_),mt=l.getFragmentShaderID(_);const ut=n.getRenderTarget(),ft=n.state.buffers.depth.getReversed(),vt=F.isInstancedMesh===!0,Et=F.isBatchedMesh===!0,wt=!!_.map,R=!!_.matcap,I=!!W,w=!!_.aoMap,tt=!!_.lightMap,H=!!_.bumpMap,j=!!_.normalMap,Y=!!_.displacementMap,rt=!!_.emissiveMap,Z=!!_.metalnessMap,E=!!_.roughnessMap,x=_.anisotropy>0,U=_.clearcoat>0,k=_.dispersion>0,J=_.iridescence>0,q=_.sheen>0,_t=_.transmission>0,ht=x&&!!_.anisotropyMap,yt=U&&!!_.clearcoatMap,Ft=U&&!!_.clearcoatNormalMap,pt=U&&!!_.clearcoatRoughnessMap,Mt=J&&!!_.iridescenceMap,Lt=J&&!!_.iridescenceThicknessMap,Bt=q&&!!_.sheenColorMap,bt=q&&!!_.sheenRoughnessMap,Ht=!!_.specularMap,Wt=!!_.specularColorMap,ne=!!_.specularIntensityMap,z=_t&&!!_.transmissionMap,Rt=_t&&!!_.thicknessMap,ct=!!_.gradientMap,dt=!!_.alphaMap,Dt=_.alphaTest>0,Ct=!!_.alphaHash,Yt=!!_.extensions;let ve=Si;_.toneMapped&&(ut===null||ut.isXRRenderTarget===!0)&&(ve=n.toneMapping);const Pe={shaderID:et,shaderType:_.type,shaderName:_.name,vertexShader:lt,fragmentShader:$,defines:_.defines,customVertexShaderID:at,customFragmentShaderID:mt,isRawShaderMaterial:_.isRawShaderMaterial===!0,glslVersion:_.glslVersion,precision:m,batching:Et,batchingColor:Et&&F._colorsTexture!==null,instancing:vt,instancingColor:vt&&F.instanceColor!==null,instancingMorph:vt&&F.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:ut===null?n.outputColorSpace:ut.isXRRenderTarget===!0?ut.texture.colorSpace:Gs,alphaToCoverage:!!_.alphaToCoverage,map:wt,matcap:R,envMap:I,envMapMode:I&&W.mapping,envMapCubeUVHeight:B,aoMap:w,lightMap:tt,bumpMap:H,normalMap:j,displacementMap:d&&Y,emissiveMap:rt,normalMapObjectSpace:j&&_.normalMapType===V_,normalMapTangentSpace:j&&_.normalMapType===od,metalnessMap:Z,roughnessMap:E,anisotropy:x,anisotropyMap:ht,clearcoat:U,clearcoatMap:yt,clearcoatNormalMap:Ft,clearcoatRoughnessMap:pt,dispersion:k,iridescence:J,iridescenceMap:Mt,iridescenceThicknessMap:Lt,sheen:q,sheenColorMap:Bt,sheenRoughnessMap:bt,specularMap:Ht,specularColorMap:Wt,specularIntensityMap:ne,transmission:_t,transmissionMap:z,thicknessMap:Rt,gradientMap:ct,opaque:_.transparent===!1&&_.blending===Cs&&_.alphaToCoverage===!1,alphaMap:dt,alphaTest:Dt,alphaHash:Ct,combine:_.combine,mapUv:wt&&M(_.map.channel),aoMapUv:w&&M(_.aoMap.channel),lightMapUv:tt&&M(_.lightMap.channel),bumpMapUv:H&&M(_.bumpMap.channel),normalMapUv:j&&M(_.normalMap.channel),displacementMapUv:Y&&M(_.displacementMap.channel),emissiveMapUv:rt&&M(_.emissiveMap.channel),metalnessMapUv:Z&&M(_.metalnessMap.channel),roughnessMapUv:E&&M(_.roughnessMap.channel),anisotropyMapUv:ht&&M(_.anisotropyMap.channel),clearcoatMapUv:yt&&M(_.clearcoatMap.channel),clearcoatNormalMapUv:Ft&&M(_.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pt&&M(_.clearcoatRoughnessMap.channel),iridescenceMapUv:Mt&&M(_.iridescenceMap.channel),iridescenceThicknessMapUv:Lt&&M(_.iridescenceThicknessMap.channel),sheenColorMapUv:Bt&&M(_.sheenColorMap.channel),sheenRoughnessMapUv:bt&&M(_.sheenRoughnessMap.channel),specularMapUv:Ht&&M(_.specularMap.channel),specularColorMapUv:Wt&&M(_.specularColorMap.channel),specularIntensityMapUv:ne&&M(_.specularIntensityMap.channel),transmissionMapUv:z&&M(_.transmissionMap.channel),thicknessMapUv:Rt&&M(_.thicknessMap.channel),alphaMapUv:dt&&M(_.alphaMap.channel),vertexTangents:!!st.attributes.tangent&&(j||x),vertexColors:_.vertexColors,vertexAlphas:_.vertexColors===!0&&!!st.attributes.color&&st.attributes.color.itemSize===4,pointsUvs:F.isPoints===!0&&!!st.attributes.uv&&(wt||dt),fog:!!K,useFog:_.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:_.flatShading===!0,sizeAttenuation:_.sizeAttenuation===!0,logarithmicDepthBuffer:h,reverseDepthBuffer:ft,skinning:F.isSkinnedMesh===!0,morphTargets:st.morphAttributes.position!==void 0,morphNormals:st.morphAttributes.normal!==void 0,morphColors:st.morphAttributes.color!==void 0,morphTargetsCount:X,morphTextureStride:ot,numDirLights:g.directional.length,numPointLights:g.point.length,numSpotLights:g.spot.length,numSpotLightMaps:g.spotLightMap.length,numRectAreaLights:g.rectArea.length,numHemiLights:g.hemi.length,numDirLightShadows:g.directionalShadowMap.length,numPointLightShadows:g.pointShadowMap.length,numSpotLightShadows:g.spotShadowMap.length,numSpotLightShadowsWithMaps:g.numSpotLightShadowsWithMaps,numLightProbes:g.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:_.dithering,shadowMapEnabled:n.shadowMap.enabled&&C.length>0,shadowMapType:n.shadowMap.type,toneMapping:ve,decodeVideoTexture:wt&&_.map.isVideoTexture===!0&&Zt.getTransfer(_.map.colorSpace)===re,decodeVideoTextureEmissive:rt&&_.emissiveMap.isVideoTexture===!0&&Zt.getTransfer(_.emissiveMap.colorSpace)===re,premultipliedAlpha:_.premultipliedAlpha,doubleSided:_.side===_n,flipSided:_.side===Ze,useDepthPacking:_.depthPacking>=0,depthPacking:_.depthPacking||0,index0AttributeName:_.index0AttributeName,extensionClipCullDistance:Yt&&_.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Yt&&_.extensions.multiDraw===!0||Et)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:_.customProgramCacheKey()};return Pe.vertexUv1s=c.has(1),Pe.vertexUv2s=c.has(2),Pe.vertexUv3s=c.has(3),c.clear(),Pe}function f(_){const g=[];if(_.shaderID?g.push(_.shaderID):(g.push(_.customVertexShaderID),g.push(_.customFragmentShaderID)),_.defines!==void 0)for(const C in _.defines)g.push(C),g.push(_.defines[C]);return _.isRawShaderMaterial===!1&&(b(g,_),T(g,_),g.push(n.outputColorSpace)),g.push(_.customProgramCacheKey),g.join()}function b(_,g){_.push(g.precision),_.push(g.outputColorSpace),_.push(g.envMapMode),_.push(g.envMapCubeUVHeight),_.push(g.mapUv),_.push(g.alphaMapUv),_.push(g.lightMapUv),_.push(g.aoMapUv),_.push(g.bumpMapUv),_.push(g.normalMapUv),_.push(g.displacementMapUv),_.push(g.emissiveMapUv),_.push(g.metalnessMapUv),_.push(g.roughnessMapUv),_.push(g.anisotropyMapUv),_.push(g.clearcoatMapUv),_.push(g.clearcoatNormalMapUv),_.push(g.clearcoatRoughnessMapUv),_.push(g.iridescenceMapUv),_.push(g.iridescenceThicknessMapUv),_.push(g.sheenColorMapUv),_.push(g.sheenRoughnessMapUv),_.push(g.specularMapUv),_.push(g.specularColorMapUv),_.push(g.specularIntensityMapUv),_.push(g.transmissionMapUv),_.push(g.thicknessMapUv),_.push(g.combine),_.push(g.fogExp2),_.push(g.sizeAttenuation),_.push(g.morphTargetsCount),_.push(g.morphAttributeCount),_.push(g.numDirLights),_.push(g.numPointLights),_.push(g.numSpotLights),_.push(g.numSpotLightMaps),_.push(g.numHemiLights),_.push(g.numRectAreaLights),_.push(g.numDirLightShadows),_.push(g.numPointLightShadows),_.push(g.numSpotLightShadows),_.push(g.numSpotLightShadowsWithMaps),_.push(g.numLightProbes),_.push(g.shadowMapType),_.push(g.toneMapping),_.push(g.numClippingPlanes),_.push(g.numClipIntersection),_.push(g.depthPacking)}function T(_,g){a.disableAll(),g.supportsVertexTextures&&a.enable(0),g.instancing&&a.enable(1),g.instancingColor&&a.enable(2),g.instancingMorph&&a.enable(3),g.matcap&&a.enable(4),g.envMap&&a.enable(5),g.normalMapObjectSpace&&a.enable(6),g.normalMapTangentSpace&&a.enable(7),g.clearcoat&&a.enable(8),g.iridescence&&a.enable(9),g.alphaTest&&a.enable(10),g.vertexColors&&a.enable(11),g.vertexAlphas&&a.enable(12),g.vertexUv1s&&a.enable(13),g.vertexUv2s&&a.enable(14),g.vertexUv3s&&a.enable(15),g.vertexTangents&&a.enable(16),g.anisotropy&&a.enable(17),g.alphaHash&&a.enable(18),g.batching&&a.enable(19),g.dispersion&&a.enable(20),g.batchingColor&&a.enable(21),_.push(a.mask),a.disableAll(),g.fog&&a.enable(0),g.useFog&&a.enable(1),g.flatShading&&a.enable(2),g.logarithmicDepthBuffer&&a.enable(3),g.reverseDepthBuffer&&a.enable(4),g.skinning&&a.enable(5),g.morphTargets&&a.enable(6),g.morphNormals&&a.enable(7),g.morphColors&&a.enable(8),g.premultipliedAlpha&&a.enable(9),g.shadowMapEnabled&&a.enable(10),g.doubleSided&&a.enable(11),g.flipSided&&a.enable(12),g.useDepthPacking&&a.enable(13),g.dithering&&a.enable(14),g.transmission&&a.enable(15),g.sheen&&a.enable(16),g.opaque&&a.enable(17),g.pointsUvs&&a.enable(18),g.decodeVideoTexture&&a.enable(19),g.decodeVideoTextureEmissive&&a.enable(20),g.alphaToCoverage&&a.enable(21),_.push(a.mask)}function S(_){const g=v[_.type];let C;if(g){const N=Rn[g];C=vg.clone(N.uniforms)}else C=_.uniforms;return C}function L(_,g){let C;for(let N=0,F=u.length;N0?i.push(f):m.transparent===!0?s.push(f):e.push(f)}function l(h,d,m,v,M,p){const f=o(h,d,m,v,M,p);m.transmission>0?i.unshift(f):m.transparent===!0?s.unshift(f):e.unshift(f)}function c(h,d){e.length>1&&e.sort(h||FM),i.length>1&&i.sort(d||xh),s.length>1&&s.sort(d||xh)}function u(){for(let h=t,d=n.length;h=r.length?(o=new Mh,r.push(o)):o=r[s],o}function e(){n=new WeakMap}return{get:t,dispose:e}}function zM(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new O,color:new kt};break;case"SpotLight":e={position:new O,direction:new O,color:new kt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new O,color:new kt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new O,skyColor:new kt,groundColor:new kt};break;case"RectAreaLight":e={color:new kt,position:new O,halfWidth:new O,halfHeight:new O};break}return n[t.id]=e,e}}}function HM(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new zt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new zt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new zt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let kM=0;function VM(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function GM(n){const t=new zM,e=HM(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new O);const s=new O,r=new se,o=new se;function a(c){let u=0,h=0,d=0;for(let _=0;_<9;_++)i.probe[_].set(0,0,0);let m=0,v=0,M=0,p=0,f=0,b=0,T=0,S=0,L=0,D=0,P=0;c.sort(VM);for(let _=0,g=c.length;_0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Tt.LTC_FLOAT_1,i.rectAreaLTC2=Tt.LTC_FLOAT_2):(i.rectAreaLTC1=Tt.LTC_HALF_1,i.rectAreaLTC2=Tt.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=d;const y=i.hash;(y.directionalLength!==m||y.pointLength!==v||y.spotLength!==M||y.rectAreaLength!==p||y.hemiLength!==f||y.numDirectionalShadows!==b||y.numPointShadows!==T||y.numSpotShadows!==S||y.numSpotMaps!==L||y.numLightProbes!==P)&&(i.directional.length=m,i.spot.length=M,i.rectArea.length=p,i.point.length=v,i.hemi.length=f,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=T,i.pointShadowMap.length=T,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=T,i.spotLightMatrix.length=S+L-D,i.spotLightMap.length=L,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=P,y.directionalLength=m,y.pointLength=v,y.spotLength=M,y.rectAreaLength=p,y.hemiLength=f,y.numDirectionalShadows=b,y.numPointShadows=T,y.numSpotShadows=S,y.numSpotMaps=L,y.numLightProbes=P,i.version=kM++)}function l(c,u){let h=0,d=0,m=0,v=0,M=0;const p=u.matrixWorldInverse;for(let f=0,b=c.length;f=o.length?(a=new Sh(n),o.push(a)):a=o[r],a}function i(){t=new WeakMap}return{get:e,dispose:i}}class XM extends Xs{static get type(){return"MeshDepthMaterial"}constructor(t){super(),this.isMeshDepthMaterial=!0,this.depthPacking=H_,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class YM extends Xs{static get type(){return"MeshDistanceMaterial"}constructor(t){super(),this.isMeshDistanceMaterial=!0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const qM=`void main() { gl_Position = vec4( position, 1.0 ); -}`,YM=`uniform sampler2D shadow_pass; +}`,jM=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3831,12 +3831,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function qM(n,t,e){let i=new Rc;const s=new Ht,r=new Ht,o=new xe,a=new GM({depthPacking:z_}),l=new WM,c={},u=e.maxTextureSize,h={[yi]:Ze,[Ze]:yi,[_n]:_n},d=new Ei({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ht},radius:{value:4}},vertexShader:XM,fragmentShader:YM}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const v=new Be;v.setAttribute("position",new Mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new wt(v,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Yf;let f=this.type;this.render=function(D,P,y){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||D.length===0)return;const _=n.getRenderTarget(),g=n.getActiveCubeFace(),C=n.getActiveMipmapLevel(),N=n.state;N.setBlending(gi),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const F=f!==Gn&&this.type===Gn,J=f===Gn&&this.type!==Gn;for(let st=0,Q=D.length;stu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/et.x),s.x=r.x*et.x,B.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/et.y),s.y=r.y*et.y,B.mapSize.y=r.y)),B.map===null||F===!0||J===!0){const X=this.type!==Gn?{minFilter:sn,magFilter:sn}:{};B.map!==null&&B.map.dispose(),B.map=new qi(s.x,s.y,X),B.map.texture.name=W.name+".shadowMap",B.camera.updateProjectionMatrix()}n.setRenderTarget(B.map),n.clear();const gt=B.getViewportCount();for(let X=0;X0||P.map&&P.alphaTest>0){const N=g.uuid,F=P.uuid;let J=c[N];J===void 0&&(J={},c[N]=J);let st=J[F];st===void 0&&(st=g.clone(),J[F]=st,P.addEventListener("dispose",U)),g=st}if(g.visible=P.visible,g.wireframe=P.wireframe,_===Gn?g.side=P.shadowSide!==null?P.shadowSide:P.side:g.side=P.shadowSide!==null?P.shadowSide:h[P.side],g.alphaMap=P.alphaMap,g.alphaTest=P.alphaTest,g.map=P.map,g.clipShadows=P.clipShadows,g.clippingPlanes=P.clippingPlanes,g.clipIntersection=P.clipIntersection,g.displacementMap=P.displacementMap,g.displacementScale=P.displacementScale,g.displacementBias=P.displacementBias,g.wireframeLinewidth=P.wireframeLinewidth,g.linewidth=P.linewidth,y.isPointLight===!0&&g.isMeshDistanceMaterial===!0){const N=n.properties.get(g);N.light=y}return g}function S(D,P,y,_,g){if(D.visible===!1)return;if(D.layers.test(P.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&g===Gn)&&(!D.frustumCulled||i.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,D.matrixWorld);const F=t.update(D),J=D.material;if(Array.isArray(J)){const st=F.groups;for(let Q=0,W=st.length;Q=1):B.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(B)[1]),Q=W>=2);let et=null,gt={};const X=n.getParameter(n.SCISSOR_BOX),ot=n.getParameter(n.VIEWPORT),lt=new xe().fromArray(X),Z=new xe().fromArray(ot);function at(z,At,ct,dt){const Pt=new Uint8Array(4),Rt=n.createTexture();n.bindTexture(z,Rt),n.texParameteri(z,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(z,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Yt=0;Yt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Ht,u=new WeakMap;let h;const d=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(E,x){return p?new OffscreenCanvas(E,x):Ho("canvas")}function M(E,x,I){let k=1;const K=$(E);if((K.width>I||K.height>I)&&(k=I/Math.max(K.width,K.height)),k<1)if(typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&E instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&E instanceof ImageBitmap||typeof VideoFrame<"u"&&E instanceof VideoFrame){const q=Math.floor(k*K.width),_t=Math.floor(k*K.height);h===void 0&&(h=v(q,_t));const ht=x?v(q,_t):h;return ht.width=q,ht.height=_t,ht.getContext("2d").drawImage(E,0,0,q,_t),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+q+"x"+_t+")."),ht}else return"data"in E&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),E;return E}function m(E){return E.generateMipmaps}function f(E){n.generateMipmap(E)}function T(E){return E.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:E.isWebGL3DRenderTarget?n.TEXTURE_3D:E.isWebGLArrayRenderTarget||E.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function b(E,x,I,k,K=!1){if(E!==null){if(n[E]!==void 0)return n[E];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+E+"'")}let q=x;if(x===n.RED&&(I===n.FLOAT&&(q=n.R32F),I===n.HALF_FLOAT&&(q=n.R16F),I===n.UNSIGNED_BYTE&&(q=n.R8)),x===n.RED_INTEGER&&(I===n.UNSIGNED_BYTE&&(q=n.R8UI),I===n.UNSIGNED_SHORT&&(q=n.R16UI),I===n.UNSIGNED_INT&&(q=n.R32UI),I===n.BYTE&&(q=n.R8I),I===n.SHORT&&(q=n.R16I),I===n.INT&&(q=n.R32I)),x===n.RG&&(I===n.FLOAT&&(q=n.RG32F),I===n.HALF_FLOAT&&(q=n.RG16F),I===n.UNSIGNED_BYTE&&(q=n.RG8)),x===n.RG_INTEGER&&(I===n.UNSIGNED_BYTE&&(q=n.RG8UI),I===n.UNSIGNED_SHORT&&(q=n.RG16UI),I===n.UNSIGNED_INT&&(q=n.RG32UI),I===n.BYTE&&(q=n.RG8I),I===n.SHORT&&(q=n.RG16I),I===n.INT&&(q=n.RG32I)),x===n.RGB_INTEGER&&(I===n.UNSIGNED_BYTE&&(q=n.RGB8UI),I===n.UNSIGNED_SHORT&&(q=n.RGB16UI),I===n.UNSIGNED_INT&&(q=n.RGB32UI),I===n.BYTE&&(q=n.RGB8I),I===n.SHORT&&(q=n.RGB16I),I===n.INT&&(q=n.RGB32I)),x===n.RGBA_INTEGER&&(I===n.UNSIGNED_BYTE&&(q=n.RGBA8UI),I===n.UNSIGNED_SHORT&&(q=n.RGBA16UI),I===n.UNSIGNED_INT&&(q=n.RGBA32UI),I===n.BYTE&&(q=n.RGBA8I),I===n.SHORT&&(q=n.RGBA16I),I===n.INT&&(q=n.RGBA32I)),x===n.RGB&&I===n.UNSIGNED_INT_5_9_9_9_REV&&(q=n.RGB9_E5),x===n.RGBA){const _t=K?ta:$t.getTransfer(k);I===n.FLOAT&&(q=n.RGBA32F),I===n.HALF_FLOAT&&(q=n.RGBA16F),I===n.UNSIGNED_BYTE&&(q=_t===re?n.SRGB8_ALPHA8:n.RGBA8),I===n.UNSIGNED_SHORT_4_4_4_4&&(q=n.RGBA4),I===n.UNSIGNED_SHORT_5_5_5_1&&(q=n.RGB5_A1)}return(q===n.R16F||q===n.R32F||q===n.RG16F||q===n.RG32F||q===n.RGBA16F||q===n.RGBA32F)&&t.get("EXT_color_buffer_float"),q}function S(E,x){let I;return E?x===null||x===Yi||x===Ls?I=n.DEPTH24_STENCIL8:x===Pn?I=n.DEPTH32F_STENCIL8:x===Er&&(I=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):x===null||x===Yi||x===Ls?I=n.DEPTH_COMPONENT24:x===Pn?I=n.DEPTH_COMPONENT32F:x===Er&&(I=n.DEPTH_COMPONENT16),I}function U(E,x){return m(E)===!0||E.isFramebufferTexture&&E.minFilter!==sn&&E.minFilter!==Cn?Math.log2(Math.max(x.width,x.height))+1:E.mipmaps!==void 0&&E.mipmaps.length>0?E.mipmaps.length:E.isCompressedTexture&&Array.isArray(E.image)?x.mipmaps.length:1}function D(E){const x=E.target;x.removeEventListener("dispose",D),y(x),x.isVideoTexture&&u.delete(x)}function P(E){const x=E.target;x.removeEventListener("dispose",P),g(x)}function y(E){const x=i.get(E);if(x.__webglInit===void 0)return;const I=E.source,k=d.get(I);if(k){const K=k[x.__cacheKey];K.usedTimes--,K.usedTimes===0&&_(E),Object.keys(k).length===0&&d.delete(I)}i.remove(E)}function _(E){const x=i.get(E);n.deleteTexture(x.__webglTexture);const I=E.source,k=d.get(I);delete k[x.__cacheKey],o.memory.textures--}function g(E){const x=i.get(E);if(E.depthTexture&&(E.depthTexture.dispose(),i.remove(E.depthTexture)),E.isWebGLCubeRenderTarget)for(let k=0;k<6;k++){if(Array.isArray(x.__webglFramebuffer[k]))for(let K=0;K=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+E+" texture units while this GPU supports only "+s.maxTextures),C+=1,E}function J(E){const x=[];return x.push(E.wrapS),x.push(E.wrapT),x.push(E.wrapR||0),x.push(E.magFilter),x.push(E.minFilter),x.push(E.anisotropy),x.push(E.internalFormat),x.push(E.format),x.push(E.type),x.push(E.generateMipmaps),x.push(E.premultiplyAlpha),x.push(E.flipY),x.push(E.unpackAlignment),x.push(E.colorSpace),x.join()}function st(E,x){const I=i.get(E);if(E.isVideoTexture&&Y(E),E.isRenderTargetTexture===!1&&E.version>0&&I.__version!==E.version){const k=E.image;if(k===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(k.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(I,E,x);return}}e.bindTexture(n.TEXTURE_2D,I.__webglTexture,n.TEXTURE0+x)}function Q(E,x){const I=i.get(E);if(E.version>0&&I.__version!==E.version){Z(I,E,x);return}e.bindTexture(n.TEXTURE_2D_ARRAY,I.__webglTexture,n.TEXTURE0+x)}function W(E,x){const I=i.get(E);if(E.version>0&&I.__version!==E.version){Z(I,E,x);return}e.bindTexture(n.TEXTURE_3D,I.__webglTexture,n.TEXTURE0+x)}function B(E,x){const I=i.get(E);if(E.version>0&&I.__version!==E.version){at(I,E,x);return}e.bindTexture(n.TEXTURE_CUBE_MAP,I.__webglTexture,n.TEXTURE0+x)}const et={[Sl]:n.REPEAT,[Vi]:n.CLAMP_TO_EDGE,[yl]:n.MIRRORED_REPEAT},gt={[sn]:n.NEAREST,[F_]:n.NEAREST_MIPMAP_NEAREST,[Fr]:n.NEAREST_MIPMAP_LINEAR,[Cn]:n.LINEAR,[_a]:n.LINEAR_MIPMAP_NEAREST,[Gi]:n.LINEAR_MIPMAP_LINEAR},X={[k_]:n.NEVER,[q_]:n.ALWAYS,[V_]:n.LESS,[sd]:n.LEQUAL,[G_]:n.EQUAL,[Y_]:n.GEQUAL,[W_]:n.GREATER,[X_]:n.NOTEQUAL};function ot(E,x){if(x.type===Pn&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===Cn||x.magFilter===_a||x.magFilter===Fr||x.magFilter===Gi||x.minFilter===Cn||x.minFilter===_a||x.minFilter===Fr||x.minFilter===Gi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(E,n.TEXTURE_WRAP_S,et[x.wrapS]),n.texParameteri(E,n.TEXTURE_WRAP_T,et[x.wrapT]),(E===n.TEXTURE_3D||E===n.TEXTURE_2D_ARRAY)&&n.texParameteri(E,n.TEXTURE_WRAP_R,et[x.wrapR]),n.texParameteri(E,n.TEXTURE_MAG_FILTER,gt[x.magFilter]),n.texParameteri(E,n.TEXTURE_MIN_FILTER,gt[x.minFilter]),x.compareFunction&&(n.texParameteri(E,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(E,n.TEXTURE_COMPARE_FUNC,X[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===sn||x.minFilter!==Fr&&x.minFilter!==Gi||x.type===Pn&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||i.get(x).__currentAnisotropy){const I=t.get("EXT_texture_filter_anisotropic");n.texParameterf(E,I.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,s.getMaxAnisotropy())),i.get(x).__currentAnisotropy=x.anisotropy}}}function lt(E,x){let I=!1;E.__webglInit===void 0&&(E.__webglInit=!0,x.addEventListener("dispose",D));const k=x.source;let K=d.get(k);K===void 0&&(K={},d.set(k,K));const q=J(x);if(q!==E.__cacheKey){K[q]===void 0&&(K[q]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,I=!0),K[q].usedTimes++;const _t=K[E.__cacheKey];_t!==void 0&&(K[E.__cacheKey].usedTimes--,_t.usedTimes===0&&_(x)),E.__cacheKey=q,E.__webglTexture=K[q].texture}return I}function Z(E,x,I){let k=n.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(k=n.TEXTURE_2D_ARRAY),x.isData3DTexture&&(k=n.TEXTURE_3D);const K=lt(E,x),q=x.source;e.bindTexture(k,E.__webglTexture,n.TEXTURE0+I);const _t=i.get(q);if(q.version!==_t.__version||K===!0){e.activeTexture(n.TEXTURE0+I);const ht=$t.getPrimaries($t.workingColorSpace),St=x.colorSpace===pi?null:$t.getPrimaries(x.colorSpace),Ft=x.colorSpace===pi||ht===St?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,x.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,x.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ft);let pt=M(x.image,!1,s.maxTextureSize);pt=rt(x,pt);const xt=r.convert(x.format,x.colorSpace),Lt=r.convert(x.type);let Bt=b(x.internalFormat,xt,Lt,x.colorSpace,x.isVideoTexture);ot(k,x);let Et;const kt=x.mipmaps,Wt=x.isVideoTexture!==!0,ne=_t.__version===void 0||K===!0,z=q.dataReady,At=U(x,pt);if(x.isDepthTexture)Bt=S(x.format===Is,x.type),ne&&(Wt?e.texStorage2D(n.TEXTURE_2D,1,Bt,pt.width,pt.height):e.texImage2D(n.TEXTURE_2D,0,Bt,pt.width,pt.height,0,xt,Lt,null));else if(x.isDataTexture)if(kt.length>0){Wt&&ne&&e.texStorage2D(n.TEXTURE_2D,At,Bt,kt[0].width,kt[0].height);for(let ct=0,dt=kt.length;ct0){const Pt=vh(Et.width,Et.height,x.format,x.type);for(const Rt of x.layerUpdates){const Yt=Et.data.subarray(Rt*Pt/Et.data.BYTES_PER_ELEMENT,(Rt+1)*Pt/Et.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ct,0,0,Rt,Et.width,Et.height,1,xt,Yt)}x.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ct,0,0,0,Et.width,Et.height,pt.depth,xt,Et.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,ct,Bt,Et.width,Et.height,pt.depth,0,Et.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Wt?z&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,ct,0,0,0,Et.width,Et.height,pt.depth,xt,Lt,Et.data):e.texImage3D(n.TEXTURE_2D_ARRAY,ct,Bt,Et.width,Et.height,pt.depth,0,xt,Lt,Et.data)}else{Wt&&ne&&e.texStorage2D(n.TEXTURE_2D,At,Bt,kt[0].width,kt[0].height);for(let ct=0,dt=kt.length;ct0){const ct=vh(pt.width,pt.height,x.format,x.type);for(const dt of x.layerUpdates){const Pt=pt.data.subarray(dt*ct/pt.data.BYTES_PER_ELEMENT,(dt+1)*ct/pt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,dt,pt.width,pt.height,1,xt,Lt,Pt)}x.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,pt.width,pt.height,pt.depth,xt,Lt,pt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Bt,pt.width,pt.height,pt.depth,0,xt,Lt,pt.data);else if(x.isData3DTexture)Wt?(ne&&e.texStorage3D(n.TEXTURE_3D,At,Bt,pt.width,pt.height,pt.depth),z&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,pt.width,pt.height,pt.depth,xt,Lt,pt.data)):e.texImage3D(n.TEXTURE_3D,0,Bt,pt.width,pt.height,pt.depth,0,xt,Lt,pt.data);else if(x.isFramebufferTexture){if(ne)if(Wt)e.texStorage2D(n.TEXTURE_2D,At,Bt,pt.width,pt.height);else{let ct=pt.width,dt=pt.height;for(let Pt=0;Pt>=1,dt>>=1}}else if(kt.length>0){if(Wt&&ne){const ct=$(kt[0]);e.texStorage2D(n.TEXTURE_2D,At,Bt,ct.width,ct.height)}for(let ct=0,dt=kt.length;ct0&&At++;const dt=$(xt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,At,kt,dt.width,dt.height)}for(let dt=0;dt<6;dt++)if(pt){Wt?z&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,xt[dt].width,xt[dt].height,Bt,Et,xt[dt].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,kt,xt[dt].width,xt[dt].height,0,Bt,Et,xt[dt].data);for(let Pt=0;Pt>q),Lt=Math.max(1,x.height>>q);K===n.TEXTURE_3D||K===n.TEXTURE_2D_ARRAY?e.texImage3D(K,q,St,xt,Lt,x.depth,0,_t,ht,null):e.texImage2D(K,q,St,xt,Lt,0,_t,ht,null)}e.bindFramebuffer(n.FRAMEBUFFER,E),j(x)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,k,K,pt.__webglTexture,0,H(x)):(K===n.TEXTURE_2D||K>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,k,K,pt.__webglTexture,q),e.bindFramebuffer(n.FRAMEBUFFER,null)}function ut(E,x,I){if(n.bindRenderbuffer(n.RENDERBUFFER,E),x.depthBuffer){const k=x.depthTexture,K=k&&k.isDepthTexture?k.type:null,q=S(x.stencilBuffer,K),_t=x.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ht=H(x);j(x)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ht,q,x.width,x.height):I?n.renderbufferStorageMultisample(n.RENDERBUFFER,ht,q,x.width,x.height):n.renderbufferStorage(n.RENDERBUFFER,q,x.width,x.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,n.RENDERBUFFER,E)}else{const k=x.textures;for(let K=0;K{delete x.__boundDepthTexture,delete x.__depthDisposeCallback,k.removeEventListener("dispose",K)};k.addEventListener("dispose",K),x.__depthDisposeCallback=K}x.__boundDepthTexture=k}if(E.depthTexture&&!x.__autoAllocateDepthBuffer){if(I)throw new Error("target.depthTexture not supported in Cube render targets");ft(x.__webglFramebuffer,E)}else if(I){x.__webglDepthbuffer=[];for(let k=0;k<6;k++)if(e.bindFramebuffer(n.FRAMEBUFFER,x.__webglFramebuffer[k]),x.__webglDepthbuffer[k]===void 0)x.__webglDepthbuffer[k]=n.createRenderbuffer(),ut(x.__webglDepthbuffer[k],E,!1);else{const K=E.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,q=x.__webglDepthbuffer[k];n.bindRenderbuffer(n.RENDERBUFFER,q),n.framebufferRenderbuffer(n.FRAMEBUFFER,K,n.RENDERBUFFER,q)}}else if(e.bindFramebuffer(n.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer===void 0)x.__webglDepthbuffer=n.createRenderbuffer(),ut(x.__webglDepthbuffer,E,!1);else{const k=E.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,K=x.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,K),n.framebufferRenderbuffer(n.FRAMEBUFFER,k,n.RENDERBUFFER,K)}e.bindFramebuffer(n.FRAMEBUFFER,null)}function yt(E,x,I){const k=i.get(E);x!==void 0&&mt(k.__webglFramebuffer,E,E.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),I!==void 0&&vt(E)}function Tt(E){const x=E.texture,I=i.get(E),k=i.get(x);E.addEventListener("dispose",P);const K=E.textures,q=E.isWebGLCubeRenderTarget===!0,_t=K.length>1;if(_t||(k.__webglTexture===void 0&&(k.__webglTexture=n.createTexture()),k.__version=x.version,o.memory.textures++),q){I.__webglFramebuffer=[];for(let ht=0;ht<6;ht++)if(x.mipmaps&&x.mipmaps.length>0){I.__webglFramebuffer[ht]=[];for(let St=0;St0){I.__webglFramebuffer=[];for(let ht=0;ht0&&j(E)===!1){I.__webglMultisampledFramebuffer=n.createFramebuffer(),I.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,I.__webglMultisampledFramebuffer);for(let ht=0;ht0)for(let St=0;St0)for(let St=0;St0){if(j(E)===!1){const x=E.textures,I=E.width,k=E.height;let K=n.COLOR_BUFFER_BIT;const q=E.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,_t=i.get(E),ht=x.length>1;if(ht)for(let St=0;St0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Y(E){const x=o.render.frame;u.get(E)!==x&&(u.set(E,x),E.update())}function rt(E,x){const I=E.colorSpace,k=E.format,K=E.type;return E.isCompressedTexture===!0||E.isVideoTexture===!0||I!==Fs&&I!==pi&&($t.getTransfer(I)===re?(k!==gn||K!==Qn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",I)),x}function $(E){return typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement?(c.width=E.naturalWidth||E.width,c.height=E.naturalHeight||E.height):typeof VideoFrame<"u"&&E instanceof VideoFrame?(c.width=E.displayWidth,c.height=E.displayHeight):(c.width=E.width,c.height=E.height),c}this.allocateTextureUnit=F,this.resetTextureUnits=N,this.setTexture2D=st,this.setTexture2DArray=Q,this.setTexture3D=W,this.setTextureCube=B,this.rebindTextures=yt,this.setupRenderTarget=Tt,this.updateRenderTargetMipmap=R,this.updateMultisampleRenderTarget=tt,this.setupDepthRenderbuffer=vt,this.setupFrameBufferTexture=mt,this.useMultisampledRTT=j}function JM(n,t){function e(i,s=pi){let r;const o=$t.getTransfer(s);if(i===Qn)return n.UNSIGNED_BYTE;if(i===Sc)return n.UNSIGNED_SHORT_4_4_4_4;if(i===yc)return n.UNSIGNED_SHORT_5_5_5_1;if(i===$f)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===jf)return n.BYTE;if(i===Zf)return n.SHORT;if(i===Er)return n.UNSIGNED_SHORT;if(i===Mc)return n.INT;if(i===Yi)return n.UNSIGNED_INT;if(i===Pn)return n.FLOAT;if(i===Cr)return n.HALF_FLOAT;if(i===Kf)return n.ALPHA;if(i===Jf)return n.RGB;if(i===gn)return n.RGBA;if(i===Qf)return n.LUMINANCE;if(i===td)return n.LUMINANCE_ALPHA;if(i===ws)return n.DEPTH_COMPONENT;if(i===Is)return n.DEPTH_STENCIL;if(i===Ec)return n.RED;if(i===bc)return n.RED_INTEGER;if(i===ed)return n.RG;if(i===Tc)return n.RG_INTEGER;if(i===wc)return n.RGBA_INTEGER;if(i===Eo||i===bo||i===To||i===wo)if(o===re)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Eo)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===bo)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===To)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===wo)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Eo)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===bo)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===To)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===wo)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===El||i===bl||i===Tl||i===wl)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===El)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===bl)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Tl)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===wl)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Al||i===Rl||i===Cl)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(i===Al||i===Rl)return o===re?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===Cl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===Pl||i===Dl||i===Ll||i===Il||i===Ul||i===Nl||i===Ol||i===Fl||i===Bl||i===zl||i===Hl||i===kl||i===Vl||i===Gl)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(i===Pl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Dl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Ll)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Il)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Ul)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Nl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Ol)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Fl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Bl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===zl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Hl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===kl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Vl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Gl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Ao||i===Wl||i===Xl)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(i===Ao)return o===re?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Wl)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Xl)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===nd||i===Yl||i===ql||i===jl)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(i===Ao)return r.COMPRESSED_RED_RGTC1_EXT;if(i===Yl)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===ql)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===jl)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Ls?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:e}}class QM extends an{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class so extends Me{constructor(){super(),this.isGroup=!0,this.type="Group"}}const tS={type:"move"};class Wa{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new so,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new so,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new so,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(const M of t.hand.values()){const m=e.getJointPose(M,i),f=this._getHandJoint(c,M);m!==null&&(f.matrix.fromArray(m.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=m.radius),f.visible=m!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=u.position.distanceTo(h.position),p=.02,v=.005;c.inputState.pinching&&d>p+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=p-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=e.getPose(t.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(tS)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const i=new so;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}const eS=` +}`;function $M(n,t,e){let i=new Pc;const s=new zt,r=new zt,o=new xe,a=new XM({depthPacking:k_}),l=new YM,c={},u=e.maxTextureSize,h={[Ti]:Ze,[Ze]:Ti,[_n]:_n},d=new wi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new zt},radius:{value:4}},vertexShader:qM,fragmentShader:jM}),m=d.clone();m.defines.HORIZONTAL_PASS=1;const v=new We;v.setAttribute("position",new Mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new At(v,d),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=$f;let f=this.type;this.render=function(D,P,y){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||D.length===0)return;const _=n.getRenderTarget(),g=n.getActiveCubeFace(),C=n.getActiveMipmapLevel(),N=n.state;N.setBlending(Mi),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const F=f!==Gn&&this.type===Gn,K=f===Gn&&this.type!==Gn;for(let st=0,Q=D.length;stu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/et.x),s.x=r.x*et.x,B.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/et.y),s.y=r.y*et.y,B.mapSize.y=r.y)),B.map===null||F===!0||K===!0){const X=this.type!==Gn?{minFilter:sn,magFilter:sn}:{};B.map!==null&&B.map.dispose(),B.map=new $i(s.x,s.y,X),B.map.texture.name=W.name+".shadowMap",B.camera.updateProjectionMatrix()}n.setRenderTarget(B.map),n.clear();const gt=B.getViewportCount();for(let X=0;X0||P.map&&P.alphaTest>0){const N=g.uuid,F=P.uuid;let K=c[N];K===void 0&&(K={},c[N]=K);let st=K[F];st===void 0&&(st=g.clone(),K[F]=st,P.addEventListener("dispose",L)),g=st}if(g.visible=P.visible,g.wireframe=P.wireframe,_===Gn?g.side=P.shadowSide!==null?P.shadowSide:P.side:g.side=P.shadowSide!==null?P.shadowSide:h[P.side],g.alphaMap=P.alphaMap,g.alphaTest=P.alphaTest,g.map=P.map,g.clipShadows=P.clipShadows,g.clippingPlanes=P.clippingPlanes,g.clipIntersection=P.clipIntersection,g.displacementMap=P.displacementMap,g.displacementScale=P.displacementScale,g.displacementBias=P.displacementBias,g.wireframeLinewidth=P.wireframeLinewidth,g.linewidth=P.linewidth,y.isPointLight===!0&&g.isMeshDistanceMaterial===!0){const N=n.properties.get(g);N.light=y}return g}function S(D,P,y,_,g){if(D.visible===!1)return;if(D.layers.test(P.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&g===Gn)&&(!D.frustumCulled||i.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,D.matrixWorld);const F=t.update(D),K=D.material;if(Array.isArray(K)){const st=F.groups;for(let Q=0,W=st.length;Q=1):B.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(B)[1]),Q=W>=2);let et=null,gt={};const X=n.getParameter(n.SCISSOR_BOX),ot=n.getParameter(n.VIEWPORT),lt=new xe().fromArray(X),$=new xe().fromArray(ot);function at(z,Rt,ct,dt){const Dt=new Uint8Array(4),Ct=n.createTexture();n.bindTexture(z,Ct),n.texParameteri(z,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(z,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Yt=0;Yt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new zt,u=new WeakMap;let h;const d=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(E,x){return m?new OffscreenCanvas(E,x):Vo("canvas")}function M(E,x,U){let k=1;const J=Z(E);if((J.width>U||J.height>U)&&(k=U/Math.max(J.width,J.height)),k<1)if(typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&E instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&E instanceof ImageBitmap||typeof VideoFrame<"u"&&E instanceof VideoFrame){const q=Math.floor(k*J.width),_t=Math.floor(k*J.height);h===void 0&&(h=v(q,_t));const ht=x?v(q,_t):h;return ht.width=q,ht.height=_t,ht.getContext("2d").drawImage(E,0,0,q,_t),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+q+"x"+_t+")."),ht}else return"data"in E&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),E;return E}function p(E){return E.generateMipmaps}function f(E){n.generateMipmap(E)}function b(E){return E.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:E.isWebGL3DRenderTarget?n.TEXTURE_3D:E.isWebGLArrayRenderTarget||E.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function T(E,x,U,k,J=!1){if(E!==null){if(n[E]!==void 0)return n[E];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+E+"'")}let q=x;if(x===n.RED&&(U===n.FLOAT&&(q=n.R32F),U===n.HALF_FLOAT&&(q=n.R16F),U===n.UNSIGNED_BYTE&&(q=n.R8)),x===n.RED_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.R8UI),U===n.UNSIGNED_SHORT&&(q=n.R16UI),U===n.UNSIGNED_INT&&(q=n.R32UI),U===n.BYTE&&(q=n.R8I),U===n.SHORT&&(q=n.R16I),U===n.INT&&(q=n.R32I)),x===n.RG&&(U===n.FLOAT&&(q=n.RG32F),U===n.HALF_FLOAT&&(q=n.RG16F),U===n.UNSIGNED_BYTE&&(q=n.RG8)),x===n.RG_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.RG8UI),U===n.UNSIGNED_SHORT&&(q=n.RG16UI),U===n.UNSIGNED_INT&&(q=n.RG32UI),U===n.BYTE&&(q=n.RG8I),U===n.SHORT&&(q=n.RG16I),U===n.INT&&(q=n.RG32I)),x===n.RGB_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.RGB8UI),U===n.UNSIGNED_SHORT&&(q=n.RGB16UI),U===n.UNSIGNED_INT&&(q=n.RGB32UI),U===n.BYTE&&(q=n.RGB8I),U===n.SHORT&&(q=n.RGB16I),U===n.INT&&(q=n.RGB32I)),x===n.RGBA_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.RGBA8UI),U===n.UNSIGNED_SHORT&&(q=n.RGBA16UI),U===n.UNSIGNED_INT&&(q=n.RGBA32UI),U===n.BYTE&&(q=n.RGBA8I),U===n.SHORT&&(q=n.RGBA16I),U===n.INT&&(q=n.RGBA32I)),x===n.RGB&&U===n.UNSIGNED_INT_5_9_9_9_REV&&(q=n.RGB9_E5),x===n.RGBA){const _t=J?ra:Zt.getTransfer(k);U===n.FLOAT&&(q=n.RGBA32F),U===n.HALF_FLOAT&&(q=n.RGBA16F),U===n.UNSIGNED_BYTE&&(q=_t===re?n.SRGB8_ALPHA8:n.RGBA8),U===n.UNSIGNED_SHORT_4_4_4_4&&(q=n.RGBA4),U===n.UNSIGNED_SHORT_5_5_5_1&&(q=n.RGB5_A1)}return(q===n.R16F||q===n.R32F||q===n.RG16F||q===n.RG32F||q===n.RGBA16F||q===n.RGBA32F)&&t.get("EXT_color_buffer_float"),q}function S(E,x){let U;return E?x===null||x===ji||x===Bs?U=n.DEPTH24_STENCIL8:x===Pn?U=n.DEPTH32F_STENCIL8:x===Pr&&(U=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):x===null||x===ji||x===Bs?U=n.DEPTH_COMPONENT24:x===Pn?U=n.DEPTH_COMPONENT32F:x===Pr&&(U=n.DEPTH_COMPONENT16),U}function L(E,x){return p(E)===!0||E.isFramebufferTexture&&E.minFilter!==sn&&E.minFilter!==Cn?Math.log2(Math.max(x.width,x.height))+1:E.mipmaps!==void 0&&E.mipmaps.length>0?E.mipmaps.length:E.isCompressedTexture&&Array.isArray(E.image)?x.mipmaps.length:1}function D(E){const x=E.target;x.removeEventListener("dispose",D),y(x),x.isVideoTexture&&u.delete(x)}function P(E){const x=E.target;x.removeEventListener("dispose",P),g(x)}function y(E){const x=i.get(E);if(x.__webglInit===void 0)return;const U=E.source,k=d.get(U);if(k){const J=k[x.__cacheKey];J.usedTimes--,J.usedTimes===0&&_(E),Object.keys(k).length===0&&d.delete(U)}i.remove(E)}function _(E){const x=i.get(E);n.deleteTexture(x.__webglTexture);const U=E.source,k=d.get(U);delete k[x.__cacheKey],o.memory.textures--}function g(E){const x=i.get(E);if(E.depthTexture&&(E.depthTexture.dispose(),i.remove(E.depthTexture)),E.isWebGLCubeRenderTarget)for(let k=0;k<6;k++){if(Array.isArray(x.__webglFramebuffer[k]))for(let J=0;J=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+E+" texture units while this GPU supports only "+s.maxTextures),C+=1,E}function K(E){const x=[];return x.push(E.wrapS),x.push(E.wrapT),x.push(E.wrapR||0),x.push(E.magFilter),x.push(E.minFilter),x.push(E.anisotropy),x.push(E.internalFormat),x.push(E.format),x.push(E.type),x.push(E.generateMipmaps),x.push(E.premultiplyAlpha),x.push(E.flipY),x.push(E.unpackAlignment),x.push(E.colorSpace),x.join()}function st(E,x){const U=i.get(E);if(E.isVideoTexture&&Y(E),E.isRenderTargetTexture===!1&&E.version>0&&U.__version!==E.version){const k=E.image;if(k===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(k.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{$(U,E,x);return}}e.bindTexture(n.TEXTURE_2D,U.__webglTexture,n.TEXTURE0+x)}function Q(E,x){const U=i.get(E);if(E.version>0&&U.__version!==E.version){$(U,E,x);return}e.bindTexture(n.TEXTURE_2D_ARRAY,U.__webglTexture,n.TEXTURE0+x)}function W(E,x){const U=i.get(E);if(E.version>0&&U.__version!==E.version){$(U,E,x);return}e.bindTexture(n.TEXTURE_3D,U.__webglTexture,n.TEXTURE0+x)}function B(E,x){const U=i.get(E);if(E.version>0&&U.__version!==E.version){at(U,E,x);return}e.bindTexture(n.TEXTURE_CUBE_MAP,U.__webglTexture,n.TEXTURE0+x)}const et={[bl]:n.REPEAT,[Wi]:n.CLAMP_TO_EDGE,[Tl]:n.MIRRORED_REPEAT},gt={[sn]:n.NEAREST,[z_]:n.NEAREST_MIPMAP_NEAREST,[Vr]:n.NEAREST_MIPMAP_LINEAR,[Cn]:n.LINEAR,[xa]:n.LINEAR_MIPMAP_NEAREST,[Xi]:n.LINEAR_MIPMAP_LINEAR},X={[G_]:n.NEVER,[$_]:n.ALWAYS,[W_]:n.LESS,[ad]:n.LEQUAL,[X_]:n.EQUAL,[j_]:n.GEQUAL,[Y_]:n.GREATER,[q_]:n.NOTEQUAL};function ot(E,x){if(x.type===Pn&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===Cn||x.magFilter===xa||x.magFilter===Vr||x.magFilter===Xi||x.minFilter===Cn||x.minFilter===xa||x.minFilter===Vr||x.minFilter===Xi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(E,n.TEXTURE_WRAP_S,et[x.wrapS]),n.texParameteri(E,n.TEXTURE_WRAP_T,et[x.wrapT]),(E===n.TEXTURE_3D||E===n.TEXTURE_2D_ARRAY)&&n.texParameteri(E,n.TEXTURE_WRAP_R,et[x.wrapR]),n.texParameteri(E,n.TEXTURE_MAG_FILTER,gt[x.magFilter]),n.texParameteri(E,n.TEXTURE_MIN_FILTER,gt[x.minFilter]),x.compareFunction&&(n.texParameteri(E,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(E,n.TEXTURE_COMPARE_FUNC,X[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===sn||x.minFilter!==Vr&&x.minFilter!==Xi||x.type===Pn&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||i.get(x).__currentAnisotropy){const U=t.get("EXT_texture_filter_anisotropic");n.texParameterf(E,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,s.getMaxAnisotropy())),i.get(x).__currentAnisotropy=x.anisotropy}}}function lt(E,x){let U=!1;E.__webglInit===void 0&&(E.__webglInit=!0,x.addEventListener("dispose",D));const k=x.source;let J=d.get(k);J===void 0&&(J={},d.set(k,J));const q=K(x);if(q!==E.__cacheKey){J[q]===void 0&&(J[q]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,U=!0),J[q].usedTimes++;const _t=J[E.__cacheKey];_t!==void 0&&(J[E.__cacheKey].usedTimes--,_t.usedTimes===0&&_(x)),E.__cacheKey=q,E.__webglTexture=J[q].texture}return U}function $(E,x,U){let k=n.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(k=n.TEXTURE_2D_ARRAY),x.isData3DTexture&&(k=n.TEXTURE_3D);const J=lt(E,x),q=x.source;e.bindTexture(k,E.__webglTexture,n.TEXTURE0+U);const _t=i.get(q);if(q.version!==_t.__version||J===!0){e.activeTexture(n.TEXTURE0+U);const ht=Zt.getPrimaries(Zt.workingColorSpace),yt=x.colorSpace===gi?null:Zt.getPrimaries(x.colorSpace),Ft=x.colorSpace===gi||ht===yt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,x.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,x.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ft);let pt=M(x.image,!1,s.maxTextureSize);pt=rt(x,pt);const Mt=r.convert(x.format,x.colorSpace),Lt=r.convert(x.type);let Bt=T(x.internalFormat,Mt,Lt,x.colorSpace,x.isVideoTexture);ot(k,x);let bt;const Ht=x.mipmaps,Wt=x.isVideoTexture!==!0,ne=_t.__version===void 0||J===!0,z=q.dataReady,Rt=L(x,pt);if(x.isDepthTexture)Bt=S(x.format===zs,x.type),ne&&(Wt?e.texStorage2D(n.TEXTURE_2D,1,Bt,pt.width,pt.height):e.texImage2D(n.TEXTURE_2D,0,Bt,pt.width,pt.height,0,Mt,Lt,null));else if(x.isDataTexture)if(Ht.length>0){Wt&&ne&&e.texStorage2D(n.TEXTURE_2D,Rt,Bt,Ht[0].width,Ht[0].height);for(let ct=0,dt=Ht.length;ct0){const Dt=yh(bt.width,bt.height,x.format,x.type);for(const Ct of x.layerUpdates){const Yt=bt.data.subarray(Ct*Dt/bt.data.BYTES_PER_ELEMENT,(Ct+1)*Dt/bt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ct,0,0,Ct,bt.width,bt.height,1,Mt,Yt)}x.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ct,0,0,0,bt.width,bt.height,pt.depth,Mt,bt.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,ct,Bt,bt.width,bt.height,pt.depth,0,bt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Wt?z&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,ct,0,0,0,bt.width,bt.height,pt.depth,Mt,Lt,bt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,ct,Bt,bt.width,bt.height,pt.depth,0,Mt,Lt,bt.data)}else{Wt&&ne&&e.texStorage2D(n.TEXTURE_2D,Rt,Bt,Ht[0].width,Ht[0].height);for(let ct=0,dt=Ht.length;ct0){const ct=yh(pt.width,pt.height,x.format,x.type);for(const dt of x.layerUpdates){const Dt=pt.data.subarray(dt*ct/pt.data.BYTES_PER_ELEMENT,(dt+1)*ct/pt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,dt,pt.width,pt.height,1,Mt,Lt,Dt)}x.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,pt.width,pt.height,pt.depth,Mt,Lt,pt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Bt,pt.width,pt.height,pt.depth,0,Mt,Lt,pt.data);else if(x.isData3DTexture)Wt?(ne&&e.texStorage3D(n.TEXTURE_3D,Rt,Bt,pt.width,pt.height,pt.depth),z&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,pt.width,pt.height,pt.depth,Mt,Lt,pt.data)):e.texImage3D(n.TEXTURE_3D,0,Bt,pt.width,pt.height,pt.depth,0,Mt,Lt,pt.data);else if(x.isFramebufferTexture){if(ne)if(Wt)e.texStorage2D(n.TEXTURE_2D,Rt,Bt,pt.width,pt.height);else{let ct=pt.width,dt=pt.height;for(let Dt=0;Dt>=1,dt>>=1}}else if(Ht.length>0){if(Wt&&ne){const ct=Z(Ht[0]);e.texStorage2D(n.TEXTURE_2D,Rt,Bt,ct.width,ct.height)}for(let ct=0,dt=Ht.length;ct0&&Rt++;const dt=Z(Mt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Rt,Ht,dt.width,dt.height)}for(let dt=0;dt<6;dt++)if(pt){Wt?z&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,Mt[dt].width,Mt[dt].height,Bt,bt,Mt[dt].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,Ht,Mt[dt].width,Mt[dt].height,0,Bt,bt,Mt[dt].data);for(let Dt=0;Dt>q),Lt=Math.max(1,x.height>>q);J===n.TEXTURE_3D||J===n.TEXTURE_2D_ARRAY?e.texImage3D(J,q,yt,Mt,Lt,x.depth,0,_t,ht,null):e.texImage2D(J,q,yt,Mt,Lt,0,_t,ht,null)}e.bindFramebuffer(n.FRAMEBUFFER,E),j(x)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,k,J,pt.__webglTexture,0,H(x)):(J===n.TEXTURE_2D||J>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&J<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,k,J,pt.__webglTexture,q),e.bindFramebuffer(n.FRAMEBUFFER,null)}function ut(E,x,U){if(n.bindRenderbuffer(n.RENDERBUFFER,E),x.depthBuffer){const k=x.depthTexture,J=k&&k.isDepthTexture?k.type:null,q=S(x.stencilBuffer,J),_t=x.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ht=H(x);j(x)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ht,q,x.width,x.height):U?n.renderbufferStorageMultisample(n.RENDERBUFFER,ht,q,x.width,x.height):n.renderbufferStorage(n.RENDERBUFFER,q,x.width,x.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,n.RENDERBUFFER,E)}else{const k=x.textures;for(let J=0;J{delete x.__boundDepthTexture,delete x.__depthDisposeCallback,k.removeEventListener("dispose",J)};k.addEventListener("dispose",J),x.__depthDisposeCallback=J}x.__boundDepthTexture=k}if(E.depthTexture&&!x.__autoAllocateDepthBuffer){if(U)throw new Error("target.depthTexture not supported in Cube render targets");ft(x.__webglFramebuffer,E)}else if(U){x.__webglDepthbuffer=[];for(let k=0;k<6;k++)if(e.bindFramebuffer(n.FRAMEBUFFER,x.__webglFramebuffer[k]),x.__webglDepthbuffer[k]===void 0)x.__webglDepthbuffer[k]=n.createRenderbuffer(),ut(x.__webglDepthbuffer[k],E,!1);else{const J=E.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,q=x.__webglDepthbuffer[k];n.bindRenderbuffer(n.RENDERBUFFER,q),n.framebufferRenderbuffer(n.FRAMEBUFFER,J,n.RENDERBUFFER,q)}}else if(e.bindFramebuffer(n.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer===void 0)x.__webglDepthbuffer=n.createRenderbuffer(),ut(x.__webglDepthbuffer,E,!1);else{const k=E.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,J=x.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,J),n.framebufferRenderbuffer(n.FRAMEBUFFER,k,n.RENDERBUFFER,J)}e.bindFramebuffer(n.FRAMEBUFFER,null)}function Et(E,x,U){const k=i.get(E);x!==void 0&&mt(k.__webglFramebuffer,E,E.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),U!==void 0&&vt(E)}function wt(E){const x=E.texture,U=i.get(E),k=i.get(x);E.addEventListener("dispose",P);const J=E.textures,q=E.isWebGLCubeRenderTarget===!0,_t=J.length>1;if(_t||(k.__webglTexture===void 0&&(k.__webglTexture=n.createTexture()),k.__version=x.version,o.memory.textures++),q){U.__webglFramebuffer=[];for(let ht=0;ht<6;ht++)if(x.mipmaps&&x.mipmaps.length>0){U.__webglFramebuffer[ht]=[];for(let yt=0;yt0){U.__webglFramebuffer=[];for(let ht=0;ht0&&j(E)===!1){U.__webglMultisampledFramebuffer=n.createFramebuffer(),U.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,U.__webglMultisampledFramebuffer);for(let ht=0;ht0)for(let yt=0;yt0)for(let yt=0;yt0){if(j(E)===!1){const x=E.textures,U=E.width,k=E.height;let J=n.COLOR_BUFFER_BIT;const q=E.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,_t=i.get(E),ht=x.length>1;if(ht)for(let yt=0;yt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Y(E){const x=o.render.frame;u.get(E)!==x&&(u.set(E,x),E.update())}function rt(E,x){const U=E.colorSpace,k=E.format,J=E.type;return E.isCompressedTexture===!0||E.isVideoTexture===!0||U!==Gs&&U!==gi&&(Zt.getTransfer(U)===re?(k!==gn||J!==ei)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",U)),x}function Z(E){return typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement?(c.width=E.naturalWidth||E.width,c.height=E.naturalHeight||E.height):typeof VideoFrame<"u"&&E instanceof VideoFrame?(c.width=E.displayWidth,c.height=E.displayHeight):(c.width=E.width,c.height=E.height),c}this.allocateTextureUnit=F,this.resetTextureUnits=N,this.setTexture2D=st,this.setTexture2DArray=Q,this.setTexture3D=W,this.setTextureCube=B,this.rebindTextures=Et,this.setupRenderTarget=wt,this.updateRenderTargetMipmap=R,this.updateMultisampleRenderTarget=tt,this.setupDepthRenderbuffer=vt,this.setupFrameBufferTexture=mt,this.useMultisampledRTT=j}function tS(n,t){function e(i,s=gi){let r;const o=Zt.getTransfer(s);if(i===ei)return n.UNSIGNED_BYTE;if(i===Ec)return n.UNSIGNED_SHORT_4_4_4_4;if(i===bc)return n.UNSIGNED_SHORT_5_5_5_1;if(i===Qf)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Kf)return n.BYTE;if(i===Jf)return n.SHORT;if(i===Pr)return n.UNSIGNED_SHORT;if(i===yc)return n.INT;if(i===ji)return n.UNSIGNED_INT;if(i===Pn)return n.FLOAT;if(i===Ur)return n.HALF_FLOAT;if(i===td)return n.ALPHA;if(i===ed)return n.RGB;if(i===gn)return n.RGBA;if(i===nd)return n.LUMINANCE;if(i===id)return n.LUMINANCE_ALPHA;if(i===Ps)return n.DEPTH_COMPONENT;if(i===zs)return n.DEPTH_STENCIL;if(i===Tc)return n.RED;if(i===wc)return n.RED_INTEGER;if(i===sd)return n.RG;if(i===Ac)return n.RG_INTEGER;if(i===Rc)return n.RGBA_INTEGER;if(i===Ao||i===Ro||i===Co||i===Po)if(o===re)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Ao)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Ro)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Co)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Po)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Ao)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Ro)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Co)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Po)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===wl||i===Al||i===Rl||i===Cl)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===wl)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Al)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Rl)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Cl)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Pl||i===Dl||i===Ll)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(i===Pl||i===Dl)return o===re?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===Ll)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===Il||i===Ul||i===Nl||i===Ol||i===Fl||i===Bl||i===zl||i===Hl||i===kl||i===Vl||i===Gl||i===Wl||i===Xl||i===Yl)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(i===Il)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Ul)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Nl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Ol)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Fl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Bl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===zl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Hl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===kl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Vl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Gl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Wl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Xl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Yl)return o===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Do||i===ql||i===jl)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(i===Do)return o===re?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===ql)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===jl)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===rd||i===$l||i===Zl||i===Kl)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(i===Do)return r.COMPRESSED_RED_RGTC1_EXT;if(i===$l)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Zl)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Kl)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Bs?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:e}}class eS extends an{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class co extends Me{constructor(){super(),this.isGroup=!0,this.type="Group"}}const nS={type:"move"};class qa{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new co,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new co,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new co,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(const M of t.hand.values()){const p=e.getJointPose(M,i),f=this._getHandJoint(c,M);p!==null&&(f.matrix.fromArray(p.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=p.radius),f.visible=p!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=u.position.distanceTo(h.position),m=.02,v=.005;c.inputState.pinching&&d>m+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=m-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=e.getPose(t.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(nS)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const i=new co;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}const iS=` void main() { gl_Position = vec4( position, 1.0 ); -}`,nS=` +}`,sS=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -3855,4 +3855,4 @@ void main() { } -}`;class iS{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){const s=new We,r=t.properties.get(s);r.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new Ei({vertexShader:eS,fragmentShader:nS,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new wt(new $i(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class sS extends Zi{constructor(t,e){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,d=null,p=null,v=null;const M=new iS,m=e.getContextAttributes();let f=null,T=null;const b=[],S=[],U=new Ht;let D=null;const P=new an;P.viewport=new xe;const y=new an;y.viewport=new xe;const _=[P,y],g=new QM;let C=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let at=b[Z];return at===void 0&&(at=new Wa,b[Z]=at),at.getTargetRaySpace()},this.getControllerGrip=function(Z){let at=b[Z];return at===void 0&&(at=new Wa,b[Z]=at),at.getGripSpace()},this.getHand=function(Z){let at=b[Z];return at===void 0&&(at=new Wa,b[Z]=at),at.getHandSpace()};function F(Z){const at=S.indexOf(Z.inputSource);if(at===-1)return;const mt=b[at];mt!==void 0&&(mt.update(Z.inputSource,Z.frame,c||o),mt.dispatchEvent({type:Z.type,data:Z.inputSource}))}function J(){s.removeEventListener("select",F),s.removeEventListener("selectstart",F),s.removeEventListener("selectend",F),s.removeEventListener("squeeze",F),s.removeEventListener("squeezestart",F),s.removeEventListener("squeezeend",F),s.removeEventListener("end",J),s.removeEventListener("inputsourceschange",st);for(let Z=0;Z=0&&(S[ut]=null,b[ut].disconnect(mt))}for(let at=0;at=S.length){S.push(mt),ut=vt;break}else if(S[vt]===null){S[vt]=mt,ut=vt;break}if(ut===-1)break}const ft=b[ut];ft&&ft.connect(mt)}}const Q=new O,W=new O;function B(Z,at,mt){Q.setFromMatrixPosition(at.matrixWorld),W.setFromMatrixPosition(mt.matrixWorld);const ut=Q.distanceTo(W),ft=at.projectionMatrix.elements,vt=mt.projectionMatrix.elements,yt=ft[14]/(ft[10]-1),Tt=ft[14]/(ft[10]+1),R=(ft[9]+1)/ft[5],L=(ft[9]-1)/ft[5],w=(ft[8]-1)/ft[0],tt=(vt[8]+1)/vt[0],H=yt*w,j=yt*tt,Y=ut/(-w+tt),rt=Y*-w;if(at.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(rt),Z.translateZ(Y),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert(),ft[10]===-1)Z.projectionMatrix.copy(at.projectionMatrix),Z.projectionMatrixInverse.copy(at.projectionMatrixInverse);else{const $=yt+Y,E=Tt+Y,x=H-rt,I=j+(ut-rt),k=R*Tt/E*$,K=L*Tt/E*$;Z.projectionMatrix.makePerspective(x,I,k,K,$,E),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}}function et(Z,at){at===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(at.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(s===null)return;let at=Z.near,mt=Z.far;M.texture!==null&&(M.depthNear>0&&(at=M.depthNear),M.depthFar>0&&(mt=M.depthFar)),g.near=y.near=P.near=at,g.far=y.far=P.far=mt,(C!==g.near||N!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),C=g.near,N=g.far),P.layers.mask=Z.layers.mask|2,y.layers.mask=Z.layers.mask|4,g.layers.mask=P.layers.mask|y.layers.mask;const ut=Z.parent,ft=g.cameras;et(g,ut);for(let vt=0;vt0&&(m.alphaTest.value=f.alphaTest);const T=t.get(f),b=T.envMap,S=T.envMapRotation;b&&(m.envMap.value=b,Ii.copy(S),Ii.x*=-1,Ii.y*=-1,Ii.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Ii.y*=-1,Ii.z*=-1),m.envMapRotation.value.setFromMatrix4(rS.makeRotationFromEuler(Ii)),m.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=f.reflectivity,m.ior.value=f.ior,m.refractionRatio.value=f.refractionRatio),f.lightMap&&(m.lightMap.value=f.lightMap,m.lightMapIntensity.value=f.lightMapIntensity,e(f.lightMap,m.lightMapTransform)),f.aoMap&&(m.aoMap.value=f.aoMap,m.aoMapIntensity.value=f.aoMapIntensity,e(f.aoMap,m.aoMapTransform))}function o(m,f){m.diffuse.value.copy(f.color),m.opacity.value=f.opacity,f.map&&(m.map.value=f.map,e(f.map,m.mapTransform))}function a(m,f){m.dashSize.value=f.dashSize,m.totalSize.value=f.dashSize+f.gapSize,m.scale.value=f.scale}function l(m,f,T,b){m.diffuse.value.copy(f.color),m.opacity.value=f.opacity,m.size.value=f.size*T,m.scale.value=b*.5,f.map&&(m.map.value=f.map,e(f.map,m.uvTransform)),f.alphaMap&&(m.alphaMap.value=f.alphaMap,e(f.alphaMap,m.alphaMapTransform)),f.alphaTest>0&&(m.alphaTest.value=f.alphaTest)}function c(m,f){m.diffuse.value.copy(f.color),m.opacity.value=f.opacity,m.rotation.value=f.rotation,f.map&&(m.map.value=f.map,e(f.map,m.mapTransform)),f.alphaMap&&(m.alphaMap.value=f.alphaMap,e(f.alphaMap,m.alphaMapTransform)),f.alphaTest>0&&(m.alphaTest.value=f.alphaTest)}function u(m,f){m.specular.value.copy(f.specular),m.shininess.value=Math.max(f.shininess,1e-4)}function h(m,f){f.gradientMap&&(m.gradientMap.value=f.gradientMap)}function d(m,f){m.metalness.value=f.metalness,f.metalnessMap&&(m.metalnessMap.value=f.metalnessMap,e(f.metalnessMap,m.metalnessMapTransform)),m.roughness.value=f.roughness,f.roughnessMap&&(m.roughnessMap.value=f.roughnessMap,e(f.roughnessMap,m.roughnessMapTransform)),f.envMap&&(m.envMapIntensity.value=f.envMapIntensity)}function p(m,f,T){m.ior.value=f.ior,f.sheen>0&&(m.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),m.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(m.sheenColorMap.value=f.sheenColorMap,e(f.sheenColorMap,m.sheenColorMapTransform)),f.sheenRoughnessMap&&(m.sheenRoughnessMap.value=f.sheenRoughnessMap,e(f.sheenRoughnessMap,m.sheenRoughnessMapTransform))),f.clearcoat>0&&(m.clearcoat.value=f.clearcoat,m.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(m.clearcoatMap.value=f.clearcoatMap,e(f.clearcoatMap,m.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,e(f.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(m.clearcoatNormalMap.value=f.clearcoatNormalMap,e(f.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===Ze&&m.clearcoatNormalScale.value.negate())),f.dispersion>0&&(m.dispersion.value=f.dispersion),f.iridescence>0&&(m.iridescence.value=f.iridescence,m.iridescenceIOR.value=f.iridescenceIOR,m.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(m.iridescenceMap.value=f.iridescenceMap,e(f.iridescenceMap,m.iridescenceMapTransform)),f.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=f.iridescenceThicknessMap,e(f.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),f.transmission>0&&(m.transmission.value=f.transmission,m.transmissionSamplerMap.value=T.texture,m.transmissionSamplerSize.value.set(T.width,T.height),f.transmissionMap&&(m.transmissionMap.value=f.transmissionMap,e(f.transmissionMap,m.transmissionMapTransform)),m.thickness.value=f.thickness,f.thicknessMap&&(m.thicknessMap.value=f.thicknessMap,e(f.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=f.attenuationDistance,m.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(m.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(m.anisotropyMap.value=f.anisotropyMap,e(f.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=f.specularIntensity,m.specularColor.value.copy(f.specularColor),f.specularColorMap&&(m.specularColorMap.value=f.specularColorMap,e(f.specularColorMap,m.specularColorMapTransform)),f.specularIntensityMap&&(m.specularIntensityMap.value=f.specularIntensityMap,e(f.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,f){f.matcap&&(m.matcap.value=f.matcap)}function M(m,f){const T=t.get(f).light;m.referencePosition.value.setFromMatrixPosition(T.matrixWorld),m.nearDistance.value=T.shadow.camera.near,m.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function aS(n,t,e,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(T,b){const S=b.program;i.uniformBlockBinding(T,S)}function c(T,b){let S=s[T.id];S===void 0&&(v(T),S=u(T),s[T.id]=S,T.addEventListener("dispose",m));const U=b.program;i.updateUBOMapping(T,U);const D=t.render.frame;r[T.id]!==D&&(d(T),r[T.id]=D)}function u(T){const b=h();T.__bindingPointIndex=b;const S=n.createBuffer(),U=T.__size,D=T.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,U,D),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,S),S}function h(){for(let T=0;T0&&(S+=U-D),T.__size=S,T.__cache={},this}function M(T){const b={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(b.boundary=4,b.storage=4):T.isVector2?(b.boundary=8,b.storage=8):T.isVector3||T.isColor?(b.boundary=16,b.storage=12):T.isVector4?(b.boundary=16,b.storage=16):T.isMatrix3?(b.boundary=48,b.storage=48):T.isMatrix4?(b.boundary=64,b.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),b}function m(T){const b=T.target;b.removeEventListener("dispose",m);const S=o.indexOf(b.__bindingPointIndex);o.splice(S,1),n.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function f(){for(const T in s)n.deleteBuffer(s[T]);o=[],s={},r={}}return{bind:l,update:c,dispose:f}}class lS{constructor(t={}){const{canvas:e=$_(),context:i=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reverseDepthBuffer:d=!1}=t;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=o;const v=new Uint32Array(4),M=new Int32Array(4);let m=null,f=null;const T=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=tn,this.toneMapping=vi,this.toneMappingExposure=1;const S=this;let U=!1,D=0,P=0,y=null,_=-1,g=null;const C=new xe,N=new xe;let F=null;const J=new zt(0);let st=0,Q=e.width,W=e.height,B=1,et=null,gt=null;const X=new xe(0,0,Q,W),ot=new xe(0,0,Q,W);let lt=!1;const Z=new Rc;let at=!1,mt=!1;const ut=new se,ft=new se,vt=new O,yt=new xe,Tt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let R=!1;function L(){return y===null?B:1}let w=i;function tt(A,V){return e.getContext(A,V)}try{const A={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${vc}`),e.addEventListener("webglcontextlost",dt,!1),e.addEventListener("webglcontextrestored",Pt,!1),e.addEventListener("webglcontextcreationerror",Rt,!1),w===null){const V="webgl2";if(w=tt(V,A),w===null)throw tt(V)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(A){throw console.error("THREE.WebGLRenderer: "+A.message),A}let H,j,Y,rt,$,E,x,I,k,K,q,_t,ht,St,Ft,pt,xt,Lt,Bt,Et,kt,Wt,ne,z;function At(){H=new dx(w),H.init(),Wt=new JM(w,H),j=new ax(w,H,t,Wt),Y=new ZM(w,H),j.reverseDepthBuffer&&d&&Y.buffers.depth.setReversed(!0),rt=new _x(w),$=new UM,E=new KM(w,H,Y,$,j,Wt,rt),x=new cx(S),I=new fx(S),k=new Eg(w),ne=new rx(w,k),K=new px(w,k,rt,ne),q=new vx(w,K,k,rt),Bt=new gx(w,j,E),pt=new lx($),_t=new IM(S,x,I,H,j,ne,pt),ht=new oS(S,$),St=new OM,Ft=new VM(H),Lt=new sx(S,x,I,Y,q,p,l),xt=new qM(S,q,j),z=new aS(w,rt,j,Y),Et=new ox(w,H,rt),kt=new mx(w,H,rt),rt.programs=_t.programs,S.capabilities=j,S.extensions=H,S.properties=$,S.renderLists=St,S.shadowMap=xt,S.state=Y,S.info=rt}At();const ct=new sS(S,w);this.xr=ct,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const A=H.get("WEBGL_lose_context");A&&A.loseContext()},this.forceContextRestore=function(){const A=H.get("WEBGL_lose_context");A&&A.restoreContext()},this.getPixelRatio=function(){return B},this.setPixelRatio=function(A){A!==void 0&&(B=A,this.setSize(Q,W,!1))},this.getSize=function(A){return A.set(Q,W)},this.setSize=function(A,V,nt=!0){if(ct.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Q=A,W=V,e.width=Math.floor(A*B),e.height=Math.floor(V*B),nt===!0&&(e.style.width=A+"px",e.style.height=V+"px"),this.setViewport(0,0,A,V)},this.getDrawingBufferSize=function(A){return A.set(Q*B,W*B).floor()},this.setDrawingBufferSize=function(A,V,nt){Q=A,W=V,B=nt,e.width=Math.floor(A*nt),e.height=Math.floor(V*nt),this.setViewport(0,0,A,V)},this.getCurrentViewport=function(A){return A.copy(C)},this.getViewport=function(A){return A.copy(X)},this.setViewport=function(A,V,nt,it){A.isVector4?X.set(A.x,A.y,A.z,A.w):X.set(A,V,nt,it),Y.viewport(C.copy(X).multiplyScalar(B).round())},this.getScissor=function(A){return A.copy(ot)},this.setScissor=function(A,V,nt,it){A.isVector4?ot.set(A.x,A.y,A.z,A.w):ot.set(A,V,nt,it),Y.scissor(N.copy(ot).multiplyScalar(B).round())},this.getScissorTest=function(){return lt},this.setScissorTest=function(A){Y.setScissorTest(lt=A)},this.setOpaqueSort=function(A){et=A},this.setTransparentSort=function(A){gt=A},this.getClearColor=function(A){return A.copy(Lt.getClearColor())},this.setClearColor=function(){Lt.setClearColor.apply(Lt,arguments)},this.getClearAlpha=function(){return Lt.getClearAlpha()},this.setClearAlpha=function(){Lt.setClearAlpha.apply(Lt,arguments)},this.clear=function(A=!0,V=!0,nt=!0){let it=0;if(A){let G=!1;if(y!==null){const Mt=y.texture.format;G=Mt===wc||Mt===Tc||Mt===bc}if(G){const Mt=y.texture.type,Ct=Mt===Qn||Mt===Yi||Mt===Er||Mt===Ls||Mt===Sc||Mt===yc,It=Lt.getClearColor(),Ut=Lt.getClearAlpha(),Vt=It.r,qt=It.g,Nt=It.b;Ct?(v[0]=Vt,v[1]=qt,v[2]=Nt,v[3]=Ut,w.clearBufferuiv(w.COLOR,0,v)):(M[0]=Vt,M[1]=qt,M[2]=Nt,M[3]=Ut,w.clearBufferiv(w.COLOR,0,M))}else it|=w.COLOR_BUFFER_BIT}V&&(it|=w.DEPTH_BUFFER_BIT),nt&&(it|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(it)},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",dt,!1),e.removeEventListener("webglcontextrestored",Pt,!1),e.removeEventListener("webglcontextcreationerror",Rt,!1),St.dispose(),Ft.dispose(),$.dispose(),x.dispose(),I.dispose(),q.dispose(),ne.dispose(),z.dispose(),_t.dispose(),ct.dispose(),ct.removeEventListener("sessionstart",Uc),ct.removeEventListener("sessionend",Nc),Ti.stop()};function dt(A){A.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Pt(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const A=rt.autoReset,V=xt.enabled,nt=xt.autoUpdate,it=xt.needsUpdate,G=xt.type;At(),rt.autoReset=A,xt.enabled=V,xt.autoUpdate=nt,xt.needsUpdate=it,xt.type=G}function Rt(A){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",A.statusMessage)}function Yt(A){const V=A.target;V.removeEventListener("dispose",Yt),ve(V)}function ve(A){Pe(A),$.remove(A)}function Pe(A){const V=$.get(A).programs;V!==void 0&&(V.forEach(function(nt){_t.releaseProgram(nt)}),A.isShaderMaterial&&_t.releaseShaderCache(A))}this.renderBufferDirect=function(A,V,nt,it,G,Mt){V===null&&(V=Tt);const Ct=G.isMesh&&G.matrixWorld.determinant()<0,It=wd(A,V,nt,it,G);Y.setMaterial(it,Ct);let Ut=nt.index,Vt=1;if(it.wireframe===!0){if(Ut=K.getWireframeAttribute(nt),Ut===void 0)return;Vt=2}const qt=nt.drawRange,Nt=nt.attributes.position;let Kt=qt.start*Vt,ce=(qt.start+qt.count)*Vt;Mt!==null&&(Kt=Math.max(Kt,Mt.start*Vt),ce=Math.min(ce,(Mt.start+Mt.count)*Vt)),Ut!==null?(Kt=Math.max(Kt,0),ce=Math.min(ce,Ut.count)):Nt!=null&&(Kt=Math.max(Kt,0),ce=Math.min(ce,Nt.count));const de=ce-Kt;if(de<0||de===1/0)return;ne.setup(G,it,It,nt,Ut);let Xe,Jt=Et;if(Ut!==null&&(Xe=k.get(Ut),Jt=kt,Jt.setIndex(Xe)),G.isMesh)it.wireframe===!0?(Y.setLineWidth(it.wireframeLinewidth*L()),Jt.setMode(w.LINES)):Jt.setMode(w.TRIANGLES);else if(G.isLine){let Ot=it.linewidth;Ot===void 0&&(Ot=1),Y.setLineWidth(Ot*L()),G.isLineSegments?Jt.setMode(w.LINES):G.isLineLoop?Jt.setMode(w.LINE_LOOP):Jt.setMode(w.LINE_STRIP)}else G.isPoints?Jt.setMode(w.POINTS):G.isSprite&&Jt.setMode(w.TRIANGLES);if(G.isBatchedMesh)if(G._multiDrawInstances!==null)Jt.renderMultiDrawInstances(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount,G._multiDrawInstances);else if(H.get("WEBGL_multi_draw"))Jt.renderMultiDraw(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount);else{const Ot=G._multiDrawStarts,Nn=G._multiDrawCounts,Qt=G._multiDrawCount,hn=Ut?k.get(Ut).bytesPerElement:1,Ki=$.get(it).currentProgram.getUniforms();for(let $e=0;$e{function Mt(){if(it.forEach(function(Ct){$.get(Ct).currentProgram.isReady()&&it.delete(Ct)}),it.size===0){G(A);return}setTimeout(Mt,10)}H.get("KHR_parallel_shader_compile")!==null?Mt():setTimeout(Mt,10)})};let un=null;function Un(A){un&&un(A)}function Uc(){Ti.stop()}function Nc(){Ti.start()}const Ti=new pd;Ti.setAnimationLoop(Un),typeof self<"u"&&Ti.setContext(self),this.setAnimationLoop=function(A){un=A,ct.setAnimationLoop(A),A===null?Ti.stop():Ti.start()},ct.addEventListener("sessionstart",Uc),ct.addEventListener("sessionend",Nc),this.render=function(A,V){if(V!==void 0&&V.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),V.parent===null&&V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),ct.enabled===!0&&ct.isPresenting===!0&&(ct.cameraAutoUpdate===!0&&ct.updateCamera(V),V=ct.getCamera()),A.isScene===!0&&A.onBeforeRender(S,A,V,y),f=Ft.get(A,b.length),f.init(V),b.push(f),ft.multiplyMatrices(V.projectionMatrix,V.matrixWorldInverse),Z.setFromProjectionMatrix(ft),mt=this.localClippingEnabled,at=pt.init(this.clippingPlanes,mt),m=St.get(A,T.length),m.init(),T.push(m),ct.enabled===!0&&ct.isPresenting===!0){const Mt=S.xr.getDepthSensingMesh();Mt!==null&&ra(Mt,V,-1/0,S.sortObjects)}ra(A,V,0,S.sortObjects),m.finish(),S.sortObjects===!0&&m.sort(et,gt),R=ct.enabled===!1||ct.isPresenting===!1||ct.hasDepthSensing()===!1,R&&Lt.addToRenderList(m,A),this.info.render.frame++,at===!0&&pt.beginShadows();const nt=f.state.shadowsArray;xt.render(nt,A,V),at===!0&&pt.endShadows(),this.info.autoReset===!0&&this.info.reset();const it=m.opaque,G=m.transmissive;if(f.setupLights(),V.isArrayCamera){const Mt=V.cameras;if(G.length>0)for(let Ct=0,It=Mt.length;Ct0&&Fc(it,G,A,V),R&&Lt.render(A),Oc(m,A,V);y!==null&&(E.updateMultisampleRenderTarget(y),E.updateRenderTargetMipmap(y)),A.isScene===!0&&A.onAfterRender(S,A,V),ne.resetDefaultState(),_=-1,g=null,b.pop(),b.length>0?(f=b[b.length-1],at===!0&&pt.setGlobalState(S.clippingPlanes,f.state.camera)):f=null,T.pop(),T.length>0?m=T[T.length-1]:m=null};function ra(A,V,nt,it){if(A.visible===!1)return;if(A.layers.test(V.layers)){if(A.isGroup)nt=A.renderOrder;else if(A.isLOD)A.autoUpdate===!0&&A.update(V);else if(A.isLight)f.pushLight(A),A.castShadow&&f.pushShadow(A);else if(A.isSprite){if(!A.frustumCulled||Z.intersectsSprite(A)){it&&yt.setFromMatrixPosition(A.matrixWorld).applyMatrix4(ft);const Ct=q.update(A),It=A.material;It.visible&&m.push(A,Ct,It,nt,yt.z,null)}}else if((A.isMesh||A.isLine||A.isPoints)&&(!A.frustumCulled||Z.intersectsObject(A))){const Ct=q.update(A),It=A.material;if(it&&(A.boundingSphere!==void 0?(A.boundingSphere===null&&A.computeBoundingSphere(),yt.copy(A.boundingSphere.center)):(Ct.boundingSphere===null&&Ct.computeBoundingSphere(),yt.copy(Ct.boundingSphere.center)),yt.applyMatrix4(A.matrixWorld).applyMatrix4(ft)),Array.isArray(It)){const Ut=Ct.groups;for(let Vt=0,qt=Ut.length;Vt0&&Dr(G,V,nt),Mt.length>0&&Dr(Mt,V,nt),Ct.length>0&&Dr(Ct,V,nt),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Fc(A,V,nt,it){if((nt.isScene===!0?nt.overrideMaterial:null)!==null)return;f.state.transmissionRenderTarget[it.id]===void 0&&(f.state.transmissionRenderTarget[it.id]=new qi(1,1,{generateMipmaps:!0,type:H.has("EXT_color_buffer_half_float")||H.has("EXT_color_buffer_float")?Cr:Qn,minFilter:Gi,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:$t.workingColorSpace}));const Mt=f.state.transmissionRenderTarget[it.id],Ct=it.viewport||C;Mt.setSize(Ct.z,Ct.w);const It=S.getRenderTarget();S.setRenderTarget(Mt),S.getClearColor(J),st=S.getClearAlpha(),st<1&&S.setClearColor(16777215,.5),S.clear(),R&&Lt.render(nt);const Ut=S.toneMapping;S.toneMapping=vi;const Vt=it.viewport;if(it.viewport!==void 0&&(it.viewport=void 0),f.setupLightsView(it),at===!0&&pt.setGlobalState(S.clippingPlanes,it),Dr(A,nt,it),E.updateMultisampleRenderTarget(Mt),E.updateRenderTargetMipmap(Mt),H.has("WEBGL_multisampled_render_to_texture")===!1){let qt=!1;for(let Nt=0,Kt=V.length;Nt0),Nt=!!nt.morphAttributes.position,Kt=!!nt.morphAttributes.normal,ce=!!nt.morphAttributes.color;let de=vi;it.toneMapped&&(y===null||y.isXRRenderTarget===!0)&&(de=S.toneMapping);const Xe=nt.morphAttributes.position||nt.morphAttributes.normal||nt.morphAttributes.color,Jt=Xe!==void 0?Xe.length:0,Ot=$.get(it),Nn=f.state.lights;if(at===!0&&(mt===!0||A!==g)){const rn=A===g&&it.id===_;pt.setState(it,A,rn)}let Qt=!1;it.version===Ot.__version?(Ot.needsLights&&Ot.lightsStateVersion!==Nn.state.version||Ot.outputColorSpace!==It||G.isBatchedMesh&&Ot.batching===!1||!G.isBatchedMesh&&Ot.batching===!0||G.isBatchedMesh&&Ot.batchingColor===!0&&G.colorTexture===null||G.isBatchedMesh&&Ot.batchingColor===!1&&G.colorTexture!==null||G.isInstancedMesh&&Ot.instancing===!1||!G.isInstancedMesh&&Ot.instancing===!0||G.isSkinnedMesh&&Ot.skinning===!1||!G.isSkinnedMesh&&Ot.skinning===!0||G.isInstancedMesh&&Ot.instancingColor===!0&&G.instanceColor===null||G.isInstancedMesh&&Ot.instancingColor===!1&&G.instanceColor!==null||G.isInstancedMesh&&Ot.instancingMorph===!0&&G.morphTexture===null||G.isInstancedMesh&&Ot.instancingMorph===!1&&G.morphTexture!==null||Ot.envMap!==Ut||it.fog===!0&&Ot.fog!==Mt||Ot.numClippingPlanes!==void 0&&(Ot.numClippingPlanes!==pt.numPlanes||Ot.numIntersection!==pt.numIntersection)||Ot.vertexAlphas!==Vt||Ot.vertexTangents!==qt||Ot.morphTargets!==Nt||Ot.morphNormals!==Kt||Ot.morphColors!==ce||Ot.toneMapping!==de||Ot.morphTargetsCount!==Jt)&&(Qt=!0):(Qt=!0,Ot.__version=it.version);let hn=Ot.currentProgram;Qt===!0&&(hn=Lr(it,V,G));let Ki=!1,$e=!1,Vs=!1;const pe=hn.getUniforms(),yn=Ot.uniforms;if(Y.useProgram(hn.program)&&(Ki=!0,$e=!0,Vs=!0),it.id!==_&&(_=it.id,$e=!0),Ki||g!==A){Y.buffers.depth.getReversed()?(ut.copy(A.projectionMatrix),J_(ut),Q_(ut),pe.setValue(w,"projectionMatrix",ut)):pe.setValue(w,"projectionMatrix",A.projectionMatrix),pe.setValue(w,"viewMatrix",A.matrixWorldInverse);const ei=pe.map.cameraPosition;ei!==void 0&&ei.setValue(w,vt.setFromMatrixPosition(A.matrixWorld)),j.logarithmicDepthBuffer&&pe.setValue(w,"logDepthBufFC",2/(Math.log(A.far+1)/Math.LN2)),(it.isMeshPhongMaterial||it.isMeshToonMaterial||it.isMeshLambertMaterial||it.isMeshBasicMaterial||it.isMeshStandardMaterial||it.isShaderMaterial)&&pe.setValue(w,"isOrthographic",A.isOrthographicCamera===!0),g!==A&&(g=A,$e=!0,Vs=!0)}if(G.isSkinnedMesh){pe.setOptional(w,G,"bindMatrix"),pe.setOptional(w,G,"bindMatrixInverse");const rn=G.skeleton;rn&&(rn.boneTexture===null&&rn.computeBoneTexture(),pe.setValue(w,"boneTexture",rn.boneTexture,E))}G.isBatchedMesh&&(pe.setOptional(w,G,"batchingTexture"),pe.setValue(w,"batchingTexture",G._matricesTexture,E),pe.setOptional(w,G,"batchingIdTexture"),pe.setValue(w,"batchingIdTexture",G._indirectTexture,E),pe.setOptional(w,G,"batchingColorTexture"),G._colorsTexture!==null&&pe.setValue(w,"batchingColorTexture",G._colorsTexture,E));const Gs=nt.morphAttributes;if((Gs.position!==void 0||Gs.normal!==void 0||Gs.color!==void 0)&&Bt.update(G,nt,hn),($e||Ot.receiveShadow!==G.receiveShadow)&&(Ot.receiveShadow=G.receiveShadow,pe.setValue(w,"receiveShadow",G.receiveShadow)),it.isMeshGouraudMaterial&&it.envMap!==null&&(yn.envMap.value=Ut,yn.flipEnvMap.value=Ut.isCubeTexture&&Ut.isRenderTargetTexture===!1?-1:1),it.isMeshStandardMaterial&&it.envMap===null&&V.environment!==null&&(yn.envMapIntensity.value=V.environmentIntensity),$e&&(pe.setValue(w,"toneMappingExposure",S.toneMappingExposure),Ot.needsLights&&Ad(yn,Vs),Mt&&it.fog===!0&&ht.refreshFogUniforms(yn,Mt),ht.refreshMaterialUniforms(yn,it,B,W,f.state.transmissionRenderTarget[A.id]),Ro.upload(w,zc(Ot),yn,E)),it.isShaderMaterial&&it.uniformsNeedUpdate===!0&&(Ro.upload(w,zc(Ot),yn,E),it.uniformsNeedUpdate=!1),it.isSpriteMaterial&&pe.setValue(w,"center",G.center),pe.setValue(w,"modelViewMatrix",G.modelViewMatrix),pe.setValue(w,"normalMatrix",G.normalMatrix),pe.setValue(w,"modelMatrix",G.matrixWorld),it.isShaderMaterial||it.isRawShaderMaterial){const rn=it.uniformsGroups;for(let ei=0,ni=rn.length;ei0&&E.useMultisampledRTT(A)===!1?G=$.get(A).__webglMultisampledFramebuffer:Array.isArray(qt)?G=qt[nt]:G=qt,C.copy(A.viewport),N.copy(A.scissor),F=A.scissorTest}else C.copy(X).multiplyScalar(B).floor(),N.copy(ot).multiplyScalar(B).floor(),F=lt;if(Y.bindFramebuffer(w.FRAMEBUFFER,G)&&it&&Y.drawBuffers(A,G),Y.viewport(C),Y.scissor(N),Y.setScissorTest(F),Mt){const Ut=$.get(A.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+V,Ut.__webglTexture,nt)}else if(Ct){const Ut=$.get(A.texture),Vt=V||0;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ut.__webglTexture,nt||0,Vt)}_=-1},this.readRenderTargetPixels=function(A,V,nt,it,G,Mt,Ct){if(!(A&&A.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let It=$.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Ct!==void 0&&(It=It[Ct]),It){Y.bindFramebuffer(w.FRAMEBUFFER,It);try{const Ut=A.texture,Vt=Ut.format,qt=Ut.type;if(!j.textureFormatReadable(Vt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!j.textureTypeReadable(qt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}V>=0&&V<=A.width-it&&nt>=0&&nt<=A.height-G&&w.readPixels(V,nt,it,G,Wt.convert(Vt),Wt.convert(qt),Mt)}finally{const Ut=y!==null?$.get(y).__webglFramebuffer:null;Y.bindFramebuffer(w.FRAMEBUFFER,Ut)}}},this.readRenderTargetPixelsAsync=async function(A,V,nt,it,G,Mt,Ct){if(!(A&&A.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let It=$.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Ct!==void 0&&(It=It[Ct]),It){const Ut=A.texture,Vt=Ut.format,qt=Ut.type;if(!j.textureFormatReadable(Vt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!j.textureTypeReadable(qt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(V>=0&&V<=A.width-it&&nt>=0&&nt<=A.height-G){Y.bindFramebuffer(w.FRAMEBUFFER,It);const Nt=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Nt),w.bufferData(w.PIXEL_PACK_BUFFER,Mt.byteLength,w.STREAM_READ),w.readPixels(V,nt,it,G,Wt.convert(Vt),Wt.convert(qt),0);const Kt=y!==null?$.get(y).__webglFramebuffer:null;Y.bindFramebuffer(w.FRAMEBUFFER,Kt);const ce=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await K_(w,ce,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Nt),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,Mt),w.deleteBuffer(Nt),w.deleteSync(ce),Mt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(A,V=null,nt=0){A.isTexture!==!0&&(sr("WebGLRenderer: copyFramebufferToTexture function signature has changed."),V=arguments[0]||null,A=arguments[1]);const it=Math.pow(2,-nt),G=Math.floor(A.image.width*it),Mt=Math.floor(A.image.height*it),Ct=V!==null?V.x:0,It=V!==null?V.y:0;E.setTexture2D(A,0),w.copyTexSubImage2D(w.TEXTURE_2D,nt,0,0,Ct,It,G,Mt),Y.unbindTexture()},this.copyTextureToTexture=function(A,V,nt=null,it=null,G=0){A.isTexture!==!0&&(sr("WebGLRenderer: copyTextureToTexture function signature has changed."),it=arguments[0]||null,A=arguments[1],V=arguments[2],G=arguments[3]||0,nt=null);let Mt,Ct,It,Ut,Vt,qt,Nt,Kt,ce;const de=A.isCompressedTexture?A.mipmaps[G]:A.image;nt!==null?(Mt=nt.max.x-nt.min.x,Ct=nt.max.y-nt.min.y,It=nt.isBox3?nt.max.z-nt.min.z:1,Ut=nt.min.x,Vt=nt.min.y,qt=nt.isBox3?nt.min.z:0):(Mt=de.width,Ct=de.height,It=de.depth||1,Ut=0,Vt=0,qt=0),it!==null?(Nt=it.x,Kt=it.y,ce=it.z):(Nt=0,Kt=0,ce=0);const Xe=Wt.convert(V.format),Jt=Wt.convert(V.type);let Ot;V.isData3DTexture?(E.setTexture3D(V,0),Ot=w.TEXTURE_3D):V.isDataArrayTexture||V.isCompressedArrayTexture?(E.setTexture2DArray(V,0),Ot=w.TEXTURE_2D_ARRAY):(E.setTexture2D(V,0),Ot=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,V.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,V.unpackAlignment);const Nn=w.getParameter(w.UNPACK_ROW_LENGTH),Qt=w.getParameter(w.UNPACK_IMAGE_HEIGHT),hn=w.getParameter(w.UNPACK_SKIP_PIXELS),Ki=w.getParameter(w.UNPACK_SKIP_ROWS),$e=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,de.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,de.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,Ut),w.pixelStorei(w.UNPACK_SKIP_ROWS,Vt),w.pixelStorei(w.UNPACK_SKIP_IMAGES,qt);const Vs=A.isDataArrayTexture||A.isData3DTexture,pe=V.isDataArrayTexture||V.isData3DTexture;if(A.isRenderTargetTexture||A.isDepthTexture){const yn=$.get(A),Gs=$.get(V),rn=$.get(yn.__renderTarget),ei=$.get(Gs.__renderTarget);Y.bindFramebuffer(w.READ_FRAMEBUFFER,rn.__webglFramebuffer),Y.bindFramebuffer(w.DRAW_FRAMEBUFFER,ei.__webglFramebuffer);for(let ni=0;ni0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class uS extends We{constructor(t=null,e=1,i=1,s,r,o,a,l,c=sn,u=sn,h,d){super(null,o,a,l,c,u,s,r,h,d),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class xh extends Mn{constructor(t,e,i,s=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const ps=new se,Mh=new se,ro=[],Sh=new bi,hS=new se,Ks=new wt,Js=new Bs;class oo extends wt{constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new xh(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;Xa.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(Xa);if(!(lt.far))return{distance:l,point:Eh.clone().applyMatrix4(n.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:n}}const bh=new O,Th=new O;class Sd extends Wn{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[];for(let s=0,r=e.count;s0&&b(!0),e>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new fe(h,3)),this.setAttribute("normal",new fe(d,3)),this.setAttribute("uv",new fe(p,2));function T(){const S=new O,U=new O;let D=0;const P=(e-t)/i;for(let y=0;y<=r;y++){const _=[],g=y/r,C=g*(e-t)+t;for(let N=0;N<=s;N++){const F=N/s,J=F*l+a,st=Math.sin(J),Q=Math.cos(J);U.x=C*st,U.y=-g*i+m,U.z=C*Q,h.push(U.x,U.y,U.z),S.set(st,P,Q).normalize(),d.push(S.x,S.y,S.z),p.push(F,1-g),_.push(v++)}M.push(_)}for(let y=0;y0||_!==0)&&(u.push(g,C,F),D+=3),(e>0||_!==r-1)&&(u.push(C,N,F),D+=3)}c.addGroup(f,D,0),f+=D}function b(S){const U=v,D=new Ht,P=new O;let y=0;const _=S===!0?t:e,g=S===!0?1:-1;for(let N=1;N<=s;N++)h.push(0,m*g,0),d.push(0,g,0),p.push(.5,.5),v++;const C=v;for(let N=0;N<=s;N++){const J=N/s*l+a,st=Math.cos(J),Q=Math.sin(J);P.x=_*Q,P.y=m*g,P.z=_*st,h.push(P.x,P.y,P.z),d.push(0,g,0),D.x=st*.5+.5,D.y=Q*.5*g+.5,p.push(D.x,D.y),v++}for(let N=0;N.9&&P<.1&&(b<.2&&(o[T+0]+=1),S<.2&&(o[T+2]+=1),U<.2&&(o[T+4]+=1))}}function d(T){r.push(T.x,T.y,T.z)}function p(T,b){const S=T*3;b.x=t[S+0],b.y=t[S+1],b.z=t[S+2]}function v(){const T=new O,b=new O,S=new O,U=new O,D=new Ht,P=new Ht,y=new Ht;for(let _=0,g=0;_0)&&p.push(b,S,D),(f!==i-1||l{if(!n.value)return;t=new cS,t.background=new zt(10413049);const o=window.innerWidth/window.innerHeight;e=new an(40,o,1,1e3),e.position.set(25,45,25),e.lookAt(0,0,0),i=new lS({antialias:!0}),i.setSize(window.innerWidth,window.innerHeight),i.shadowMap.enabled=!0,i.outputColorSpace=tn,n.value.appendChild(i.domElement),window.addEventListener("resize",r)},r=()=>{!i||!e||(e.aspect=window.innerWidth/window.innerHeight,e.updateProjectionMatrix(),i.setSize(window.innerWidth,window.innerHeight))};return Zo(()=>{window.removeEventListener("resize",r),i&&i.dispose()}),{canvasContainer:n,initScene:s,getScene:()=>t,getCamera:()=>e,getRenderer:()=>i}}var ja={exports:{}},Dh;function xS(){return Dh||(Dh=1,(function(n,t){(function(){var e=Math.PI,i=Math.sin,s=Math.cos,r=Math.tan,o=Math.asin,a=Math.atan2,l=Math.acos,c=e/180,u=1e3*60*60*24,h=2440588,d=2451545;function p(X){return X.valueOf()/u-.5+h}function v(X){return new Date((X+.5-h)*u)}function M(X){return p(X)-d}var m=c*23.4397;function f(X,ot){return a(i(X)*s(m)-r(ot)*i(m),s(X))}function T(X,ot){return o(i(ot)*s(m)+s(ot)*i(m)*i(X))}function b(X,ot,lt){return a(i(X),s(X)*i(ot)-r(lt)*s(ot))}function S(X,ot,lt){return o(i(ot)*i(lt)+s(ot)*s(lt)*s(X))}function U(X,ot){return c*(280.16+360.9856235*X)-ot}function D(X){return X<0&&(X=0),2967e-7/Math.tan(X+.00312536/(X+.08901179))}function P(X){return c*(357.5291+.98560028*X)}function y(X){var ot=c*(1.9148*i(X)+.02*i(2*X)+3e-4*i(3*X)),lt=c*102.9372;return X+ot+lt+e}function _(X){var ot=P(X),lt=y(ot);return{dec:T(lt,0),ra:f(lt,0)}}var g={};g.getPosition=function(X,ot,lt){var Z=c*-lt,at=c*ot,mt=M(X),ut=_(mt),ft=U(mt,Z)-ut.ra;return{azimuth:b(ft,at,ut.dec),altitude:S(ft,at,ut.dec)}};var C=g.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];g.addTime=function(X,ot,lt){C.push([X,ot,lt])};var N=9e-4;function F(X,ot){return Math.round(X-N-ot/(2*e))}function J(X,ot,lt){return N+(X+ot)/(2*e)+lt}function st(X,ot,lt){return d+X+.0053*i(ot)-.0069*i(2*lt)}function Q(X,ot,lt){return l((i(X)-i(ot)*i(lt))/(s(ot)*s(lt)))}function W(X){return-2.076*Math.sqrt(X)/60}function B(X,ot,lt,Z,at,mt,ut){var ft=Q(X,lt,Z),vt=J(ft,ot,at);return st(vt,mt,ut)}g.getTimes=function(X,ot,lt,Z){Z=Z||0;var at=c*-lt,mt=c*ot,ut=W(Z),ft=M(X),vt=F(ft,at),yt=J(0,at,vt),Tt=P(yt),R=y(Tt),L=T(R,0),w=st(yt,Tt,R),tt,H,j,Y,rt,$,E={solarNoon:v(w),nadir:v(w-.5)};for(tt=0,H=C.length;tt=0&&($=Math.sqrt(H)/(Math.abs(R)*2),Y=w-$,rt=w+$,Math.abs(Y)<=1&&j++,Math.abs(rt)<=1&&j++,Y<-1&&(Y=rt)),j===1?ut<0?yt=E+Y:Tt=E+Y:j===2&&(yt=E+(tt<0?rt:Y),Tt=E+(tt<0?Y:rt)),!(yt&&Tt));E+=2)ut=vt;var x={};return yt&&(x.rise=gt(at,yt)),Tt&&(x.set=gt(at,Tt)),!yt&&!Tt&&(x[tt>0?"alwaysUp":"alwaysDown"]=!0),x},n.exports=g})()})(ja)),ja.exports}var MS=xS();const SS=Xf(MS);function yS(n,t){let e,i;const s={day:new zt(11129853),night:new zt(657955),sunriseSun:new zt(10736127),daySun:new zt(16777129),sunsetSun:new zt(16763941),nightSun:new zt(2236996),dayAmbient:new zt(11129853),nightAmbient:new zt(5592456),tempSun:new zt,tempAmbient:new zt,tempBg:new zt},r=()=>{i=new _S(9485245,1.2),n.add(i),e=new mS(16777215),e.position.set(20,30,10),e.castShadow=!0,e.shadow.mapSize.width=2048,e.shadow.mapSize.height=2048,e.shadow.camera.near=.5,e.shadow.camera.far=500,e.shadow.bias=-5e-4,e.shadow.normalBias=.05,e.shadow.camera.left=-100,e.shadow.camera.right=100,e.shadow.camera.top=100,e.shadow.camera.bottom=-100,n.add(e)},o=l=>{const c=l*(180/Math.PI);if(c>10)return{sun:s.daySun,ambient:s.dayAmbient,bg:s.day,intensity:1.5,shadow:!0};if(c>0){const u=c/10;return s.tempSun.copy(s.sunsetSun).lerp(s.daySun,u),s.tempAmbient.copy(s.nightAmbient).lerp(s.dayAmbient,u),s.tempBg.copy(s.night).lerp(s.day,u),{sun:s.tempSun,ambient:s.tempAmbient,bg:s.tempBg,intensity:.5+1*u,shadow:!0}}if(c>-6){const u=(c+6)/6;return s.tempSun.copy(s.nightSun).lerp(s.sunsetSun,u),s.tempAmbient.copy(s.nightAmbient).lerp(s.nightAmbient,u),s.tempBg.copy(s.night).lerp(new zt(4469589),u),{sun:s.tempSun,ambient:s.tempAmbient,bg:s.tempBg,intensity:u*.5,shadow:!1}}return{sun:s.nightSun,ambient:s.nightAmbient,bg:s.night,intensity:.2,shadow:!1}};return{initSun:r,updateSun:()=>{if(!e||!i)return;const l=41.17873,c=-8.60835,u=t.value.currentTime,h=new Date;h.setHours(Math.floor(u)),h.setMinutes(Math.floor(u%1*60)),h.setSeconds(0);const d=SS.getPosition(h,l,c),p=100,v=d.azimuth,M=d.altitude,m=p*Math.cos(M)*Math.cos(v),f=p*Math.sin(M),T=p*Math.cos(M)*Math.sin(v);e&&(e.position.set(m,f,T),e.target.position.set(0,0,0),e.target.updateMatrixWorld());const b=o(d.altitude),S=t.value.brightness??1;e.color.copy(b.sun),e.intensity=b.intensity*S,e.castShadow=b.shadow,i.color.copy(b.ambient),i.intensity=1.2*S,n.background=b.bg}}}function ES(){const n=[],t={road:new Vn({color:3355443}),roadLine:new Hs({color:16777215}),sidewalk:new Vn({color:13421772}),grass:new Vn({color:8190976}),treeTrunk:new Vn({color:9127187}),treeLeaves:new Vn({color:2263842})},e={house:{geometry:new he(6,6,6),material:new Vn({color:16755200}),description:"Residential House"},factory:{geometry:new he(8,6,10),material:new Vn({color:15158332}),description:"Manufacturing Plant"},office:{geometry:new he(8,14,8),material:new Vn({color:3447003}),description:"Office Building"},shop:{geometry:new he(8,5,8),material:new Vn({color:15844367}),description:"Retail Shop"}},i=30,s=8,r=1.5,o=6,a=200,l=o*o,c=(p,v,M,m,f,T=0)=>{const b=new wt(v.geometry,v.material);b.position.copy(M),b.rotation.y=T,v.geometry.type==="BoxGeometry"&&(b.position.y+=v.geometry.parameters.height/2),b.castShadow=!0,b.receiveShadow=!0,b.userData={id:m,type:v.description||"Generic",...v,csvPath:f},n.push(b),p.add(b)},u=(p,v,M,m,f,T=0)=>{const b=e[v];if(!b){console.warn(`Building type ${v} not found`);return}const S=M.clone();S.y=.5,c(p,b,S,m,f,T)},h=p=>{const v=new $i(300,300),M=new wt(v,t.road);M.rotation.x=-Math.PI/2,M.position.y=-.1,M.receiveShadow=!0,p.add(M);const m=[],f=(o-1)*i/2,T=new he(i-s,.4,i-s),b=new oo(T,t.sidewalk,l);b.receiveShadow=!0;const S=i-s-r*2,U=new he(S,.5,S),D=new oo(U,t.grass,l);D.receiveShadow=!0;const P=new Me;let y=0;for(let g=0;g{const M=[{id:"H01",type:"house",csv:"data/H01.csv"},{id:"H02",type:"factory",csv:"data/H02.csv"},{id:"H03",type:"office",csv:"data/H03.csv"},{id:"H04",type:"shop",csv:"data/H04.csv"},{id:"H05",type:"house",csv:"data/H05.csv"},{id:"H06",type:"house",csv:"data/H06.csv"},{id:"H07",type:"house",csv:"data/H07.csv"},{id:"H08",type:"shop",csv:"data/H08.csv"},{id:"H09",type:"shop",csv:"data/H09.csv"},{id:"H10",type:"house",csv:"data/H10.csv"},{id:"H11",type:"house",csv:"data/H11.csv"},{id:"H12",type:"house",csv:"data/H12.csv"},{id:"H13",type:"house",csv:"data/H13.csv"},{id:"H14",type:"house",csv:"data/H14.csv"}],m=new Ae(.5,.5,2,6),f=new Pc(2,4,8),T=new oo(m,t.treeTrunk,a),b=new oo(f,t.treeLeaves,a);T.castShadow=!0,T.receiveShadow=!0,b.castShadow=!0,b.receiveShadow=!0;let S=0;const U=new Me,D=y=>{S>=a||(U.position.copy(y).add(new O(0,1,0)),U.rotation.set(0,0,0),U.scale.set(1,1,1),U.updateMatrix(),T.setMatrixAt(S,U.matrix),U.position.copy(y).add(new O(0,4,0)),U.updateMatrix(),b.setMatrixAt(S,U.matrix),S++)};let P=0;for(let y=0;y.5&&D(_.clone().add(new O(6,.5,4)))}T.count=S,b.count=S,p.add(T),p.add(b)};return{interactableObjects:n,initCity:p=>{const v=h(p);d(p,v)}}}const Lh={type:"change"},Ic={type:"start"},Td={type:"end"},fo=new ea,Ih=new di,bS=Math.cos(70*Z_.DEG2RAD),ye=new O,qe=2*Math.PI,oe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Za=1e-6;class TS extends bd{constructor(t,e=null){super(t,e),this.state=oe.NONE,this.enabled=!0,this.target=new O,this.cursor=new O,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Xi.ROTATE,MIDDLE:Xi.DOLLY,RIGHT:Xi.PAN},this.touches={ONE:_s.ROTATE,TWO:_s.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new O,this._lastQuaternion=new Ce,this._lastTargetPosition=new O,this._quat=new Ce().setFromUnitVectors(t.up,new O(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Ph,this._sphericalDelta=new Ph,this._scale=1,this._panOffset=new O,this._rotateStart=new Ht,this._rotateEnd=new Ht,this._rotateDelta=new Ht,this._panStart=new Ht,this._panEnd=new Ht,this._panDelta=new Ht,this._dollyStart=new Ht,this._dollyEnd=new Ht,this._dollyDelta=new Ht,this._dollyDirection=new O,this._mouse=new Ht,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=AS.bind(this),this._onPointerDown=wS.bind(this),this._onPointerUp=RS.bind(this),this._onContextMenu=NS.bind(this),this._onMouseWheel=DS.bind(this),this._onKeyDown=LS.bind(this),this._onTouchStart=IS.bind(this),this._onTouchMove=US.bind(this),this._onMouseDown=CS.bind(this),this._onMouseMove=PS.bind(this),this._interceptControlDown=OS.bind(this),this._interceptControlUp=FS.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Lh),this.update(),this.state=oe.NONE}update(t=null){const e=this.object.position;ye.copy(e).sub(this.target),ye.applyQuaternion(this._quat),this._spherical.setFromVector3(ye),this.autoRotate&&this.state===oe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),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 i=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(i)&&isFinite(s)&&(i<-Math.PI?i+=qe:i>Math.PI&&(i-=qe),s<-Math.PI?s+=qe:s>Math.PI&&(s-=qe),i<=s?this._spherical.theta=Math.max(i,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+s)/2?Math.max(i,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=o!=this._spherical.radius}if(ye.setFromSpherical(this._spherical),ye.applyQuaternion(this._quatInverse),e.copy(this.target).add(ye),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=ye.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const a=new O(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new O(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=ye.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(fo.origin.copy(this.object.position),fo.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(fo.direction))Za||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Za||this._lastTargetPosition.distanceToSquared(this.target)>Za?(this.dispatchEvent(Lh),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?qe/60*this.autoRotateSpeed*t:qe/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){ye.setFromMatrixColumn(e,0),ye.multiplyScalar(-t),this._panOffset.add(ye)}_panUp(t,e){this.screenSpacePanning===!0?ye.setFromMatrixColumn(e,1):(ye.setFromMatrixColumn(e,0),ye.crossVectors(this.object.up,ye)),ye.multiplyScalar(t),this._panOffset.add(ye)}_pan(t,e){const i=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;ye.copy(s).sub(this.target);let r=ye.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/i.clientHeight,this.object.matrix),this._panUp(2*e*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),s=t-i.left,r=e-i.top,o=i.width,a=i.height;this._mouse.x=s/o*2-1,this._mouse.y=-(r/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(qe*this._rotateDelta.x/e.clientHeight),this._rotateUp(qe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(-qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(-qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(i,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(i,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),r=.5*(t.pageY+i.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(qe*this._rotateDelta.x/e.clientHeight),this._rotateUp(qe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(i,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(t.pageX+e.x)*.5,a=(t.pageY+e.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e{e=new TS(n,t.domElement),e.enableDamping=!1,e.dampingFactor=.05,e.enableRotate=!1,e.enablePan=!0,e.enableZoom=!1,e.screenSpacePanning=!1,e.mouseButtons={LEFT:Xi.PAN},e.target.set(0,0,0),e.addEventListener("change",()=>{i||(e.target.y=0,n.position.y=Math.min(n.position.y,h.value.maxZoom||120))}),t.domElement.addEventListener("wheel",v=>{if(v.preventDefault(),!i){const M=h.value.zoomSensitivity||5,m=h.value.maxZoom||120,f=new O().subVectors(n.position,e.target).normalize();let T=null;v.deltaY<0?(T=n.position.clone().add(f.multiplyScalar(M)),T.y>m&&(T=null)):v.deltaY>0&&(T=n.position.clone().sub(f.multiplyScalar(M)),T.y<10&&(T=null)),T&&(s=n.position.clone(),r=T,o=e.target.clone(),a=e.target.clone(),l=0,u=performance.now()/1e3,i=!0)}},{passive:!1})},updateControls:()=>{if(i&&s&&r&&o&&a){const v=performance.now()/1e3;l=Math.min((v-u)/c,1),n.position.lerpVectors(s,r,l),e.target.lerpVectors(o,a,l),l>=1&&(i=!1),e.update()}e&&e.update()},getControls:()=>e}}const Ui=new Ed,Ie=new O,ci=new O,ge=new Ce,Uh={X:new O(1,0,0),Y:new O(0,1,0),Z:new O(0,0,1)},$a={type:"change"},Nh={type:"mouseDown",mode:null},Oh={type:"mouseUp",mode:null},Fh={type:"objectChange"};class zS extends bd{constructor(t,e=null){super(void 0,e);const i=new XS(this);this._root=i;const s=new YS;this._gizmo=s,i.add(s);const r=new qS;this._plane=r,i.add(r);const o=this;function a(b,S){let U=S;Object.defineProperty(o,b,{get:function(){return U!==void 0?U:S},set:function(D){U!==D&&(U=D,r[b]=D,s[b]=D,o.dispatchEvent({type:b+"-changed",value:D}),o.dispatchEvent($a))}}),o[b]=S,r[b]=S,s[b]=S}a("camera",t),a("object",void 0),a("enabled",!0),a("axis",null),a("mode","translate"),a("translationSnap",null),a("rotationSnap",null),a("scaleSnap",null),a("space","world"),a("size",1),a("dragging",!1),a("showX",!0),a("showY",!0),a("showZ",!0),a("minX",-1/0),a("maxX",1/0),a("minY",-1/0),a("maxY",1/0),a("minZ",-1/0),a("maxZ",1/0);const l=new O,c=new O,u=new Ce,h=new Ce,d=new O,p=new Ce,v=new O,M=new O,m=new O,f=0,T=new O;a("worldPosition",l),a("worldPositionStart",c),a("worldQuaternion",u),a("worldQuaternionStart",h),a("cameraPosition",d),a("cameraQuaternion",p),a("pointStart",v),a("pointEnd",M),a("rotationAxis",m),a("rotationAngle",f),a("eye",T),this._offset=new O,this._startNorm=new O,this._endNorm=new O,this._cameraScale=new O,this._parentPosition=new O,this._parentQuaternion=new Ce,this._parentQuaternionInv=new Ce,this._parentScale=new O,this._worldScaleStart=new O,this._worldQuaternionInv=new Ce,this._worldScale=new O,this._positionStart=new O,this._quaternionStart=new Ce,this._scaleStart=new O,this._getPointer=HS.bind(this),this._onPointerDown=VS.bind(this),this._onPointerHover=kS.bind(this),this._onPointerMove=GS.bind(this),this._onPointerUp=WS.bind(this),e!==null&&this.connect()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&Ui.setFromCamera(t,this.camera);const e=Ka(this._gizmo.picker[this.mode],Ui);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&Ui.setFromCamera(t,this.camera);const e=Ka(this._plane,Ui,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,Nh.mode=this.mode,this.dispatchEvent(Nh)}}pointerMove(t){const e=this.axis,i=this.mode,s=this.object;let r=this.space;if(i==="scale"?r="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(r="world"),s===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&Ui.setFromCamera(t,this.camera);const o=Ka(this._plane,Ui,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),r==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),r==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(r==="local"&&(s.position.applyQuaternion(ge.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),r==="world"&&(s.parent&&s.position.add(Ie.setFromMatrixPosition(s.parent.matrixWorld)),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(Ie.setFromMatrixPosition(s.parent.matrixWorld)))),s.position.x=Math.max(this.minX,Math.min(this.maxX,s.position.x)),s.position.y=Math.max(this.minY,Math.min(this.maxY,s.position.y)),s.position.z=Math.max(this.minZ,Math.min(this.maxZ,s.position.z));else if(i==="scale"){if(e.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),ci.set(a,a,a)}else Ie.copy(this.pointStart),ci.copy(this.pointEnd),Ie.applyQuaternion(this._worldQuaternionInv),ci.applyQuaternion(this._worldQuaternionInv),ci.divide(Ie),e.search("X")===-1&&(ci.x=1),e.search("Y")===-1&&(ci.y=1),e.search("Z")===-1&&(ci.z=1);s.scale.copy(this._scaleStart).multiply(ci),this.scaleSnap&&(e.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(Ie.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Ie.copy(this.rotationAxis).cross(this.eye))*a):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(Uh[e]),Ie.copy(Uh[e]),r==="local"&&Ie.applyQuaternion(this.worldQuaternion),Ie.cross(this.eye),Ie.length()===0?l=!0:this.rotationAngle=this._offset.dot(Ie.normalize())*a),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),r==="local"&&e!=="E"&&e!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(ge.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(ge.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent($a),this.dispatchEvent(Fh)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Oh.mode=this.mode,this.dispatchEvent(Oh)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent($a),this.dispatchEvent(Fh),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Ui}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function HS(n){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:n.button};{const t=this.domElement.getBoundingClientRect();return{x:(n.clientX-t.left)/t.width*2-1,y:-(n.clientY-t.top)/t.height*2+1,button:n.button}}}function kS(n){if(this.enabled)switch(n.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(n));break}}function VS(n){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(n.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(n)),this.pointerDown(this._getPointer(n)))}function GS(n){this.enabled&&this.pointerMove(this._getPointer(n))}function WS(n){this.enabled&&(this.domElement.releasePointerCapture(n.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(n)))}function Ka(n,t,e){const i=t.intersectObject(n,!0);for(let s=0;s.9&&(o.visible=!1)),this.axis==="Y"&&(ge.setFromEuler(po.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(ge),Math.abs(ae.copy(Fi).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(ge.setFromEuler(po.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(ge),Math.abs(ae.copy(ar).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(ge.setFromEuler(po.set(0,Math.PI/2,0)),ae.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(zh.lookAt(Bh,ae,Fi)),o.quaternion.multiply(ge),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Ie.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Ie.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Ie),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(ae.copy(or).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(ae.copy(Fi).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(ae.copy(ar).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(ae.copy(ar).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(ae.copy(or).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(ae.copy(Fi).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(mo.copy(i),ae.copy(this.eye).applyQuaternion(ge.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(zh.lookAt(this.eye,Bh,Fi)),o.name==="X"&&(ge.setFromAxisAngle(or,Math.atan2(-ae.y,ae.z)),ge.multiplyQuaternions(mo,ge),o.quaternion.copy(ge)),o.name==="Y"&&(ge.setFromAxisAngle(Fi,Math.atan2(ae.x,ae.z)),ge.multiplyQuaternions(mo,ge),o.quaternion.copy(ge)),o.name==="Z"&&(ge.setFromAxisAngle(ar,Math.atan2(ae.y,ae.x)),ge.multiplyQuaternions(mo,ge),o.quaternion.copy(ge))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(l){return o.name===l}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(t)}}class qS extends wt{constructor(){super(new $i(1e5,1e5,2,2),new Hs({visible:!1,wireframe:!0,side:_n,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),_o.copy(or).applyQuaternion(e==="local"?this.worldQuaternion:Co),tr.copy(Fi).applyQuaternion(e==="local"?this.worldQuaternion:Co),er.copy(ar).applyQuaternion(e==="local"?this.worldQuaternion:Co),ae.copy(tr),this.mode){case"translate":case"scale":switch(this.axis){case"X":ae.copy(this.eye).cross(_o),bn.copy(_o).cross(ae);break;case"Y":ae.copy(this.eye).cross(tr),bn.copy(tr).cross(ae);break;case"Z":ae.copy(this.eye).cross(er),bn.copy(er).cross(ae);break;case"XY":bn.copy(er);break;case"YZ":bn.copy(_o);break;case"XZ":ae.copy(er),bn.copy(tr);break;case"XYZ":case"E":bn.set(0,0,0);break}break;case"rotate":default:bn.set(0,0,0)}bn.length()===0?this.quaternion.copy(this.cameraQuaternion):(Hh.lookAt(Ie.set(0,0,0),bn,ae),this.quaternion.setFromRotationMatrix(Hh)),super.updateMatrixWorld(t)}}function jS(n,t,e,i,s){const{selectedBuilding:r,loadBuildingData:o}=Os();let a,l,c,u,h=!1;const d=()=>{const b=new $i(1,1),S=new Hs({color:16776960,side:_n,transparent:!0,opacity:.5});u=new wt(b,S),u.rotation.x=-Math.PI/2,u.visible=!1;const U=new fS(b),D=new Sd(U,new ia({color:16776960}));u.add(D),e.add(u)},p=b=>{if(!b){u.visible=!1;return}u.visible=!0;const S=new bi().setFromObject(b),U=new O;S.getSize(U);const D=4;u.scale.set(U.x+D,U.z+D,1),u.position.copy(b.position),u.position.y=.2},v=()=>{a=new Ed,l=new Ht,d(),c=new zS(n,t.domElement),c.setMode("translate"),c.showY=!1,c.enabled=!1,c.addEventListener("dragging-changed",b=>{const S=s();S&&(S.enabled=!b.value)});try{e.add(c.getHelper())}catch(b){console.error("Failed to add TransformControls helper to scene:",b)}window.addEventListener("keydown",b=>{b.key==="m"&&(h=!h,c.enabled=h,h||c.detach(),console.log("Move Mode:",h?"ON":"OFF"))}),t.domElement.addEventListener("pointerdown",f),t.domElement.addEventListener("pointerup",T)};let M=0,m=0;const f=b=>{M=b.clientX,m=b.clientY},T=b=>{const S=Math.abs(b.clientX-M),U=Math.abs(b.clientY-m);if(S>5||U>5)return;const D=t.domElement.getBoundingClientRect();l.x=(b.clientX-D.left)/D.width*2-1,l.y=-((b.clientY-D.top)/D.height)*2+1,a.setFromCamera(l,n);const P=a.intersectObjects(i);if(h)if(P.length>0){const y=P[0].object,_=y.userData.parentGroup||y;c.attach(_)}else c.detach();if(P.length>0){const y=P[0].object,_=y.userData.parentGroup||y,g=_.userData,C=_.position.clone();C.project(n);const N=(C.x*.5+.5)*D.width,F=(-(C.y*.5)+.5)*D.height;r.value={id:g.id,type:g.type,description:g.description,consumption:g.consumption||"Loading...",generation:g.generation||"Loading...",iot:g.iot||"None",csvPath:g.csvPath,uiX:N,uiY:F},g.csvPath&&o(g.id,g.csvPath).then(J=>{if(r.value&&r.value.id===g.id&&J&&J.length>0){const st=J[0];r.value.consumption=st.Consumption,r.value.generation=st.Generation}}),p(_)}else r.value=null,p(null)};return{initInteraction:v}}const ZS=wr({__name:"DigitalTwin",setup(n){const{state:t,updateTime:e}=Os(),{canvasContainer:i,initScene:s,getScene:r,getCamera:o,getRenderer:a}=vS(),l=()=>{s();const c=r(),u=o(),h=a(),{initCity:d,interactableObjects:p}=ES();d(c);const{initSun:v,updateSun:M}=yS(c,t);v();const{initControls:m,updateControls:f,getControls:T}=BS(u,h);m();const{initInteraction:b}=jS(u,h,c,p,T);b();const S=()=>{requestAnimationFrame(S),e(.016),M(),f(),h.render(c,u)};S()};return pc(()=>{l()}),(c,u)=>(Ns(),Ar("div",{ref_key:"canvasContainer",ref:i,class:"canvas-container"},null,512))}}),sa=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},$S=sa(ZS,[["__scopeId","data-v-0c7f17d8"]]),KS={class:"header"},JS={class:"content"},QS={class:"info-row"},ty={class:"value"},ey={class:"info-row"},ny={class:"value"},iy={class:"info-row"},sy={class:"value"},ry={class:"iot-text"},oy=300,ay=350,nr=20,ly=wr({__name:"BuildingInfoCanvas",setup(n){const{selectedBuilding:t}=Os(),e=mn(window.innerWidth),i=mn(window.innerHeight),s=()=>{e.value=window.innerWidth,i.value=window.innerHeight};pc(()=>window.addEventListener("resize",s)),Zo(()=>window.removeEventListener("resize",s));const r=()=>{t.value=null},o=yr(()=>!t.value||!t.value.uiY?!1:t.value.uiY{if(!t.value||!t.value.uiX||!t.value.uiY)return{};let l=t.value.uiX,c=t.value.uiY;const u=oy/2;return l-ue.value-nr&&(l=e.value-nr-u),{left:l+"px",top:c+"px"}});return(l,c)=>Re(t)?(Ns(),Ar("div",{key:0,class:mi(["building-panel",{flipped:o.value}]),ref:"panelRef",style:Yo(a.value)},[Dt("div",KS,[Dt("h3",null,Ue(Re(t).id)+" - "+Ue(Re(t).description),1),Dt("button",{class:"close-btn",onClick:r},"×")]),Dt("div",JS,[Dt("div",QS,[c[0]||(c[0]=Dt("span",{class:"label"},"Type:",-1)),Dt("span",ty,Ue(Re(t).type),1)]),c[3]||(c[3]=Dt("div",{class:"section-title"},"Energy Status",-1)),Dt("div",ey,[c[1]||(c[1]=Dt("span",{class:"label"},"Consumption:",-1)),Dt("span",ny,Ue(Re(t).consumption)+" kWh",1)]),Dt("div",iy,[c[2]||(c[2]=Dt("span",{class:"label"},"Generation:",-1)),Dt("span",sy,Ue(Re(t).generation)+" kWh",1)]),c[4]||(c[4]=Dt("div",{class:"section-title"},"IoT Devices",-1)),Dt("p",ry,Ue(Re(t).iot||"No active devices"),1),c[5]||(c[5]=Dt("div",{class:"actions"},[Dt("button",{class:"action-btn"},"Toggle Lights"),Dt("button",{class:"action-btn"},"View Charts")],-1))])],6)):kf("",!0)}}),cy=sa(ly,[["__scopeId","data-v-7c86670f"]]),uy={class:"dashboard-bar"},hy={class:"stat-group"},fy={class:"stat-item"},dy={class:"value red"},py={class:"stat-item"},my={class:"value green"},_y={class:"stat-item"},gy={class:"time-display"},vy={class:"controls"},xy={class:"speed-controls"},My=wr({__name:"TimeControls",setup(n){const{state:t,togglePlay:e,setSpeed:i}=Os(),s=yr(()=>{const o=Math.floor(t.value.currentTime),a=Math.floor((t.value.currentTime-o)*60);return`Day ${t.value.day} - ${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}),r=yr(()=>(t.value.totalGeneration||0)-(t.value.totalConsumption||0));return(o,a)=>(Ns(),Ar("div",uy,[Dt("div",hy,[Dt("div",fy,[a[3]||(a[3]=Dt("span",{class:"label"},"CONSUMPTION",-1)),Dt("span",dy,Ue(Math.round(Re(t).totalConsumption||0))+" kW",1)]),Dt("div",py,[a[4]||(a[4]=Dt("span",{class:"label"},"GENERATION",-1)),Dt("span",my,Ue(Math.round(Re(t).totalGeneration||0))+" kW",1)]),Dt("div",_y,[a[5]||(a[5]=Dt("span",{class:"label"},"NET GRID",-1)),Dt("span",{class:mi(["value",r.value>=0?"green":"red"])},Ue(r.value>0?"+":"")+Ue(Math.round(r.value))+" kW ",3)])]),Dt("div",gy,Ue(s.value),1),Dt("div",vy,[Dt("div",xy,[Dt("button",{onClick:a[0]||(a[0]=l=>Re(i)(1)),class:mi({active:Re(t).speed===1})},"1x",2),Dt("button",{onClick:a[1]||(a[1]=l=>Re(i)(200)),class:mi({active:Re(t).speed===200})},"200x",2)]),Dt("button",{class:mi(["play-btn",{active:Re(t).isPlaying}]),onClick:a[2]||(a[2]=(...l)=>Re(e)&&Re(e)(...l))},Ue(Re(t).isPlaying?"PAUSE":"PLAY"),3)])]))}}),Sy=sa(My,[["__scopeId","data-v-99b9fc73"]]),yy={key:0,class:"modal-overlay"},Ey={class:"modal"},by={class:"modal-content"},Ty={class:"setting-group"},wy={class:"radio-group"},Ay={class:"radio-label"},Ry={class:"radio-label"},Cy={class:"setting-group"},Py={class:"setting-group"},Dy={class:"setting-group"},Ly={class:"setting-group"},Iy=wr({__name:"SettingsModal",props:{isOpen:{type:Boolean}},emits:["close"],setup(n,{emit:t}){const e=n,i=t,{state:s,setDataBaseUrl:r,setBrightness:o,setSimulationMode:a,setMaxZoom:l,setZoomSensitivity:c}=Os(),u=mn(""),h=mn(1),d=mn("simulated"),p=mn(120),v=mn(5);xo(()=>e.isOpen,f=>{f&&(u.value=s.value.dataBaseUrl||"",h.value=s.value.brightness??1,d.value=s.value.simulationMode??"simulated",p.value=s.value.maxZoom??120,v.value=s.value.zoomSensitivity??5)});const M=()=>{i("close")},m=()=>{r(u.value),o(Number(h.value)),a(d.value),l(Number(p.value)),c(Number(v.value)),M()};return(f,T)=>n.isOpen?(Ns(),Ar("div",yy,[Dt("div",Ey,[Dt("div",{class:"modal-header"},[T[6]||(T[6]=Dt("h3",null,"Simulation Settings",-1)),Dt("button",{class:"close-btn",onClick:M},"×")]),Dt("div",by,[Dt("div",Ty,[T[9]||(T[9]=Dt("label",null,"Simulation Mode",-1)),Dt("div",wy,[Dt("label",Ay,[Qi(Dt("input",{type:"radio",value:"simulated","onUpdate:modelValue":T[0]||(T[0]=b=>d.value=b)},null,512),[[vu,d.value]]),T[7]||(T[7]=al(" Simulated (Manual Time) ",-1))]),Dt("label",Ry,[Qi(Dt("input",{type:"radio",value:"live","onUpdate:modelValue":T[1]||(T[1]=b=>d.value=b)},null,512),[[vu,d.value]]),T[8]||(T[8]=al(" Live (Real Time) ",-1))])])]),Dt("div",Cy,[Dt("label",null,"Brightness: "+Ue(h.value),1),T[10]||(T[10]=Dt("div",{class:"description"},"Global light intensity multiplier.",-1)),Qi(Dt("input",{type:"range",min:"0.1",max:"2.0",step:"0.1","onUpdate:modelValue":T[2]||(T[2]=b=>h.value=b),class:"slider"},null,512),[[Or,h.value]])]),Dt("div",Py,[Dt("label",null,"Max Zoom Height: "+Ue(p.value),1),T[11]||(T[11]=Dt("div",{class:"description"},"Limit how far the camera can zoom out.",-1)),Qi(Dt("input",{type:"range",min:"50",max:"300",step:"10","onUpdate:modelValue":T[3]||(T[3]=b=>p.value=b),class:"slider"},null,512),[[Or,p.value]])]),Dt("div",Dy,[Dt("label",null,"Zoom Sensitivity: "+Ue(v.value),1),T[12]||(T[12]=Dt("div",{class:"description"},"Speed of zooming in/out.",-1)),Qi(Dt("input",{type:"range",min:"1",max:"20",step:"1","onUpdate:modelValue":T[4]||(T[4]=b=>v.value=b),class:"slider"},null,512),[[Or,v.value]])]),Dt("div",Ly,[T[13]||(T[13]=Dt("label",null,"Data Origin (Base URL)",-1)),T[14]||(T[14]=Dt("div",{class:"description"}," Prepend this URL to all data file requests. Leave empty for default (local). ",-1)),Qi(Dt("input",{"onUpdate:modelValue":T[5]||(T[5]=b=>u.value=b),type:"text",placeholder:"e.g., http://localhost:8080/",class:"input-field"},null,512),[[Or,u.value]])])]),Dt("div",{class:"modal-actions"},[Dt("button",{class:"btn secondary",onClick:M},"Cancel"),Dt("button",{class:"btn primary",onClick:m},"Save Settings")])])])):kf("",!0)}}),Uy=sa(Iy,[["__scopeId","data-v-cb5071c1"]]),Ny=wr({__name:"App",setup(n){const t=mn(!1);return(e,i)=>(Ns(),Ar(wn,null,[nn($S),nn(cy),nn(Sy),Dt("button",{class:"settings-btn",onClick:i[0]||(i[0]=s=>t.value=!0)}," ⚙ Settings "),nn(Uy,{isOpen:t.value,onClose:i[1]||(i[1]=s=>t.value=!1)},null,8,["isOpen"])],64))}});Zm(Ny).mount("#app"); +}`;class rS{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){const s=new Ge,r=t.properties.get(s);r.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new wi({vertexShader:iS,fragmentShader:sS,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new At(new ts(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class oS extends Qi{constructor(t,e){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,d=null,m=null,v=null;const M=new rS,p=e.getContextAttributes();let f=null,b=null;const T=[],S=[],L=new zt;let D=null;const P=new an;P.viewport=new xe;const y=new an;y.viewport=new xe;const _=[P,y],g=new eS;let C=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function($){let at=T[$];return at===void 0&&(at=new qa,T[$]=at),at.getTargetRaySpace()},this.getControllerGrip=function($){let at=T[$];return at===void 0&&(at=new qa,T[$]=at),at.getGripSpace()},this.getHand=function($){let at=T[$];return at===void 0&&(at=new qa,T[$]=at),at.getHandSpace()};function F($){const at=S.indexOf($.inputSource);if(at===-1)return;const mt=T[at];mt!==void 0&&(mt.update($.inputSource,$.frame,c||o),mt.dispatchEvent({type:$.type,data:$.inputSource}))}function K(){s.removeEventListener("select",F),s.removeEventListener("selectstart",F),s.removeEventListener("selectend",F),s.removeEventListener("squeeze",F),s.removeEventListener("squeezestart",F),s.removeEventListener("squeezeend",F),s.removeEventListener("end",K),s.removeEventListener("inputsourceschange",st);for(let $=0;$=0&&(S[ut]=null,T[ut].disconnect(mt))}for(let at=0;at<$.added.length;at++){const mt=$.added[at];let ut=S.indexOf(mt);if(ut===-1){for(let vt=0;vt=S.length){S.push(mt),ut=vt;break}else if(S[vt]===null){S[vt]=mt,ut=vt;break}if(ut===-1)break}const ft=T[ut];ft&&ft.connect(mt)}}const Q=new O,W=new O;function B($,at,mt){Q.setFromMatrixPosition(at.matrixWorld),W.setFromMatrixPosition(mt.matrixWorld);const ut=Q.distanceTo(W),ft=at.projectionMatrix.elements,vt=mt.projectionMatrix.elements,Et=ft[14]/(ft[10]-1),wt=ft[14]/(ft[10]+1),R=(ft[9]+1)/ft[5],I=(ft[9]-1)/ft[5],w=(ft[8]-1)/ft[0],tt=(vt[8]+1)/vt[0],H=Et*w,j=Et*tt,Y=ut/(-w+tt),rt=Y*-w;if(at.matrixWorld.decompose($.position,$.quaternion,$.scale),$.translateX(rt),$.translateZ(Y),$.matrixWorld.compose($.position,$.quaternion,$.scale),$.matrixWorldInverse.copy($.matrixWorld).invert(),ft[10]===-1)$.projectionMatrix.copy(at.projectionMatrix),$.projectionMatrixInverse.copy(at.projectionMatrixInverse);else{const Z=Et+Y,E=wt+Y,x=H-rt,U=j+(ut-rt),k=R*wt/E*Z,J=I*wt/E*Z;$.projectionMatrix.makePerspective(x,U,k,J,Z,E),$.projectionMatrixInverse.copy($.projectionMatrix).invert()}}function et($,at){at===null?$.matrixWorld.copy($.matrix):$.matrixWorld.multiplyMatrices(at.matrixWorld,$.matrix),$.matrixWorldInverse.copy($.matrixWorld).invert()}this.updateCamera=function($){if(s===null)return;let at=$.near,mt=$.far;M.texture!==null&&(M.depthNear>0&&(at=M.depthNear),M.depthFar>0&&(mt=M.depthFar)),g.near=y.near=P.near=at,g.far=y.far=P.far=mt,(C!==g.near||N!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),C=g.near,N=g.far),P.layers.mask=$.layers.mask|2,y.layers.mask=$.layers.mask|4,g.layers.mask=P.layers.mask|y.layers.mask;const ut=$.parent,ft=g.cameras;et(g,ut);for(let vt=0;vt0&&(p.alphaTest.value=f.alphaTest);const b=t.get(f),T=b.envMap,S=b.envMapRotation;T&&(p.envMap.value=T,Oi.copy(S),Oi.x*=-1,Oi.y*=-1,Oi.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(Oi.y*=-1,Oi.z*=-1),p.envMapRotation.value.setFromMatrix4(aS.makeRotationFromEuler(Oi)),p.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=f.reflectivity,p.ior.value=f.ior,p.refractionRatio.value=f.refractionRatio),f.lightMap&&(p.lightMap.value=f.lightMap,p.lightMapIntensity.value=f.lightMapIntensity,e(f.lightMap,p.lightMapTransform)),f.aoMap&&(p.aoMap.value=f.aoMap,p.aoMapIntensity.value=f.aoMapIntensity,e(f.aoMap,p.aoMapTransform))}function o(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,f.map&&(p.map.value=f.map,e(f.map,p.mapTransform))}function a(p,f){p.dashSize.value=f.dashSize,p.totalSize.value=f.dashSize+f.gapSize,p.scale.value=f.scale}function l(p,f,b,T){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.size.value=f.size*b,p.scale.value=T*.5,f.map&&(p.map.value=f.map,e(f.map,p.uvTransform)),f.alphaMap&&(p.alphaMap.value=f.alphaMap,e(f.alphaMap,p.alphaMapTransform)),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest)}function c(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.rotation.value=f.rotation,f.map&&(p.map.value=f.map,e(f.map,p.mapTransform)),f.alphaMap&&(p.alphaMap.value=f.alphaMap,e(f.alphaMap,p.alphaMapTransform)),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest)}function u(p,f){p.specular.value.copy(f.specular),p.shininess.value=Math.max(f.shininess,1e-4)}function h(p,f){f.gradientMap&&(p.gradientMap.value=f.gradientMap)}function d(p,f){p.metalness.value=f.metalness,f.metalnessMap&&(p.metalnessMap.value=f.metalnessMap,e(f.metalnessMap,p.metalnessMapTransform)),p.roughness.value=f.roughness,f.roughnessMap&&(p.roughnessMap.value=f.roughnessMap,e(f.roughnessMap,p.roughnessMapTransform)),f.envMap&&(p.envMapIntensity.value=f.envMapIntensity)}function m(p,f,b){p.ior.value=f.ior,f.sheen>0&&(p.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),p.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(p.sheenColorMap.value=f.sheenColorMap,e(f.sheenColorMap,p.sheenColorMapTransform)),f.sheenRoughnessMap&&(p.sheenRoughnessMap.value=f.sheenRoughnessMap,e(f.sheenRoughnessMap,p.sheenRoughnessMapTransform))),f.clearcoat>0&&(p.clearcoat.value=f.clearcoat,p.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(p.clearcoatMap.value=f.clearcoatMap,e(f.clearcoatMap,p.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,e(f.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(p.clearcoatNormalMap.value=f.clearcoatNormalMap,e(f.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===Ze&&p.clearcoatNormalScale.value.negate())),f.dispersion>0&&(p.dispersion.value=f.dispersion),f.iridescence>0&&(p.iridescence.value=f.iridescence,p.iridescenceIOR.value=f.iridescenceIOR,p.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(p.iridescenceMap.value=f.iridescenceMap,e(f.iridescenceMap,p.iridescenceMapTransform)),f.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=f.iridescenceThicknessMap,e(f.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),f.transmission>0&&(p.transmission.value=f.transmission,p.transmissionSamplerMap.value=b.texture,p.transmissionSamplerSize.value.set(b.width,b.height),f.transmissionMap&&(p.transmissionMap.value=f.transmissionMap,e(f.transmissionMap,p.transmissionMapTransform)),p.thickness.value=f.thickness,f.thicknessMap&&(p.thicknessMap.value=f.thicknessMap,e(f.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=f.attenuationDistance,p.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(p.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(p.anisotropyMap.value=f.anisotropyMap,e(f.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=f.specularIntensity,p.specularColor.value.copy(f.specularColor),f.specularColorMap&&(p.specularColorMap.value=f.specularColorMap,e(f.specularColorMap,p.specularColorMapTransform)),f.specularIntensityMap&&(p.specularIntensityMap.value=f.specularIntensityMap,e(f.specularIntensityMap,p.specularIntensityMapTransform))}function v(p,f){f.matcap&&(p.matcap.value=f.matcap)}function M(p,f){const b=t.get(f).light;p.referencePosition.value.setFromMatrixPosition(b.matrixWorld),p.nearDistance.value=b.shadow.camera.near,p.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function cS(n,t,e,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,T){const S=T.program;i.uniformBlockBinding(b,S)}function c(b,T){let S=s[b.id];S===void 0&&(v(b),S=u(b),s[b.id]=S,b.addEventListener("dispose",p));const L=T.program;i.updateUBOMapping(b,L);const D=t.render.frame;r[b.id]!==D&&(d(b),r[b.id]=D)}function u(b){const T=h();b.__bindingPointIndex=T;const S=n.createBuffer(),L=b.__size,D=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,L,D),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,T,S),S}function h(){for(let b=0;b0&&(S+=L-D),b.__size=S,b.__cache={},this}function M(b){const T={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(T.boundary=4,T.storage=4):b.isVector2?(T.boundary=8,T.storage=8):b.isVector3||b.isColor?(T.boundary=16,T.storage=12):b.isVector4?(T.boundary=16,T.storage=16):b.isMatrix3?(T.boundary=48,T.storage=48):b.isMatrix4?(T.boundary=64,T.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),T}function p(b){const T=b.target;T.removeEventListener("dispose",p);const S=o.indexOf(T.__bindingPointIndex);o.splice(S,1),n.deleteBuffer(s[T.id]),delete s[T.id],delete r[T.id]}function f(){for(const b in s)n.deleteBuffer(s[b]);o=[],s={},r={}}return{bind:l,update:c,dispose:f}}class uS{constructor(t={}){const{canvas:e=J_(),context:i=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reverseDepthBuffer:d=!1}=t;this.isWebGLRenderer=!0;let m;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=i.getContextAttributes().alpha}else m=o;const v=new Uint32Array(4),M=new Int32Array(4);let p=null,f=null;const b=[],T=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=en,this.toneMapping=Si,this.toneMappingExposure=1;const S=this;let L=!1,D=0,P=0,y=null,_=-1,g=null;const C=new xe,N=new xe;let F=null;const K=new kt(0);let st=0,Q=e.width,W=e.height,B=1,et=null,gt=null;const X=new xe(0,0,Q,W),ot=new xe(0,0,Q,W);let lt=!1;const $=new Pc;let at=!1,mt=!1;const ut=new se,ft=new se,vt=new O,Et=new xe,wt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let R=!1;function I(){return y===null?B:1}let w=i;function tt(A,V){return e.getContext(A,V)}try{const A={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Mc}`),e.addEventListener("webglcontextlost",dt,!1),e.addEventListener("webglcontextrestored",Dt,!1),e.addEventListener("webglcontextcreationerror",Ct,!1),w===null){const V="webgl2";if(w=tt(V,A),w===null)throw tt(V)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(A){throw console.error("THREE.WebGLRenderer: "+A.message),A}let H,j,Y,rt,Z,E,x,U,k,J,q,_t,ht,yt,Ft,pt,Mt,Lt,Bt,bt,Ht,Wt,ne,z;function Rt(){H=new mx(w),H.init(),Wt=new tS(w,H),j=new cx(w,H,t,Wt),Y=new KM(w,H),j.reverseDepthBuffer&&d&&Y.buffers.depth.setReversed(!0),rt=new vx(w),Z=new OM,E=new QM(w,H,Y,Z,j,Wt,rt),x=new hx(S),U=new px(S),k=new Tg(w),ne=new ax(w,k),J=new _x(w,k,rt,ne),q=new Mx(w,J,k,rt),Bt=new xx(w,j,E),pt=new ux(Z),_t=new NM(S,x,U,H,j,ne,pt),ht=new lS(S,Z),yt=new BM,Ft=new WM(H),Lt=new ox(S,x,U,Y,q,m,l),Mt=new $M(S,q,j),z=new cS(w,rt,j,Y),bt=new lx(w,H,rt),Ht=new gx(w,H,rt),rt.programs=_t.programs,S.capabilities=j,S.extensions=H,S.properties=Z,S.renderLists=yt,S.shadowMap=Mt,S.state=Y,S.info=rt}Rt();const ct=new oS(S,w);this.xr=ct,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const A=H.get("WEBGL_lose_context");A&&A.loseContext()},this.forceContextRestore=function(){const A=H.get("WEBGL_lose_context");A&&A.restoreContext()},this.getPixelRatio=function(){return B},this.setPixelRatio=function(A){A!==void 0&&(B=A,this.setSize(Q,W,!1))},this.getSize=function(A){return A.set(Q,W)},this.setSize=function(A,V,nt=!0){if(ct.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Q=A,W=V,e.width=Math.floor(A*B),e.height=Math.floor(V*B),nt===!0&&(e.style.width=A+"px",e.style.height=V+"px"),this.setViewport(0,0,A,V)},this.getDrawingBufferSize=function(A){return A.set(Q*B,W*B).floor()},this.setDrawingBufferSize=function(A,V,nt){Q=A,W=V,B=nt,e.width=Math.floor(A*nt),e.height=Math.floor(V*nt),this.setViewport(0,0,A,V)},this.getCurrentViewport=function(A){return A.copy(C)},this.getViewport=function(A){return A.copy(X)},this.setViewport=function(A,V,nt,it){A.isVector4?X.set(A.x,A.y,A.z,A.w):X.set(A,V,nt,it),Y.viewport(C.copy(X).multiplyScalar(B).round())},this.getScissor=function(A){return A.copy(ot)},this.setScissor=function(A,V,nt,it){A.isVector4?ot.set(A.x,A.y,A.z,A.w):ot.set(A,V,nt,it),Y.scissor(N.copy(ot).multiplyScalar(B).round())},this.getScissorTest=function(){return lt},this.setScissorTest=function(A){Y.setScissorTest(lt=A)},this.setOpaqueSort=function(A){et=A},this.setTransparentSort=function(A){gt=A},this.getClearColor=function(A){return A.copy(Lt.getClearColor())},this.setClearColor=function(){Lt.setClearColor.apply(Lt,arguments)},this.getClearAlpha=function(){return Lt.getClearAlpha()},this.setClearAlpha=function(){Lt.setClearAlpha.apply(Lt,arguments)},this.clear=function(A=!0,V=!0,nt=!0){let it=0;if(A){let G=!1;if(y!==null){const St=y.texture.format;G=St===Rc||St===Ac||St===wc}if(G){const St=y.texture.type,Pt=St===ei||St===ji||St===Pr||St===Bs||St===Ec||St===bc,It=Lt.getClearColor(),Ut=Lt.getClearAlpha(),Gt=It.r,qt=It.g,Nt=It.b;Pt?(v[0]=Gt,v[1]=qt,v[2]=Nt,v[3]=Ut,w.clearBufferuiv(w.COLOR,0,v)):(M[0]=Gt,M[1]=qt,M[2]=Nt,M[3]=Ut,w.clearBufferiv(w.COLOR,0,M))}else it|=w.COLOR_BUFFER_BIT}V&&(it|=w.DEPTH_BUFFER_BIT),nt&&(it|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(it)},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",dt,!1),e.removeEventListener("webglcontextrestored",Dt,!1),e.removeEventListener("webglcontextcreationerror",Ct,!1),yt.dispose(),Ft.dispose(),Z.dispose(),x.dispose(),U.dispose(),q.dispose(),ne.dispose(),z.dispose(),_t.dispose(),ct.dispose(),ct.removeEventListener("sessionstart",Fc),ct.removeEventListener("sessionend",Bc),Ri.stop()};function dt(A){A.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),L=!0}function Dt(){console.log("THREE.WebGLRenderer: Context Restored."),L=!1;const A=rt.autoReset,V=Mt.enabled,nt=Mt.autoUpdate,it=Mt.needsUpdate,G=Mt.type;Rt(),rt.autoReset=A,Mt.enabled=V,Mt.autoUpdate=nt,Mt.needsUpdate=it,Mt.type=G}function Ct(A){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",A.statusMessage)}function Yt(A){const V=A.target;V.removeEventListener("dispose",Yt),ve(V)}function ve(A){Pe(A),Z.remove(A)}function Pe(A){const V=Z.get(A).programs;V!==void 0&&(V.forEach(function(nt){_t.releaseProgram(nt)}),A.isShaderMaterial&&_t.releaseShaderCache(A))}this.renderBufferDirect=function(A,V,nt,it,G,St){V===null&&(V=wt);const Pt=G.isMesh&&G.matrixWorld.determinant()<0,It=Rd(A,V,nt,it,G);Y.setMaterial(it,Pt);let Ut=nt.index,Gt=1;if(it.wireframe===!0){if(Ut=J.getWireframeAttribute(nt),Ut===void 0)return;Gt=2}const qt=nt.drawRange,Nt=nt.attributes.position;let Kt=qt.start*Gt,ce=(qt.start+qt.count)*Gt;St!==null&&(Kt=Math.max(Kt,St.start*Gt),ce=Math.min(ce,(St.start+St.count)*Gt)),Ut!==null?(Kt=Math.max(Kt,0),ce=Math.min(ce,Ut.count)):Nt!=null&&(Kt=Math.max(Kt,0),ce=Math.min(ce,Nt.count));const de=ce-Kt;if(de<0||de===1/0)return;ne.setup(G,it,It,nt,Ut);let Xe,Jt=bt;if(Ut!==null&&(Xe=k.get(Ut),Jt=Ht,Jt.setIndex(Xe)),G.isMesh)it.wireframe===!0?(Y.setLineWidth(it.wireframeLinewidth*I()),Jt.setMode(w.LINES)):Jt.setMode(w.TRIANGLES);else if(G.isLine){let Ot=it.linewidth;Ot===void 0&&(Ot=1),Y.setLineWidth(Ot*I()),G.isLineSegments?Jt.setMode(w.LINES):G.isLineLoop?Jt.setMode(w.LINE_LOOP):Jt.setMode(w.LINE_STRIP)}else G.isPoints?Jt.setMode(w.POINTS):G.isSprite&&Jt.setMode(w.TRIANGLES);if(G.isBatchedMesh)if(G._multiDrawInstances!==null)Jt.renderMultiDrawInstances(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount,G._multiDrawInstances);else if(H.get("WEBGL_multi_draw"))Jt.renderMultiDraw(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount);else{const Ot=G._multiDrawStarts,Nn=G._multiDrawCounts,Qt=G._multiDrawCount,fn=Ut?k.get(Ut).bytesPerElement:1,es=Z.get(it).currentProgram.getUniforms();for(let Ke=0;Ke{function St(){if(it.forEach(function(Pt){Z.get(Pt).currentProgram.isReady()&&it.delete(Pt)}),it.size===0){G(A);return}setTimeout(St,10)}H.get("KHR_parallel_shader_compile")!==null?St():setTimeout(St,10)})};let hn=null;function Un(A){hn&&hn(A)}function Fc(){Ri.stop()}function Bc(){Ri.start()}const Ri=new gd;Ri.setAnimationLoop(Un),typeof self<"u"&&Ri.setContext(self),this.setAnimationLoop=function(A){hn=A,ct.setAnimationLoop(A),A===null?Ri.stop():Ri.start()},ct.addEventListener("sessionstart",Fc),ct.addEventListener("sessionend",Bc),this.render=function(A,V){if(V!==void 0&&V.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===!0)return;if(A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),V.parent===null&&V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),ct.enabled===!0&&ct.isPresenting===!0&&(ct.cameraAutoUpdate===!0&&ct.updateCamera(V),V=ct.getCamera()),A.isScene===!0&&A.onBeforeRender(S,A,V,y),f=Ft.get(A,T.length),f.init(V),T.push(f),ft.multiplyMatrices(V.projectionMatrix,V.matrixWorldInverse),$.setFromProjectionMatrix(ft),mt=this.localClippingEnabled,at=pt.init(this.clippingPlanes,mt),p=yt.get(A,b.length),p.init(),b.push(p),ct.enabled===!0&&ct.isPresenting===!0){const St=S.xr.getDepthSensingMesh();St!==null&&la(St,V,-1/0,S.sortObjects)}la(A,V,0,S.sortObjects),p.finish(),S.sortObjects===!0&&p.sort(et,gt),R=ct.enabled===!1||ct.isPresenting===!1||ct.hasDepthSensing()===!1,R&&Lt.addToRenderList(p,A),this.info.render.frame++,at===!0&&pt.beginShadows();const nt=f.state.shadowsArray;Mt.render(nt,A,V),at===!0&&pt.endShadows(),this.info.autoReset===!0&&this.info.reset();const it=p.opaque,G=p.transmissive;if(f.setupLights(),V.isArrayCamera){const St=V.cameras;if(G.length>0)for(let Pt=0,It=St.length;Pt0&&Hc(it,G,A,V),R&&Lt.render(A),zc(p,A,V);y!==null&&(E.updateMultisampleRenderTarget(y),E.updateRenderTargetMipmap(y)),A.isScene===!0&&A.onAfterRender(S,A,V),ne.resetDefaultState(),_=-1,g=null,T.pop(),T.length>0?(f=T[T.length-1],at===!0&&pt.setGlobalState(S.clippingPlanes,f.state.camera)):f=null,b.pop(),b.length>0?p=b[b.length-1]:p=null};function la(A,V,nt,it){if(A.visible===!1)return;if(A.layers.test(V.layers)){if(A.isGroup)nt=A.renderOrder;else if(A.isLOD)A.autoUpdate===!0&&A.update(V);else if(A.isLight)f.pushLight(A),A.castShadow&&f.pushShadow(A);else if(A.isSprite){if(!A.frustumCulled||$.intersectsSprite(A)){it&&Et.setFromMatrixPosition(A.matrixWorld).applyMatrix4(ft);const Pt=q.update(A),It=A.material;It.visible&&p.push(A,Pt,It,nt,Et.z,null)}}else if((A.isMesh||A.isLine||A.isPoints)&&(!A.frustumCulled||$.intersectsObject(A))){const Pt=q.update(A),It=A.material;if(it&&(A.boundingSphere!==void 0?(A.boundingSphere===null&&A.computeBoundingSphere(),Et.copy(A.boundingSphere.center)):(Pt.boundingSphere===null&&Pt.computeBoundingSphere(),Et.copy(Pt.boundingSphere.center)),Et.applyMatrix4(A.matrixWorld).applyMatrix4(ft)),Array.isArray(It)){const Ut=Pt.groups;for(let Gt=0,qt=Ut.length;Gt0&&Fr(G,V,nt),St.length>0&&Fr(St,V,nt),Pt.length>0&&Fr(Pt,V,nt),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Hc(A,V,nt,it){if((nt.isScene===!0?nt.overrideMaterial:null)!==null)return;f.state.transmissionRenderTarget[it.id]===void 0&&(f.state.transmissionRenderTarget[it.id]=new $i(1,1,{generateMipmaps:!0,type:H.has("EXT_color_buffer_half_float")||H.has("EXT_color_buffer_float")?Ur:ei,minFilter:Xi,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Zt.workingColorSpace}));const St=f.state.transmissionRenderTarget[it.id],Pt=it.viewport||C;St.setSize(Pt.z,Pt.w);const It=S.getRenderTarget();S.setRenderTarget(St),S.getClearColor(K),st=S.getClearAlpha(),st<1&&S.setClearColor(16777215,.5),S.clear(),R&&Lt.render(nt);const Ut=S.toneMapping;S.toneMapping=Si;const Gt=it.viewport;if(it.viewport!==void 0&&(it.viewport=void 0),f.setupLightsView(it),at===!0&&pt.setGlobalState(S.clippingPlanes,it),Fr(A,nt,it),E.updateMultisampleRenderTarget(St),E.updateRenderTargetMipmap(St),H.has("WEBGL_multisampled_render_to_texture")===!1){let qt=!1;for(let Nt=0,Kt=V.length;Nt0),Nt=!!nt.morphAttributes.position,Kt=!!nt.morphAttributes.normal,ce=!!nt.morphAttributes.color;let de=Si;it.toneMapped&&(y===null||y.isXRRenderTarget===!0)&&(de=S.toneMapping);const Xe=nt.morphAttributes.position||nt.morphAttributes.normal||nt.morphAttributes.color,Jt=Xe!==void 0?Xe.length:0,Ot=Z.get(it),Nn=f.state.lights;if(at===!0&&(mt===!0||A!==g)){const rn=A===g&&it.id===_;pt.setState(it,A,rn)}let Qt=!1;it.version===Ot.__version?(Ot.needsLights&&Ot.lightsStateVersion!==Nn.state.version||Ot.outputColorSpace!==It||G.isBatchedMesh&&Ot.batching===!1||!G.isBatchedMesh&&Ot.batching===!0||G.isBatchedMesh&&Ot.batchingColor===!0&&G.colorTexture===null||G.isBatchedMesh&&Ot.batchingColor===!1&&G.colorTexture!==null||G.isInstancedMesh&&Ot.instancing===!1||!G.isInstancedMesh&&Ot.instancing===!0||G.isSkinnedMesh&&Ot.skinning===!1||!G.isSkinnedMesh&&Ot.skinning===!0||G.isInstancedMesh&&Ot.instancingColor===!0&&G.instanceColor===null||G.isInstancedMesh&&Ot.instancingColor===!1&&G.instanceColor!==null||G.isInstancedMesh&&Ot.instancingMorph===!0&&G.morphTexture===null||G.isInstancedMesh&&Ot.instancingMorph===!1&&G.morphTexture!==null||Ot.envMap!==Ut||it.fog===!0&&Ot.fog!==St||Ot.numClippingPlanes!==void 0&&(Ot.numClippingPlanes!==pt.numPlanes||Ot.numIntersection!==pt.numIntersection)||Ot.vertexAlphas!==Gt||Ot.vertexTangents!==qt||Ot.morphTargets!==Nt||Ot.morphNormals!==Kt||Ot.morphColors!==ce||Ot.toneMapping!==de||Ot.morphTargetsCount!==Jt)&&(Qt=!0):(Qt=!0,Ot.__version=it.version);let fn=Ot.currentProgram;Qt===!0&&(fn=Br(it,V,G));let es=!1,Ke=!1,js=!1;const pe=fn.getUniforms(),yn=Ot.uniforms;if(Y.useProgram(fn.program)&&(es=!0,Ke=!0,js=!0),it.id!==_&&(_=it.id,Ke=!0),es||g!==A){Y.buffers.depth.getReversed()?(ut.copy(A.projectionMatrix),tg(ut),eg(ut),pe.setValue(w,"projectionMatrix",ut)):pe.setValue(w,"projectionMatrix",A.projectionMatrix),pe.setValue(w,"viewMatrix",A.matrixWorldInverse);const ii=pe.map.cameraPosition;ii!==void 0&&ii.setValue(w,vt.setFromMatrixPosition(A.matrixWorld)),j.logarithmicDepthBuffer&&pe.setValue(w,"logDepthBufFC",2/(Math.log(A.far+1)/Math.LN2)),(it.isMeshPhongMaterial||it.isMeshToonMaterial||it.isMeshLambertMaterial||it.isMeshBasicMaterial||it.isMeshStandardMaterial||it.isShaderMaterial)&&pe.setValue(w,"isOrthographic",A.isOrthographicCamera===!0),g!==A&&(g=A,Ke=!0,js=!0)}if(G.isSkinnedMesh){pe.setOptional(w,G,"bindMatrix"),pe.setOptional(w,G,"bindMatrixInverse");const rn=G.skeleton;rn&&(rn.boneTexture===null&&rn.computeBoneTexture(),pe.setValue(w,"boneTexture",rn.boneTexture,E))}G.isBatchedMesh&&(pe.setOptional(w,G,"batchingTexture"),pe.setValue(w,"batchingTexture",G._matricesTexture,E),pe.setOptional(w,G,"batchingIdTexture"),pe.setValue(w,"batchingIdTexture",G._indirectTexture,E),pe.setOptional(w,G,"batchingColorTexture"),G._colorsTexture!==null&&pe.setValue(w,"batchingColorTexture",G._colorsTexture,E));const $s=nt.morphAttributes;if(($s.position!==void 0||$s.normal!==void 0||$s.color!==void 0)&&Bt.update(G,nt,fn),(Ke||Ot.receiveShadow!==G.receiveShadow)&&(Ot.receiveShadow=G.receiveShadow,pe.setValue(w,"receiveShadow",G.receiveShadow)),it.isMeshGouraudMaterial&&it.envMap!==null&&(yn.envMap.value=Ut,yn.flipEnvMap.value=Ut.isCubeTexture&&Ut.isRenderTargetTexture===!1?-1:1),it.isMeshStandardMaterial&&it.envMap===null&&V.environment!==null&&(yn.envMapIntensity.value=V.environmentIntensity),Ke&&(pe.setValue(w,"toneMappingExposure",S.toneMappingExposure),Ot.needsLights&&Cd(yn,js),St&&it.fog===!0&&ht.refreshFogUniforms(yn,St),ht.refreshMaterialUniforms(yn,it,B,W,f.state.transmissionRenderTarget[A.id]),Lo.upload(w,Vc(Ot),yn,E)),it.isShaderMaterial&&it.uniformsNeedUpdate===!0&&(Lo.upload(w,Vc(Ot),yn,E),it.uniformsNeedUpdate=!1),it.isSpriteMaterial&&pe.setValue(w,"center",G.center),pe.setValue(w,"modelViewMatrix",G.modelViewMatrix),pe.setValue(w,"normalMatrix",G.normalMatrix),pe.setValue(w,"modelMatrix",G.matrixWorld),it.isShaderMaterial||it.isRawShaderMaterial){const rn=it.uniformsGroups;for(let ii=0,si=rn.length;ii0&&E.useMultisampledRTT(A)===!1?G=Z.get(A).__webglMultisampledFramebuffer:Array.isArray(qt)?G=qt[nt]:G=qt,C.copy(A.viewport),N.copy(A.scissor),F=A.scissorTest}else C.copy(X).multiplyScalar(B).floor(),N.copy(ot).multiplyScalar(B).floor(),F=lt;if(Y.bindFramebuffer(w.FRAMEBUFFER,G)&&it&&Y.drawBuffers(A,G),Y.viewport(C),Y.scissor(N),Y.setScissorTest(F),St){const Ut=Z.get(A.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+V,Ut.__webglTexture,nt)}else if(Pt){const Ut=Z.get(A.texture),Gt=V||0;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ut.__webglTexture,nt||0,Gt)}_=-1},this.readRenderTargetPixels=function(A,V,nt,it,G,St,Pt){if(!(A&&A.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let It=Z.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Pt!==void 0&&(It=It[Pt]),It){Y.bindFramebuffer(w.FRAMEBUFFER,It);try{const Ut=A.texture,Gt=Ut.format,qt=Ut.type;if(!j.textureFormatReadable(Gt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!j.textureTypeReadable(qt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}V>=0&&V<=A.width-it&&nt>=0&&nt<=A.height-G&&w.readPixels(V,nt,it,G,Wt.convert(Gt),Wt.convert(qt),St)}finally{const Ut=y!==null?Z.get(y).__webglFramebuffer:null;Y.bindFramebuffer(w.FRAMEBUFFER,Ut)}}},this.readRenderTargetPixelsAsync=async function(A,V,nt,it,G,St,Pt){if(!(A&&A.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let It=Z.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Pt!==void 0&&(It=It[Pt]),It){const Ut=A.texture,Gt=Ut.format,qt=Ut.type;if(!j.textureFormatReadable(Gt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!j.textureTypeReadable(qt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(V>=0&&V<=A.width-it&&nt>=0&&nt<=A.height-G){Y.bindFramebuffer(w.FRAMEBUFFER,It);const Nt=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Nt),w.bufferData(w.PIXEL_PACK_BUFFER,St.byteLength,w.STREAM_READ),w.readPixels(V,nt,it,G,Wt.convert(Gt),Wt.convert(qt),0);const Kt=y!==null?Z.get(y).__webglFramebuffer:null;Y.bindFramebuffer(w.FRAMEBUFFER,Kt);const ce=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await Q_(w,ce,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Nt),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,St),w.deleteBuffer(Nt),w.deleteSync(ce),St}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(A,V=null,nt=0){A.isTexture!==!0&&(ur("WebGLRenderer: copyFramebufferToTexture function signature has changed."),V=arguments[0]||null,A=arguments[1]);const it=Math.pow(2,-nt),G=Math.floor(A.image.width*it),St=Math.floor(A.image.height*it),Pt=V!==null?V.x:0,It=V!==null?V.y:0;E.setTexture2D(A,0),w.copyTexSubImage2D(w.TEXTURE_2D,nt,0,0,Pt,It,G,St),Y.unbindTexture()},this.copyTextureToTexture=function(A,V,nt=null,it=null,G=0){A.isTexture!==!0&&(ur("WebGLRenderer: copyTextureToTexture function signature has changed."),it=arguments[0]||null,A=arguments[1],V=arguments[2],G=arguments[3]||0,nt=null);let St,Pt,It,Ut,Gt,qt,Nt,Kt,ce;const de=A.isCompressedTexture?A.mipmaps[G]:A.image;nt!==null?(St=nt.max.x-nt.min.x,Pt=nt.max.y-nt.min.y,It=nt.isBox3?nt.max.z-nt.min.z:1,Ut=nt.min.x,Gt=nt.min.y,qt=nt.isBox3?nt.min.z:0):(St=de.width,Pt=de.height,It=de.depth||1,Ut=0,Gt=0,qt=0),it!==null?(Nt=it.x,Kt=it.y,ce=it.z):(Nt=0,Kt=0,ce=0);const Xe=Wt.convert(V.format),Jt=Wt.convert(V.type);let Ot;V.isData3DTexture?(E.setTexture3D(V,0),Ot=w.TEXTURE_3D):V.isDataArrayTexture||V.isCompressedArrayTexture?(E.setTexture2DArray(V,0),Ot=w.TEXTURE_2D_ARRAY):(E.setTexture2D(V,0),Ot=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,V.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,V.unpackAlignment);const Nn=w.getParameter(w.UNPACK_ROW_LENGTH),Qt=w.getParameter(w.UNPACK_IMAGE_HEIGHT),fn=w.getParameter(w.UNPACK_SKIP_PIXELS),es=w.getParameter(w.UNPACK_SKIP_ROWS),Ke=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,de.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,de.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,Ut),w.pixelStorei(w.UNPACK_SKIP_ROWS,Gt),w.pixelStorei(w.UNPACK_SKIP_IMAGES,qt);const js=A.isDataArrayTexture||A.isData3DTexture,pe=V.isDataArrayTexture||V.isData3DTexture;if(A.isRenderTargetTexture||A.isDepthTexture){const yn=Z.get(A),$s=Z.get(V),rn=Z.get(yn.__renderTarget),ii=Z.get($s.__renderTarget);Y.bindFramebuffer(w.READ_FRAMEBUFFER,rn.__webglFramebuffer),Y.bindFramebuffer(w.DRAW_FRAMEBUFFER,ii.__webglFramebuffer);for(let si=0;si0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class fS extends Ge{constructor(t=null,e=1,i=1,s,r,o,a,l,c=sn,u=sn,h,d){super(null,o,a,l,c,u,s,r,h,d),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Eh extends Mn{constructor(t,e,i,s=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const gs=new se,bh=new se,uo=[],Th=new Ai,dS=new se,ir=new At,sr=new Ws;class ho extends At{constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new Eh(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;ja.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(ja);if(!(lt.far))return{distance:l,point:Ah.clone().applyMatrix4(n.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:n}}const Rh=new O,Ch=new O;class pS extends Wn{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[];for(let s=0,r=e.count;s0&&T(!0),e>0&&T(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(m,2));function b(){const S=new O,L=new O;let D=0;const P=(e-t)/i;for(let y=0;y<=r;y++){const _=[],g=y/r,C=g*(e-t)+t;for(let N=0;N<=s;N++){const F=N/s,K=F*l+a,st=Math.sin(K),Q=Math.cos(K);L.x=C*st,L.y=-g*i+p,L.z=C*Q,h.push(L.x,L.y,L.z),S.set(st,P,Q).normalize(),d.push(S.x,S.y,S.z),m.push(F,1-g),_.push(v++)}M.push(_)}for(let y=0;y0||_!==0)&&(u.push(g,C,F),D+=3),(e>0||_!==r-1)&&(u.push(C,N,F),D+=3)}c.addGroup(f,D,0),f+=D}function T(S){const L=v,D=new zt,P=new O;let y=0;const _=S===!0?t:e,g=S===!0?1:-1;for(let N=1;N<=s;N++)h.push(0,p*g,0),d.push(0,g,0),m.push(.5,.5),v++;const C=v;for(let N=0;N<=s;N++){const K=N/s*l+a,st=Math.cos(K),Q=Math.sin(K);P.x=_*Q,P.y=p*g,P.z=_*st,h.push(P.x,P.y,P.z),d.push(0,g,0),D.x=st*.5+.5,D.y=Q*.5*g+.5,m.push(D.x,D.y),v++}for(let N=0;N.9&&P<.1&&(T<.2&&(o[b+0]+=1),S<.2&&(o[b+2]+=1),L<.2&&(o[b+4]+=1))}}function d(b){r.push(b.x,b.y,b.z)}function m(b,T){const S=b*3;T.x=t[S+0],T.y=t[S+1],T.z=t[S+2]}function v(){const b=new O,T=new O,S=new O,L=new O,D=new zt,P=new zt,y=new zt;for(let _=0,g=0;_0)&&m.push(T,S,D),(f!==i-1||l{if(!n.value)return;t=new hS,t.background=new kt(10413049);const o=window.innerWidth/window.innerHeight;e=new an(40,o,1,1e3),e.position.set(25,45,25),e.lookAt(0,0,0),i=new uS({antialias:!0}),i.setSize(window.innerWidth,window.innerHeight),i.shadowMap.enabled=!0,i.outputColorSpace=en,n.value.appendChild(i.domElement),window.addEventListener("resize",r)},r=()=>{!i||!e||(e.aspect=window.innerWidth/window.innerHeight,e.updateProjectionMatrix(),i.setSize(window.innerWidth,window.innerHeight))};return ta(()=>{window.removeEventListener("resize",r),i&&i.dispose()}),{canvasContainer:n,initScene:s,getScene:()=>t,getCamera:()=>e,getRenderer:()=>i}}var Ka={exports:{}},Nh;function SS(){return Nh||(Nh=1,(function(n,t){(function(){var e=Math.PI,i=Math.sin,s=Math.cos,r=Math.tan,o=Math.asin,a=Math.atan2,l=Math.acos,c=e/180,u=1e3*60*60*24,h=2440588,d=2451545;function m(X){return X.valueOf()/u-.5+h}function v(X){return new Date((X+.5-h)*u)}function M(X){return m(X)-d}var p=c*23.4397;function f(X,ot){return a(i(X)*s(p)-r(ot)*i(p),s(X))}function b(X,ot){return o(i(ot)*s(p)+s(ot)*i(p)*i(X))}function T(X,ot,lt){return a(i(X),s(X)*i(ot)-r(lt)*s(ot))}function S(X,ot,lt){return o(i(ot)*i(lt)+s(ot)*s(lt)*s(X))}function L(X,ot){return c*(280.16+360.9856235*X)-ot}function D(X){return X<0&&(X=0),2967e-7/Math.tan(X+.00312536/(X+.08901179))}function P(X){return c*(357.5291+.98560028*X)}function y(X){var ot=c*(1.9148*i(X)+.02*i(2*X)+3e-4*i(3*X)),lt=c*102.9372;return X+ot+lt+e}function _(X){var ot=P(X),lt=y(ot);return{dec:b(lt,0),ra:f(lt,0)}}var g={};g.getPosition=function(X,ot,lt){var $=c*-lt,at=c*ot,mt=M(X),ut=_(mt),ft=L(mt,$)-ut.ra;return{azimuth:T(ft,at,ut.dec),altitude:S(ft,at,ut.dec)}};var C=g.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];g.addTime=function(X,ot,lt){C.push([X,ot,lt])};var N=9e-4;function F(X,ot){return Math.round(X-N-ot/(2*e))}function K(X,ot,lt){return N+(X+ot)/(2*e)+lt}function st(X,ot,lt){return d+X+.0053*i(ot)-.0069*i(2*lt)}function Q(X,ot,lt){return l((i(X)-i(ot)*i(lt))/(s(ot)*s(lt)))}function W(X){return-2.076*Math.sqrt(X)/60}function B(X,ot,lt,$,at,mt,ut){var ft=Q(X,lt,$),vt=K(ft,ot,at);return st(vt,mt,ut)}g.getTimes=function(X,ot,lt,$){$=$||0;var at=c*-lt,mt=c*ot,ut=W($),ft=M(X),vt=F(ft,at),Et=K(0,at,vt),wt=P(Et),R=y(wt),I=b(R,0),w=st(Et,wt,R),tt,H,j,Y,rt,Z,E={solarNoon:v(w),nadir:v(w-.5)};for(tt=0,H=C.length;tt=0&&(Z=Math.sqrt(H)/(Math.abs(R)*2),Y=w-Z,rt=w+Z,Math.abs(Y)<=1&&j++,Math.abs(rt)<=1&&j++,Y<-1&&(Y=rt)),j===1?ut<0?Et=E+Y:wt=E+Y:j===2&&(Et=E+(tt<0?rt:Y),wt=E+(tt<0?Y:rt)),!(Et&&wt));E+=2)ut=vt;var x={};return Et&&(x.rise=gt(at,Et)),wt&&(x.set=gt(at,wt)),!Et&&!wt&&(x[tt>0?"alwaysUp":"alwaysDown"]=!0),x},n.exports=g})()})(Ka)),Ka.exports}var yS=SS();const ES=jf(yS);function bS(n,t){let e,i;const s={day:new kt(11129853),night:new kt(657955),sunriseSun:new kt(10736127),daySun:new kt(16777129),sunsetSun:new kt(16763941),nightSun:new kt(2236996),dayAmbient:new kt(11129853),nightAmbient:new kt(5592456),tempSun:new kt,tempAmbient:new kt,tempBg:new kt},r=()=>{i=new xS(9485245,1.2),n.add(i),e=new vS(16777215),e.position.set(20,30,10),e.castShadow=!0,e.shadow.mapSize.width=2048,e.shadow.mapSize.height=2048,e.shadow.camera.near=.5,e.shadow.camera.far=500,e.shadow.bias=-5e-4,e.shadow.normalBias=.05,e.shadow.camera.left=-100,e.shadow.camera.right=100,e.shadow.camera.top=100,e.shadow.camera.bottom=-100,n.add(e)},o=l=>{const c=l*(180/Math.PI);if(c>10)return{sun:s.daySun,ambient:s.dayAmbient,bg:s.day,intensity:1.5,shadow:!0};if(c>0){const u=c/10;return s.tempSun.copy(s.sunsetSun).lerp(s.daySun,u),s.tempAmbient.copy(s.nightAmbient).lerp(s.dayAmbient,u),s.tempBg.copy(s.night).lerp(s.day,u),{sun:s.tempSun,ambient:s.tempAmbient,bg:s.tempBg,intensity:.5+1*u,shadow:!0}}if(c>-6){const u=(c+6)/6;return s.tempSun.copy(s.nightSun).lerp(s.sunsetSun,u),s.tempAmbient.copy(s.nightAmbient).lerp(s.nightAmbient,u),s.tempBg.copy(s.night).lerp(new kt(4469589),u),{sun:s.tempSun,ambient:s.tempAmbient,bg:s.tempBg,intensity:u*.5,shadow:!1}}return{sun:s.nightSun,ambient:s.nightAmbient,bg:s.night,intensity:.2,shadow:!1}};return{initSun:r,updateSun:()=>{if(!e||!i)return;const l=41.17873,c=-8.60835,u=t.value.currentTime,h=new Date;h.setHours(Math.floor(u)),h.setMinutes(Math.floor(u%1*60)),h.setSeconds(0);const d=ES.getPosition(h,l,c),m=100,v=d.azimuth,M=d.altitude,p=m*Math.cos(M)*Math.cos(v),f=m*Math.sin(M),b=m*Math.cos(M)*Math.sin(v);e&&(e.position.set(p,f,b),e.target.position.set(0,0,0),e.target.updateMatrixWorld());const T=o(d.altitude),S=t.value.brightness??1;e.color.copy(T.sun),e.intensity=T.intensity*S,e.castShadow=T.shadow,i.color.copy(T.ambient),i.intensity=1.2*S,n.background=T.bg}}}function TS(){const n=[],t=[],e={road:new Vn({color:3355443}),roadLine:new Ys({color:16777215}),sidewalk:new Vn({color:13421772}),grass:new Vn({color:8190976}),treeTrunk:new Vn({color:9127187}),treeLeaves:new Vn({color:2263842})},i={house:{geometry:new fe(6,6,6),material:new Vn({color:16755200}),description:"Residential House"},factory:{geometry:new fe(8,6,10),material:new Vn({color:15158332}),description:"Manufacturing Plant"},office:{geometry:new fe(8,14,8),material:new Vn({color:3447003}),description:"Office Building"},shop:{geometry:new fe(8,5,8),material:new Vn({color:15844367}),description:"Retail Shop"}},s=30,r=8,o=1.5,a=6,l=200,c=a*a,u=(M,p,f,b,T,S=0)=>{const L=new At(p.geometry,p.material);L.position.copy(f),L.rotation.y=S,p.geometry.type==="BoxGeometry"&&(L.position.y+=p.geometry.parameters.height/2),L.castShadow=!0,L.receiveShadow=!0,L.userData={id:b,type:p.description||"Generic",...p,csvPath:T},n.push(L),t.push(L),M.add(L)},h=(M,p,f,b,T,S=0)=>{const L=i[p];if(!L){console.warn(`Building type ${p} not found`);return}const D=f.clone();D.y=.5,u(M,L,D,b,T,S)},d=M=>{const p=new ts(300,300),f=new At(p,e.road);f.rotation.x=-Math.PI/2,f.position.y=-.1,f.receiveShadow=!0,M.add(f),t.push(f);const b=[],T=(a-1)*s/2,S=new fe(s-r,.4,s-r),L=new ho(S,e.sidewalk,c);L.receiveShadow=!0,t.push(L);const D=s-r-o*2,P=new fe(D,.5,D),y=new ho(P,e.grass,c);y.receiveShadow=!0,t.push(y);const _=new Me;let g=0;for(let C=0;C{const b=new Ae(.5,.5,2,6),T=new Ic(2,4,8),S=new ho(b,e.treeTrunk,l),L=new ho(T,e.treeLeaves,l);S.castShadow=!0,S.receiveShadow=!0,L.castShadow=!0,L.receiveShadow=!0,t.push(S),t.push(L);let D=0;const P=new Me,y=g=>{D>=l||(P.position.copy(g).add(new O(0,1,0)),P.rotation.set(0,0,0),P.scale.set(1,1,1),P.updateMatrix(),S.setMatrixAt(D,P.matrix),P.position.copy(g).add(new O(0,4,0)),P.updateMatrix(),L.setMatrixAt(D,P.matrix),D++)};let _=0;for(let g=0;g.5&&y(C.clone().add(new O(6,.5,4)))}S.count=D,L.count=D,M.add(S),M.add(L)};return{interactableObjects:n,initCity:(M,p)=>{const f=d(M);m(M,f,p)},clearCity:M=>{t.forEach(p=>{M.remove(p)}),t.length=0,n.length=0}}}const Oh={type:"change"},Oc={type:"start"},Ad={type:"end"},vo=new oa,Fh=new mi,wS=Math.cos(70*K_.DEG2RAD),ye=new O,qe=2*Math.PI,oe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Ja=1e-6;class AS extends wd{constructor(t,e=null){super(t,e),this.state=oe.NONE,this.enabled=!0,this.target=new O,this.cursor=new O,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:qi.ROTATE,MIDDLE:qi.DOLLY,RIGHT:qi.PAN},this.touches={ONE:Ms.ROTATE,TWO:Ms.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new O,this._lastQuaternion=new Ce,this._lastTargetPosition=new O,this._quat=new Ce().setFromUnitVectors(t.up,new O(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Uh,this._sphericalDelta=new Uh,this._scale=1,this._panOffset=new O,this._rotateStart=new zt,this._rotateEnd=new zt,this._rotateDelta=new zt,this._panStart=new zt,this._panEnd=new zt,this._panDelta=new zt,this._dollyStart=new zt,this._dollyEnd=new zt,this._dollyDelta=new zt,this._dollyDirection=new O,this._mouse=new zt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=CS.bind(this),this._onPointerDown=RS.bind(this),this._onPointerUp=PS.bind(this),this._onContextMenu=FS.bind(this),this._onMouseWheel=IS.bind(this),this._onKeyDown=US.bind(this),this._onTouchStart=NS.bind(this),this._onTouchMove=OS.bind(this),this._onMouseDown=DS.bind(this),this._onMouseMove=LS.bind(this),this._interceptControlDown=BS.bind(this),this._interceptControlUp=zS.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Oh),this.update(),this.state=oe.NONE}update(t=null){const e=this.object.position;ye.copy(e).sub(this.target),ye.applyQuaternion(this._quat),this._spherical.setFromVector3(ye),this.autoRotate&&this.state===oe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),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 i=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(i)&&isFinite(s)&&(i<-Math.PI?i+=qe:i>Math.PI&&(i-=qe),s<-Math.PI?s+=qe:s>Math.PI&&(s-=qe),i<=s?this._spherical.theta=Math.max(i,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+s)/2?Math.max(i,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=o!=this._spherical.radius}if(ye.setFromSpherical(this._spherical),ye.applyQuaternion(this._quatInverse),e.copy(this.target).add(ye),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=ye.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const a=new O(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new O(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=ye.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(vo.origin.copy(this.object.position),vo.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(vo.direction))Ja||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ja||this._lastTargetPosition.distanceToSquared(this.target)>Ja?(this.dispatchEvent(Oh),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?qe/60*this.autoRotateSpeed*t:qe/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){ye.setFromMatrixColumn(e,0),ye.multiplyScalar(-t),this._panOffset.add(ye)}_panUp(t,e){this.screenSpacePanning===!0?ye.setFromMatrixColumn(e,1):(ye.setFromMatrixColumn(e,0),ye.crossVectors(this.object.up,ye)),ye.multiplyScalar(t),this._panOffset.add(ye)}_pan(t,e){const i=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;ye.copy(s).sub(this.target);let r=ye.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/i.clientHeight,this.object.matrix),this._panUp(2*e*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),s=t-i.left,r=e-i.top,o=i.width,a=i.height;this._mouse.x=s/o*2-1,this._mouse.y=-(r/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(qe*this._rotateDelta.x/e.clientHeight),this._rotateUp(qe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(-qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(-qe*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(i,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(i,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),r=.5*(t.pageY+i.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(qe*this._rotateDelta.x/e.clientHeight),this._rotateUp(qe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(i,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(t.pageX+e.x)*.5,a=(t.pageY+e.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e{e=new AS(n,t.domElement),e.enableDamping=!1,e.dampingFactor=.05,e.enableRotate=!1,e.enablePan=!0,e.enableZoom=!1,e.screenSpacePanning=!1,e.mouseButtons={LEFT:qi.PAN},e.target.set(0,0,0),e.addEventListener("change",()=>{i||(e.target.y=0,n.position.y=Math.min(n.position.y,h.value.maxZoom||120))}),t.domElement.addEventListener("wheel",v=>{if(v.preventDefault(),!i){const M=h.value.zoomSensitivity||5,p=h.value.maxZoom||120,f=new O().subVectors(n.position,e.target).normalize();let b=null;v.deltaY<0?(b=n.position.clone().add(f.multiplyScalar(M)),b.y>p&&(b=null)):v.deltaY>0&&(b=n.position.clone().sub(f.multiplyScalar(M)),b.y<10&&(b=null)),b&&(s=n.position.clone(),r=b,o=e.target.clone(),a=e.target.clone(),l=0,u=performance.now()/1e3,i=!0)}},{passive:!1})},updateControls:()=>{if(i&&s&&r&&o&&a){const v=performance.now()/1e3;l=Math.min((v-u)/c,1),n.position.lerpVectors(s,r,l),e.target.lerpVectors(o,a,l),l>=1&&(i=!1),e.update()}e&&e.update()},getControls:()=>e}}const Fi=new Td,Ie=new O,hi=new O,_e=new Ce,Bh={X:new O(1,0,0),Y:new O(0,1,0),Z:new O(0,0,1)},Qa={type:"change"},zh={type:"mouseDown",mode:null},Hh={type:"mouseUp",mode:null},kh={type:"objectChange"};class kS extends wd{constructor(t,e=null){super(void 0,e);const i=new qS(this);this._root=i;const s=new jS;this._gizmo=s,i.add(s);const r=new $S;this._plane=r,i.add(r);const o=this;function a(T,S){let L=S;Object.defineProperty(o,T,{get:function(){return L!==void 0?L:S},set:function(D){L!==D&&(L=D,r[T]=D,s[T]=D,o.dispatchEvent({type:T+"-changed",value:D}),o.dispatchEvent(Qa))}}),o[T]=S,r[T]=S,s[T]=S}a("camera",t),a("object",void 0),a("enabled",!0),a("axis",null),a("mode","translate"),a("translationSnap",null),a("rotationSnap",null),a("scaleSnap",null),a("space","world"),a("size",1),a("dragging",!1),a("showX",!0),a("showY",!0),a("showZ",!0),a("minX",-1/0),a("maxX",1/0),a("minY",-1/0),a("maxY",1/0),a("minZ",-1/0),a("maxZ",1/0);const l=new O,c=new O,u=new Ce,h=new Ce,d=new O,m=new Ce,v=new O,M=new O,p=new O,f=0,b=new O;a("worldPosition",l),a("worldPositionStart",c),a("worldQuaternion",u),a("worldQuaternionStart",h),a("cameraPosition",d),a("cameraQuaternion",m),a("pointStart",v),a("pointEnd",M),a("rotationAxis",p),a("rotationAngle",f),a("eye",b),this._offset=new O,this._startNorm=new O,this._endNorm=new O,this._cameraScale=new O,this._parentPosition=new O,this._parentQuaternion=new Ce,this._parentQuaternionInv=new Ce,this._parentScale=new O,this._worldScaleStart=new O,this._worldQuaternionInv=new Ce,this._worldScale=new O,this._positionStart=new O,this._quaternionStart=new Ce,this._scaleStart=new O,this._getPointer=VS.bind(this),this._onPointerDown=WS.bind(this),this._onPointerHover=GS.bind(this),this._onPointerMove=XS.bind(this),this._onPointerUp=YS.bind(this),e!==null&&this.connect()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&Fi.setFromCamera(t,this.camera);const e=tl(this._gizmo.picker[this.mode],Fi);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&Fi.setFromCamera(t,this.camera);const e=tl(this._plane,Fi,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,zh.mode=this.mode,this.dispatchEvent(zh)}}pointerMove(t){const e=this.axis,i=this.mode,s=this.object;let r=this.space;if(i==="scale"?r="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(r="world"),s===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&Fi.setFromCamera(t,this.camera);const o=tl(this._plane,Fi,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),r==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),r==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(r==="local"&&(s.position.applyQuaternion(_e.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),r==="world"&&(s.parent&&s.position.add(Ie.setFromMatrixPosition(s.parent.matrixWorld)),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(Ie.setFromMatrixPosition(s.parent.matrixWorld)))),s.position.x=Math.max(this.minX,Math.min(this.maxX,s.position.x)),s.position.y=Math.max(this.minY,Math.min(this.maxY,s.position.y)),s.position.z=Math.max(this.minZ,Math.min(this.maxZ,s.position.z));else if(i==="scale"){if(e.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),hi.set(a,a,a)}else Ie.copy(this.pointStart),hi.copy(this.pointEnd),Ie.applyQuaternion(this._worldQuaternionInv),hi.applyQuaternion(this._worldQuaternionInv),hi.divide(Ie),e.search("X")===-1&&(hi.x=1),e.search("Y")===-1&&(hi.y=1),e.search("Z")===-1&&(hi.z=1);s.scale.copy(this._scaleStart).multiply(hi),this.scaleSnap&&(e.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(Ie.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Ie.copy(this.rotationAxis).cross(this.eye))*a):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(Bh[e]),Ie.copy(Bh[e]),r==="local"&&Ie.applyQuaternion(this.worldQuaternion),Ie.cross(this.eye),Ie.length()===0?l=!0:this.rotationAngle=this._offset.dot(Ie.normalize())*a),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),r==="local"&&e!=="E"&&e!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(_e.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(_e.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Qa),this.dispatchEvent(kh)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Hh.mode=this.mode,this.dispatchEvent(Hh)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Qa),this.dispatchEvent(kh),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Fi}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function VS(n){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:n.button};{const t=this.domElement.getBoundingClientRect();return{x:(n.clientX-t.left)/t.width*2-1,y:-(n.clientY-t.top)/t.height*2+1,button:n.button}}}function GS(n){if(this.enabled)switch(n.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(n));break}}function WS(n){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(n.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(n)),this.pointerDown(this._getPointer(n)))}function XS(n){this.enabled&&this.pointerMove(this._getPointer(n))}function YS(n){this.enabled&&(this.domElement.releasePointerCapture(n.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(n)))}function tl(n,t,e){const i=t.intersectObject(n,!0);for(let s=0;s.9&&(o.visible=!1)),this.axis==="Y"&&(_e.setFromEuler(xo.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(_e),Math.abs(ae.copy(Hi).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(_e.setFromEuler(xo.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(_e),Math.abs(ae.copy(dr).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(_e.setFromEuler(xo.set(0,Math.PI/2,0)),ae.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Gh.lookAt(Vh,ae,Hi)),o.quaternion.multiply(_e),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Ie.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Ie.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Ie),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(ae.copy(fr).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(ae.copy(Hi).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(ae.copy(dr).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(ae.copy(dr).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(ae.copy(fr).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(ae.copy(Hi).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Mo.copy(i),ae.copy(this.eye).applyQuaternion(_e.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Gh.lookAt(this.eye,Vh,Hi)),o.name==="X"&&(_e.setFromAxisAngle(fr,Math.atan2(-ae.y,ae.z)),_e.multiplyQuaternions(Mo,_e),o.quaternion.copy(_e)),o.name==="Y"&&(_e.setFromAxisAngle(Hi,Math.atan2(ae.x,ae.z)),_e.multiplyQuaternions(Mo,_e),o.quaternion.copy(_e)),o.name==="Z"&&(_e.setFromAxisAngle(dr,Math.atan2(ae.y,ae.x)),_e.multiplyQuaternions(Mo,_e),o.quaternion.copy(_e))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(l){return o.name===l}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(t)}}class $S extends At{constructor(){super(new ts(1e5,1e5,2,2),new Ys({visible:!1,wireframe:!0,side:_n,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),So.copy(fr).applyQuaternion(e==="local"?this.worldQuaternion:Io),or.copy(Hi).applyQuaternion(e==="local"?this.worldQuaternion:Io),ar.copy(dr).applyQuaternion(e==="local"?this.worldQuaternion:Io),ae.copy(or),this.mode){case"translate":case"scale":switch(this.axis){case"X":ae.copy(this.eye).cross(So),bn.copy(So).cross(ae);break;case"Y":ae.copy(this.eye).cross(or),bn.copy(or).cross(ae);break;case"Z":ae.copy(this.eye).cross(ar),bn.copy(ar).cross(ae);break;case"XY":bn.copy(ar);break;case"YZ":bn.copy(So);break;case"XZ":ae.copy(ar),bn.copy(or);break;case"XYZ":case"E":bn.set(0,0,0);break}break;case"rotate":default:bn.set(0,0,0)}bn.length()===0?this.quaternion.copy(this.cameraQuaternion):(Wh.lookAt(Ie.set(0,0,0),bn,ae),this.quaternion.setFromRotationMatrix(Wh)),super.updateMatrixWorld(t)}}function ZS(n,t,e,i,s){const{selectedBuilding:r,loadBuildingData:o}=Ji();let a,l,c,u,h=!1;const d=()=>{const T=new ts(1,1),S=new Ys({color:16776960,side:_n,transparent:!0,opacity:.5});u=new At(T,S),u.rotation.x=-Math.PI/2,u.visible=!1;const L=new mS(T),D=new pS(L,new Lc({color:16776960}));u.add(D),e.add(u)},m=T=>{if(!T){u.visible=!1;return}u.visible=!0;const S=new Ai().setFromObject(T),L=new O;S.getSize(L);const D=4;u.scale.set(L.x+D,L.z+D,1),u.position.copy(T.position),u.position.y=.2},v=()=>{a=new Td,l=new zt,d(),c=new kS(n,t.domElement),c.setMode("translate"),c.showY=!1,c.enabled=!1,c.addEventListener("dragging-changed",T=>{const S=s();S&&(S.enabled=!T.value)});try{e.add(c.getHelper())}catch(T){console.error("Failed to add TransformControls helper to scene:",T)}window.addEventListener("keydown",T=>{T.key==="m"&&(h=!h,c.enabled=h,h||c.detach(),console.log("Move Mode:",h?"ON":"OFF"))}),t.domElement.addEventListener("pointerdown",f),t.domElement.addEventListener("pointerup",b)};let M=0,p=0;const f=T=>{M=T.clientX,p=T.clientY},b=T=>{const S=Math.abs(T.clientX-M),L=Math.abs(T.clientY-p);if(S>5||L>5)return;const D=t.domElement.getBoundingClientRect();l.x=(T.clientX-D.left)/D.width*2-1,l.y=-((T.clientY-D.top)/D.height)*2+1,a.setFromCamera(l,n);const P=a.intersectObjects(i);if(h)if(P.length>0){const y=P[0].object,_=y.userData.parentGroup||y;c.attach(_)}else c.detach();if(P.length>0){const y=P[0].object,_=y.userData.parentGroup||y,g=_.userData,C=_.position.clone();C.project(n);const N=(C.x*.5+.5)*D.width,F=(-(C.y*.5)+.5)*D.height;r.value={id:g.id,type:g.type,description:g.description,consumption:g.consumption||"Loading...",generation:g.generation||"Loading...",iot:g.iot||"None",csvPath:g.csvPath,uiX:N,uiY:F},g.csvPath&&o(g.id,g.csvPath).then(K=>{if(r.value&&r.value.id===g.id&&K&&K.length>0){const st=K[0];r.value.consumption=st.Consumption,r.value.generation=st.Generation}}),m(_)}else r.value=null,m(null)};return{initInteraction:v}}const KS=ks({__name:"DigitalTwin",setup(n){const{state:t,updateTime:e}=Ji(),{canvasContainer:i,initScene:s,getScene:r,getCamera:o,getRenderer:a}=MS(),l=()=>{s();const c=r(),u=o(),h=a(),{initCity:d,interactableObjects:m,clearCity:v}=TS();d(c,t.value.buildings),Rs(()=>t.value.buildings.length,()=>{v(c),d(c,t.value.buildings)});const{initSun:M,updateSun:p}=bS(c,t);M();const{initControls:f,updateControls:b,getControls:T}=HS(u,h);f();const{initInteraction:S}=ZS(u,h,c,m,T);S();const L=()=>{requestAnimationFrame(L),e(.016),p(),b(),h.render(c,u)};L()};return mc(()=>{l()}),(c,u)=>(Ki(),Vs("div",{ref_key:"canvasContainer",ref:i,class:"canvas-container"},null,512))}}),Or=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},JS=Or(KS,[["__scopeId","data-v-59d3d9b5"]]),QS={class:"header"},ty={class:"content"},ey={class:"info-row"},ny={class:"value"},iy={class:"info-row"},sy={class:"value"},ry={class:"info-row"},oy={class:"value"},ay={class:"iot-text"},ly=300,cy=350,lr=20,uy=ks({__name:"BuildingInfoCanvas",setup(n){const{selectedBuilding:t}=Ji(),e=ln(window.innerWidth),i=ln(window.innerHeight),s=()=>{e.value=window.innerWidth,i.value=window.innerHeight};mc(()=>window.addEventListener("resize",s)),ta(()=>window.removeEventListener("resize",s));const r=()=>{t.value=null},o=Rr(()=>!t.value||!t.value.uiY?!1:t.value.uiY{if(!t.value||!t.value.uiX||!t.value.uiY)return{};let l=t.value.uiX,c=t.value.uiY;const u=ly/2;return l-ue.value-lr&&(l=e.value-lr-u),{left:l+"px",top:c+"px"}});return(l,c)=>Re(t)?(Ki(),Vs("div",{key:0,class:vi(["building-panel",{flipped:o.value}]),ref:"panelRef",style:Zo(a.value)},[xt("div",QS,[xt("h3",null,Ue(Re(t).id)+" - "+Ue(Re(t).description),1),xt("button",{class:"close-btn",onClick:r},"×")]),xt("div",ty,[xt("div",ey,[c[0]||(c[0]=xt("span",{class:"label"},"Type:",-1)),xt("span",ny,Ue(Re(t).type),1)]),c[3]||(c[3]=xt("div",{class:"section-title"},"Energy Status",-1)),xt("div",iy,[c[1]||(c[1]=xt("span",{class:"label"},"Consumption:",-1)),xt("span",sy,Ue(Re(t).consumption)+" kWh",1)]),xt("div",ry,[c[2]||(c[2]=xt("span",{class:"label"},"Generation:",-1)),xt("span",oy,Ue(Re(t).generation)+" kWh",1)]),c[4]||(c[4]=xt("div",{class:"section-title"},"IoT Devices",-1)),xt("p",ay,Ue(Re(t).iot||"No active devices"),1),c[5]||(c[5]=xt("div",{class:"actions"},[xt("button",{class:"action-btn"},"Toggle Lights"),xt("button",{class:"action-btn"},"View Charts")],-1))])],6)):vc("",!0)}}),hy=Or(uy,[["__scopeId","data-v-7c86670f"]]),fy={class:"dashboard-bar"},dy={class:"stat-group"},py={class:"stat-item"},my={class:"value red"},_y={class:"stat-item"},gy={class:"value green"},vy={class:"stat-item"},xy={class:"time-display"},My={class:"controls"},Sy={class:"speed-controls"},yy=ks({__name:"TimeControls",setup(n){const{state:t,togglePlay:e,setSpeed:i}=Ji(),s=Rr(()=>{const o=Math.floor(t.value.currentTime),a=Math.floor((t.value.currentTime-o)*60);return`Day ${t.value.day} - ${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}),r=Rr(()=>(t.value.totalGeneration||0)-(t.value.totalConsumption||0));return(o,a)=>(Ki(),Vs("div",fy,[xt("div",dy,[xt("div",py,[a[3]||(a[3]=xt("span",{class:"label"},"CONSUMPTION",-1)),xt("span",my,Ue(Math.round(Re(t).totalConsumption||0))+" kW",1)]),xt("div",_y,[a[4]||(a[4]=xt("span",{class:"label"},"GENERATION",-1)),xt("span",gy,Ue(Math.round(Re(t).totalGeneration||0))+" kW",1)]),xt("div",vy,[a[5]||(a[5]=xt("span",{class:"label"},"NET GRID",-1)),xt("span",{class:vi(["value",r.value>=0?"green":"red"])},Ue(r.value>0?"+":"")+Ue(Math.round(r.value))+" kW ",3)])]),xt("div",xy,Ue(s.value),1),xt("div",My,[xt("div",Sy,[xt("button",{onClick:a[0]||(a[0]=l=>Re(i)(1)),class:vi({active:Re(t).speed===1})},"1x",2),xt("button",{onClick:a[1]||(a[1]=l=>Re(i)(200)),class:vi({active:Re(t).speed===200})},"200x",2)]),xt("button",{class:vi(["play-btn",{active:Re(t).isPlaying}]),onClick:a[2]||(a[2]=(...l)=>Re(e)&&Re(e)(...l))},Ue(Re(t).isPlaying?"PAUSE":"PLAY"),3)])]))}}),Ey=Or(yy,[["__scopeId","data-v-99b9fc73"]]),by={key:0,class:"modal-overlay"},Ty={class:"modal"},wy={class:"modal-content"},Ay={class:"setting-group"},Ry={class:"radio-group"},Cy={class:"radio-label"},Py={class:"radio-label"},Dy={class:"setting-group"},Ly={class:"setting-group"},Iy={class:"setting-group"},Uy={class:"setting-group"},Ny=ks({__name:"SettingsModal",props:{isOpen:{type:Boolean}},emits:["close"],setup(n,{emit:t}){const e=n,i=t,{state:s,setDataBaseUrl:r,setBrightness:o,setSimulationMode:a,setMaxZoom:l,setZoomSensitivity:c}=Ji(),u=ln(""),h=ln(1),d=ln("simulated"),m=ln(120),v=ln(5);Rs(()=>e.isOpen,f=>{f&&(u.value=s.value.dataBaseUrl||"",h.value=s.value.brightness??1,d.value=s.value.simulationMode??"simulated",m.value=s.value.maxZoom??120,v.value=s.value.zoomSensitivity??5)});const M=()=>{i("close")},p=()=>{r(u.value),o(Number(h.value)),a(d.value),l(Number(m.value)),c(Number(v.value)),M()};return(f,b)=>n.isOpen?(Ki(),Vs("div",by,[xt("div",Ty,[xt("div",{class:"modal-header"},[b[6]||(b[6]=xt("h3",null,"Simulation Settings",-1)),xt("button",{class:"close-btn",onClick:M},"×")]),xt("div",wy,[xt("div",Ay,[b[9]||(b[9]=xt("label",null,"Simulation Mode",-1)),xt("div",Ry,[xt("label",Cy,[Yn(xt("input",{type:"radio",value:"simulated","onUpdate:modelValue":b[0]||(b[0]=T=>d.value=T)},null,512),[[Su,d.value]]),b[7]||(b[7]=ul(" Simulated (Manual Time) ",-1))]),xt("label",Py,[Yn(xt("input",{type:"radio",value:"live","onUpdate:modelValue":b[1]||(b[1]=T=>d.value=T)},null,512),[[Su,d.value]]),b[8]||(b[8]=ul(" Live (Real Time) ",-1))])])]),xt("div",Dy,[xt("label",null,"Brightness: "+Ue(h.value),1),b[10]||(b[10]=xt("div",{class:"description"},"Global light intensity multiplier.",-1)),Yn(xt("input",{type:"range",min:"0.1",max:"2.0",step:"0.1","onUpdate:modelValue":b[2]||(b[2]=T=>h.value=T),class:"slider"},null,512),[[xs,h.value]])]),xt("div",Ly,[xt("label",null,"Max Zoom Height: "+Ue(m.value),1),b[11]||(b[11]=xt("div",{class:"description"},"Limit how far the camera can zoom out.",-1)),Yn(xt("input",{type:"range",min:"50",max:"300",step:"10","onUpdate:modelValue":b[3]||(b[3]=T=>m.value=T),class:"slider"},null,512),[[xs,m.value]])]),xt("div",Iy,[xt("label",null,"Zoom Sensitivity: "+Ue(v.value),1),b[12]||(b[12]=xt("div",{class:"description"},"Speed of zooming in/out.",-1)),Yn(xt("input",{type:"range",min:"1",max:"20",step:"1","onUpdate:modelValue":b[4]||(b[4]=T=>v.value=T),class:"slider"},null,512),[[xs,v.value]])]),xt("div",Uy,[b[13]||(b[13]=xt("label",null,"Data Origin (Base URL)",-1)),b[14]||(b[14]=xt("div",{class:"description"}," Prepend this URL to all data file requests. Leave empty for default (local). ",-1)),Yn(xt("input",{"onUpdate:modelValue":b[5]||(b[5]=T=>u.value=T),type:"text",placeholder:"e.g., http://localhost:8080/",class:"input-field"},null,512),[[xs,u.value]])])]),xt("div",{class:"modal-actions"},[xt("button",{class:"btn secondary",onClick:M},"Cancel"),xt("button",{class:"btn primary",onClick:p},"Save Settings")])])])):vc("",!0)}}),Oy=Or(Ny,[["__scopeId","data-v-cb5071c1"]]),Fy={key:0,class:"modal-overlay"},By={class:"modal"},zy={class:"modal-content"},Hy={class:"setting-group"},ky={class:"setting-group"},Vy={class:"setting-group"},Gy=ks({__name:"AddBuildingModal",props:{isOpen:{type:Boolean}},emits:["close"],setup(n,{emit:t}){const e=n,i=t,{addBuilding:s,state:r}=Ji(),o=Ko({id:"",type:"house",csvPath:"data/H01.csv"});Rs(()=>e.isOpen,c=>{if(c){const u=r.value.buildings.length+1;o.id=`H${u.toString().padStart(2,"0")}`,o.type="house",o.csvPath="data/H01.csv"}});const a=()=>{i("close")},l=()=>{s({...o}),a()};return(c,u)=>n.isOpen?(Ki(),Vs("div",Fy,[xt("div",By,[xt("div",{class:"modal-header"},[u[3]||(u[3]=xt("h3",null,"Add New Building",-1)),xt("button",{class:"close-btn",onClick:a},"×")]),xt("div",zy,[xt("div",Hy,[u[4]||(u[4]=xt("label",null,"Building ID",-1)),Yn(xt("input",{"onUpdate:modelValue":u[0]||(u[0]=h=>o.id=h),type:"text",class:"input-field",placeholder:"e.g. H15"},null,512),[[xs,o.id]])]),xt("div",ky,[u[6]||(u[6]=xt("label",null,"Type",-1)),Yn(xt("select",{"onUpdate:modelValue":u[1]||(u[1]=h=>o.type=h),class:"input-field select-field"},[...u[5]||(u[5]=[xt("option",{value:"house"},"House",-1),xt("option",{value:"factory"},"Factory",-1),xt("option",{value:"office"},"Office",-1),xt("option",{value:"shop"},"Shop",-1)])],512),[[jm,o.type]])]),xt("div",Vy,[u[7]||(u[7]=xt("label",null,"Data Source (CSV Path)",-1)),Yn(xt("input",{"onUpdate:modelValue":u[2]||(u[2]=h=>o.csvPath=h),type:"text",class:"input-field",placeholder:"e.g. data/H01.csv"},null,512),[[xs,o.csvPath]])])]),xt("div",{class:"modal-actions"},[xt("button",{class:"btn secondary",onClick:a},"Cancel"),xt("button",{class:"btn primary",onClick:l},"Add Building")])])])):vc("",!0)}}),Wy=Or(Gy,[["__scopeId","data-v-c9277bf5"]]),Xy=ks({__name:"App",setup(n){const t=ln(!1),e=ln(!1);return(i,s)=>(Ki(),Vs(wn,null,[$e(JS),$e(hy),$e(Ey),xt("button",{class:"settings-btn",onClick:s[0]||(s[0]=r=>t.value=!0)}," ⚙ Settings "),xt("button",{class:"add-building-btn",onClick:s[1]||(s[1]=r=>e.value=!0)}," + Add Building "),$e(Oy,{isOpen:t.value,onClose:s[2]||(s[2]=r=>t.value=!1)},null,8,["isOpen"]),$e(Wy,{isOpen:e.value,onClose:s[3]||(s[3]=r=>e.value=!1)},null,8,["isOpen"])],64))}});Km(Xy).mount("#app"); diff --git a/web-app/dist/assets/index-BqNgBlW1.css b/web-app/dist/assets/index-D9Xb8bfs.css similarity index 66% rename from web-app/dist/assets/index-BqNgBlW1.css rename to web-app/dist/assets/index-D9Xb8bfs.css index c042e2d..0e9bf18 100644 --- a/web-app/dist/assets/index-BqNgBlW1.css +++ b/web-app/dist/assets/index-D9Xb8bfs.css @@ -1 +1 @@ -:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}.canvas-container[data-v-0c7f17d8]{width:100%;height:100vh;display:block}.building-panel[data-v-7c86670f]{position:absolute;width:300px;background:#141419f2;border:3px solid #000;border-radius:0;box-shadow:6px 6px #0006;padding:0;overflow:hidden;font-family:Courier New,monospace;z-index:1000;pointer-events:auto;color:#fff;transform:translate(-50%,-110%);transition:left .05s linear,top .05s linear}.building-panel.flipped[data-v-7c86670f]{transform:translate(-50%,10%)}.header[data-v-7c86670f]{background:gold;color:#000;padding:12px;display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #000;text-transform:uppercase}.header h3[data-v-7c86670f]{margin:0;font-size:1rem;font-weight:900}.close-btn[data-v-7c86670f]{background:#000;border:2px solid black;color:#fff;font-size:1.2rem;cursor:pointer;line-height:1;padding:2px 8px;font-weight:700}.close-btn[data-v-7c86670f]:hover{background:#f44}.content[data-v-7c86670f]{padding:16px}.info-row[data-v-7c86670f]{display:flex;justify-content:space-between;margin-bottom:8px;border-bottom:2px dashed #444;padding-bottom:4px}.label[data-v-7c86670f]{color:#aaa;font-weight:700;text-transform:uppercase;font-size:.8rem}.value[data-v-7c86670f]{font-weight:600;color:#fff;font-family:monospace}.section-title[data-v-7c86670f]{margin-top:16px;margin-bottom:8px;font-size:.8rem;text-transform:uppercase;background:#333;color:#fff;padding:4px;text-align:center;font-weight:700;border:2px solid #000}.iot-text[data-v-7c86670f]{font-size:.85rem;color:#ccc;background:#111;padding:8px;border:2px solid #333;margin:0}.actions[data-v-7c86670f]{margin-top:20px;display:flex;gap:8px}.action-btn[data-v-7c86670f]{flex:1;padding:8px;border:3px solid #000;border-radius:0;background:#fc0;color:#000;font-weight:900;cursor:pointer;text-transform:uppercase;box-shadow:3px 3px #000;transition:all .1s}.action-btn[data-v-7c86670f]:hover{transform:translate(2px,2px);box-shadow:1px 1px #000}.action-btn[data-v-7c86670f]:active{transform:translate(3px,3px);box-shadow:0 0 #000}.dashboard-bar[data-v-99b9fc73]{position:absolute;bottom:0;left:0;width:100%;height:80px;background:#111;border-top:4px solid #000;display:flex;justify-content:space-between;align-items:center;padding:0 40px;box-sizing:border-box;color:#fff;font-family:Courier New,monospace;z-index:900;box-shadow:0 -4px 20px #00000080}.stat-group[data-v-99b9fc73]{display:flex;gap:30px}.stat-item[data-v-99b9fc73]{display:flex;flex-direction:column}.label[data-v-99b9fc73]{font-size:.75rem;color:#888;font-weight:700}.value[data-v-99b9fc73]{font-size:1.4rem;font-weight:700}.value.green[data-v-99b9fc73]{color:#0f0;text-shadow:0 0 10px rgba(0,255,0,.3)}.value.red[data-v-99b9fc73]{color:#f33;text-shadow:0 0 10px rgba(255,0,0,.3)}.time-display[data-v-99b9fc73]{font-size:1.8rem;font-weight:900;color:gold;background:#000;padding:5px 20px;border:2px solid #333;letter-spacing:2px}.controls[data-v-99b9fc73]{display:flex;gap:20px;align-items:center}.speed-controls[data-v-99b9fc73]{display:flex;gap:5px;background:#222;padding:4px;border:1px solid #444}button[data-v-99b9fc73]{background:transparent;border:2px solid transparent;color:#888;padding:6px 12px;cursor:pointer;font-family:Courier New,monospace;font-weight:700;text-transform:uppercase;transition:all .1s}button[data-v-99b9fc73]:hover{color:#fff;background:#333}button.active[data-v-99b9fc73]{background:gold;color:#000;box-shadow:0 0 10px gold}.play-btn[data-v-99b9fc73]{border:2px solid #444;padding:10px 24px;font-size:1.1rem;background:#222;color:#fff}.play-btn[data-v-99b9fc73]:hover{border-color:#fff}.play-btn.active[data-v-99b9fc73]{background:#f33;color:#fff;box-shadow:none;border-color:red}.modal-overlay[data-v-cb5071c1]{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000000b3;display:flex;justify-content:center;align-items:center;z-index:2000}.modal[data-v-cb5071c1]{background:#1a1a1a;border:3px solid #000;width:400px;max-width:90%;color:#fff;font-family:Courier New,monospace;box-shadow:10px 10px #00000080}.modal-header[data-v-cb5071c1]{background:gold;color:#000;padding:12px;display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #000}.modal-header h3[data-v-cb5071c1]{margin:0;text-transform:uppercase;font-weight:900;font-size:1.1rem}.close-btn[data-v-cb5071c1]{background:#000;border:none;color:#fff;font-size:1.5rem;cursor:pointer;line-height:1;padding:0 8px;font-weight:700}.close-btn[data-v-cb5071c1]:hover{color:#f44}.modal-content[data-v-cb5071c1]{padding:20px}.setting-group[data-v-cb5071c1]{margin-bottom:20px}.setting-group label[data-v-cb5071c1]{display:block;margin-bottom:8px;font-weight:700;text-transform:uppercase;color:gold}.description[data-v-cb5071c1]{font-size:.8rem;color:#888;margin-bottom:8px}.input-field[data-v-cb5071c1]{width:100%;padding:8px;background:#000;border:2px solid #333;color:#fff;font-family:monospace;font-size:.9rem;box-sizing:border-box}.input-field[data-v-cb5071c1]:focus{outline:none;border-color:gold}.modal-actions[data-v-cb5071c1]{padding:16px;display:flex;justify-content:flex-end;gap:12px;border-top:2px solid #333;background:#222}.btn[data-v-cb5071c1]{padding:8px 16px;font-family:Courier New,monospace;text-transform:uppercase;font-weight:700;cursor:pointer;border:2px solid #000;box-shadow:2px 2px #000;transition:all .1s}.btn[data-v-cb5071c1]:active{transform:translate(2px,2px);box-shadow:none}.btn.primary[data-v-cb5071c1]{background:gold;color:#000}.btn.primary[data-v-cb5071c1]:hover{background:#ffea70}.btn.secondary[data-v-cb5071c1]{background:#444;color:#fff}.btn.secondary[data-v-cb5071c1]:hover{background:#555}.radio-group[data-v-cb5071c1]{display:flex;gap:16px;margin-top:8px}.radio-label[data-v-cb5071c1]{display:flex;align-items:center;gap:6px;cursor:pointer;font-size:.9rem}.slider[data-v-cb5071c1]{width:100%;cursor:pointer;accent-color:#FFD700}html,body,#app{margin:0;padding:0;width:100%;height:100%;overflow:hidden}.settings-btn{position:absolute;top:20px;right:20px;z-index:1000;padding:8px 12px;background:#000;color:#fff;border:2px solid #FFD700;font-family:Courier New,monospace;font-weight:700;cursor:pointer;text-transform:uppercase;box-shadow:4px 4px #00000080;transition:all .1s}.settings-btn:hover{background:#111;color:gold;transform:translate(1px,1px);box-shadow:3px 3px #00000080}.settings-btn:active{transform:translate(4px,4px);box-shadow:none} +:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}.canvas-container[data-v-59d3d9b5]{width:100%;height:100vh;display:block}.building-panel[data-v-7c86670f]{position:absolute;width:300px;background:#141419f2;border:3px solid #000;border-radius:0;box-shadow:6px 6px #0006;padding:0;overflow:hidden;font-family:Courier New,monospace;z-index:1000;pointer-events:auto;color:#fff;transform:translate(-50%,-110%);transition:left .05s linear,top .05s linear}.building-panel.flipped[data-v-7c86670f]{transform:translate(-50%,10%)}.header[data-v-7c86670f]{background:gold;color:#000;padding:12px;display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #000;text-transform:uppercase}.header h3[data-v-7c86670f]{margin:0;font-size:1rem;font-weight:900}.close-btn[data-v-7c86670f]{background:#000;border:2px solid black;color:#fff;font-size:1.2rem;cursor:pointer;line-height:1;padding:2px 8px;font-weight:700}.close-btn[data-v-7c86670f]:hover{background:#f44}.content[data-v-7c86670f]{padding:16px}.info-row[data-v-7c86670f]{display:flex;justify-content:space-between;margin-bottom:8px;border-bottom:2px dashed #444;padding-bottom:4px}.label[data-v-7c86670f]{color:#aaa;font-weight:700;text-transform:uppercase;font-size:.8rem}.value[data-v-7c86670f]{font-weight:600;color:#fff;font-family:monospace}.section-title[data-v-7c86670f]{margin-top:16px;margin-bottom:8px;font-size:.8rem;text-transform:uppercase;background:#333;color:#fff;padding:4px;text-align:center;font-weight:700;border:2px solid #000}.iot-text[data-v-7c86670f]{font-size:.85rem;color:#ccc;background:#111;padding:8px;border:2px solid #333;margin:0}.actions[data-v-7c86670f]{margin-top:20px;display:flex;gap:8px}.action-btn[data-v-7c86670f]{flex:1;padding:8px;border:3px solid #000;border-radius:0;background:#fc0;color:#000;font-weight:900;cursor:pointer;text-transform:uppercase;box-shadow:3px 3px #000;transition:all .1s}.action-btn[data-v-7c86670f]:hover{transform:translate(2px,2px);box-shadow:1px 1px #000}.action-btn[data-v-7c86670f]:active{transform:translate(3px,3px);box-shadow:0 0 #000}.dashboard-bar[data-v-99b9fc73]{position:absolute;bottom:0;left:0;width:100%;height:80px;background:#111;border-top:4px solid #000;display:flex;justify-content:space-between;align-items:center;padding:0 40px;box-sizing:border-box;color:#fff;font-family:Courier New,monospace;z-index:900;box-shadow:0 -4px 20px #00000080}.stat-group[data-v-99b9fc73]{display:flex;gap:30px}.stat-item[data-v-99b9fc73]{display:flex;flex-direction:column}.label[data-v-99b9fc73]{font-size:.75rem;color:#888;font-weight:700}.value[data-v-99b9fc73]{font-size:1.4rem;font-weight:700}.value.green[data-v-99b9fc73]{color:#0f0;text-shadow:0 0 10px rgba(0,255,0,.3)}.value.red[data-v-99b9fc73]{color:#f33;text-shadow:0 0 10px rgba(255,0,0,.3)}.time-display[data-v-99b9fc73]{font-size:1.8rem;font-weight:900;color:gold;background:#000;padding:5px 20px;border:2px solid #333;letter-spacing:2px}.controls[data-v-99b9fc73]{display:flex;gap:20px;align-items:center}.speed-controls[data-v-99b9fc73]{display:flex;gap:5px;background:#222;padding:4px;border:1px solid #444}button[data-v-99b9fc73]{background:transparent;border:2px solid transparent;color:#888;padding:6px 12px;cursor:pointer;font-family:Courier New,monospace;font-weight:700;text-transform:uppercase;transition:all .1s}button[data-v-99b9fc73]:hover{color:#fff;background:#333}button.active[data-v-99b9fc73]{background:gold;color:#000;box-shadow:0 0 10px gold}.play-btn[data-v-99b9fc73]{border:2px solid #444;padding:10px 24px;font-size:1.1rem;background:#222;color:#fff}.play-btn[data-v-99b9fc73]:hover{border-color:#fff}.play-btn.active[data-v-99b9fc73]{background:#f33;color:#fff;box-shadow:none;border-color:red}.modal-overlay[data-v-cb5071c1]{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000000b3;display:flex;justify-content:center;align-items:center;z-index:2000}.modal[data-v-cb5071c1]{background:#1a1a1a;border:3px solid #000;width:400px;max-width:90%;color:#fff;font-family:Courier New,monospace;box-shadow:10px 10px #00000080}.modal-header[data-v-cb5071c1]{background:gold;color:#000;padding:12px;display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #000}.modal-header h3[data-v-cb5071c1]{margin:0;text-transform:uppercase;font-weight:900;font-size:1.1rem}.close-btn[data-v-cb5071c1]{background:#000;border:none;color:#fff;font-size:1.5rem;cursor:pointer;line-height:1;padding:0 8px;font-weight:700}.close-btn[data-v-cb5071c1]:hover{color:#f44}.modal-content[data-v-cb5071c1]{padding:20px}.setting-group[data-v-cb5071c1]{margin-bottom:20px}.setting-group label[data-v-cb5071c1]{display:block;margin-bottom:8px;font-weight:700;text-transform:uppercase;color:gold}.description[data-v-cb5071c1]{font-size:.8rem;color:#888;margin-bottom:8px}.input-field[data-v-cb5071c1]{width:100%;padding:8px;background:#000;border:2px solid #333;color:#fff;font-family:monospace;font-size:.9rem;box-sizing:border-box}.input-field[data-v-cb5071c1]:focus{outline:none;border-color:gold}.modal-actions[data-v-cb5071c1]{padding:16px;display:flex;justify-content:flex-end;gap:12px;border-top:2px solid #333;background:#222}.btn[data-v-cb5071c1]{padding:8px 16px;font-family:Courier New,monospace;text-transform:uppercase;font-weight:700;cursor:pointer;border:2px solid #000;box-shadow:2px 2px #000;transition:all .1s}.btn[data-v-cb5071c1]:active{transform:translate(2px,2px);box-shadow:none}.btn.primary[data-v-cb5071c1]{background:gold;color:#000}.btn.primary[data-v-cb5071c1]:hover{background:#ffea70}.btn.secondary[data-v-cb5071c1]{background:#444;color:#fff}.btn.secondary[data-v-cb5071c1]:hover{background:#555}.radio-group[data-v-cb5071c1]{display:flex;gap:16px;margin-top:8px}.radio-label[data-v-cb5071c1]{display:flex;align-items:center;gap:6px;cursor:pointer;font-size:.9rem}.slider[data-v-cb5071c1]{width:100%;cursor:pointer;accent-color:#FFD700}.modal-overlay[data-v-c9277bf5]{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000000b3;display:flex;justify-content:center;align-items:center;z-index:2000}.modal[data-v-c9277bf5]{background:#1a1a1a;border:3px solid #000;width:400px;max-width:90%;color:#fff;font-family:Courier New,monospace;box-shadow:10px 10px #00000080}.modal-header[data-v-c9277bf5]{background:gold;color:#000;padding:12px;display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #000}.modal-header h3[data-v-c9277bf5]{margin:0;text-transform:uppercase;font-weight:900;font-size:1.1rem}.close-btn[data-v-c9277bf5]{background:#000;border:none;color:#fff;font-size:1.5rem;cursor:pointer;line-height:1;padding:0 8px;font-weight:700}.close-btn[data-v-c9277bf5]:hover{color:#f44}.modal-content[data-v-c9277bf5]{padding:20px}.setting-group[data-v-c9277bf5]{margin-bottom:20px}.setting-group label[data-v-c9277bf5]{display:block;margin-bottom:8px;font-weight:700;text-transform:uppercase;color:gold}.input-field[data-v-c9277bf5]{width:100%;padding:8px;background:#000;border:2px solid #333;color:#fff;font-family:monospace;font-size:.9rem;box-sizing:border-box}.input-field[data-v-c9277bf5]:focus{outline:none;border-color:gold}.select-field[data-v-c9277bf5]{cursor:pointer}.modal-actions[data-v-c9277bf5]{padding:16px;display:flex;justify-content:flex-end;gap:12px;border-top:2px solid #333;background:#222}.btn[data-v-c9277bf5]{padding:8px 16px;font-family:Courier New,monospace;text-transform:uppercase;font-weight:700;cursor:pointer;border:2px solid #000;box-shadow:2px 2px #000;transition:all .1s}.btn[data-v-c9277bf5]:active{transform:translate(2px,2px);box-shadow:none}.btn.primary[data-v-c9277bf5]{background:gold;color:#000}.btn.primary[data-v-c9277bf5]:hover{background:#ffea70}.btn.secondary[data-v-c9277bf5]{background:#444;color:#fff}.btn.secondary[data-v-c9277bf5]:hover{background:#555}html,body,#app{margin:0;padding:0;width:100%;height:100%;overflow:hidden}.settings-btn{position:absolute;top:20px;right:20px;z-index:1000;padding:8px 12px;background:#000;color:#fff;border:2px solid #FFD700;font-family:Courier New,monospace;font-weight:700;cursor:pointer;text-transform:uppercase;box-shadow:4px 4px #00000080;transition:all .1s}.settings-btn:hover{background:#111;color:gold;transform:translate(1px,1px);box-shadow:3px 3px #00000080}.settings-btn:active{transform:translate(4px,4px);box-shadow:none}.add-building-btn{position:absolute;top:20px;right:160px;z-index:1000;padding:8px 12px;background:#000;color:#fff;border:2px solid #00FF00;font-family:Courier New,monospace;font-weight:700;cursor:pointer;text-transform:uppercase;box-shadow:4px 4px #00000080;transition:all .1s}.add-building-btn:hover{background:#111;color:#0f0;transform:translate(1px,1px);box-shadow:3px 3px #00000080}.add-building-btn:active{transform:translate(4px,4px);box-shadow:none} diff --git a/web-app/dist/index.html b/web-app/dist/index.html index e2b67ef..57ac2ae 100644 --- a/web-app/dist/index.html +++ b/web-app/dist/index.html @@ -5,8 +5,8 @@ Community Digital Twin - - + +
diff --git a/web-app/src/App.vue b/web-app/src/App.vue index 61ceee4..7e993cc 100644 --- a/web-app/src/App.vue +++ b/web-app/src/App.vue @@ -4,8 +4,10 @@ import DigitalTwin from './components/DigitalTwin.vue' import BuildingInfoCanvas from './components/BuildingInfoCanvas.vue' import TimeControls from './components/TimeControls.vue' import SettingsModal from './components/SettingsModal.vue' +import AddBuildingModal from './components/AddBuildingModal.vue' const isSettingsOpen = ref(false); +const isAddBuildingOpen = ref(false); diff --git a/web-app/src/components/AddBuildingModal.vue b/web-app/src/components/AddBuildingModal.vue new file mode 100644 index 0000000..46662ec --- /dev/null +++ b/web-app/src/components/AddBuildingModal.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/web-app/src/components/DigitalTwin.vue b/web-app/src/components/DigitalTwin.vue index 896ecdd..72ebdbb 100644 --- a/web-app/src/components/DigitalTwin.vue +++ b/web-app/src/components/DigitalTwin.vue @@ -1,5 +1,5 @@