diff --git "a/assets/index-93xzqGq8.js" "b/assets/index-93xzqGq8.js" new file mode 100644--- /dev/null +++ "b/assets/index-93xzqGq8.js" @@ -0,0 +1,4020 @@ +var xS=Object.defineProperty;var bS=(n,e,t)=>e in n?xS(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Vn=(n,e,t)=>bS(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function op(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const _t={},eo=[],vi=()=>{},MS=()=>!1,Wu=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),ap=n=>n.startsWith("onUpdate:"),Ht=Object.assign,lp=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},SS=Object.prototype.hasOwnProperty,ft=(n,e)=>SS.call(n,e),Ve=Array.isArray,to=n=>Xu(n)==="[object Map]",Sv=n=>Xu(n)==="[object Set]",$e=n=>typeof n=="function",Ot=n=>typeof n=="string",Ms=n=>typeof n=="symbol",St=n=>n!==null&&typeof n=="object",Ev=n=>(St(n)||$e(n))&&$e(n.then)&&$e(n.catch),Tv=Object.prototype.toString,Xu=n=>Tv.call(n),ES=n=>Xu(n).slice(8,-1),wv=n=>Xu(n)==="[object Object]",cp=n=>Ot(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,ea=op(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qu=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},TS=/-(\w)/g,Si=qu(n=>n.replace(TS,(e,t)=>t?t.toUpperCase():"")),wS=/\B([A-Z])/g,br=qu(n=>n.replace(wS,"-$1").toLowerCase()),up=qu(n=>n.charAt(0).toUpperCase()+n.slice(1)),Wh=qu(n=>n?`on${up(n)}`:""),gs=(n,e)=>!Object.is(n,e),Xh=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},AS=n=>{const e=parseFloat(n);return isNaN(e)?n:e},CS=n=>{const e=Ot(n)?Number(n):NaN;return isNaN(e)?n:e};let Qm;const ju=()=>Qm||(Qm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Yu(n){if(Ve(n)){const e={};for(let t=0;t{if(t){const i=t.split(IS);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Ja(n){let e="";if(Ot(n))e=n;else if(Ve(n))for(let t=0;t!!(n&&n.__v_isRef===!0),rd=n=>Ot(n)?n:n==null?"":Ve(n)||St(n)&&(n.toString===Tv||!$e(n.toString))?Rv(n)?rd(n.value):JSON.stringify(n,Iv,2):String(n),Iv=(n,e)=>Rv(e)?Iv(n,e.value):to(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[qh(i,r)+" =>"]=s,t),{})}:Sv(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>qh(t))}:Ms(e)?qh(e):St(e)&&!Ve(e)&&!wv(e)?String(e):e,qh=(n,e="")=>{var t;return Ms(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let dn;class US{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=dn,!e&&dn&&(this.index=(dn.scopes||(dn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(na){let e=na;for(na=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;ta;){let e=ta;for(ta=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function Uv(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Nv(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),pp(i),NS(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function od(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Fv(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Fv(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Sa))return;n.globalVersion=Sa;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!od(n)){n.flags&=-3;return}const t=xt,i=si;xt=n,si=!0;try{Uv(n);const s=n.fn(n._value);(e.version===0||gs(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{xt=t,si=i,Nv(n),n.flags&=-3}}function pp(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)pp(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function NS(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let si=!0;const Bv=[];function Ss(){Bv.push(si),si=!1}function Es(){const n=Bv.pop();si=n===void 0?!0:n}function eg(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=xt;xt=void 0;try{e()}finally{xt=t}}}let Sa=0;class FS{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class $u{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!xt||!si||xt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==xt)t=this.activeLink=new FS(xt,this),xt.deps?(t.prevDep=xt.depsTail,xt.depsTail.nextDep=t,xt.depsTail=t):xt.deps=xt.depsTail=t,kv(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=xt.depsTail,t.nextDep=void 0,xt.depsTail.nextDep=t,xt.depsTail=t,xt.deps===t&&(xt.deps=i)}return t}trigger(e){this.version++,Sa++,this.notify(e)}notify(e){fp();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{dp()}}}function kv(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)kv(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const zc=new WeakMap,rr=Symbol(""),ad=Symbol(""),Ea=Symbol("");function sn(n,e,t){if(si&&xt){let i=zc.get(n);i||zc.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new $u),s.map=i,s.key=t),s.track()}}function ki(n,e,t,i,s,r){const o=zc.get(n);if(!o){Sa++;return}const a=l=>{l&&l.trigger()};if(fp(),e==="clear")o.forEach(a);else{const l=Ve(n),c=l&&cp(t);if(l&&t==="length"){const u=Number(i);o.forEach((h,f)=>{(f==="length"||f===Ea||!Ms(f)&&f>=u)&&a(h)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Ea)),e){case"add":l?c&&a(o.get("length")):(a(o.get(rr)),to(n)&&a(o.get(ad)));break;case"delete":l||(a(o.get(rr)),to(n)&&a(o.get(ad)));break;case"set":to(n)&&a(o.get(rr));break}}dp()}function BS(n,e){const t=zc.get(n);return t&&t.get(e)}function wr(n){const e=nt(n);return e===n?e:(sn(e,"iterate",Ea),jn(n)?e:e.map(rn))}function Ku(n){return sn(n=nt(n),"iterate",Ea),n}const kS={__proto__:null,[Symbol.iterator](){return Yh(this,Symbol.iterator,rn)},concat(...n){return wr(this).concat(...n.map(e=>Ve(e)?wr(e):e))},entries(){return Yh(this,"entries",n=>(n[1]=rn(n[1]),n))},every(n,e){return Ri(this,"every",n,e,void 0,arguments)},filter(n,e){return Ri(this,"filter",n,e,t=>t.map(rn),arguments)},find(n,e){return Ri(this,"find",n,e,rn,arguments)},findIndex(n,e){return Ri(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Ri(this,"findLast",n,e,rn,arguments)},findLastIndex(n,e){return Ri(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Ri(this,"forEach",n,e,void 0,arguments)},includes(...n){return $h(this,"includes",n)},indexOf(...n){return $h(this,"indexOf",n)},join(n){return wr(this).join(n)},lastIndexOf(...n){return $h(this,"lastIndexOf",n)},map(n,e){return Ri(this,"map",n,e,void 0,arguments)},pop(){return Do(this,"pop")},push(...n){return Do(this,"push",n)},reduce(n,...e){return tg(this,"reduce",n,e)},reduceRight(n,...e){return tg(this,"reduceRight",n,e)},shift(){return Do(this,"shift")},some(n,e){return Ri(this,"some",n,e,void 0,arguments)},splice(...n){return Do(this,"splice",n)},toReversed(){return wr(this).toReversed()},toSorted(n){return wr(this).toSorted(n)},toSpliced(...n){return wr(this).toSpliced(...n)},unshift(...n){return Do(this,"unshift",n)},values(){return Yh(this,"values",rn)}};function Yh(n,e,t){const i=Ku(n),s=i[e]();return i!==n&&!jn(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const zS=Array.prototype;function Ri(n,e,t,i,s,r){const o=Ku(n),a=o!==n&&!jn(n),l=o[e];if(l!==zS[e]){const h=l.apply(n,r);return a?rn(h):h}let c=t;o!==n&&(a?c=function(h,f){return t.call(this,rn(h),f,n)}:t.length>2&&(c=function(h,f){return t.call(this,h,f,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function tg(n,e,t,i){const s=Ku(n);let r=t;return s!==n&&(jn(n)?t.length>3&&(r=function(o,a,l){return t.call(this,o,a,l,n)}):r=function(o,a,l){return t.call(this,o,rn(a),l,n)}),s[e](r,...i)}function $h(n,e,t){const i=nt(n);sn(i,"iterate",Ea);const s=i[e](...t);return(s===-1||s===!1)&&_p(t[0])?(t[0]=nt(t[0]),i[e](...t)):s}function Do(n,e,t=[]){Ss(),fp();const i=nt(n)[e].apply(n,t);return dp(),Es(),i}const VS=op("__proto__,__v_isRef,__isVue"),zv=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ms));function HS(n){Ms(n)||(n=String(n));const e=nt(this);return sn(e,"has",n),e.hasOwnProperty(n)}class Vv{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(s?r?JS:Xv:r?Wv:Gv).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Ve(e);if(!s){let l;if(o&&(l=kS[t]))return l;if(t==="hasOwnProperty")return HS}const a=Reflect.get(e,t,Bt(e)?e:i);return(Ms(t)?zv.has(t):VS(t))||(s||sn(e,"get",t),r)?a:Bt(a)?o&&cp(t)?a:a.value:St(a)?s?hr(a):Ts(a):a}}class Hv extends Vv{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=fr(r);if(!jn(i)&&!fr(i)&&(r=nt(r),i=nt(i)),!Ve(e)&&Bt(r)&&!Bt(i))return l?!1:(r.value=i,!0)}const o=Ve(e)&&cp(t)?Number(t)n,El=n=>Reflect.getPrototypeOf(n);function jS(n,e,t){return function(...i){const s=this.__v_raw,r=nt(s),o=to(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=t?ld:e?cd:rn;return!e&&sn(r,"iterate",l?ad:rr),{next(){const{value:h,done:f}=c.next();return f?{value:h,done:f}:{value:a?[u(h[0]),u(h[1])]:u(h),done:f}},[Symbol.iterator](){return this}}}}function Tl(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function YS(n,e){const t={get(s){const r=this.__v_raw,o=nt(r),a=nt(s);n||(gs(s,a)&&sn(o,"get",s),sn(o,"get",a));const{has:l}=El(o),c=e?ld:n?cd:rn;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&&sn(nt(s),"iterate",rr),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=nt(r),a=nt(s);return n||(gs(s,a)&&sn(o,"has",s),sn(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=nt(a),c=e?ld:n?cd:rn;return!n&&sn(l,"iterate",rr),a.forEach((u,h)=>s.call(r,c(u),c(h),o))}};return Ht(t,n?{add:Tl("add"),set:Tl("set"),delete:Tl("delete"),clear:Tl("clear")}:{add(s){!e&&!jn(s)&&!fr(s)&&(s=nt(s));const r=nt(this);return El(r).has.call(r,s)||(r.add(s),ki(r,"add",s,s)),this},set(s,r){!e&&!jn(r)&&!fr(r)&&(r=nt(r));const o=nt(this),{has:a,get:l}=El(o);let c=a.call(o,s);c||(s=nt(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?gs(r,u)&&ki(o,"set",s,r):ki(o,"add",s,r),this},delete(s){const r=nt(this),{has:o,get:a}=El(r);let l=o.call(r,s);l||(s=nt(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&ki(r,"delete",s,void 0),c},clear(){const s=nt(this),r=s.size!==0,o=s.clear();return r&&ki(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=jS(s,n,e)}),t}function mp(n,e){const t=YS(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(ft(t,s)&&s in i?t:i,s,r)}const $S={get:mp(!1,!1)},KS={get:mp(!1,!0)},ZS={get:mp(!0,!1)};const Gv=new WeakMap,Wv=new WeakMap,Xv=new WeakMap,JS=new WeakMap;function QS(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function eE(n){return n.__v_skip||!Object.isExtensible(n)?0:QS(ES(n))}function Ts(n){return fr(n)?n:gp(n,!1,WS,$S,Gv)}function tE(n){return gp(n,!1,qS,KS,Wv)}function hr(n){return gp(n,!0,XS,ZS,Xv)}function gp(n,e,t,i,s){if(!St(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=eE(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function no(n){return fr(n)?no(n.__v_raw):!!(n&&n.__v_isReactive)}function fr(n){return!!(n&&n.__v_isReadonly)}function jn(n){return!!(n&&n.__v_isShallow)}function _p(n){return n?!!n.__v_raw:!1}function nt(n){const e=n&&n.__v_raw;return e?nt(e):n}function nE(n){return!ft(n,"__v_skip")&&Object.isExtensible(n)&&Av(n,"__v_skip",!0),n}const rn=n=>St(n)?Ts(n):n,cd=n=>St(n)?hr(n):n;function Bt(n){return n?n.__v_isRef===!0:!1}function vt(n){return qv(n,!1)}function it(n){return qv(n,!0)}function qv(n,e){return Bt(n)?n:new iE(n,e)}class iE{constructor(e,t){this.dep=new $u,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:nt(e),this._value=t?e:rn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||jn(e)||fr(e);e=i?e:nt(e),gs(e,t)&&(this._rawValue=e,this._value=i?e:rn(e),this.dep.trigger())}}function gt(n){return Bt(n)?n.value:n}function Vt(n){return $e(n)?n():gt(n)}const sE={get:(n,e,t)=>e==="__v_raw"?n:gt(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return Bt(s)&&!Bt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function jv(n){return no(n)?n:new Proxy(n,sE)}class rE{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new $u,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function oE(n){return new rE(n)}function aE(n){const e=Ve(n)?new Array(n.length):{};for(const t in n)e[t]=cE(n,t);return e}class lE{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return BS(nt(this._object),this._key)}}function cE(n,e,t){const i=n[e];return Bt(i)?i:new lE(n,e,t)}class uE{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new $u(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Sa-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&xt!==this)return Ov(this,!0),!0}get value(){const e=this.dep.track();return Fv(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function hE(n,e,t=!1){let i,s;return $e(n)?i=n:(i=n.get,s=n.set),new uE(i,s,t)}const wl={},Vc=new WeakMap;let $s;function fE(n,e=!1,t=$s){if(t){let i=Vc.get(t);i||Vc.set(t,i=[]),i.push(n)}}function dE(n,e,t=_t){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=y=>s?y:jn(y)||s===!1||s===0?zi(y,1):zi(y);let u,h,f,d,p=!1,_=!1;if(Bt(n)?(h=()=>n.value,p=jn(n)):no(n)?(h=()=>c(n),p=!0):Ve(n)?(_=!0,p=n.some(y=>no(y)||jn(y)),h=()=>n.map(y=>{if(Bt(y))return y.value;if(no(y))return c(y);if($e(y))return l?l(y,2):y()})):$e(n)?e?h=l?()=>l(n,2):n:h=()=>{if(f){Ss();try{f()}finally{Es()}}const y=$s;$s=u;try{return l?l(n,3,[d]):n(d)}finally{$s=y}}:h=vi,e&&s){const y=h,w=s===!0?1/0:s;h=()=>zi(y(),w)}const g=hp(),m=()=>{u.stop(),g&&g.active&&lp(g.effects,u)};if(r&&e){const y=e;e=(...w)=>{y(...w),m()}}let x=_?new Array(n.length).fill(wl):wl;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(e){const w=u.run();if(s||p||(_?w.some((A,C)=>gs(A,x[C])):gs(w,x))){f&&f();const A=$s;$s=u;try{const C=[w,x===wl?void 0:_&&x[0]===wl?[]:x,d];l?l(e,3,C):e(...C),x=w}finally{$s=A}}}else u.run()};return a&&a(v),u=new Lv(h),u.scheduler=o?()=>o(v,!1):v,d=y=>fE(y,!1,u),f=u.onStop=()=>{const y=Vc.get(u);if(y){if(l)l(y,4);else for(const w of y)w();Vc.delete(u)}},e?i?v(!0):x=u.run():o?o(v.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function zi(n,e=1/0,t){if(e<=0||!St(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Bt(n))zi(n.value,e,t);else if(Ve(n))for(let i=0;i{zi(i,e,t)});else if(wv(n)){for(const i in n)zi(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&zi(n[i],e,t)}return n}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Qa(n,e,t,i){try{return i?n(...i):n()}catch(s){Zu(s,e,t)}}function ri(n,e,t,i){if($e(n)){const s=Qa(n,e,t,i);return s&&Ev(s)&&s.catch(r=>{Zu(r,e,t)}),s}if(Ve(n)){const s=[];for(let r=0;r>>1,s=pn[i],r=Ta(s);r=Ta(t)?pn.push(n):pn.splice(mE(e),0,n),n.flags|=1,Kv()}}function Kv(){Hc||(Hc=Yv.then(Jv))}function gE(n){Ve(n)?io.push(...n):cs&&n.id===-1?cs.splice(qr+1,0,n):n.flags&1||(io.push(n),n.flags|=1),Kv()}function ng(n,e,t=pi+1){for(;tTa(t)-Ta(i));if(io.length=0,cs){cs.push(...e);return}for(cs=e,qr=0;qrn.id==null?n.flags&2?-1:1/0:n.id;function Jv(n){try{for(pi=0;pi{i._d&&fg(-1);const r=Gc(e);let o;try{o=n(...s)}finally{Gc(r),i._d&&fg(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function _E(n,e){if(vn===null)return n;const t=nh(vn),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,Ar=Symbol("_leaveCb"),Al=Symbol("_enterCb");function xE(){const n={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return _s(()=>{n.isMounted=!0}),ry(()=>{n.isUnmounting=!0}),n}const Hn=[Function,Array],bE={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Hn,onEnter:Hn,onAfterEnter:Hn,onEnterCancelled:Hn,onBeforeLeave:Hn,onLeave:Hn,onAfterLeave:Hn,onLeaveCancelled:Hn,onBeforeAppear:Hn,onAppear:Hn,onAfterAppear:Hn,onAppearCancelled:Hn};function ME(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function hd(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:h,onBeforeLeave:f,onLeave:d,onAfterLeave:p,onLeaveCancelled:_,onBeforeAppear:g,onAppear:m,onAfterAppear:x,onAppearCancelled:v}=e,y=String(n.key),w=ME(t,n),A=(b,M)=>{b&&ri(b,i,9,M)},C=(b,M)=>{const L=M[1];A(b,M),Ve(b)?b.every(N=>N.length<=1)&&L():b.length<=1&&L()},I={mode:o,persisted:a,beforeEnter(b){let M=l;if(!t.isMounted)if(r)M=g||l;else return;b[Ar]&&b[Ar](!0);const L=w[y];L&&jr(n,L)&&L.el[Ar]&&L.el[Ar](),A(M,[b])},enter(b){let M=c,L=u,N=h;if(!t.isMounted)if(r)M=m||c,L=x||u,N=v||h;else return;let B=!1;const K=b[Al]=J=>{B||(B=!0,J?A(N,[b]):A(L,[b]),I.delayedLeave&&I.delayedLeave(),b[Al]=void 0)};M?C(M,[b,K]):K()},leave(b,M){const L=String(n.key);if(b[Al]&&b[Al](!0),t.isUnmounting)return M();A(f,[b]);let N=!1;const B=b[Ar]=K=>{N||(N=!0,M(),K?A(_,[b]):A(p,[b]),b[Ar]=void 0,w[L]===n&&delete w[L])};w[L]=n,d?C(d,[b,B]):B()},clone(b){return hd(b,e,t,i)}};return I}function wa(n,e){n.shapeFlag&6&&n.component?(n.transition=e,wa(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function ey(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rWc(p,e&&(Ve(e)?e[_]:e),t,i,s));return}if(ia(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Wc(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?nh(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,u=a.refs===_t?a.refs={}:a.refs,h=a.setupState,f=nt(h),d=h===_t?()=>!1:p=>ft(f,p);if(c!=null&&c!==l&&(Ot(c)?(u[c]=null,d(c)&&(h[c]=null)):Bt(c)&&(c.value=null)),$e(l))Qa(l,a,12,[o,u]);else{const p=Ot(l),_=Bt(l);if(p||_){const g=()=>{if(n.f){const m=p?d(l)?h[l]:u[l]:l.value;s?Ve(m)&&lp(m,r):Ve(m)?m.includes(r)||m.push(r):p?(u[l]=[r],d(l)&&(h[l]=u[l])):(l.value=[r],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,d(l)&&(h[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,On(g,t)):g()}}}ju().requestIdleCallback;ju().cancelIdleCallback;const ia=n=>!!n.type.__asyncLoader,ny=n=>n.type.__isKeepAlive;function SE(n,e){iy(n,"a",e)}function EE(n,e){iy(n,"da",e)}function iy(n,e,t=qt){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(Ju(e,i,t),t){let s=t.parent;for(;s&&s.parent;)ny(s.parent.vnode)&&TE(i,e,t,s),s=s.parent}}function TE(n,e,t,i){const s=Ju(e,n,i,!0);qi(()=>{lp(i[e],s)},t)}function Ju(n,e,t=qt,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{Ss();const a=el(t),l=ri(e,t,n,o);return a(),Es(),l});return i?s.unshift(r):s.push(r),r}}const Ji=n=>(e,t=qt)=>{(!Ca||n==="sp")&&Ju(n,(...i)=>e(...i),t)},wE=Ji("bm"),_s=Ji("m"),AE=Ji("bu"),sy=Ji("u"),ry=Ji("bum"),qi=Ji("um"),CE=Ji("sp"),RE=Ji("rtg"),IE=Ji("rtc");function PE(n,e=qt){Ju("ec",n,e)}const LE="directives",DE=Symbol.for("v-ndc");function OE(n){return UE(LE,n)}function UE(n,e,t=!0,i=!1){const s=vn||qt;if(s){const r=s.type,o=ig(s[n]||r[n],e)||ig(s.appContext[n],e);return!o&&i?r:o}}function ig(n,e){return n&&(n[e]||n[Si(e)]||n[up(Si(e))])}function NE(n,e,t,i){let s;const r=t,o=Ve(n);if(o||Ot(n)){const a=o&&no(n);let l=!1;a&&(l=!jn(n),n=Ku(n)),s=new Array(n.length);for(let c=0,u=n.length;ce(a,l,void 0,r));else{const a=Object.keys(n);s=new Array(a.length);for(let l=0,c=a.length;ln?wy(n)?nh(n):fd(n.parent):null,sa=Ht(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=>fd(n.parent),$root:n=>fd(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>ay(n),$forceUpdate:n=>n.f||(n.f=()=>{vp(n.update)}),$nextTick:n=>n.n||(n.n=$v.bind(n.proxy)),$watch:n=>iT.bind(n)}),Kh=(n,e)=>n!==_t&&!n.__isScriptSetup&&ft(n,e),FE={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(Kh(i,e))return o[e]=1,i[e];if(s!==_t&&ft(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&ft(c,e))return o[e]=3,r[e];if(t!==_t&&ft(t,e))return o[e]=4,t[e];dd&&(o[e]=0)}}const u=sa[e];let h,f;if(u)return e==="$attrs"&&sn(n.attrs,"get",""),u(n);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==_t&&ft(t,e))return o[e]=4,t[e];if(f=l.config.globalProperties,ft(f,e))return f[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return Kh(s,e)?(s[e]=t,!0):i!==_t&&ft(i,e)?(i[e]=t,!0):ft(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!t[o]||n!==_t&&ft(n,o)||Kh(e,o)||(a=r[0])&&ft(a,o)||ft(i,o)||ft(sa,o)||ft(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:ft(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function yp(){return BE().slots}function BE(){const n=ji();return n.setupContext||(n.setupContext=Cy(n))}function sg(n){return Ve(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let dd=!0;function kE(n){const e=ay(n),t=n.proxy,i=n.ctx;dd=!1,e.beforeCreate&&rg(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:f,beforeUpdate:d,updated:p,activated:_,deactivated:g,beforeDestroy:m,beforeUnmount:x,destroyed:v,unmounted:y,render:w,renderTracked:A,renderTriggered:C,errorCaptured:I,serverPrefetch:b,expose:M,inheritAttrs:L,components:N,directives:B,filters:K}=e;if(c&&zE(c,i,null),o)for(const re in o){const Y=o[re];$e(Y)&&(i[re]=Y.bind(t))}if(s){const re=s.call(t,t);St(re)&&(n.data=Ts(re))}if(dd=!0,r)for(const re in r){const Y=r[re],he=$e(Y)?Y.bind(t,t):$e(Y.get)?Y.get.bind(t,t):vi,me=!$e(Y)&&$e(Y.set)?Y.set.bind(t):vi,ee=bt({get:he,set:me});Object.defineProperty(i,re,{enumerable:!0,configurable:!0,get:()=>ee.value,set:ge=>ee.value=ge})}if(a)for(const re in a)oy(a[re],i,t,re);if(l){const re=$e(l)?l.call(t):l;Reflect.ownKeys(re).forEach(Y=>{ra(Y,re[Y])})}u&&rg(u,n,"c");function k(re,Y){Ve(Y)?Y.forEach(he=>re(he.bind(t))):Y&&re(Y.bind(t))}if(k(wE,h),k(_s,f),k(AE,d),k(sy,p),k(SE,_),k(EE,g),k(PE,I),k(IE,A),k(RE,C),k(ry,x),k(qi,y),k(CE,b),Ve(M))if(M.length){const re=n.exposed||(n.exposed={});M.forEach(Y=>{Object.defineProperty(re,Y,{get:()=>t[Y],set:he=>t[Y]=he})})}else n.exposed||(n.exposed={});w&&n.render===vi&&(n.render=w),L!=null&&(n.inheritAttrs=L),N&&(n.components=N),B&&(n.directives=B),b&&ty(n)}function zE(n,e,t=vi){Ve(n)&&(n=pd(n));for(const i in n){const s=n[i];let r;St(s)?"default"in s?r=ar(s.from||i,s.default,!0):r=ar(s.from||i):r=ar(s),Bt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function rg(n,e,t){ri(Ve(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function oy(n,e,t,i){let s=i.includes(".")?My(t,i):()=>t[i];if(Ot(n)){const r=e[n];$e(r)&&pt(s,r)}else if($e(n))pt(s,n.bind(t));else if(St(n))if(Ve(n))n.forEach(r=>oy(r,e,t,i));else{const r=$e(n.handler)?n.handler.bind(t):e[n.handler];$e(r)&&pt(s,r,n)}}function ay(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>Xc(l,c,o,!0)),Xc(l,e,o)),St(e)&&r.set(e,l),l}function Xc(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&Xc(n,r,t,!0),s&&s.forEach(o=>Xc(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=VE[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const VE={data:og,props:ag,emits:ag,methods:Yo,computed:Yo,beforeCreate:hn,created:hn,beforeMount:hn,mounted:hn,beforeUpdate:hn,updated:hn,beforeDestroy:hn,beforeUnmount:hn,destroyed:hn,unmounted:hn,activated:hn,deactivated:hn,errorCaptured:hn,serverPrefetch:hn,components:Yo,directives:Yo,watch:GE,provide:og,inject:HE};function og(n,e){return e?n?function(){return Ht($e(n)?n.call(this,this):n,$e(e)?e.call(this,this):e)}:e:n}function HE(n,e){return Yo(pd(n),pd(e))}function pd(n){if(Ve(n)){const e={};for(let t=0;t1)return t&&$e(e)?e.call(i&&i.proxy):e}}function cy(){return!!(qt||vn||or)}const uy={},hy=()=>Object.create(uy),fy=n=>Object.getPrototypeOf(n)===uy;function qE(n,e,t,i=!1){const s={},r=hy();n.propsDefaults=Object.create(null),dy(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:tE(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function jE(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=nt(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[f,d]=py(h,e,!0);Ht(o,f),d&&a.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!l)return St(n)&&i.set(n,eo),eo;if(Ve(r))for(let u=0;un[0]==="_"||n==="$stable",xp=n=>Ve(n)?n.map(gi):[gi(n)],$E=(n,e,t)=>{if(e._n)return e;const i=ud((...s)=>xp(e(...s)),t);return i._c=!1,i},gy=(n,e,t)=>{const i=n._ctx;for(const s in n){if(my(s))continue;const r=n[s];if($e(r))e[s]=$E(s,r,i);else if(r!=null){const o=xp(r);e[s]=()=>o}}},_y=(n,e)=>{const t=xp(e);n.slots.default=()=>t},vy=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},KE=(n,e,t)=>{const i=n.slots=hy();if(n.vnode.shapeFlag&32){const s=e._;s?(vy(i,e,t),t&&Av(i,"_",s,!0)):gy(e,i)}else e&&_y(n,e)},ZE=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=_t;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:vy(s,e,t):(r=!e.$stable,gy(e,s)),o=e}else e&&(_y(n,e),o={default:1});if(r)for(const a in s)!my(a)&&o[a]==null&&delete s[a]},On=uT;function yy(n){return JE(n)}function JE(n,e){const t=ju();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:f,setScopeId:d=vi,insertStaticContent:p}=n,_=(D,U,E,q=null,F=null,z=null,V=void 0,ne=null,W=!!U.dynamicChildren)=>{if(D===U)return;D&&!jr(D,U)&&(q=_e(D),ge(D,F,z,!0),D=null),U.patchFlag===-2&&(W=!1,U.dynamicChildren=null);const{type:T,ref:S,shapeFlag:O}=U;switch(T){case th:g(D,U,E,q);break;case oo:m(D,U,E,q);break;case Jh:D==null&&x(U,E,q,V);break;case mn:N(D,U,E,q,F,z,V,ne,W);break;default:O&1?w(D,U,E,q,F,z,V,ne,W):O&6?B(D,U,E,q,F,z,V,ne,W):(O&64||O&128)&&T.process(D,U,E,q,F,z,V,ne,W,De)}S!=null&&F&&Wc(S,D&&D.ref,z,U||D,!U)},g=(D,U,E,q)=>{if(D==null)i(U.el=a(U.children),E,q);else{const F=U.el=D.el;U.children!==D.children&&c(F,U.children)}},m=(D,U,E,q)=>{D==null?i(U.el=l(U.children||""),E,q):U.el=D.el},x=(D,U,E,q)=>{[D.el,D.anchor]=p(D.children,U,E,q,D.el,D.anchor)},v=({el:D,anchor:U},E,q)=>{let F;for(;D&&D!==U;)F=f(D),i(D,E,q),D=F;i(U,E,q)},y=({el:D,anchor:U})=>{let E;for(;D&&D!==U;)E=f(D),s(D),D=E;s(U)},w=(D,U,E,q,F,z,V,ne,W)=>{U.type==="svg"?V="svg":U.type==="math"&&(V="mathml"),D==null?A(U,E,q,F,z,V,ne,W):b(D,U,F,z,V,ne,W)},A=(D,U,E,q,F,z,V,ne)=>{let W,T;const{props:S,shapeFlag:O,transition:G,dirs:Z}=D;if(W=D.el=o(D.type,z,S&&S.is,S),O&8?u(W,D.children):O&16&&I(D.children,W,null,q,F,Zh(D,z),V,ne),Z&&Ps(D,null,q,"created"),C(W,D,D.scopeId,V,q),S){for(const pe in S)pe!=="value"&&!ea(pe)&&r(W,pe,null,S[pe],z,q);"value"in S&&r(W,"value",null,S.value,z),(T=S.onVnodeBeforeMount)&&li(T,q,D)}Z&&Ps(D,null,q,"beforeMount");const $=QE(F,G);$&&G.beforeEnter(W),i(W,U,E),((T=S&&S.onVnodeMounted)||$||Z)&&On(()=>{T&&li(T,q,D),$&&G.enter(W),Z&&Ps(D,null,q,"mounted")},F)},C=(D,U,E,q,F)=>{if(E&&d(D,E),q)for(let z=0;z{for(let T=W;T{const ne=U.el=D.el;let{patchFlag:W,dynamicChildren:T,dirs:S}=U;W|=D.patchFlag&16;const O=D.props||_t,G=U.props||_t;let Z;if(E&&Ls(E,!1),(Z=G.onVnodeBeforeUpdate)&&li(Z,E,U,D),S&&Ps(U,D,E,"beforeUpdate"),E&&Ls(E,!0),(O.innerHTML&&G.innerHTML==null||O.textContent&&G.textContent==null)&&u(ne,""),T?M(D.dynamicChildren,T,ne,E,q,Zh(U,F),z):V||Y(D,U,ne,null,E,q,Zh(U,F),z,!1),W>0){if(W&16)L(ne,O,G,E,F);else if(W&2&&O.class!==G.class&&r(ne,"class",null,G.class,F),W&4&&r(ne,"style",O.style,G.style,F),W&8){const $=U.dynamicProps;for(let pe=0;pe<$.length;pe++){const le=$[pe],Ae=O[le],Pe=G[le];(Pe!==Ae||le==="value")&&r(ne,le,Ae,Pe,F,E)}}W&1&&D.children!==U.children&&u(ne,U.children)}else!V&&T==null&&L(ne,O,G,E,F);((Z=G.onVnodeUpdated)||S)&&On(()=>{Z&&li(Z,E,U,D),S&&Ps(U,D,E,"updated")},q)},M=(D,U,E,q,F,z,V)=>{for(let ne=0;ne{if(U!==E){if(U!==_t)for(const z in U)!ea(z)&&!(z in E)&&r(D,z,U[z],null,F,q);for(const z in E){if(ea(z))continue;const V=E[z],ne=U[z];V!==ne&&z!=="value"&&r(D,z,ne,V,F,q)}"value"in E&&r(D,"value",U.value,E.value,F)}},N=(D,U,E,q,F,z,V,ne,W)=>{const T=U.el=D?D.el:a(""),S=U.anchor=D?D.anchor:a("");let{patchFlag:O,dynamicChildren:G,slotScopeIds:Z}=U;Z&&(ne=ne?ne.concat(Z):Z),D==null?(i(T,E,q),i(S,E,q),I(U.children||[],E,S,F,z,V,ne,W)):O>0&&O&64&&G&&D.dynamicChildren?(M(D.dynamicChildren,G,E,F,z,V,ne),(U.key!=null||F&&U===F.subTree)&&xy(D,U,!0)):Y(D,U,E,S,F,z,V,ne,W)},B=(D,U,E,q,F,z,V,ne,W)=>{U.slotScopeIds=ne,D==null?U.shapeFlag&512?F.ctx.activate(U,E,q,V,W):K(U,E,q,F,z,V,W):J(D,U,W)},K=(D,U,E,q,F,z,V)=>{const ne=D.component=yT(D,q,F);if(ny(D)&&(ne.ctx.renderer=De),xT(ne,!1,V),ne.asyncDep){if(F&&F.registerDep(ne,k,V),!D.el){const W=ne.subTree=on(oo);m(null,W,U,E)}}else k(ne,D,U,E,F,z,V)},J=(D,U,E)=>{const q=U.component=D.component;if(lT(D,U,E))if(q.asyncDep&&!q.asyncResolved){re(q,U,E);return}else q.next=U,q.update();else U.el=D.el,q.vnode=U},k=(D,U,E,q,F,z,V)=>{const ne=()=>{if(D.isMounted){let{next:O,bu:G,u:Z,parent:$,vnode:pe}=D;{const ye=by(D);if(ye){O&&(O.el=pe.el,re(D,O,V)),ye.asyncDep.then(()=>{D.isUnmounted||ne()});return}}let le=O,Ae;Ls(D,!1),O?(O.el=pe.el,re(D,O,V)):O=pe,G&&Xh(G),(Ae=O.props&&O.props.onVnodeBeforeUpdate)&&li(Ae,$,O,pe),Ls(D,!0);const Pe=ug(D),ce=D.subTree;D.subTree=Pe,_(ce,Pe,h(ce.el),_e(ce),D,F,z),O.el=Pe.el,le===null&&cT(D,Pe.el),Z&&On(Z,F),(Ae=O.props&&O.props.onVnodeUpdated)&&On(()=>li(Ae,$,O,pe),F)}else{let O;const{el:G,props:Z}=U,{bm:$,m:pe,parent:le,root:Ae,type:Pe}=D,ce=ia(U);Ls(D,!1),$&&Xh($),!ce&&(O=Z&&Z.onVnodeBeforeMount)&&li(O,le,U),Ls(D,!0);{Ae.ce&&Ae.ce._injectChildStyle(Pe);const ye=D.subTree=ug(D);_(null,ye,E,q,D,F,z),U.el=ye.el}if(pe&&On(pe,F),!ce&&(O=Z&&Z.onVnodeMounted)){const ye=U;On(()=>li(O,le,ye),F)}(U.shapeFlag&256||le&&ia(le.vnode)&&le.vnode.shapeFlag&256)&&D.a&&On(D.a,F),D.isMounted=!0,U=E=q=null}};D.scope.on();const W=D.effect=new Lv(ne);D.scope.off();const T=D.update=W.run.bind(W),S=D.job=W.runIfDirty.bind(W);S.i=D,S.id=D.uid,W.scheduler=()=>vp(S),Ls(D,!0),T()},re=(D,U,E)=>{U.component=D;const q=D.vnode.props;D.vnode=U,D.next=null,jE(D,U.props,q,E),ZE(D,U.children,E),Ss(),ng(D),Es()},Y=(D,U,E,q,F,z,V,ne,W=!1)=>{const T=D&&D.children,S=D?D.shapeFlag:0,O=U.children,{patchFlag:G,shapeFlag:Z}=U;if(G>0){if(G&128){me(T,O,E,q,F,z,V,ne,W);return}else if(G&256){he(T,O,E,q,F,z,V,ne,W);return}}Z&8?(S&16&&Te(T,F,z),O!==T&&u(E,O)):S&16?Z&16?me(T,O,E,q,F,z,V,ne,W):Te(T,F,z,!0):(S&8&&u(E,""),Z&16&&I(O,E,q,F,z,V,ne,W))},he=(D,U,E,q,F,z,V,ne,W)=>{D=D||eo,U=U||eo;const T=D.length,S=U.length,O=Math.min(T,S);let G;for(G=0;GS?Te(D,F,z,!0,!1,O):I(U,E,q,F,z,V,ne,W,O)},me=(D,U,E,q,F,z,V,ne,W)=>{let T=0;const S=U.length;let O=D.length-1,G=S-1;for(;T<=O&&T<=G;){const Z=D[T],$=U[T]=W?us(U[T]):gi(U[T]);if(jr(Z,$))_(Z,$,E,null,F,z,V,ne,W);else break;T++}for(;T<=O&&T<=G;){const Z=D[O],$=U[G]=W?us(U[G]):gi(U[G]);if(jr(Z,$))_(Z,$,E,null,F,z,V,ne,W);else break;O--,G--}if(T>O){if(T<=G){const Z=G+1,$=ZG)for(;T<=O;)ge(D[T],F,z,!0),T++;else{const Z=T,$=T,pe=new Map;for(T=$;T<=G;T++){const xe=U[T]=W?us(U[T]):gi(U[T]);xe.key!=null&&pe.set(xe.key,T)}let le,Ae=0;const Pe=G-$+1;let ce=!1,ye=0;const Ue=new Array(Pe);for(T=0;T=Pe){ge(xe,F,z,!0);continue}let Ge;if(xe.key!=null)Ge=pe.get(xe.key);else for(le=$;le<=G;le++)if(Ue[le-$]===0&&jr(xe,U[le])){Ge=le;break}Ge===void 0?ge(xe,F,z,!0):(Ue[Ge-$]=T+1,Ge>=ye?ye=Ge:ce=!0,_(xe,U[Ge],E,null,F,z,V,ne,W),Ae++)}const ze=ce?eT(Ue):eo;for(le=ze.length-1,T=Pe-1;T>=0;T--){const xe=$+T,Ge=U[xe],je=xe+1{const{el:z,type:V,transition:ne,children:W,shapeFlag:T}=D;if(T&6){ee(D.component.subTree,U,E,q);return}if(T&128){D.suspense.move(U,E,q);return}if(T&64){V.move(D,U,E,De);return}if(V===mn){i(z,U,E);for(let O=0;One.enter(z),F);else{const{leave:O,delayLeave:G,afterLeave:Z}=ne,$=()=>i(z,U,E),pe=()=>{O(z,()=>{$(),Z&&Z()})};G?G(z,$,pe):pe()}else i(z,U,E)},ge=(D,U,E,q=!1,F=!1)=>{const{type:z,props:V,ref:ne,children:W,dynamicChildren:T,shapeFlag:S,patchFlag:O,dirs:G,cacheIndex:Z}=D;if(O===-2&&(F=!1),ne!=null&&Wc(ne,null,E,D,!0),Z!=null&&(U.renderCache[Z]=void 0),S&256){U.ctx.deactivate(D);return}const $=S&1&&G,pe=!ia(D);let le;if(pe&&(le=V&&V.onVnodeBeforeUnmount)&&li(le,U,D),S&6)de(D.component,E,q);else{if(S&128){D.suspense.unmount(E,q);return}$&&Ps(D,null,U,"beforeUnmount"),S&64?D.type.remove(D,U,E,De,q):T&&!T.hasOnce&&(z!==mn||O>0&&O&64)?Te(T,U,E,!1,!0):(z===mn&&O&384||!F&&S&16)&&Te(W,U,E),q&&Fe(D)}(pe&&(le=V&&V.onVnodeUnmounted)||$)&&On(()=>{le&&li(le,U,D),$&&Ps(D,null,U,"unmounted")},E)},Fe=D=>{const{type:U,el:E,anchor:q,transition:F}=D;if(U===mn){ie(E,q);return}if(U===Jh){y(D);return}const z=()=>{s(E),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(D.shapeFlag&1&&F&&!F.persisted){const{leave:V,delayLeave:ne}=F,W=()=>V(E,z);ne?ne(D.el,z,W):W()}else z()},ie=(D,U)=>{let E;for(;D!==U;)E=f(D),s(D),D=E;s(U)},de=(D,U,E)=>{const{bum:q,scope:F,job:z,subTree:V,um:ne,m:W,a:T}=D;cg(W),cg(T),q&&Xh(q),F.stop(),z&&(z.flags|=8,ge(V,D,U,E)),ne&&On(ne,U),On(()=>{D.isUnmounted=!0},U),U&&U.pendingBranch&&!U.isUnmounted&&D.asyncDep&&!D.asyncResolved&&D.suspenseId===U.pendingId&&(U.deps--,U.deps===0&&U.resolve())},Te=(D,U,E,q=!1,F=!1,z=0)=>{for(let V=z;V{if(D.shapeFlag&6)return _e(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const U=f(D.anchor||D.el),E=U&&U[vE];return E?f(E):U};let Oe=!1;const Xe=(D,U,E)=>{D==null?U._vnode&&ge(U._vnode,null,null,!0):_(U._vnode||null,D,U,null,null,null,E),U._vnode=D,Oe||(Oe=!0,ng(),Zv(),Oe=!1)},De={p:_,um:ge,m:ee,r:Fe,mt:K,mc:I,pc:Y,pbc:M,n:_e,o:n};return{render:Xe,hydrate:void 0,createApp:XE(Xe)}}function Zh({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Ls({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function QE(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function xy(n,e,t=!1){const i=n.children,s=e.children;if(Ve(i)&&Ve(s))for(let r=0;r>1,n[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function by(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:by(e)}function cg(n){if(n)for(let e=0;ear(tT);function Qu(n,e){return bp(n,null,e)}function pt(n,e,t){return bp(n,e,t)}function bp(n,e,t=_t){const{immediate:i,deep:s,flush:r,once:o}=t,a=Ht({},t),l=e&&i||!e&&r!=="post";let c;if(Ca){if(r==="sync"){const d=nT();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=vi,d.resume=vi,d.pause=vi,d}}const u=qt;a.call=(d,p,_)=>ri(d,u,p,_);let h=!1;r==="post"?a.scheduler=d=>{On(d,u&&u.suspense)}:r!=="sync"&&(h=!0,a.scheduler=(d,p)=>{p?d():vp(d)}),a.augmentJob=d=>{e&&(d.flags|=4),h&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const f=dE(n,e,a);return Ca&&(c?c.push(f):l&&f()),f}function iT(n,e,t){const i=this.proxy,s=Ot(n)?n.includes(".")?My(i,n):()=>i[n]:n.bind(i,i);let r;$e(e)?r=e:(r=e.handler,t=e);const o=el(this),a=bp(s,r.bind(i),t);return o(),a}function My(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;se==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${Si(e)}Modifiers`]||n[`${br(e)}Modifiers`];function rT(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||_t;let s=t;const r=e.startsWith("update:"),o=r&&sT(i,e.slice(7));o&&(o.trim&&(s=t.map(u=>Ot(u)?u.trim():u)),o.number&&(s=t.map(AS)));let a,l=i[a=Wh(e)]||i[a=Wh(Si(e))];!l&&r&&(l=i[a=Wh(br(e))]),l&&ri(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,ri(c,n,6,s)}}function Sy(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!$e(n)){const l=c=>{const u=Sy(c,e,!0);u&&(a=!0,Ht(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(St(n)&&i.set(n,null),null):(Ve(r)?r.forEach(l=>o[l]=null):Ht(o,r),St(n)&&i.set(n,o),o)}function eh(n,e){return!n||!Wu(e)?!1:(e=e.slice(2).replace(/Once$/,""),ft(n,e[0].toLowerCase()+e.slice(1))||ft(n,br(e))||ft(n,e))}function ug(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:f,setupState:d,ctx:p,inheritAttrs:_}=n,g=Gc(n);let m,x;try{if(t.shapeFlag&4){const y=s||i,w=y;m=gi(c.call(w,y,u,h,d,f,p)),x=a}else{const y=e;m=gi(y.length>1?y(h,{attrs:a,slots:o,emit:l}):y(h,null)),x=e.props?a:oT(a)}}catch(y){oa.length=0,Zu(y,n,1),m=on(oo)}let v=m;if(x&&_!==!1){const y=Object.keys(x),{shapeFlag:w}=v;y.length&&w&7&&(r&&y.some(ap)&&(x=aT(x,r)),v=pr(v,x,!1,!0))}return t.dirs&&(v=pr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(t.dirs):t.dirs),t.transition&&wa(v,t.transition),m=v,Gc(g),m}const oT=n=>{let e;for(const t in n)(t==="class"||t==="style"||Wu(t))&&((e||(e={}))[t]=n[t]);return e},aT=(n,e)=>{const t={};for(const i in n)(!ap(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function lT(n,e,t){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?hg(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let h=0;hn.__isSuspense;function uT(n,e){e&&e.pendingBranch?Ve(n)?e.effects.push(...n):e.effects.push(n):gE(n)}const mn=Symbol.for("v-fgt"),th=Symbol.for("v-txt"),oo=Symbol.for("v-cmt"),Jh=Symbol.for("v-stc"),oa=[];let Nn=null;function Fi(n=!1){oa.push(Nn=n?null:[])}function hT(){oa.pop(),Nn=oa[oa.length-1]||null}let Aa=1;function fg(n,e=!1){Aa+=n,n<0&&Nn&&e&&(Nn.hasOnce=!0)}function fT(n){return n.dynamicChildren=Aa>0?Nn||eo:null,hT(),Aa>0&&Nn&&Nn.push(n),n}function Bi(n,e,t,i,s,r){return fT(Dt(n,e,t,i,s,r,!0))}function qc(n){return n?n.__v_isVNode===!0:!1}function jr(n,e){return n.type===e.type&&n.key===e.key}const Ty=({key:n})=>n??null,Tc=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ot(n)||Bt(n)||$e(n)?{i:vn,r:n,k:e,f:!!t}:n:null);function Dt(n,e=null,t=null,i=0,s=null,r=n===mn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Ty(e),ref:e&&Tc(e),scopeId:Qv,slotScopeIds:null,children:t,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:vn};return a?(Mp(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=Ot(t)?8:16),Aa>0&&!o&&Nn&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&Nn.push(l),l}const on=dT;function dT(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===DE)&&(n=oo),qc(n)){const a=pr(n,e,!0);return t&&Mp(a,t),Aa>0&&!r&&Nn&&(a.shapeFlag&6?Nn[Nn.indexOf(n)]=a:Nn.push(a)),a.patchFlag=-2,a}if(ST(n)&&(n=n.__vccOpts),e){e=pT(e);let{class:a,style:l}=e;a&&!Ot(a)&&(e.class=Ja(a)),St(l)&&(_p(l)&&!Ve(l)&&(l=Ht({},l)),e.style=Yu(l))}const o=Ot(n)?1:Ey(n)?128:yE(n)?64:St(n)?4:$e(n)?2:0;return Dt(n,e,t,i,s,o,r,!0)}function pT(n){return n?_p(n)||fy(n)?Ht({},n):n:null}function pr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?gT(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&Ty(c),ref:e&&e.ref?t&&r?Ve(r)?r.concat(Tc(e)):[r,Tc(e)]:Tc(e):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:e&&n.type!==mn?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&&pr(n.ssContent),ssFallback:n.ssFallback&&pr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&wa(u,l.clone(u)),u}function mT(n=" ",e=0){return on(th,null,n,e)}function gi(n){return n==null||typeof n=="boolean"?on(oo):Ve(n)?on(mn,null,n.slice()):qc(n)?us(n):on(th,null,String(n))}function us(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:pr(n)}function Mp(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Ve(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),Mp(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!fy(e)?e._ctx=vn:s===3&&vn&&(vn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else $e(e)?(e={default:e,_ctx:vn},t=32):(e=String(e),i&64?(t=16,e=[mT(e)]):t=8);n.children=e,n.shapeFlag|=t}function gT(...n){const e={};for(let t=0;tqt||vn;let jc,gd;{const n=ju(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};jc=e("__VUE_INSTANCE_SETTERS__",t=>qt=t),gd=e("__VUE_SSR_SETTERS__",t=>Ca=t)}const el=n=>{const e=qt;return jc(n),n.scope.on(),()=>{n.scope.off(),jc(e)}},dg=()=>{qt&&qt.scope.off(),jc(null)};function wy(n){return n.vnode.shapeFlag&4}let Ca=!1;function xT(n,e=!1,t=!1){e&&gd(e);const{props:i,children:s}=n.vnode,r=wy(n);qE(n,i,r,e),KE(n,s,t);const o=r?bT(n,e):void 0;return e&&gd(!1),o}function bT(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,FE);const{setup:i}=t;if(i){Ss();const s=n.setupContext=i.length>1?Cy(n):null,r=el(n),o=Qa(i,n,0,[n.props,s]),a=Ev(o);if(Es(),r(),(a||n.sp)&&!ia(n)&&ty(n),a){if(o.then(dg,dg),e)return o.then(l=>{pg(n,l)}).catch(l=>{Zu(l,n,0)});n.asyncDep=o}else pg(n,o)}else Ay(n)}function pg(n,e,t){$e(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:St(e)&&(n.setupState=jv(e)),Ay(n)}function Ay(n,e,t){const i=n.type;n.render||(n.render=i.render||vi);{const s=el(n);Ss();try{kE(n)}finally{Es(),s()}}}const MT={get(n,e){return sn(n,"get",""),n[e]}};function Cy(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,MT),slots:n.slots,emit:n.emit,expose:e}}function nh(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(jv(nE(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in sa)return sa[t](n)},has(e,t){return t in e||t in sa}})):n.proxy}function ST(n){return $e(n)&&"__vccOpts"in n}const bt=(n,e)=>hE(n,e,Ca);function Yc(n,e,t){const i=arguments.length;return i===2?St(e)&&!Ve(e)?qc(e)?on(n,null,[e]):on(n,e):on(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&qc(t)&&(t=[t]),on(n,e,t))}const ET="3.5.13";/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let _d;const mg=typeof window<"u"&&window.trustedTypes;if(mg)try{_d=mg.createPolicy("vue",{createHTML:n=>n})}catch{}const Ry=_d?n=>_d.createHTML(n):n=>n,TT="http://www.w3.org/2000/svg",wT="http://www.w3.org/1998/Math/MathML",Ni=typeof document<"u"?document:null,gg=Ni&&Ni.createElement("template"),AT={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?Ni.createElementNS(TT,n):e==="mathml"?Ni.createElementNS(wT,n):t?Ni.createElement(n,{is:t}):Ni.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>Ni.createTextNode(n),createComment:n=>Ni.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Ni.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{gg.innerHTML=Ry(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=gg.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},es="transition",Oo="animation",ao=Symbol("_vtc"),Iy={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},CT=Ht({},bE,Iy),Ds=(n,e=[])=>{Ve(n)?n.forEach(t=>t(...e)):n&&n(...e)},_g=n=>n?Ve(n)?n.some(e=>e.length>1):n.length>1:!1;function RT(n){const e={};for(const N in n)N in Iy||(e[N]=n[N]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:h=`${t}-leave-from`,leaveActiveClass:f=`${t}-leave-active`,leaveToClass:d=`${t}-leave-to`}=n,p=IT(s),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:x,onEnterCancelled:v,onLeave:y,onLeaveCancelled:w,onBeforeAppear:A=m,onAppear:C=x,onAppearCancelled:I=v}=e,b=(N,B,K,J)=>{N._enterCancelled=J,ls(N,B?u:a),ls(N,B?c:o),K&&K()},M=(N,B)=>{N._isLeaving=!1,ls(N,h),ls(N,d),ls(N,f),B&&B()},L=N=>(B,K)=>{const J=N?C:x,k=()=>b(B,N,K);Ds(J,[B,k]),vg(()=>{ls(B,N?l:r),di(B,N?u:a),_g(J)||yg(B,i,_,k)})};return Ht(e,{onBeforeEnter(N){Ds(m,[N]),di(N,r),di(N,o)},onBeforeAppear(N){Ds(A,[N]),di(N,l),di(N,c)},onEnter:L(!1),onAppear:L(!0),onLeave(N,B){N._isLeaving=!0;const K=()=>M(N,B);di(N,h),N._enterCancelled?(di(N,f),vd()):(vd(),di(N,f)),vg(()=>{N._isLeaving&&(ls(N,h),di(N,d),_g(y)||yg(N,i,g,K))}),Ds(y,[N,K])},onEnterCancelled(N){b(N,!1,void 0,!0),Ds(v,[N])},onAppearCancelled(N){b(N,!0,void 0,!0),Ds(I,[N])},onLeaveCancelled(N){M(N),Ds(w,[N])}})}function IT(n){if(n==null)return null;if(St(n))return[Qh(n.enter),Qh(n.leave)];{const e=Qh(n);return[e,e]}}function Qh(n){return CS(n)}function di(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[ao]||(n[ao]=new Set)).add(e)}function ls(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[ao];t&&(t.delete(e),t.size||(n[ao]=void 0))}function vg(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let PT=0;function yg(n,e,t,i){const s=n._endId=++PT,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=Py(n,e);if(!o)return i();const c=o+"end";let u=0;const h=()=>{n.removeEventListener(c,f),r()},f=d=>{d.target===n&&++u>=l&&h()};setTimeout(()=>{u(t[p]||"").split(", "),s=i(`${es}Delay`),r=i(`${es}Duration`),o=xg(s,r),a=i(`${Oo}Delay`),l=i(`${Oo}Duration`),c=xg(a,l);let u=null,h=0,f=0;e===es?o>0&&(u=es,h=o,f=r.length):e===Oo?c>0&&(u=Oo,h=c,f=l.length):(h=Math.max(o,c),u=h>0?o>c?es:Oo:null,f=u?u===es?r.length:l.length:0);const d=u===es&&/\b(transform|all)(,|$)/.test(i(`${es}Property`).toString());return{type:u,timeout:h,propCount:f,hasTransform:d}}function xg(n,e){for(;n.lengthbg(t)+bg(n[i])))}function bg(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function vd(){return document.body.offsetHeight}function LT(n,e,t){const i=n[ao];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Mg=Symbol("_vod"),DT=Symbol("_vsh"),OT=Symbol(""),UT=/(^|;)\s*display\s*:/;function NT(n,e,t){const i=n.style,s=Ot(t);let r=!1;if(t&&!s){if(e)if(Ot(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&wc(i,a,"")}else for(const o in e)t[o]==null&&wc(i,o,"");for(const o in t)o==="display"&&(r=!0),wc(i,o,t[o])}else if(s){if(e!==t){const o=i[OT];o&&(t+=";"+o),i.cssText=t,r=UT.test(t)}}else e&&n.removeAttribute("style");Mg in n&&(n[Mg]=r?i.display:"",n[DT]&&(i.display="none"))}const Sg=/\s*!important$/;function wc(n,e,t){if(Ve(t))t.forEach(i=>wc(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=FT(n,e);Sg.test(t)?n.setProperty(br(i),t.replace(Sg,""),"important"):n[i]=t}}const Eg=["Webkit","Moz","ms"],ef={};function FT(n,e){const t=ef[e];if(t)return t;let i=Si(e);if(i!=="filter"&&i in n)return ef[e]=i;i=up(i);for(let s=0;stf||(HT.then(()=>tf=0),tf=Date.now());function WT(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;ri(XT(i,t.value),e,5,[i])};return t.value=n,t.attached=GT(),t}function XT(n,e){if(Ve(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const Ig=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,qT=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?LT(n,i,o):e==="style"?NT(n,t,i):Wu(e)?ap(e)||zT(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):jT(n,e,i,o))?(Ag(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&wg(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Ot(i))?Ag(n,Si(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),wg(n,e,i,o))};function jT(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&Ig(e)&&$e(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ig(e)&&Ot(t)?!1:e in n}const Ly=new WeakMap,Dy=new WeakMap,$c=Symbol("_moveCb"),Pg=Symbol("_enterCb"),YT=n=>(delete n.props.mode,n),$T=YT({name:"TransitionGroup",props:Ht({},CT,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=ji(),i=xE();let s,r;return sy(()=>{if(!s.length)return;const o=n.moveClass||`${n.name||"v"}-move`;if(!ew(s[0].el,t.vnode.el,o))return;s.forEach(ZT),s.forEach(JT);const a=s.filter(QT);vd(),a.forEach(l=>{const c=l.el,u=c.style;di(c,o),u.transform=u.webkitTransform=u.transitionDuration="";const h=c[$c]=f=>{f&&f.target!==c||(!f||/transform$/.test(f.propertyName))&&(c.removeEventListener("transitionend",h),c[$c]=null,ls(c,o))};c.addEventListener("transitionend",h)})}),()=>{const o=nt(n),a=RT(o);let l=o.tag||mn;if(s=[],r)for(let c=0;c{a.split(/\s+/).forEach(l=>l&&i.classList.remove(l))}),t.split(/\s+/).forEach(a=>a&&i.classList.add(a)),i.style.display="none";const r=e.nodeType===1?e:e.parentNode;r.appendChild(i);const{hasTransform:o}=Py(i);return r.removeChild(i),o}const tw=Ht({patchProp:qT},AT);let Lg;function nw(){return Lg||(Lg=yy(tw))}const iw=(...n)=>{const e=nw().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=rw(i);if(!s)return;const r=e._component;!$e(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,sw(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function sw(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function rw(n){return Ot(n)?document.querySelector(n):n}/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */const tl="176",ow={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},aw={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Oy=0,yd=1,Uy=2,lw=3,cw=0,Sp=1,Ep=2,mi=3,Yi=0,xn=1,ti=2,yi=0,lr=1,Kc=2,xd=3,bd=4,Ny=5,fs=100,Fy=101,By=102,ky=103,zy=104,Vy=200,Hy=201,Gy=202,Wy=203,Zc=204,Jc=205,Xy=206,qy=207,jy=208,Yy=209,$y=210,Ky=211,Zy=212,Jy=213,Qy=214,Qc=0,eu=1,tu=2,mr=3,nu=4,iu=5,su=6,ru=7,nl=0,ex=1,tx=2,xi=0,Tp=1,wp=2,Ap=3,So=4,Cp=5,Rp=6,Ip=7,Md="attached",nx="detached",ih=300,$i=301,vs=302,Ra=303,Ia=304,Eo=306,Pa=1e3,Xn=1001,La=1002,Kt=1003,Pp=1004,uw=1004,Yr=1005,hw=1005,zt=1006,aa=1007,fw=1007,_i=1008,dw=1008,oi=1009,Lp=1010,Dp=1011,lo=1012,sh=1013,Ki=1014,An=1015,bi=1016,rh=1017,oh=1018,co=1020,Op=35902,Up=1021,Np=1022,yn=1023,uo=1026,ho=1027,ah=1028,il=1029,Fp=1030,lh=1031,pw=1032,ch=1033,la=33776,ca=33777,ua=33778,ha=33779,ou=35840,au=35841,lu=35842,cu=35843,uu=36196,hu=37492,fu=37496,du=37808,pu=37809,mu=37810,gu=37811,_u=37812,vu=37813,yu=37814,xu=37815,bu=37816,Mu=37817,Su=37818,Eu=37819,Tu=37820,wu=37821,fa=36492,Au=36494,Cu=36495,Bp=36283,Ru=36284,Iu=36285,Pu=36286,ix=2200,sx=2201,rx=2202,Da=2300,Lu=2301,Ac=2302,er=2400,tr=2401,Oa=2402,uh=2500,kp=2501,mw=0,gw=1,_w=2,ox=3200,ax=3201,vw=3202,yw=3203,ws=0,lx=1,Vi="",nn="srgb",gr="srgb-linear",Ua="linear",ht="srgb",xw=0,Ks=7680,bw=7681,Mw=7682,Sw=7683,Ew=34055,Tw=34056,ww=5386,Aw=512,Cw=513,Rw=514,Iw=515,Pw=516,Lw=517,Dw=518,Sd=519,cx=512,ux=513,hx=514,zp=515,fx=516,dx=517,px=518,mx=519,Na=35044,Ow=35048,Uw=35040,Nw=35045,Fw=35049,Bw=35041,kw=35046,zw=35050,Vw=35042,Hw="100",Ed="300 es",qn=2e3,Fa=2001,Gw={COMPUTE:"compute",RENDER:"render"},Ww={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},Xw={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FLAT_FIRST:"flat first",FLAT_EITHER:"flat either"};class Ei{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const s=i[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+Qt[n>>16&255]+Qt[n>>24&255]+"-"+Qt[e&255]+Qt[e>>8&255]+"-"+Qt[e>>16&15|64]+Qt[e>>24&255]+"-"+Qt[t&63|128]+Qt[t>>8&255]+"-"+Qt[t>>16&255]+Qt[t>>24&255]+Qt[i&255]+Qt[i>>8&255]+Qt[i>>16&255]+Qt[i>>24&255]).toLowerCase()}function qe(n,e,t){return Math.max(e,Math.min(t,n))}function Vp(n,e){return(n%e+e)%e}function qw(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function jw(n,e,t){return n!==e?(t-n)/(e-n):0}function da(n,e,t){return(1-t)*n+t*e}function Yw(n,e,t,i){return da(n,e,1-Math.exp(-t*i))}function $w(n,e=1){return e-Math.abs(Vp(n,e*2)-e)}function Kw(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Zw(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Jw(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Qw(n,e){return n+Math.random()*(e-n)}function eA(n){return n*(.5-Math.random())}function tA(n){n!==void 0&&(Dg=n);let e=Dg+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function nA(n){return n*cr}function iA(n){return n*fo}function sA(n){return(n&n-1)===0&&n!==0}function rA(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function oA(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function aA(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),u=o((e+i)/2),h=r((e-i)/2),f=o((e-i)/2),d=r((i-e)/2),p=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*h,l*f,a*c);break;case"YZY":n.set(l*f,a*u,l*h,a*c);break;case"ZXZ":n.set(l*h,l*f,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*d,a*c);break;case"YXY":n.set(l*d,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*d,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function _n(n,e){switch(e.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 Ze(n,e){switch(e.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 Hp={DEG2RAD:cr,RAD2DEG:fo,generateUUID:Fn,clamp:qe,euclideanModulo:Vp,mapLinear:qw,inverseLerp:jw,lerp:da,damp:Yw,pingpong:$w,smoothstep:Kw,smootherstep:Zw,randInt:Jw,randFloat:Qw,randFloatSpread:eA,seededRandom:tA,degToRad:nA,radToDeg:iA,isPowerOfTwo:sA,ceilPowerOfTwo:rA,floorPowerOfTwo:oA,setQuaternionFromProperEuler:aA,normalize:Ze,denormalize:_n};class oe{constructor(e=0,t=0){oe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=qe(this.x,e.x,t.x),this.y=qe(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=qe(this.x,e,t),this.y=qe(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(qe(i,e,t))}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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(qe(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ye{constructor(e,t,i,s,r,o,a,l,c){Ye.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c)}set(e,t,i,s,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,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(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],f=i[2],d=i[5],p=i[8],_=s[0],g=s[3],m=s[6],x=s[1],v=s[4],y=s[7],w=s[2],A=s[5],C=s[8];return r[0]=o*_+a*x+l*w,r[3]=o*g+a*v+l*A,r[6]=o*m+a*y+l*C,r[1]=c*_+u*x+h*w,r[4]=c*g+u*v+h*A,r[7]=c*m+u*y+h*C,r[2]=f*_+d*x+p*w,r[5]=f*g+d*v+p*A,r[8]=f*m+d*y+p*C,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,f=a*l-u*r,d=c*r-o*l,p=t*h+i*f+s*d;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=h*_,e[1]=(s*c-u*i)*_,e[2]=(a*i-s*o)*_,e[3]=f*_,e[4]=(u*t-s*l)*_,e[5]=(s*r-a*t)*_,e[6]=d*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,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+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(nf.makeScale(e,t)),this}rotate(e){return this.premultiply(nf.makeRotation(-e)),this}translate(e,t){return this.premultiply(nf.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const nf=new Ye;function gx(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const lA={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function $r(n,e){return new lA[n](e)}function Ba(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function _x(){const n=Ba("canvas");return n.style.display="block",n}const Og={};function Cc(n){n in Og||(Og[n]=!0,console.warn(n))}function cA(n,e,t){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}function uA(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function hA(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const Ug=new Ye().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ng=new Ye().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function fA(){const n={enabled:!0,workingColorSpace:gr,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===ht&&(s.r=Wi(s.r),s.g=Wi(s.g),s.b=Wi(s.b)),this.spaces[r].primaries!==this.spaces[o].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===ht&&(s.r=so(s.r),s.g=so(s.g),s.b=so(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Vi?Ua:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,o){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[gr]:{primaries:e,whitePoint:i,transfer:Ua,toXYZ:Ug,fromXYZ:Ng,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:nn},outputColorSpaceConfig:{drawingBufferColorSpace:nn}},[nn]:{primaries:e,whitePoint:i,transfer:ht,toXYZ:Ug,fromXYZ:Ng,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:nn}}}),n}const tt=fA();function Wi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function so(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Cr;class vx{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Cr===void 0&&(Cr=Ba("canvas")),Cr.width=e.width,Cr.height=e.height;const s=Cr.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),i=Cr}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Ba("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ih)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Pa:e.x=e.x-Math.floor(e.x);break;case Xn:e.x=e.x<0?0:1;break;case La:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Pa:e.y=e.y-Math.floor(e.y);break;case Xn:e.y=e.y<0?0:1;break;case La:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Pt.DEFAULT_IMAGE=null;Pt.DEFAULT_MAPPING=ih;Pt.DEFAULT_ANISOTROPY=1;class at{constructor(e=0,t=0,i=0,s=1){at.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],d=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(c+1)/2,y=(d+1)/2,w=(m+1)/2,A=(u+f)/4,C=(h+_)/4,I=(p+g)/4;return v>y&&v>w?v<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(v),s=A/i,r=C/i):y>w?y<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(y),i=A/s,r=I/s):w<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(w),i=C/r,s=I/r),this.set(i,s,r,t),this}let x=Math.sqrt((g-p)*(g-p)+(h-_)*(h-_)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-p)/x,this.y=(h-_)/x,this.z=(f-u)/x,this.w=Math.acos((c+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=qe(this.x,e.x,t.x),this.y=qe(this.y,e.y,t.y),this.z=qe(this.z,e.z,t.z),this.w=qe(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=qe(this.x,e,t),this.y=qe(this.y,e,t),this.z=qe(this.z,e,t),this.w=qe(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(qe(i,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class hh extends Ei{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth?i.depth:1,this.scissor=new at(0,0,e,t),this.scissorTest=!1,this.viewport=new at(0,0,e,t);const s={width:e,height:t,depth:this.depth};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},i);const r=new Pt(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,v=1-m*m;if(v>Number.EPSILON){const w=Math.sqrt(v),A=Math.atan2(w,m*x);g=Math.sin(g*A)/w,a=Math.sin(a*A)/w}const y=a*x;if(l=l*g+f*y,c=c*g+d*y,u=u*g+p*y,h=h*g+_*y,g===1-a){const w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],h=r[o],f=r[o+1],d=r[o+2],p=r[o+3];return e[t]=a*p+u*h+l*d-c*f,e[t+1]=l*p+u*f+c*h-a*d,e[t+2]=c*p+u*d+a*f-l*h,e[t+3]=u*p-a*h-l*f-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),h=a(r/2),f=l(i/2),d=l(s/2),p=l(r/2);switch(o){case"XYZ":this._x=f*u*h+c*d*p,this._y=c*d*h-f*u*p,this._z=c*u*p+f*d*h,this._w=c*u*h-f*d*p;break;case"YXZ":this._x=f*u*h+c*d*p,this._y=c*d*h-f*u*p,this._z=c*u*p-f*d*h,this._w=c*u*h+f*d*p;break;case"ZXY":this._x=f*u*h-c*d*p,this._y=c*d*h+f*u*p,this._z=c*u*p+f*d*h,this._w=c*u*h-f*d*p;break;case"ZYX":this._x=f*u*h-c*d*p,this._y=c*d*h+f*u*p,this._z=c*u*p-f*d*h,this._w=c*u*h+f*d*p;break;case"YZX":this._x=f*u*h+c*d*p,this._y=c*d*h+f*u*p,this._z=c*u*p-f*d*h,this._w=c*u*h-f*d*p;break;case"XZY":this._x=f*u*h-c*d*p,this._y=c*d*h-f*u*p,this._z=c*u*p+f*d*h,this._w=c*u*h+f*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=i+a+h;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(u-l)*d,this._y=(r-c)*d,this._z=(o-s)*d}else if(i>a&&i>h){const d=2*Math.sqrt(1+i-a-h);this._w=(u-l)/d,this._x=.25*d,this._y=(s+o)/d,this._z=(r+c)/d}else if(a>h){const d=2*Math.sqrt(1+a-i-h);this._w=(r-c)/d,this._x=(s+o)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+h-i-a);this._w=(o-s)/d,this._x=(r+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(qe(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._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(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const d=1-t;return this._w=d*o+t*this._w,this._x=d*i+t*this._x,this._y=d*s+t*this._y,this._z=d*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,f=Math.sin(t*u)/c;return this._w=o*h+this._w*f,this._x=i*h+this._x*f,this._y=s*h+this._y*f,this._z=r*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class P{constructor(e=0,t=0,i=0){P.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Fg.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Fg.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*s-a*i),u=2*(a*t-r*s),h=2*(r*i-o*t);return this.x=t+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(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=qe(this.x,e.x,t.x),this.y=qe(this.y,e.y,t.y),this.z=qe(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=qe(this.x,e,t),this.y=qe(this.y,e,t),this.z=qe(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(qe(i,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return rf.copy(this).projectOnVector(e),this.sub(rf)}reflect(e){return this.sub(rf.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(qe(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const rf=new P,Fg=new Rn;class an{constructor(e=new P(1/0,1/0,1/0),t=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Zn),Zn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Uo),Rl.subVectors(this.max,Uo),Rr.subVectors(e.a,Uo),Ir.subVectors(e.b,Uo),Pr.subVectors(e.c,Uo),ts.subVectors(Ir,Rr),ns.subVectors(Pr,Ir),Os.subVectors(Rr,Pr);let t=[0,-ts.z,ts.y,0,-ns.z,ns.y,0,-Os.z,Os.y,ts.z,0,-ts.x,ns.z,0,-ns.x,Os.z,0,-Os.x,-ts.y,ts.x,0,-ns.y,ns.x,0,-Os.y,Os.x,0];return!of(t,Rr,Ir,Pr,Rl)||(t=[1,0,0,0,1,0,0,0,1],!of(t,Rr,Ir,Pr,Rl))?!1:(Il.crossVectors(ts,ns),t=[Il.x,Il.y,Il.z],of(t,Rr,Ir,Pr,Rl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Zn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Zn).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ii[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ii[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ii[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ii[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ii[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ii[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ii[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ii[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ii),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ii=[new P,new P,new P,new P,new P,new P,new P,new P],Zn=new P,Cl=new an,Rr=new P,Ir=new P,Pr=new P,ts=new P,ns=new P,Os=new P,Uo=new P,Rl=new P,Il=new P,Us=new P;function of(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Us.fromArray(n,r);const a=s.x*Math.abs(Us.x)+s.y*Math.abs(Us.y)+s.z*Math.abs(Us.z),l=e.dot(Us),c=t.dot(Us),u=i.dot(Us);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const _A=new an,No=new P,af=new P;class Zt{constructor(e=new P,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):_A.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;No.subVectors(e,this.center);const t=No.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(No,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(af.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(No.copy(e.center).add(af)),this.expandByPoint(No.copy(e.center).sub(af))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Pi=new P,lf=new P,Pl=new P,is=new P,cf=new P,Ll=new P,uf=new P;class To{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Pi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Pi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Pi.copy(this.origin).addScaledVector(this.direction,t),Pi.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){lf.copy(e).add(t).multiplyScalar(.5),Pl.copy(t).sub(e).normalize(),is.copy(this.origin).sub(lf);const r=e.distanceTo(t)*.5,o=-this.direction.dot(Pl),a=is.dot(this.direction),l=-is.dot(Pl),c=is.lengthSq(),u=Math.abs(1-o*o);let h,f,d,p;if(u>0)if(h=o*l-a,f=o*a-l,p=r*u,h>=0)if(f>=-p)if(f<=p){const _=1/u;h*=_,f*=_,d=h*(h+o*f+2*a)+f*(o*h+f+2*l)+c}else f=r,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;else f=-r,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;else f<=-p?(h=Math.max(0,-(-o*r+a)),f=h>0?-r:Math.min(Math.max(-r,-l),r),d=-h*h+f*(f+2*l)+c):f<=p?(h=0,f=Math.min(Math.max(-r,-l),r),d=f*(f+2*l)+c):(h=Math.max(0,-(o*r+a)),f=h>0?r:Math.min(Math.max(-r,-l),r),d=-h*h+f*(f+2*l)+c);else f=o>0?-r:r,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),s&&s.copy(lf).addScaledVector(Pl,f),d}intersectSphere(e,t){Pi.subVectors(e.center,this.origin);const i=Pi.dot(this.direction),s=Pi.dot(Pi)-i*i,r=e.radius*e.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,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,s=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,s=(e.min.x-f.x)*c),u>=0?(r=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(r=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(a=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,Pi)!==null}intersectTriangle(e,t,i,s,r){cf.subVectors(t,e),Ll.subVectors(i,e),uf.crossVectors(cf,Ll);let o=this.direction.dot(uf),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;is.subVectors(this.origin,e);const l=a*this.direction.dot(Ll.crossVectors(is,Ll));if(l<0)return null;const c=a*this.direction.dot(cf.cross(is));if(c<0||l+c>o)return null;const u=-a*is.dot(uf);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ke{constructor(e,t,i,s,r,o,a,l,c,u,h,f,d,p,_,g){ke.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c,u,h,f,d,p,_,g)}set(e,t,i,s,r,o,a,l,c,u,h,f,d,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=s,m[1]=r,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=d,m[7]=p,m[11]=_,m[15]=g,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 ke().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/Lr.setFromMatrixColumn(e,0).length(),r=1/Lr.setFromMatrixColumn(e,1).length(),o=1/Lr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.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(e.order==="XYZ"){const f=o*u,d=o*h,p=a*u,_=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=d+p*c,t[5]=f-_*c,t[9]=-a*l,t[2]=_-f*c,t[6]=p+d*c,t[10]=o*l}else if(e.order==="YXZ"){const f=l*u,d=l*h,p=c*u,_=c*h;t[0]=f+_*a,t[4]=p*a-d,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=d*a-p,t[6]=_+f*a,t[10]=o*l}else if(e.order==="ZXY"){const f=l*u,d=l*h,p=c*u,_=c*h;t[0]=f-_*a,t[4]=-o*h,t[8]=p+d*a,t[1]=d+p*a,t[5]=o*u,t[9]=_-f*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const f=o*u,d=o*h,p=a*u,_=a*h;t[0]=l*u,t[4]=p*c-d,t[8]=f*c+_,t[1]=l*h,t[5]=_*c+f,t[9]=d*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const f=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=_-f*h,t[8]=p*h+d,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=d*h+p,t[10]=f-_*h}else if(e.order==="XZY"){const f=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+_,t[5]=o*u,t[9]=d*h-p,t[2]=p*h-d,t[6]=a*u,t[10]=_*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(vA,e,yA)}lookAt(e,t,i){const s=this.elements;return Ln.subVectors(e,t),Ln.lengthSq()===0&&(Ln.z=1),Ln.normalize(),ss.crossVectors(i,Ln),ss.lengthSq()===0&&(Math.abs(i.z)===1?Ln.x+=1e-4:Ln.z+=1e-4,Ln.normalize(),ss.crossVectors(i,Ln)),ss.normalize(),Dl.crossVectors(Ln,ss),s[0]=ss.x,s[4]=Dl.x,s[8]=Ln.x,s[1]=ss.y,s[5]=Dl.y,s[9]=Ln.y,s[2]=ss.z,s[6]=Dl.z,s[10]=Ln.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],f=i[9],d=i[13],p=i[2],_=i[6],g=i[10],m=i[14],x=i[3],v=i[7],y=i[11],w=i[15],A=s[0],C=s[4],I=s[8],b=s[12],M=s[1],L=s[5],N=s[9],B=s[13],K=s[2],J=s[6],k=s[10],re=s[14],Y=s[3],he=s[7],me=s[11],ee=s[15];return r[0]=o*A+a*M+l*K+c*Y,r[4]=o*C+a*L+l*J+c*he,r[8]=o*I+a*N+l*k+c*me,r[12]=o*b+a*B+l*re+c*ee,r[1]=u*A+h*M+f*K+d*Y,r[5]=u*C+h*L+f*J+d*he,r[9]=u*I+h*N+f*k+d*me,r[13]=u*b+h*B+f*re+d*ee,r[2]=p*A+_*M+g*K+m*Y,r[6]=p*C+_*L+g*J+m*he,r[10]=p*I+_*N+g*k+m*me,r[14]=p*b+_*B+g*re+m*ee,r[3]=x*A+v*M+y*K+w*Y,r[7]=x*C+v*L+y*J+w*he,r[11]=x*I+v*N+y*k+w*me,r[15]=x*b+v*B+y*re+w*ee,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],d=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+r*l*h-s*c*h-r*a*f+i*c*f+s*a*d-i*l*d)+_*(+t*l*d-t*c*f+r*o*f-s*o*d+s*c*u-r*l*u)+g*(+t*c*h-t*a*d-r*o*h+i*o*d+r*a*u-i*c*u)+m*(-s*a*u-t*l*h+t*a*f+s*o*h-i*o*f+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],_=e[13],g=e[14],m=e[15],x=h*g*c-_*f*c+_*l*d-a*g*d-h*l*m+a*f*m,v=p*f*c-u*g*c-p*l*d+o*g*d+u*l*m-o*f*m,y=u*_*c-p*h*c+p*a*d-o*_*d-u*a*m+o*h*m,w=p*h*l-u*_*l-p*a*f+o*_*f+u*a*g-o*h*g,A=t*x+i*v+s*y+r*w;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/A;return e[0]=x*C,e[1]=(_*f*r-h*g*r-_*s*d+i*g*d+h*s*m-i*f*m)*C,e[2]=(a*g*r-_*l*r+_*s*c-i*g*c-a*s*m+i*l*m)*C,e[3]=(h*l*r-a*f*r-h*s*c+i*f*c+a*s*d-i*l*d)*C,e[4]=v*C,e[5]=(u*g*r-p*f*r+p*s*d-t*g*d-u*s*m+t*f*m)*C,e[6]=(p*l*r-o*g*r-p*s*c+t*g*c+o*s*m-t*l*m)*C,e[7]=(o*f*r-u*l*r+u*s*c-t*f*c-o*s*d+t*l*d)*C,e[8]=y*C,e[9]=(p*h*r-u*_*r-p*i*d+t*_*d+u*i*m-t*h*m)*C,e[10]=(o*_*r-p*a*r+p*i*c-t*_*c-o*i*m+t*a*m)*C,e[11]=(u*a*r-o*h*r-u*i*c+t*h*c+o*i*d-t*a*d)*C,e[12]=w*C,e[13]=(u*_*s-p*h*s+p*i*f-t*_*f-u*i*g+t*h*g)*C,e[14]=(p*a*s-o*_*s-p*i*l+t*_*l+o*i*g-t*a*g)*C,e[15]=(o*h*s-u*a*s+u*i*l-t*h*l-o*i*f+t*a*f)*C,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.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(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,u=o+o,h=a+a,f=r*c,d=r*u,p=r*h,_=o*u,g=o*h,m=a*h,x=l*c,v=l*u,y=l*h,w=i.x,A=i.y,C=i.z;return s[0]=(1-(_+m))*w,s[1]=(d+y)*w,s[2]=(p-v)*w,s[3]=0,s[4]=(d-y)*A,s[5]=(1-(f+m))*A,s[6]=(g+x)*A,s[7]=0,s[8]=(p+v)*C,s[9]=(g-x)*C,s[10]=(1-(f+_))*C,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=Lr.set(s[0],s[1],s[2]).length();const o=Lr.set(s[4],s[5],s[6]).length(),a=Lr.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],Jn.copy(this);const c=1/r,u=1/o,h=1/a;return Jn.elements[0]*=c,Jn.elements[1]*=c,Jn.elements[2]*=c,Jn.elements[4]*=u,Jn.elements[5]*=u,Jn.elements[6]*=u,Jn.elements[8]*=h,Jn.elements[9]*=h,Jn.elements[10]*=h,t.setFromRotationMatrix(Jn),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=qn){const l=this.elements,c=2*r/(t-e),u=2*r/(i-s),h=(t+e)/(t-e),f=(i+s)/(i-s);let d,p;if(a===qn)d=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===Fa)d=-o/(o-r),p=-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]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=qn){const l=this.elements,c=1/(t-e),u=1/(i-s),h=1/(o-r),f=(t+e)*c,d=(i+s)*u;let p,_;if(a===qn)p=(o+r)*h,_=-2*h;else if(a===Fa)p=r*h,_=-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]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=_,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Lr=new P,Jn=new ke,vA=new P(0,0,0),yA=new P(1,1,1),ss=new P,Dl=new P,Ln=new P,Bg=new ke,kg=new Rn;class Bn{constructor(e=0,t=0,i=0,s=Bn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],h=s[2],f=s[6],d=s[10];switch(t){case"XYZ":this._y=Math.asin(qe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-qe(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(qe(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-qe(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(qe(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,d));break;case"XZY":this._z=Math.asin(-qe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Bg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Bg,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return kg.setFromEuler(this),this.setFromQuaternion(kg,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Bn.DEFAULT_ORDER="XYZ";class rl{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){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.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?{min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}:void 0,boundingSphere:a.boundingSphere?{radius:a.boundingSphere.radius,center:a.boundingSphere.center.toArray()}:void 0})),s.instanceInfo=this._instanceInfo.map(a=>({...a})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.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),f.length>0&&(i.skeletons=f),d.length>0&&(i.animations=d),p.length>0&&(i.nodes=p)}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(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Qn.subVectors(s,t),Di.subVectors(i,t),ff.subVectors(e,t);const o=Qn.dot(Qn),a=Qn.dot(Di),l=Qn.dot(ff),c=Di.dot(Di),u=Di.dot(ff),h=o*c-a*a;if(h===0)return r.set(0,0,0),null;const f=1/h,d=(c*l-a*u)*f,p=(o*u-a*l)*f;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,Oi)===null?!1:Oi.x>=0&&Oi.y>=0&&Oi.x+Oi.y<=1}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,Oi)===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,Oi.x),l.addScaledVector(o,Oi.y),l.addScaledVector(a,Oi.z),l)}static getInterpolatedAttribute(e,t,i,s,r,o){return gf.setScalar(0),_f.setScalar(0),vf.setScalar(0),gf.fromBufferAttribute(e,t),_f.fromBufferAttribute(e,i),vf.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(gf,r.x),o.addScaledVector(_f,r.y),o.addScaledVector(vf,r.z),o}static isFrontFacing(e,t,i,s){return Qn.subVectors(i,t),Di.subVectors(e,t),Qn.cross(Di).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Qn.subVectors(this.c,this.b),Di.subVectors(this.a,this.b),Qn.cross(Di).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,s,r){return wn.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return wn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Ur.subVectors(s,i),Nr.subVectors(r,i),df.subVectors(e,i);const l=Ur.dot(df),c=Nr.dot(df);if(l<=0&&c<=0)return t.copy(i);pf.subVectors(e,s);const u=Ur.dot(pf),h=Nr.dot(pf);if(u>=0&&h<=u)return t.copy(s);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Ur,o);mf.subVectors(e,r);const d=Ur.dot(mf),p=Nr.dot(mf);if(p>=0&&d<=p)return t.copy(r);const _=d*c-l*p;if(_<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector(Nr,a);const g=u*p-d*h;if(g<=0&&h-u>=0&&d-p>=0)return Xg.subVectors(r,s),a=(h-u)/(h-u+(d-p)),t.copy(s).addScaledVector(Xg,a);const m=1/(g+_+f);return o=_*m,a=f*m,t.copy(i).addScaledVector(Ur,o).addScaledVector(Nr,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const yx={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},rs={h:0,s:0,l:0},Ul={h:0,s:0,l:0};function yf(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class ve{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=nn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,tt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=tt.workingColorSpace){return this.r=e,this.g=t,this.b=i,tt.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=tt.workingColorSpace){if(e=Vp(e,1),t=qe(t,0,1),i=qe(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=yf(o,r,e+1/3),this.g=yf(o,r,e),this.b=yf(o,r,e-1/3)}return tt.toWorkingColorSpace(this,s),this}setStyle(e,t=nn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){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,t);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,t);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,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){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,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=nn){const i=yx[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Wi(e.r),this.g=Wi(e.g),this.b=Wi(e.b),this}copyLinearToSRGB(e){return this.r=so(e.r),this.g=so(e.g),this.b=so(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=nn){return tt.fromWorkingColorSpace(en.copy(this),e),Math.round(qe(en.r*255,0,255))*65536+Math.round(qe(en.g*255,0,255))*256+Math.round(qe(en.b*255,0,255))}getHexString(e=nn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=tt.workingColorSpace){tt.fromWorkingColorSpace(en.copy(this),t);const i=en.r,s=en.g,r=en.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!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' 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[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).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(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).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(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).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!==lr&&(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!==Zc&&(i.blendSrc=this.blendSrc),this.blendDst!==Jc&&(i.blendDst=this.blendDst),this.blendEquation!==fs&&(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!==mr&&(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!==Sd&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ks&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ks&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ks&&(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(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ti extends ln{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ve(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 Bn,this.combine=nl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Hi=TA();function TA(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,r[l]=c|u}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function En(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=qe(n,-65504,65504),Hi.floatView[0]=n;const e=Hi.uint32View[0],t=e>>23&511;return Hi.baseTable[t]+((e&8388607)>>Hi.shiftTable[t])}function $o(n){const e=n>>10;return Hi.uint32View[0]=Hi.mantissaTable[Hi.offsetTable[e]+(n&1023)]+Hi.exponentTable[e],Hi.floatView[0]}class wA{static toHalfFloat(e){return En(e)}static fromHalfFloat(e){return $o(e)}}const Nt=new P,Nl=new oe;let AA=0;class mt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:AA++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Na,this.updateRanges=[],this.gpuType=An,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;st.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new an);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,s=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const s=e.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(t))}const r=e.morphAttributes;for(const c in r){const u=[],h=r[c];for(let f=0,d=h.length;f0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(qg.copy(r).invert(),Ns.copy(e.ray).applyMatrix4(qg),!(i.boundingBox!==null&&Ns.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Ns)))}_computeIntersections(e,t,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,f=r.groups,d=r.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,_=f.length;p<_;p++){const g=f[p],m=o[g.materialIndex],x=Math.max(g.start,d.start),v=Math.min(a.count,Math.min(g.start+g.count,d.start+d.count));for(let y=x,w=v;yt.far?null:{distance:c,point:Hl.clone(),object:n}}function Gl(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,Bl),n.getVertexPosition(l,kl),n.getVertexPosition(c,zl);const u=UA(n,e,t,i,Bl,kl,zl,Yg);if(u){const h=new P;wn.getBarycoord(Yg,Bl,kl,zl,h),s&&(u.uv=wn.getInterpolatedAttribute(s,a,l,c,h,new oe)),r&&(u.uv1=wn.getInterpolatedAttribute(r,a,l,c,h,new oe)),o&&(u.normal=wn.getInterpolatedAttribute(o,a,l,c,h,new P),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new P,materialIndex:0};wn.getNormal(Bl,kl,zl,f.normal),u.face=f,u.barycoord=h}return u}class Mr extends Ke{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,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 f=0,d=0;p("z","y","x",-1,-1,i,t,e,o,r,0),p("z","y","x",1,-1,i,t,-e,o,r,1),p("x","z","y",1,1,e,i,t,s,o,2),p("x","z","y",1,-1,e,i,-t,s,o,3),p("x","y","z",1,-1,e,t,i,s,r,4),p("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new Re(c,3)),this.setAttribute("normal",new Re(u,3)),this.setAttribute("uv",new Re(h,2));function p(_,g,m,x,v,y,w,A,C,I,b){const M=y/C,L=w/I,N=y/2,B=w/2,K=A/2,J=C+1,k=I+1;let re=0,Y=0;const he=new P;for(let me=0;me0?1:-1,u.push(he.x,he.y,he.z),h.push(ge/C),h.push(1-me/I),re+=1}}for(let me=0;me0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class ol extends st{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ke,this.projectionMatrix=new ke,this.projectionMatrixInverse=new ke,this.coordinateSystem=qn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const os=new P,$g=new oe,Kg=new oe;class Ft extends ol{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=fo*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(cr*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return fo*2*Math.atan(Math.tan(cr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){os.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(os.x,os.y).multiplyScalar(-e/os.z),os.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(os.x,os.y).multiplyScalar(-e/os.z)}getViewSize(e,t){return this.getViewBounds(e,$g,Kg),t.subVectors(Kg,$g)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,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=e,this.view.fullHeight=t,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 e=this.near;let t=e*Math.tan(cr*.5*this.fov)/this.zoom,i=2*t,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,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Br=-90,kr=1;class bx extends st{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Ft(Br,kr,e,t);s.layers=this.layers,this.add(s);const r=new Ft(Br,kr,e,t);r.layers=this.layers,this.add(r);const o=new Ft(Br,kr,e,t);o.layers=this.layers,this.add(o);const a=new Ft(Br,kr,e,t);a.layers=this.layers,this.add(a);const l=new Ft(Br,kr,e,t);l.layers=this.layers,this.add(l);const c=new Ft(Br,kr,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const c of t)this.remove(c);if(e===qn)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(e===Fa)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: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,s),e.render(t,u),e.setRenderTarget(h,f,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class al extends Pt{constructor(e=[],t=$i,i,s,r,o,a,l,c,u){super(e,t,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Mx extends Cn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];this.texture=new al(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:zt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new Mr(5,5,5),r=new jt({name:"CubemapFromEquirect",uniforms:po(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:xn,blending:yi});r.uniforms.tEquirect.value=t;const o=new It(s,r),a=t.minFilter;return t.minFilter===_i&&(t.minFilter=zt),new bx(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,i=!0,s=!0){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}class Kr extends st{constructor(){super(),this.isGroup=!0,this.type="Group"}}const kA={type:"move"};class Rc{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Kr,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 Kr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Kr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,i),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),d=.02,p=.005;c.inputState.pinching&&f>d+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=d-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.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=t.getPose(e.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(kA)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Kr;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class dh{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ve(e),this.density=t}clone(){return new dh(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ph{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new ve(e),this.near=t,this.far=i}clone(){return new ph(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class mh extends st{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Bn,this.environmentIntensity=1,this.environmentRotation=new Bn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class gh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Na,this.updateRanges=[],this.version=0,this.uuid=Fn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;se.far||t.push({distance:l,point:ko.clone(),uv:wn.getInterpolation(ko,Wl,Vo,Xl,Zg,Mf,Jg,new oe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function ql(n,e,t,i,s,r){Gr.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(zo.x=r*Gr.x-s*Gr.y,zo.y=s*Gr.x+r*Gr.y):zo.copy(Gr),n.copy(e),n.x+=zo.x,n.y+=zo.y,n.applyMatrix4(Sx)}const jl=new P,Qg=new P;class Tx extends st{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,s=t.length;i0){let i,s;for(i=1,s=t.length;i0){jl.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(jl);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){jl.setFromMatrixPosition(e.matrixWorld),Qg.setFromMatrixPosition(this.matrixWorld);const i=jl.distanceTo(Qg)/e.zoom;t[0].object.visible=!0;let s,r;for(s=1,r=t.length;s=o)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||WA.getNormalMatrix(e),s=this.coplanarPoint(Tf).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Fs=new Zt,Kl=new P;class wo{constructor(e=new hs,t=new hs,i=new hs,s=new hs,r=new hs,o=new hs){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=qn){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],u=s[5],h=s[6],f=s[7],d=s[8],p=s[9],_=s[10],g=s[11],m=s[12],x=s[13],v=s[14],y=s[15];if(i[0].setComponents(l-r,f-c,g-d,y-m).normalize(),i[1].setComponents(l+r,f+c,g+d,y+m).normalize(),i[2].setComponents(l+o,f+u,g+p,y+x).normalize(),i[3].setComponents(l-o,f-u,g-p,y-x).normalize(),i[4].setComponents(l-a,f-h,g-_,y-v).normalize(),t===qn)i[5].setComponents(l+a,f+h,g+_,y+v).normalize();else if(t===Fa)i[5].setComponents(a,h,_,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Fs.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Fs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Fs)}intersectsSprite(e){return Fs.center.set(0,0,0),Fs.radius=.7071067811865476,Fs.applyMatrix4(e.matrixWorld),this.intersectsSphere(Fs)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,Kl.y=s.normal.y>0?e.max.y:e.min.y,Kl.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Kl)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const ci=new ke,ui=new wo;class vh{constructor(){this.coordinateSystem=qn}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=s}reset(){this.list.length=0,this.index=0}}const Sn=new ke,YA=new ve(1,1,1),l_=new wo,$A=new vh,Zl=new an,Bs=new Zt,Wo=new P,c_=new P,KA=new P,Af=new jA,tn=new It,Jl=[];function ZA(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const s=n.count;for(let r=0;r65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new mt(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=e.getAttribute(i),r=t.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new an);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,s=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(wf),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Sn.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const o=this._colorsTexture;return o&&(YA.toArray(o.image.data,s*4),o.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?o.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(wf),l=this._availableGeometryIds.shift(),r[l]=s):(l=this._geometryCount,this._geometryCount++,r.push(s)),this.setGeometryAt(l,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,s=i.getIndex()!==null,r=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(s&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const h=t.getAttribute(u),f=i.getAttribute(u);ZA(h,f,l);const d=h.itemSize;for(let p=h.count,_=c;p<_;p++){const g=l+p;for(let m=0;m=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let s=0,r=i.length;sa).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),r=this.geometry;for(let o=0,a=i.length;o=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const r=new an,o=i.index,a=i.attributes.position;for(let l=s.start,c=s.start+s.count;l=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const r=new Zt;this.getBoundingBoxAt(e,Zl),Zl.getCenter(r.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=s.start,u=s.start+s.count;ca.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Ke,this._initializeGeometry(r));const o=this.geometry;r.index&&ks(r.index.array,o.index.array);for(const a in r.attributes)ks(r.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,o=this.geometry;tn.material=this.material,tn.geometry.index=o.index,tn.geometry.attributes=o.attributes,tn.geometry.boundingBox===null&&(tn.geometry.boundingBox=new an),tn.geometry.boundingSphere===null&&(tn.geometry.boundingSphere=new Zt);for(let a=0,l=i.length;a({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=s.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,h=this._geometryInfo,f=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data,_=i.isArrayCamera?$A:l_;f&&!i.isArrayCamera&&(Sn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),l_.setFromProjectionMatrix(Sn,e.coordinateSystem));let g=0;if(this.sortObjects){Sn.copy(this.matrixWorld).invert(),Wo.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Sn),c_.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Sn);for(let v=0,y=l.length;v0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;Cf.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Cf);if(!(ce.far))return{distance:c,point:h_.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const f_=new P,d_=new P;class wi extends ys{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let s=0,r=t.count;s0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class Px extends Pt{constructor(e,t,i,s,r=zt,o=zt,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1;const u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class JA extends Px{constructor(e,t,i,s,r,o,a,l){super({},e,t,i,s,r,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class QA extends Pt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Kt,this.minFilter=Kt,this.generateMipmaps=!1,this.needsUpdate=!0}}class yh extends Pt{constructor(e,t,i,s,r,o,a,l,c,u,h,f){super(null,o,a,l,c,u,s,r,h,f),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class e1 extends yh{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=Xn,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class t1 extends yh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,$i),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class n1 extends Pt{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class xh extends Pt{constructor(e,t,i=Ki,s,r,o,a=Kt,l=Kt,c,u=uo){if(u!==uo&&u!==ho)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,s,r,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new ds(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class i1 extends xh{constructor(e=1,t=1,i=1){super(e,t),this.isDepthArrayTexture=!0,this.image={width:e,height:t,depth:i},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class bh extends Ke{constructor(e=1,t=1,i=4,s=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:s,heightSegments:r},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),s=Math.max(3,Math.floor(s)),r=Math.max(1,Math.floor(r));const o=[],a=[],l=[],c=[],u=t/2,h=Math.PI/2*e,f=t,d=2*h+f,p=i*2+r,_=s+1,g=new P,m=new P;for(let x=0;x<=p;x++){let v=0,y=0,w=0,A=0;if(x<=i){const b=x/i,M=b*Math.PI/2;y=-u-e*Math.cos(M),w=e*Math.sin(M),A=-e*Math.cos(M),v=b*h}else if(x<=i+r){const b=(x-i)/r;y=-u+b*t,w=e,A=0,v=h+b*f}else{const b=(x-i-r)/i,M=b*Math.PI/2;y=u+e*Math.sin(M),w=e*Math.cos(M),A=e*Math.sin(M),v=h+f+b*h}const C=Math.max(0,Math.min(1,v/d));let I=0;x===0?I=.5/s:x===p&&(I=-.5/s);for(let b=0;b<=s;b++){const M=b/s,L=M*Math.PI*2,N=Math.sin(L),B=Math.cos(L);m.x=-w*B,m.y=y,m.z=w*N,a.push(m.x,m.y,m.z),g.set(-w*B,A,w*N),g.normalize(),l.push(g.x,g.y,g.z),c.push(M+I,C)}if(x>0){const b=(x-1)*_;for(let M=0;M0&&v(!0),t>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new Re(h,3)),this.setAttribute("normal",new Re(f,3)),this.setAttribute("uv",new Re(d,2));function x(){const y=new P,w=new P;let A=0;const C=(t-e)/i;for(let I=0;I<=r;I++){const b=[],M=I/r,L=M*(t-e)+e;for(let N=0;N<=s;N++){const B=N/s,K=B*l+a,J=Math.sin(K),k=Math.cos(K);w.x=L*J,w.y=-M*i+g,w.z=L*k,h.push(w.x,w.y,w.z),y.set(J,C,k).normalize(),f.push(y.x,y.y,y.z),d.push(B,1-M),b.push(p++)}_.push(b)}for(let I=0;I0||b!==0)&&(u.push(M,L,B),A+=3),(t>0||b!==r-1)&&(u.push(L,N,B),A+=3)}c.addGroup(m,A,0),m+=A}function v(y){const w=p,A=new oe,C=new P;let I=0;const b=y===!0?e:t,M=y===!0?1:-1;for(let N=1;N<=s;N++)h.push(0,g*M,0),f.push(0,M,0),d.push(.5,.5),p++;const L=p;for(let N=0;N<=s;N++){const K=N/s*l+a,J=Math.cos(K),k=Math.sin(K);C.x=b*k,C.y=g*M,C.z=b*J,h.push(C.x,C.y,C.z),f.push(0,M,0),A.x=J*.5+.5,A.y=k*.5*M+.5,d.push(A.x,A.y),p++}for(let N=0;N.9&&C<.1&&(v<.2&&(o[x+0]+=1),y<.2&&(o[x+2]+=1),w<.2&&(o[x+4]+=1))}}function f(x){r.push(x.x,x.y,x.z)}function d(x,v){const y=x*3;v.x=e[y+0],v.y=e[y+1],v.z=e[y+2]}function p(){const x=new P,v=new P,y=new P,w=new P,A=new oe,C=new oe,I=new oe;for(let b=0,M=0;b0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],f=i[s+1]-u,d=(o-u)/f;return(s+d)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),l=t||(o.isVector2?new oe:new P);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new P,s=[],r=[],o=[],a=new P,l=new ke;for(let d=0;d<=e;d++){const p=d/e;s[d]=this.getTangentAt(p,new P)}r[0]=new P,o[0]=new P;let c=Number.MAX_VALUE;const u=Math.abs(s[0].x),h=Math.abs(s[0].y),f=Math.abs(s[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),f<=c&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let d=1;d<=e;d++){if(r[d]=r[d-1].clone(),o[d]=o[d-1].clone(),a.crossVectors(s[d-1],s[d]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(qe(s[d-1].dot(s[d]),-1,1));r[d].applyMatrix4(l.makeRotationAxis(a,p))}o[d].crossVectors(s[d],r[d])}if(t===!0){let d=Math.acos(qe(r[0].dot(r[e]),-1,1));d/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(d=-d);for(let p=1;p<=e;p++)r[p].applyMatrix4(l.makeRotationAxis(s[p],d*p)),o[p].crossVectors(s[p],r[p])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Eh extends ai{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new oe){const i=t,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let c,u;this.closed||a>0?c=s[(a-1)%r]:(oc.subVectors(s[0],s[1]).add(s[0]),c=oc);const h=s[a%r],f=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],h=s[o>s.length-3?s.length-1:o+2];return i.set(g_(a,l.x,c.x,u.x,h.x),g_(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=s[r]-i,a=this.curves[r],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class ur extends Nu{constructor(e){super(e),this.uuid=Fn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,s=this.holes.length;i80*t){a=1/0,l=1/0;let u=-1/0,h=-1/0;for(let f=t;fu&&(u=d),p>h&&(h=p)}c=Math.max(u-a,h-l),c=c!==0?32767/c:0}return ka(r,o,t,a,l,c,0),o}function Bx(n,e,t,i,s){let r;if(s===A1(n,e,t,i)>0)for(let o=e;o=e;o-=i)r=__(o/i|0,n[o],n[o+1],r);return r&&_o(r,r.next)&&(Va(r),r=r.next),r}function vr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(_o(t,t.next)||wt(t.prev,t,t.next)===0)){if(Va(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function ka(n,e,t,i,s,r,o){if(!n)return;!o&&r&&b1(n,i,s,r);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(r?d1(n,i,s,r):f1(n)){e.push(l.i,n.i,c.i),Va(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=p1(vr(n),e),ka(n,e,t,i,s,r,2)):o===2&&m1(n,e,t,i,s,r):ka(vr(n),e,t,i,s,r,1);break}}}function f1(n){const e=n.prev,t=n,i=n.next;if(wt(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=Math.min(s,r,o),h=Math.min(a,l,c),f=Math.max(s,r,o),d=Math.max(a,l,c);let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=f&&p.y>=h&&p.y<=d&&Ko(s,a,r,l,o,c,p.x,p.y)&&wt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function d1(n,e,t,i){const s=n.prev,r=n,o=n.next;if(wt(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,u=s.y,h=r.y,f=o.y,d=Math.min(a,l,c),p=Math.min(u,h,f),_=Math.max(a,l,c),g=Math.max(u,h,f),m=wd(d,p,e,t,i),x=wd(_,g,e,t,i);let v=n.prevZ,y=n.nextZ;for(;v&&v.z>=m&&y&&y.z<=x;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Ko(a,u,l,h,c,f,v.x,v.y)&&wt(v.prev,v,v.next)>=0||(v=v.prevZ,y.x>=d&&y.x<=_&&y.y>=p&&y.y<=g&&y!==s&&y!==o&&Ko(a,u,l,h,c,f,y.x,y.y)&&wt(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;v&&v.z>=m;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Ko(a,u,l,h,c,f,v.x,v.y)&&wt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;y&&y.z<=x;){if(y.x>=d&&y.x<=_&&y.y>=p&&y.y<=g&&y!==s&&y!==o&&Ko(a,u,l,h,c,f,y.x,y.y)&&wt(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function p1(n,e){let t=n;do{const i=t.prev,s=t.next.next;!_o(i,s)&&zx(i,t,t.next,s)&&za(i,s)&&za(s,i)&&(e.push(i.i,t.i,s.i),Va(t),Va(t.next),t=n=s),t=t.next}while(t!==n);return vr(t)}function m1(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&E1(o,a)){let l=Vx(o,a);o=vr(o,o.next),l=vr(l,l.next),ka(o,e,t,i,s,r,0),ka(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function g1(n,e,t,i){const s=[];for(let r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const h=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=i&&h>r&&(r=h,o=t.x=t.x&&t.x>=l&&i!==t.x&&kx(so.x||t.x===o.x&&x1(o,t)))&&(o=t,u=h)}t=t.next}while(t!==a);return o}function x1(n,e){return wt(n.prev,n,e.prev)<0&&wt(e.next,n,n.next)<0}function b1(n,e,t,i){let s=n;do s.z===0&&(s.z=wd(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,M1(s)}function M1(n){let e,t=1;do{let i=n,s;n=null;let r=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;i=o}r.nextZ=null,t*=2}while(e>1);return n}function wd(n,e,t,i,s){return n=(n-t)*s|0,e=(e-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function S1(n){let e=n,t=n;do(e.x=(n-o)*(r-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(s-o)*(i-a)}function Ko(n,e,t,i,s,r,o,a){return!(n===o&&e===a)&&kx(n,e,t,i,s,r,o,a)}function E1(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!T1(n,e)&&(za(n,e)&&za(e,n)&&w1(n,e)&&(wt(n.prev,n,e.prev)||wt(n,e.prev,e))||_o(n,e)&&wt(n.prev,n,n.next)>0&&wt(e.prev,e,e.next)>0)}function wt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function _o(n,e){return n.x===e.x&&n.y===e.y}function zx(n,e,t,i){const s=lc(wt(n,e,t)),r=lc(wt(n,e,i)),o=lc(wt(t,i,n)),a=lc(wt(t,i,e));return!!(s!==r&&o!==a||s===0&&ac(n,t,e)||r===0&&ac(n,i,e)||o===0&&ac(t,n,i)||a===0&&ac(t,e,i))}function ac(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function lc(n){return n>0?1:n<0?-1:0}function T1(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&zx(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function za(n,e){return wt(n.prev,n,n.next)<0?wt(n,e,n.next)>=0&&wt(n,n.prev,e)>=0:wt(n,e,n.prev)<0||wt(n,n.next,e)<0}function w1(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Vx(n,e){const t=Ad(n.i,n.x,n.y),i=Ad(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function __(n,e,t,i){const s=Ad(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Va(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Ad(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function A1(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function y_(n,e){for(let t=0;tNumber.EPSILON){const $=Math.sqrt(G),pe=Math.sqrt(S*S+O*O),le=q.x-T/$,Ae=q.y+W/$,Pe=F.x-O/pe,ce=F.y+S/pe,ye=((Pe-le)*O-(ce-Ae)*S)/(W*O-T*S);z=le+W*ye-E.x,V=Ae+T*ye-E.y;const Ue=z*z+V*V;if(Ue<=2)return new oe(z,V);ne=Math.sqrt(Ue/2)}else{let $=!1;W>Number.EPSILON?S>Number.EPSILON&&($=!0):W<-Number.EPSILON?S<-Number.EPSILON&&($=!0):Math.sign(T)===Math.sign(O)&&($=!0),$?(z=-T,V=W,ne=Math.sqrt(G)):(z=W,V=T,ne=Math.sqrt(G/2))}return new oe(z/ne,V/ne)}const he=[];for(let E=0,q=J.length,F=q-1,z=E+1;E=0;E--){const q=E/g,F=d*Math.cos(q*Math.PI/2),z=p*Math.sin(q*Math.PI/2)+_;for(let V=0,ne=J.length;V=0;){const z=F;let V=F-1;V<0&&(V=E.length-1);for(let ne=0,W=u+g*2;ne0)&&d.push(v,y,A),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Xx extends ln{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ve(16777215),this.specular=new ve(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ws,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Bn,this.combine=nl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class qx extends ln{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ve(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ws,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class jx extends ln{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ws,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class Yx extends ln{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ve(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ws,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Bn,this.combine=nl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class nm extends ln{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ox,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class im extends ln{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class $x extends ln{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ve(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ws,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Kx extends bn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function nr(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function Zx(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Jx(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function Cd(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function sm(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push(...o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}function L1(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){h.push(c.times[d]);for(let _=0;_r.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*h+u,x=m+h-u;_=a.values.slice(m,x)}else{const m=a.createInterpolant(),x=u,v=h-u;m.evaluate(r),_=m.resultBuffer.slice(x,v)}l==="quaternion"&&new Rn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&Zx(s))for(let a=0,l=s.length;a!==l;++a){const c=s[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Ac,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Yn.prototype.ValueTypeName="";Yn.prototype.TimeBufferType=Float32Array;Yn.prototype.ValueBufferType=Float32Array;Yn.prototype.DefaultInterpolation=Lu;class Sr extends Yn{constructor(e,t,i){super(e,t,i)}}Sr.prototype.ValueTypeName="bool";Sr.prototype.ValueBufferType=Array;Sr.prototype.DefaultInterpolation=Da;Sr.prototype.InterpolantFactoryMethodLinear=void 0;Sr.prototype.InterpolantFactoryMethodSmooth=void 0;class om extends Yn{constructor(e,t,i,s){super(e,t,i,s)}}om.prototype.ValueTypeName="color";class Ha extends Yn{constructor(e,t,i,s){super(e,t,i,s)}}Ha.prototype.ValueTypeName="number";class tb extends dl{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Rn.slerpFlat(r,0,o,c-a,o,c,l);return r}}class pl extends Yn{constructor(e,t,i,s){super(e,t,i,s)}InterpolantFactoryMethodLinear(e){return new tb(this.times,this.values,this.getValueSize(),e)}}pl.prototype.ValueTypeName="quaternion";pl.prototype.InterpolantFactoryMethodSmooth=void 0;class Er extends Yn{constructor(e,t,i){super(e,t,i)}}Er.prototype.ValueTypeName="string";Er.prototype.ValueBufferType=Array;Er.prototype.DefaultInterpolation=Da;Er.prototype.InterpolantFactoryMethodLinear=void 0;Er.prototype.InterpolantFactoryMethodSmooth=void 0;class Ga extends Yn{constructor(e,t,i,s){super(e,t,i,s)}}Ga.prototype.ValueTypeName="vector";class Wa{constructor(e="",t=-1,i=[],s=uh){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=Fn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(N1(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(Yn.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const h=u[1];let f=s[h];f||(s[h]=f=[]),f.push(c)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,f,d,p,_){if(d.length!==0){const g=[],m=[];sm(d,g,m,p),g.length!==0&&_.push(new h(f,g,m))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h{t&&t(r),this.manager.itemEnd(e)},0),r;if(Ui[e]!==void 0){Ui[e].push({onLoad:t,onProgress:i,onError:s});return}Ui[e]=[],Ui[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Ui[e],h=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=f?parseInt(f):0,p=d!==0;let _=0;const g=new ReadableStream({start(m){x();function x(){h.read().then(({done:v,value:y})=>{if(v)m.close();else{_+=y.byteLength;const w=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:d});for(let A=0,C=u.length;A{m.error(v)})}}});return new Response(g)}else throw new F1(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),f=h&&h[1]?h[1].toLowerCase():void 0,d=new TextDecoder(f);return c.arrayBuffer().then(p=>d.decode(p))}}}).then(c=>{Gi.add(e,c);const u=Ui[e];delete Ui[e];for(let h=0,f=u.length;h{const u=Ui[e];if(u===void 0)throw this.manager.itemError(e),c;delete Ui[e];for(let h=0,f=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class B1 extends In{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Zi(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t=[];for(let i=0;i0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(s.uniforms[r]={},o.type){case"t":s.uniforms[r].value=i(o.value);break;case"c":s.uniforms[r].value=new ve().setHex(o.value);break;case"v2":s.uniforms[r].value=new oe().fromArray(o.value);break;case"v3":s.uniforms[r].value=new P().fromArray(o.value);break;case"v4":s.uniforms[r].value=new at().fromArray(o.value);break;case"m3":s.uniforms[r].value=new Ye().fromArray(o.value);break;case"m4":s.uniforms[r].value=new ke().fromArray(o.value);break;default:s.uniforms[r].value=o.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)s.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=i(e.map)),e.matcap!==void 0&&(s.matcap=i(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new oe().fromArray(r)}return e.displacementMap!==void 0&&(s.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=i(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new oe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Dh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:Gx,SpriteMaterial:Xp,RawShaderMaterial:em,ShaderMaterial:jt,PointsMaterial:jp,MeshPhysicalMaterial:Wx,MeshStandardMaterial:tm,MeshPhongMaterial:Xx,MeshToonMaterial:qx,MeshNormalMaterial:jx,MeshLambertMaterial:Yx,MeshDepthMaterial:nm,MeshDistanceMaterial:im,MeshBasicMaterial:Ti,MeshMatcapMaterial:$x,LineDashedMaterial:Kx,LineBasicMaterial:bn,Material:ln};return new t[e]}}class Rd{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class hb extends Ke{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class fb extends In{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Zi(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t={},i={};function s(d,p){if(t[p]!==void 0)return t[p];const g=d.interleavedBuffers[p],m=r(d,g.buffer),x=$r(g.type,m),v=new gh(x,g.stride);return v.uuid=g.uuid,t[p]=v,v}function r(d,p){if(i[p]!==void 0)return i[p];const g=d.arrayBuffers[p],m=new Uint32Array(g).buffer;return i[p]=m,m}const o=e.isInstancedBufferGeometry?new hb:new Ke,a=e.data.index;if(a!==void 0){const d=$r(a.type,a.array);o.setIndex(new mt(d,1))}const l=e.data.attributes;for(const d in l){const p=l[d];let _;if(p.isInterleavedBufferAttribute){const g=s(e.data,p.data);_=new _r(g,p.itemSize,p.offset,p.normalized)}else{const g=$r(p.type,p.array),m=p.isInstancedBufferAttribute?go:mt;_=new m(g,p.itemSize,p.normalized)}p.name!==void 0&&(_.name=p.name),p.usage!==void 0&&_.setUsage(p.usage),o.setAttribute(d,_)}const c=e.data.morphAttributes;if(c)for(const d in c){const p=c[d],_=[];for(let g=0,m=p.length;g0){const l=new am(t);r=new Xa(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){s=new Xa(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{let g=null,m=null;return _.boundingBox!==void 0&&(g=new an,g.min.fromArray(_.boundingBox.min),g.max.fromArray(_.boundingBox.max)),_.boundingSphere!==void 0&&(m=new Zt,m.radius=_.boundingSphere.radius,m.center.fromArray(_.boundingSphere.center)),{..._,boundingBox:g,boundingSphere:m}}),o._instanceInfo=e.instanceInfo,o._availableInstanceIds=e._availableInstanceIds,o._availableGeometryIds=e._availableGeometryIds,o._nextIndexStart=e.nextIndexStart,o._nextVertexStart=e.nextVertexStart,o._geometryCount=e.geometryCount,o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._matricesTexture=c(e.matricesTexture.uuid),o._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(o.boundingSphere=new Zt,o.boundingSphere.center.fromArray(e.boundingSphere.center),o.boundingSphere.radius=e.boundingSphere.radius),e.boundingBox!==void 0&&(o.boundingBox=new an,o.boundingBox.min.fromArray(e.boundingBox.min),o.boundingBox.max.fromArray(e.boundingBox.max));break;case"LOD":o=new Tx;break;case"Line":o=new ys(a(e.geometry),l(e.material));break;case"LineLoop":o=new Rx(a(e.geometry),l(e.material));break;case"LineSegments":o=new wi(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new Ix(a(e.geometry),l(e.material));break;case"Sprite":o=new Ex(l(e.material));break;case"Group":o=new Kr;break;case"Bone":o=new qp;break;default:o=new st}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const f=e.children;for(let d=0;d"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Gi.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),r.manager.itemEnd(e)}).catch(c=>{s&&s(c)});return}return setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return Gi.add(e,c),t&&t(c),r.manager.itemEnd(e),c}).catch(function(c){s&&s(c),Gi.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});Gi.add(e,l),r.manager.itemStart(e)}}let cc;class cm{static getContext(){return cc===void 0&&(cc=new(window.AudioContext||window.webkitAudioContext)),cc}static setContext(e){cc=e}}class $1 extends In{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Zi(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);cm.getContext().decodeAudioData(c,function(h){t(h)}).catch(a)}catch(c){a(c)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}const A_=new ke,C_=new ke,zs=new ke;class K1{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ft,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ft,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,zs.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(cr*t.fov*.5)/t.zoom;let a,l;C_.elements[12]=-s,A_.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,zs.elements[0]=2*t.near/(l-a),zs.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(zs),a=-o*t.aspect-r,l=o*t.aspect-r,zs.elements[0]=2*t.near/(l-a),zs.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(zs)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(C_),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(A_)}}class db extends Ft{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class gl{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=R_(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=R_();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function R_(){return performance.now()}const Vs=new P,I_=new Rn,Z1=new P,Hs=new P;class J1 extends st{constructor(){super(),this.type="AudioListener",this.context=cm.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new gl}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Vs,I_,Z1),Hs.set(0,0,-1).applyQuaternion(I_),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Vs.x,s),t.positionY.linearRampToValueAtTime(Vs.y,s),t.positionZ.linearRampToValueAtTime(Vs.z,s),t.forwardX.linearRampToValueAtTime(Hs.x,s),t.forwardY.linearRampToValueAtTime(Hs.y,s),t.forwardZ.linearRampToValueAtTime(Hs.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(Vs.x,Vs.y,Vs.z),t.setOrientation(Hs.x,Hs.y,Hs.z,i.x,i.y,i.z)}}class pb extends st{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Rn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Rn.multiplyQuaternionsFlat(e,o,e,t,e,i),Rn.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const um="\\[\\]\\.:\\/",nC=new RegExp("["+um+"]","g"),hm="[^"+um+"]",iC="[^"+um.replace("\\.","")+"]",sC=/((?:WC+[\/:])*)/.source.replace("WC",hm),rC=/(WCOD+)?/.source.replace("WCOD",iC),oC=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hm),aC=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hm),lC=new RegExp("^"+sC+rC+oC+aC+"$"),cC=["material","materials","bones","map"];class uC{constructor(e,t,i){const s=i||ot.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class ot{constructor(e,t,i){this.path=t,this.parsedPath=i||ot.parseTrackName(t),this.node=ot.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new ot.Composite(e,t,i):new ot(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nC,"")}static parseTrackName(e){const t=lC.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);cC.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=r){const h=r++,f=e[h];t[f.uuid]=u,e[u]=f,t[c]=h,e[h]=l;for(let d=0,p=s;d!==p;++d){const _=i[d],g=_[h],m=_[u];_[u]=g,_[h]=m}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,s=i.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[d.uuid]=h),e[h]=d,e.pop();for(let p=0,_=s;p!==_;++p){const g=i[p];g[h]=g[f],g.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let s=i[e];const r=this._bindings;if(s!==void 0)return r[s];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(h);for(let f=u,d=l.length;f!==d;++f){const p=l[f];h[f]=new ot(p,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const s=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class gb{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:er,endingEnd:er};for(let c=0;c!==o;++c){const u=r[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=sx,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case kp:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case uh:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===rx;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===ix){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=tr,s.endingEnd=tr):(e?s.endingStart=this.zeroSlopeAtStart?tr:er:s.endingStart=Oa,t?s.endingEnd=this.zeroSlopeAtEnd?tr:er:s.endingEnd=Oa)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=i,this}}const fC=new Float32Array(1);class dC extends Ei{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==r;++h){const f=s[h],d=f.name;let p=u[d];if(p!==void 0)++p.referenceCount,o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,d));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;p=new mb(ot.create(i,d,_),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,d),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(s,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,O_).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const U_=new P,uc=new P;class SC{constructor(e=new P,t=new P){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){U_.subVectors(e,this.start),uc.subVectors(this.end,this.start);const i=uc.dot(uc);let r=uc.dot(U_)/i;return t&&(r=qe(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const N_=new P;class EC extends st{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Ke,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{V_.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(V_,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class FC extends wi{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new Ke;s.setAttribute("position",new Re(t,3)),s.setAttribute("color",new Re(i,3));const r=new bn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new ve,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class BC{constructor(){this.type="ShapePath",this.color=new ve,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Nu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,s){return this.currentPath.quadraticCurveTo(e,t,i,s),this}bezierCurveTo(e,t,i,s,r,o){return this.currentPath.bezierCurveTo(e,t,i,s,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const x=[];for(let v=0,y=m.length;vNumber.EPSILON){if(M<0&&(C=x[A],b=-b,I=x[w],M=-M),m.yI.y)continue;if(m.y===C.y){if(m.x===C.x)return!0}else{const L=M*(m.x-C.x)-b*(m.y-C.y);if(L===0)return!0;if(L<0)continue;y=!y}}else{if(m.y!==C.y)continue;if(I.x<=m.x&&m.x<=C.x||C.x<=m.x&&m.x<=I.x)return!0}}return y}const s=ni.isClockWise,r=this.subPaths;if(r.length===0)return[];let o,a,l;const c=[];if(r.length===1)return a=r[0],l=new ur,l.curves=a.curves,c.push(l),c;let u=!s(r[0].getPoints());u=e?!u:u;const h=[],f=[];let d=[],p=0,_;f[p]=void 0,d[p]=[];for(let m=0,x=r.length;m1){let m=!1,x=0;for(let v=0,y=f.length;v0&&m===!1&&(d=h)}let g;for(let m=0,x=f.length;me?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function VC(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function HC(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function Pd(n,e,t,i){const s=GC(i);switch(t){case Up:return n*e;case ah:return n*e/s.components*s.byteLength;case il:return n*e/s.components*s.byteLength;case Fp:return n*e*2/s.components*s.byteLength;case lh:return n*e*2/s.components*s.byteLength;case Np:return n*e*3/s.components*s.byteLength;case yn:return n*e*4/s.components*s.byteLength;case ch:return n*e*4/s.components*s.byteLength;case la:case ca:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case ua:case ha:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case au:case cu:return Math.max(n,16)*Math.max(e,8)/4;case ou:case lu:return Math.max(n,8)*Math.max(e,8)/2;case uu:case hu:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case fu:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case du:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case pu:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case mu:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case gu:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case _u:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case vu:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case yu:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case xu:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case bu:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Mu:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Su:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Eu:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Tu:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case wu:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case fa:case Au:case Cu:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Bp:case Ru:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Iu:case Pu:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function GC(n){switch(n){case oi:case Lp:return{byteLength:1,components:1};case lo:case Dp:case bi:return{byteLength:2,components:1};case rh:case oh:return{byteLength:2,components:4};case Ki:case sh:case An:return{byteLength:4,components:1};case Op:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class WC{static contain(e,t){return zC(e,t)}static cover(e,t){return VC(e,t)}static fill(e){return HC(e)}static getByteLength(e,t,i,s){return Pd(e,t,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:tl}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=tl);/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */function yb(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function XC(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,h=c.byteLength,f=n.createBuffer();n.bindBuffer(l,f),n.bufferData(l,c,u),a.onUploadCallback();let d;if(c instanceof Float32Array)d=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?d=n.HALF_FLOAT:d=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=n.SHORT;else if(c instanceof Uint32Array)d=n.UNSIGNED_INT;else if(c instanceof Int32Array)d=n.INT;else if(c instanceof Int8Array)d=n.BYTE;else if(c instanceof Uint8Array)d=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:d,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((d,p)=>d.start-p.start);let f=0;for(let d=1;d 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,lR=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,cR=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,uR=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,hR=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,fR=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,dR=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,pR=`#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 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,mR=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 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 ); +} +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`,gR=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,_R=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,vR=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,yR=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,xR=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,bR=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,MR="gl_FragColor = linearToOutputTexel( gl_FragColor );",SR=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +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 ); +}`,ER=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,TR=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,wR=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,AR=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,CR=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,RR=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,IR=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,PR=`#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`,LR=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,DR=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + 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 +}`,OR=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,UR=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,NR=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,FR=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,BR=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,kR=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,zR=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,VR=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,HR=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,GR=`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 ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + 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`,WR=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#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 ); +}`,XR=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,qR=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,jR=`#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`,YR=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,$R=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,KR=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,ZR=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,JR=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,QR=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,eI=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,tI=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,nI=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,iI=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,sI=`#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`,rI=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,oI=`#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`,aI=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,lI=`#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`,cI=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,uI=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,hI=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,fI=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,dI=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,pI=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,mI=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,gI=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,_I=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,vI=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,yI=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,xI=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,bI=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,MI=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,SI=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,EI=`#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`,TI=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,wI=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,AI=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,CI=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,RI=`#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 +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,II=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,PI=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,LI=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,DI=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,OI=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,UI=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,NI=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,FI=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,BI=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,kI=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,zI=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,VI=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,HI=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,GI=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,WI=`#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; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const XI=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,qI=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,jI=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,YI=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,$I=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,KI=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,ZI=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,JI=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,QI=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,eP=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,tP=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,nP=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,iP=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,sP=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,rP=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,oP=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,aP=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,lP=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,cP=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,uP=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,hP=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,fP=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,dP=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,pP=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,mP=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,gP=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,_P=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,vP=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,yP=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,xP=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,bP=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,MP=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,SP=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,EP=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,et={alphahash_fragment:qC,alphahash_pars_fragment:jC,alphamap_fragment:YC,alphamap_pars_fragment:$C,alphatest_fragment:KC,alphatest_pars_fragment:ZC,aomap_fragment:JC,aomap_pars_fragment:QC,batching_pars_vertex:eR,batching_vertex:tR,begin_vertex:nR,beginnormal_vertex:iR,bsdfs:sR,iridescence_fragment:rR,bumpmap_pars_fragment:oR,clipping_planes_fragment:aR,clipping_planes_pars_fragment:lR,clipping_planes_pars_vertex:cR,clipping_planes_vertex:uR,color_fragment:hR,color_pars_fragment:fR,color_pars_vertex:dR,color_vertex:pR,common:mR,cube_uv_reflection_fragment:gR,defaultnormal_vertex:_R,displacementmap_pars_vertex:vR,displacementmap_vertex:yR,emissivemap_fragment:xR,emissivemap_pars_fragment:bR,colorspace_fragment:MR,colorspace_pars_fragment:SR,envmap_fragment:ER,envmap_common_pars_fragment:TR,envmap_pars_fragment:wR,envmap_pars_vertex:AR,envmap_physical_pars_fragment:BR,envmap_vertex:CR,fog_vertex:RR,fog_pars_vertex:IR,fog_fragment:PR,fog_pars_fragment:LR,gradientmap_pars_fragment:DR,lightmap_pars_fragment:OR,lights_lambert_fragment:UR,lights_lambert_pars_fragment:NR,lights_pars_begin:FR,lights_toon_fragment:kR,lights_toon_pars_fragment:zR,lights_phong_fragment:VR,lights_phong_pars_fragment:HR,lights_physical_fragment:GR,lights_physical_pars_fragment:WR,lights_fragment_begin:XR,lights_fragment_maps:qR,lights_fragment_end:jR,logdepthbuf_fragment:YR,logdepthbuf_pars_fragment:$R,logdepthbuf_pars_vertex:KR,logdepthbuf_vertex:ZR,map_fragment:JR,map_pars_fragment:QR,map_particle_fragment:eI,map_particle_pars_fragment:tI,metalnessmap_fragment:nI,metalnessmap_pars_fragment:iI,morphinstance_vertex:sI,morphcolor_vertex:rI,morphnormal_vertex:oI,morphtarget_pars_vertex:aI,morphtarget_vertex:lI,normal_fragment_begin:cI,normal_fragment_maps:uI,normal_pars_fragment:hI,normal_pars_vertex:fI,normal_vertex:dI,normalmap_pars_fragment:pI,clearcoat_normal_fragment_begin:mI,clearcoat_normal_fragment_maps:gI,clearcoat_pars_fragment:_I,iridescence_pars_fragment:vI,opaque_fragment:yI,packing:xI,premultiplied_alpha_fragment:bI,project_vertex:MI,dithering_fragment:SI,dithering_pars_fragment:EI,roughnessmap_fragment:TI,roughnessmap_pars_fragment:wI,shadowmap_pars_fragment:AI,shadowmap_pars_vertex:CI,shadowmap_vertex:RI,shadowmask_pars_fragment:II,skinbase_vertex:PI,skinning_pars_vertex:LI,skinning_vertex:DI,skinnormal_vertex:OI,specularmap_fragment:UI,specularmap_pars_fragment:NI,tonemapping_fragment:FI,tonemapping_pars_fragment:BI,transmission_fragment:kI,transmission_pars_fragment:zI,uv_pars_fragment:VI,uv_pars_vertex:HI,uv_vertex:GI,worldpos_vertex:WI,background_vert:XI,background_frag:qI,backgroundCube_vert:jI,backgroundCube_frag:YI,cube_vert:$I,cube_frag:KI,depth_vert:ZI,depth_frag:JI,distanceRGBA_vert:QI,distanceRGBA_frag:eP,equirect_vert:tP,equirect_frag:nP,linedashed_vert:iP,linedashed_frag:sP,meshbasic_vert:rP,meshbasic_frag:oP,meshlambert_vert:aP,meshlambert_frag:lP,meshmatcap_vert:cP,meshmatcap_frag:uP,meshnormal_vert:hP,meshnormal_frag:fP,meshphong_vert:dP,meshphong_frag:pP,meshphysical_vert:mP,meshphysical_frag:gP,meshtoon_vert:_P,meshtoon_frag:vP,points_vert:yP,points_frag:xP,shadow_vert:bP,shadow_frag:MP,sprite_vert:SP,sprite_frag:EP},be={common:{diffuse:{value:new ve(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ye},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ye}},envmap:{envMap:{value:null},envMapRotation:{value:new Ye},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ye}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ye}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ye},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ye},normalScale:{value:new oe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ye},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ye}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ye}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ye}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ve(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 ve(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0},uvTransform:{value:new Ye}},sprite:{diffuse:{value:new ve(16777215)},opacity:{value:1},center:{value:new oe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ye},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0}}},ei={basic:{uniforms:fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:et.meshbasic_vert,fragmentShader:et.meshbasic_frag},lambert:{uniforms:fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new ve(0)}}]),vertexShader:et.meshlambert_vert,fragmentShader:et.meshlambert_frag},phong:{uniforms:fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new ve(0)},specular:{value:new ve(1118481)},shininess:{value:30}}]),vertexShader:et.meshphong_vert,fragmentShader:et.meshphong_frag},standard:{uniforms:fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new ve(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag},toon:{uniforms:fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new ve(0)}}]),vertexShader:et.meshtoon_vert,fragmentShader:et.meshtoon_frag},matcap:{uniforms:fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:et.meshmatcap_vert,fragmentShader:et.meshmatcap_frag},points:{uniforms:fn([be.points,be.fog]),vertexShader:et.points_vert,fragmentShader:et.points_frag},dashed:{uniforms:fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:et.linedashed_vert,fragmentShader:et.linedashed_frag},depth:{uniforms:fn([be.common,be.displacementmap]),vertexShader:et.depth_vert,fragmentShader:et.depth_frag},normal:{uniforms:fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:et.meshnormal_vert,fragmentShader:et.meshnormal_frag},sprite:{uniforms:fn([be.sprite,be.fog]),vertexShader:et.sprite_vert,fragmentShader:et.sprite_frag},background:{uniforms:{uvTransform:{value:new Ye},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:et.background_vert,fragmentShader:et.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ye}},vertexShader:et.backgroundCube_vert,fragmentShader:et.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:et.cube_vert,fragmentShader:et.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:et.equirect_vert,fragmentShader:et.equirect_frag},distanceRGBA:{uniforms:fn([be.common,be.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:et.distanceRGBA_vert,fragmentShader:et.distanceRGBA_frag},shadow:{uniforms:fn([be.lights,be.fog,{color:{value:new ve(0)},opacity:{value:1}}]),vertexShader:et.shadow_vert,fragmentShader:et.shadow_frag}};ei.physical={uniforms:fn([ei.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ye},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ye},clearcoatNormalScale:{value:new oe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ye},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ye},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ye},sheen:{value:0},sheenColor:{value:new ve(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ye},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ye},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ye},transmissionSamplerSize:{value:new oe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ye},attenuationDistance:{value:0},attenuationColor:{value:new ve(0)},specularColor:{value:new ve(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ye},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ye},anisotropyVector:{value:new oe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ye}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag};const gc={r:0,b:0,g:0},Xs=new Bn,TP=new ke;function wP(n,e,t,i,s,r,o){const a=new ve(0);let l=r===!0?0:1,c,u,h=null,f=0,d=null;function p(v){let y=v.isScene===!0?v.background:null;return y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y}function _(v){let y=!1;const w=p(v);w===null?m(a,l):w&&w.isColor&&(m(w,1),y=!0);const A=n.xr.getEnvironmentBlendMode();A==="additive"?i.buffers.color.setClear(0,0,0,1,o):A==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||y)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function g(v,y){const w=p(y);w&&(w.isCubeTexture||w.mapping===Eo)?(u===void 0&&(u=new It(new Mr(1,1,1),new jt({name:"BackgroundCubeMaterial",uniforms:po(ei.backgroundCube.uniforms),vertexShader:ei.backgroundCube.vertexShader,fragmentShader:ei.backgroundCube.fragmentShader,side:xn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,C,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Xs.copy(y.backgroundRotation),Xs.x*=-1,Xs.y*=-1,Xs.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Xs.y*=-1,Xs.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(TP.makeRotationFromEuler(Xs)),u.material.toneMapped=tt.getTransfer(w.colorSpace)!==ht,(h!==w||f!==w.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,h=w,f=w.version,d=n.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new It(new Ao(2,2),new jt({name:"BackgroundMaterial",uniforms:po(ei.background.uniforms),vertexShader:ei.background.vertexShader,fragmentShader:ei.background.fragmentShader,side:Yi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!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=w,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=tt.getTransfer(w.colorSpace)!==ht,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(h!==w||f!==w.version||d!==n.toneMapping)&&(c.material.needsUpdate=!0,h=w,f=w.version,d=n.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null))}function m(v,y){v.getRGB(gc,xx(n)),i.buffers.color.setClear(gc.r,gc.g,gc.b,y,o)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(v,y=1){a.set(v),l=y,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,m(a,l)},render:_,addToRenderList:g,dispose:x}}function AP(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=f(null);let r=s,o=!1;function a(M,L,N,B,K){let J=!1;const k=h(B,N,L);r!==k&&(r=k,c(r.object)),J=d(M,B,N,K),J&&p(M,B,N,K),K!==null&&e.update(K,n.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,y(M,L,N,B),K!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(K).buffer))}function l(){return n.createVertexArray()}function c(M){return n.bindVertexArray(M)}function u(M){return n.deleteVertexArray(M)}function h(M,L,N){const B=N.wireframe===!0;let K=i[M.id];K===void 0&&(K={},i[M.id]=K);let J=K[L.id];J===void 0&&(J={},K[L.id]=J);let k=J[B];return k===void 0&&(k=f(l()),J[B]=k),k}function f(M){const L=[],N=[],B=[];for(let K=0;K=0){const me=K[Y];let ee=J[Y];if(ee===void 0&&(Y==="instanceMatrix"&&M.instanceMatrix&&(ee=M.instanceMatrix),Y==="instanceColor"&&M.instanceColor&&(ee=M.instanceColor)),me===void 0||me.attribute!==ee||ee&&me.data!==ee.data)return!0;k++}return r.attributesNum!==k||r.index!==B}function p(M,L,N,B){const K={},J=L.attributes;let k=0;const re=N.getAttributes();for(const Y in re)if(re[Y].location>=0){let me=J[Y];me===void 0&&(Y==="instanceMatrix"&&M.instanceMatrix&&(me=M.instanceMatrix),Y==="instanceColor"&&M.instanceColor&&(me=M.instanceColor));const ee={};ee.attribute=me,me&&me.data&&(ee.data=me.data),K[Y]=ee,k++}r.attributes=K,r.attributesNum=k,r.index=B}function _(){const M=r.newAttributes;for(let L=0,N=M.length;L=0){let he=K[re];if(he===void 0&&(re==="instanceMatrix"&&M.instanceMatrix&&(he=M.instanceMatrix),re==="instanceColor"&&M.instanceColor&&(he=M.instanceColor)),he!==void 0){const me=he.normalized,ee=he.itemSize,ge=e.get(he);if(ge===void 0)continue;const Fe=ge.buffer,ie=ge.type,de=ge.bytesPerElement,Te=ie===n.INT||ie===n.UNSIGNED_INT||he.gpuType===sh;if(he.isInterleavedBufferAttribute){const _e=he.data,Oe=_e.stride,Xe=he.offset;if(_e.isInstancedInterleavedBuffer){for(let De=0;De0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="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=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,f=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),m=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),v=n.getParameter(n.MAX_VARYING_VECTORS),y=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),w=p>0,A=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,reverseDepthBuffer:f,maxTextures:d,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:x,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:w,maxSamples:A}}function IP(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new hs,a=new Ye,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const d=h.length!==0||f||i!==0||s;return s=f,i=h.length,d},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,f){t=u(h,f,0)},this.setState=function(h,f,d){const p=h.clippingPlanes,_=h.clipIntersection,g=h.clipShadows,m=n.get(h);if(!s||p===null||p.length===0||r&&!g)r?u(null):c();else{const x=r?0:i,v=x*4;let y=m.clippingState||null;l.value=y,y=u(p,f,v,d);for(let w=0;w!==v;++w)y[w]=t[w];m.clippingState=y,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,f,d,p){const _=h!==null?h.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=d+_*4,x=f.matrixWorldInverse;a.getNormalMatrix(x),(g===null||g.length0){const c=new Mx(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",s),t(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}const Zr=4,H_=[.125,.215,.35,.446,.526,.582],Qs=20,Ff=new ml,G_=new ve;let Bf=null,kf=0,zf=0,Vf=!1;const Zs=(1+Math.sqrt(5))/2,Xr=1/Zs,W_=[new P(-Zs,Xr,0),new P(Zs,Xr,0),new P(-Xr,0,Zs),new P(Xr,0,Zs),new P(0,Zs,-Xr),new P(0,Zs,Xr),new P(-1,1,-1),new P(1,1,-1),new P(-1,1,1),new P(1,1,1)],LP=new P;class Ld{constructor(e){this._renderer=e,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(e,t=0,i=.1,s=100,r={}){const{size:o=256,position:a=LP}=r;Bf=this._renderer.getRenderTarget(),kf=this._renderer.getActiveCubeFace(),zf=this._renderer.getActiveMipmapLevel(),Vf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,s,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=j_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=q_(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),h.setRenderTarget(s),g&&h.render(_,l),h.render(e,l)}_.geometry.dispose(),_.material.dispose(),h.toneMapping=d,h.autoClear=f,e.background=m}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===$i||e.mapping===vs;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=j_()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=q_());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new It(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;_c(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Ff)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rQs&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Qs}`);const m=[];let x=0;for(let C=0;Cv-Zr?s-v+Zr:0),A=4*(this._cubeSize-y);_c(t,w,A,3*y,2*y),l.setRenderTarget(t),l.render(h,Ff)}}function DP(n){const e=[],t=[],i=[];let s=n;const r=n-Zr+1+H_.length;for(let o=0;on-Zr?l=H_[o-n+Zr-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,h=1+c,f=[u,u,h,u,h,h,u,u,h,h,u,h],d=6,p=6,_=3,g=2,m=1,x=new Float32Array(_*p*d),v=new Float32Array(g*p*d),y=new Float32Array(m*p*d);for(let A=0;A2?0:-1,b=[C,I,0,C+2/3,I,0,C+2/3,I+1,0,C,I,0,C+2/3,I+1,0,C,I+1,0];x.set(b,_*p*A),v.set(f,g*p*A);const M=[A,A,A,A,A,A];y.set(M,m*p*A)}const w=new Ke;w.setAttribute("position",new mt(x,_)),w.setAttribute("uv",new mt(v,g)),w.setAttribute("faceIndex",new mt(y,m)),e.push(w),s>Zr&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function X_(n,e,t){const i=new Cn(n,e,t);return i.texture.mapping=Eo,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function _c(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function OP(n,e,t){const i=new Float32Array(Qs),s=new P(0,1,0);return new jt({name:"SphericalGaussianBlur",defines:{n:Qs,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,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:pm(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:yi,depthTest:!1,depthWrite:!1})}function q_(){return new jt({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:pm(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:yi,depthTest:!1,depthWrite:!1})}function j_(){return new jt({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:pm(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:yi,depthTest:!1,depthWrite:!1})}function pm(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function UP(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Ra||l===Ia,u=l===$i||l===vs;if(c||u){let h=e.get(a);const f=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return t===null&&(t=new Ld(n)),h=c?t.fromEquirectangular(a,h):t.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),h.texture;if(h!==void 0)return h.texture;{const d=a.image;return c&&d&&d.height>0||u&&d&&s(d)?(t===null&&(t=new Ld(n)),h=c?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.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;ue.maxTextureSize&&(w=Math.ceil(y/e.maxTextureSize),y=e.maxTextureSize);const A=new Float32Array(y*w*4*h),C=new sl(A,y,w,h);C.type=An,C.needsUpdate=!0;const I=v*4;for(let M=0;M0)return n;const s=e*t;let r=$_[s];if(r===void 0&&(r=new Float32Array(s),$_[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function Gt(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}const n0=new Ye;function UL(n){tt._getMatrix(n0,tt.workingColorSpace,n);const e=`mat3( ${n0.elements.map(t=>t.toFixed(4))} )`;switch(tt.getTransfer(n)){case Ua:return[e,"LinearTransferOETF"];case ht:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function i0(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` + +`+s+` + +`+OL(n.getShaderSource(e),o)}else return s}function NL(n,e){const t=UL(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` +`)}function FL(n,e){let t;switch(e){case Tp:t="Linear";break;case wp:t="Reinhard";break;case Ap:t="Cineon";break;case So:t="ACESFilmic";break;case Rp:t="AgX";break;case Ip:t="Neutral";break;case Cp:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const vc=new P;function BL(){tt.getLuminanceCoefficients(vc);const n=vc.x.toFixed(4),e=vc.y.toFixed(4),t=vc.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`)}function kL(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Zo).join(` +`)}function zL(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function VL(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Dd(n){return n.replace(HL,WL)}const GL=new Map;function WL(n,e){let t=et[e];if(t===void 0){const i=GL.get(e);if(i!==void 0)t=et[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Dd(t)}const XL=/#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 o0(n){return n.replace(XL,qL)}function qL(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(g+=` +`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(Zo).join(` +`),m.length>0&&(m+=` +`)):(g=[a0(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.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(Zo).join(` +`),m=[a0(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==xi?"#define TONE_MAPPING":"",t.toneMapping!==xi?et.tonemapping_pars_fragment:"",t.toneMapping!==xi?FL("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",et.colorspace_pars_fragment,NL("linearToOutputTexel",t.outputColorSpace),BL(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Zo).join(` +`)),o=Dd(o),o=s0(o,t),o=r0(o,t),a=Dd(a),a=s0(a,t),a=r0(a,t),o=o0(o),a=o0(a),t.isRawShaderMaterial!==!0&&(x=`#version 300 es +`,g=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,m=["#define varying in",t.glslVersion===Ed?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Ed?"":"#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(` +`)+` +`+m);const v=x+g+o,y=x+m+a,w=t0(s,s.VERTEX_SHADER,v),A=t0(s,s.FRAGMENT_SHADER,y);s.attachShader(_,w),s.attachShader(_,A),t.index0AttributeName!==void 0?s.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);function C(L){if(n.debug.checkShaderErrors){const N=s.getProgramInfoLog(_).trim(),B=s.getShaderInfoLog(w).trim(),K=s.getShaderInfoLog(A).trim();let J=!0,k=!0;if(s.getProgramParameter(_,s.LINK_STATUS)===!1)if(J=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,_,w,A);else{const re=i0(s,w,"vertex"),Y=i0(s,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,s.VALIDATE_STATUS)+` + +Material Name: `+L.name+` +Material Type: `+L.type+` + +Program Info Log: `+N+` +`+re+` +`+Y)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(B===""||K==="")&&(k=!1);k&&(L.diagnostics={runnable:J,programLog:N,vertexShader:{log:B,prefix:g},fragmentShader:{log:K,prefix:m}})}s.deleteShader(w),s.deleteShader(A),I=new Ic(s,_),b=VL(s,_)}let I;this.getUniforms=function(){return I===void 0&&C(this),I};let b;this.getAttributes=function(){return b===void 0&&C(this),b};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(_,LL)),M},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=DL++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=w,this.fragmentShader=A,this}let QL=0;class e2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new t2(e),t.set(e,i)),i}}class t2{constructor(e){this.id=QL++,this.code=e,this.usedTimes=0}}function n2(n,e,t,i,s,r,o){const a=new rl,l=new e2,c=new Set,u=[],h=s.logarithmicDepthBuffer,f=s.vertexTextures;let d=s.precision;const p={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 _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,M,L,N,B){const K=N.fog,J=B.geometry,k=b.isMeshStandardMaterial?N.environment:null,re=(b.isMeshStandardMaterial?t:e).get(b.envMap||k),Y=re&&re.mapping===Eo?re.image.height:null,he=p[b.type];b.precision!==null&&(d=s.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));const me=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,ee=me!==void 0?me.length:0;let ge=0;J.morphAttributes.position!==void 0&&(ge=1),J.morphAttributes.normal!==void 0&&(ge=2),J.morphAttributes.color!==void 0&&(ge=3);let Fe,ie,de,Te;if(he){const dt=ei[he];Fe=dt.vertexShader,ie=dt.fragmentShader}else Fe=b.vertexShader,ie=b.fragmentShader,l.update(b),de=l.getVertexShaderID(b),Te=l.getFragmentShaderID(b);const _e=n.getRenderTarget(),Oe=n.state.buffers.depth.getReversed(),Xe=B.isInstancedMesh===!0,De=B.isBatchedMesh===!0,Et=!!b.map,D=!!b.matcap,U=!!re,E=!!b.aoMap,q=!!b.lightMap,F=!!b.bumpMap,z=!!b.normalMap,V=!!b.displacementMap,ne=!!b.emissiveMap,W=!!b.metalnessMap,T=!!b.roughnessMap,S=b.anisotropy>0,O=b.clearcoat>0,G=b.dispersion>0,Z=b.iridescence>0,$=b.sheen>0,pe=b.transmission>0,le=S&&!!b.anisotropyMap,Ae=O&&!!b.clearcoatMap,Pe=O&&!!b.clearcoatNormalMap,ce=O&&!!b.clearcoatRoughnessMap,ye=Z&&!!b.iridescenceMap,Ue=Z&&!!b.iridescenceThicknessMap,ze=$&&!!b.sheenColorMap,xe=$&&!!b.sheenRoughnessMap,Ge=!!b.specularMap,je=!!b.specularColorMap,yt=!!b.specularIntensityMap,H=pe&&!!b.transmissionMap,Se=pe&&!!b.thicknessMap,se=!!b.gradientMap,ae=!!b.alphaMap,we=b.alphaTest>0,Ee=!!b.alphaHash,Je=!!b.extensions;let At=xi;b.toneMapped&&(_e===null||_e.isXRRenderTarget===!0)&&(At=n.toneMapping);const Jt={shaderID:he,shaderType:b.type,shaderName:b.name,vertexShader:Fe,fragmentShader:ie,defines:b.defines,customVertexShaderID:de,customFragmentShaderID:Te,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:De,batchingColor:De&&B._colorsTexture!==null,instancing:Xe,instancingColor:Xe&&B.instanceColor!==null,instancingMorph:Xe&&B.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:_e===null?n.outputColorSpace:_e.isXRRenderTarget===!0?_e.texture.colorSpace:gr,alphaToCoverage:!!b.alphaToCoverage,map:Et,matcap:D,envMap:U,envMapMode:U&&re.mapping,envMapCubeUVHeight:Y,aoMap:E,lightMap:q,bumpMap:F,normalMap:z,displacementMap:f&&V,emissiveMap:ne,normalMapObjectSpace:z&&b.normalMapType===lx,normalMapTangentSpace:z&&b.normalMapType===ws,metalnessMap:W,roughnessMap:T,anisotropy:S,anisotropyMap:le,clearcoat:O,clearcoatMap:Ae,clearcoatNormalMap:Pe,clearcoatRoughnessMap:ce,dispersion:G,iridescence:Z,iridescenceMap:ye,iridescenceThicknessMap:Ue,sheen:$,sheenColorMap:ze,sheenRoughnessMap:xe,specularMap:Ge,specularColorMap:je,specularIntensityMap:yt,transmission:pe,transmissionMap:H,thicknessMap:Se,gradientMap:se,opaque:b.transparent===!1&&b.blending===lr&&b.alphaToCoverage===!1,alphaMap:ae,alphaTest:we,alphaHash:Ee,combine:b.combine,mapUv:Et&&_(b.map.channel),aoMapUv:E&&_(b.aoMap.channel),lightMapUv:q&&_(b.lightMap.channel),bumpMapUv:F&&_(b.bumpMap.channel),normalMapUv:z&&_(b.normalMap.channel),displacementMapUv:V&&_(b.displacementMap.channel),emissiveMapUv:ne&&_(b.emissiveMap.channel),metalnessMapUv:W&&_(b.metalnessMap.channel),roughnessMapUv:T&&_(b.roughnessMap.channel),anisotropyMapUv:le&&_(b.anisotropyMap.channel),clearcoatMapUv:Ae&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Pe&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ce&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:ye&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:Ue&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:ze&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:xe&&_(b.sheenRoughnessMap.channel),specularMapUv:Ge&&_(b.specularMap.channel),specularColorMapUv:je&&_(b.specularColorMap.channel),specularIntensityMapUv:yt&&_(b.specularIntensityMap.channel),transmissionMapUv:H&&_(b.transmissionMap.channel),thicknessMapUv:Se&&_(b.thicknessMap.channel),alphaMapUv:ae&&_(b.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(z||S),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:B.isPoints===!0&&!!J.attributes.uv&&(Et||ae),fog:!!K,useFog:b.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,reverseDepthBuffer:Oe,skinning:B.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:ee,morphTextureStride:ge,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:At,decodeVideoTexture:Et&&b.map.isVideoTexture===!0&&tt.getTransfer(b.map.colorSpace)===ht,decodeVideoTextureEmissive:ne&&b.emissiveMap.isVideoTexture===!0&&tt.getTransfer(b.emissiveMap.colorSpace)===ht,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===ti,flipSided:b.side===xn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Je&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Je&&b.extensions.multiDraw===!0||De)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Jt.vertexUv1s=c.has(1),Jt.vertexUv2s=c.has(2),Jt.vertexUv3s=c.has(3),c.clear(),Jt}function m(b){const M=[];if(b.shaderID?M.push(b.shaderID):(M.push(b.customVertexShaderID),M.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)M.push(L),M.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(x(M,b),v(M,b),M.push(n.outputColorSpace)),M.push(b.customProgramCacheKey),M.join()}function x(b,M){b.push(M.precision),b.push(M.outputColorSpace),b.push(M.envMapMode),b.push(M.envMapCubeUVHeight),b.push(M.mapUv),b.push(M.alphaMapUv),b.push(M.lightMapUv),b.push(M.aoMapUv),b.push(M.bumpMapUv),b.push(M.normalMapUv),b.push(M.displacementMapUv),b.push(M.emissiveMapUv),b.push(M.metalnessMapUv),b.push(M.roughnessMapUv),b.push(M.anisotropyMapUv),b.push(M.clearcoatMapUv),b.push(M.clearcoatNormalMapUv),b.push(M.clearcoatRoughnessMapUv),b.push(M.iridescenceMapUv),b.push(M.iridescenceThicknessMapUv),b.push(M.sheenColorMapUv),b.push(M.sheenRoughnessMapUv),b.push(M.specularMapUv),b.push(M.specularColorMapUv),b.push(M.specularIntensityMapUv),b.push(M.transmissionMapUv),b.push(M.thicknessMapUv),b.push(M.combine),b.push(M.fogExp2),b.push(M.sizeAttenuation),b.push(M.morphTargetsCount),b.push(M.morphAttributeCount),b.push(M.numDirLights),b.push(M.numPointLights),b.push(M.numSpotLights),b.push(M.numSpotLightMaps),b.push(M.numHemiLights),b.push(M.numRectAreaLights),b.push(M.numDirLightShadows),b.push(M.numPointLightShadows),b.push(M.numSpotLightShadows),b.push(M.numSpotLightShadowsWithMaps),b.push(M.numLightProbes),b.push(M.shadowMapType),b.push(M.toneMapping),b.push(M.numClippingPlanes),b.push(M.numClipIntersection),b.push(M.depthPacking)}function v(b,M){a.disableAll(),M.supportsVertexTextures&&a.enable(0),M.instancing&&a.enable(1),M.instancingColor&&a.enable(2),M.instancingMorph&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),M.dispersion&&a.enable(20),M.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reverseDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),b.push(a.mask)}function y(b){const M=p[b.type];let L;if(M){const N=ei[M];L=mo.clone(N.uniforms)}else L=b.uniforms;return L}function w(b,M){let L;for(let N=0,B=u.length;N0?i.push(m):d.transparent===!0?s.push(m):t.push(m)}function l(h,f,d,p,_,g){const m=o(h,f,d,p,_,g);d.transmission>0?i.unshift(m):d.transparent===!0?s.unshift(m):t.unshift(m)}function c(h,f){t.length>1&&t.sort(h||s2),i.length>1&&i.sort(f||l0),s.length>1&&s.sort(f||l0)}function u(){for(let h=e,f=n.length;h=r.length?(o=new c0,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function o2(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new P,color:new ve};break;case"SpotLight":t={position:new P,direction:new P,color:new ve,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new P,color:new ve,distance:0,decay:0};break;case"HemisphereLight":t={direction:new P,skyColor:new ve,groundColor:new ve};break;case"RectAreaLight":t={color:new ve,position:new P,halfWidth:new P,halfHeight:new P};break}return n[e.id]=t,t}}}function a2(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let l2=0;function c2(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function u2(n){const e=new o2,t=a2(),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 P);const s=new P,r=new ke,o=new ke;function a(c){let u=0,h=0,f=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let d=0,p=0,_=0,g=0,m=0,x=0,v=0,y=0,w=0,A=0,C=0;c.sort(c2);for(let b=0,M=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=f;const I=i.hash;(I.directionalLength!==d||I.pointLength!==p||I.spotLength!==_||I.rectAreaLength!==g||I.hemiLength!==m||I.numDirectionalShadows!==x||I.numPointShadows!==v||I.numSpotShadows!==y||I.numSpotMaps!==w||I.numLightProbes!==C)&&(i.directional.length=d,i.spot.length=_,i.rectArea.length=g,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=v,i.pointShadowMap.length=v,i.spotShadow.length=y,i.spotShadowMap.length=y,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=v,i.spotLightMatrix.length=y+w-A,i.spotLightMap.length=w,i.numSpotLightShadowsWithMaps=A,i.numLightProbes=C,I.directionalLength=d,I.pointLength=p,I.spotLength=_,I.rectAreaLength=g,I.hemiLength=m,I.numDirectionalShadows=x,I.numPointShadows=v,I.numSpotShadows=y,I.numSpotMaps=w,I.numLightProbes=C,i.version=l2++)}function l(c,u){let h=0,f=0,d=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,x=c.length;m=o.length?(a=new u0(n),o.push(a)):a=o[r],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const f2=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,d2=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function p2(n,e,t){let i=new wo;const s=new oe,r=new oe,o=new at,a=new nm({depthPacking:ax}),l=new im,c={},u=t.maxTextureSize,h={[Yi]:xn,[xn]:Yi,[ti]:ti},f=new jt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new oe},radius:{value:4}},vertexShader:f2,fragmentShader:d2}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const p=new Ke;p.setAttribute("position",new mt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new It(p,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Sp;let m=this.type;this.render=function(A,C,I){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||A.length===0)return;const b=n.getRenderTarget(),M=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),N=n.state;N.setBlending(yi),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const B=m!==mi&&this.type===mi,K=m===mi&&this.type!==mi;for(let J=0,k=A.length;Ju||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/he.x),s.x=r.x*he.x,Y.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/he.y),s.y=r.y*he.y,Y.mapSize.y=r.y)),Y.map===null||B===!0||K===!0){const ee=this.type!==mi?{minFilter:Kt,magFilter:Kt}:{};Y.map!==null&&Y.map.dispose(),Y.map=new Cn(s.x,s.y,ee),Y.map.texture.name=re.name+".shadowMap",Y.camera.updateProjectionMatrix()}n.setRenderTarget(Y.map),n.clear();const me=Y.getViewportCount();for(let ee=0;ee0||C.map&&C.alphaTest>0||C.alphaToCoverage===!0){const N=M.uuid,B=C.uuid;let K=c[N];K===void 0&&(K={},c[N]=K);let J=K[B];J===void 0&&(J=M.clone(),K[B]=J,C.addEventListener("dispose",w)),M=J}if(M.visible=C.visible,M.wireframe=C.wireframe,b===mi?M.side=C.shadowSide!==null?C.shadowSide:C.side:M.side=C.shadowSide!==null?C.shadowSide:h[C.side],M.alphaMap=C.alphaMap,M.alphaTest=C.alphaToCoverage===!0?.5:C.alphaTest,M.map=C.map,M.clipShadows=C.clipShadows,M.clippingPlanes=C.clippingPlanes,M.clipIntersection=C.clipIntersection,M.displacementMap=C.displacementMap,M.displacementScale=C.displacementScale,M.displacementBias=C.displacementBias,M.wireframeLinewidth=C.wireframeLinewidth,M.linewidth=C.linewidth,I.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const N=n.properties.get(M);N.light=I}return M}function y(A,C,I,b,M){if(A.visible===!1)return;if(A.layers.test(C.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&M===mi)&&(!A.frustumCulled||i.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,A.matrixWorld);const B=e.update(A),K=A.material;if(Array.isArray(K)){const J=B.groups;for(let k=0,re=J.length;k=1):Y.indexOf("OpenGL ES")!==-1&&(re=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),k=re>=2);let he=null,me={};const ee=n.getParameter(n.SCISSOR_BOX),ge=n.getParameter(n.VIEWPORT),Fe=new at().fromArray(ee),ie=new at().fromArray(ge);function de(H,Se,se,ae){const we=new Uint8Array(4),Ee=n.createTexture();n.bindTexture(H,Ee),n.texParameteri(H,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(H,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Je=0;Je"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new oe,u=new WeakMap;let h;const f=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(T,S){return d?new OffscreenCanvas(T,S):Ba("canvas")}function _(T,S,O){let G=1;const Z=W(T);if((Z.width>O||Z.height>O)&&(G=O/Math.max(Z.width,Z.height)),G<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){const $=Math.floor(G*Z.width),pe=Math.floor(G*Z.height);h===void 0&&(h=p($,pe));const le=S?p($,pe):h;return le.width=$,le.height=pe,le.getContext("2d").drawImage(T,0,0,$,pe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Z.width+"x"+Z.height+") to ("+$+"x"+pe+")."),le}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Z.width+"x"+Z.height+")."),T;return T}function g(T){return T.generateMipmaps}function m(T){n.generateMipmap(T)}function x(T){return T.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:T.isWebGL3DRenderTarget?n.TEXTURE_3D:T.isWebGLArrayRenderTarget||T.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function v(T,S,O,G,Z=!1){if(T!==null){if(n[T]!==void 0)return n[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let $=S;if(S===n.RED&&(O===n.FLOAT&&($=n.R32F),O===n.HALF_FLOAT&&($=n.R16F),O===n.UNSIGNED_BYTE&&($=n.R8)),S===n.RED_INTEGER&&(O===n.UNSIGNED_BYTE&&($=n.R8UI),O===n.UNSIGNED_SHORT&&($=n.R16UI),O===n.UNSIGNED_INT&&($=n.R32UI),O===n.BYTE&&($=n.R8I),O===n.SHORT&&($=n.R16I),O===n.INT&&($=n.R32I)),S===n.RG&&(O===n.FLOAT&&($=n.RG32F),O===n.HALF_FLOAT&&($=n.RG16F),O===n.UNSIGNED_BYTE&&($=n.RG8)),S===n.RG_INTEGER&&(O===n.UNSIGNED_BYTE&&($=n.RG8UI),O===n.UNSIGNED_SHORT&&($=n.RG16UI),O===n.UNSIGNED_INT&&($=n.RG32UI),O===n.BYTE&&($=n.RG8I),O===n.SHORT&&($=n.RG16I),O===n.INT&&($=n.RG32I)),S===n.RGB_INTEGER&&(O===n.UNSIGNED_BYTE&&($=n.RGB8UI),O===n.UNSIGNED_SHORT&&($=n.RGB16UI),O===n.UNSIGNED_INT&&($=n.RGB32UI),O===n.BYTE&&($=n.RGB8I),O===n.SHORT&&($=n.RGB16I),O===n.INT&&($=n.RGB32I)),S===n.RGBA_INTEGER&&(O===n.UNSIGNED_BYTE&&($=n.RGBA8UI),O===n.UNSIGNED_SHORT&&($=n.RGBA16UI),O===n.UNSIGNED_INT&&($=n.RGBA32UI),O===n.BYTE&&($=n.RGBA8I),O===n.SHORT&&($=n.RGBA16I),O===n.INT&&($=n.RGBA32I)),S===n.RGB&&O===n.UNSIGNED_INT_5_9_9_9_REV&&($=n.RGB9_E5),S===n.RGBA){const pe=Z?Ua:tt.getTransfer(G);O===n.FLOAT&&($=n.RGBA32F),O===n.HALF_FLOAT&&($=n.RGBA16F),O===n.UNSIGNED_BYTE&&($=pe===ht?n.SRGB8_ALPHA8:n.RGBA8),O===n.UNSIGNED_SHORT_4_4_4_4&&($=n.RGBA4),O===n.UNSIGNED_SHORT_5_5_5_1&&($=n.RGB5_A1)}return($===n.R16F||$===n.R32F||$===n.RG16F||$===n.RG32F||$===n.RGBA16F||$===n.RGBA32F)&&e.get("EXT_color_buffer_float"),$}function y(T,S){let O;return T?S===null||S===Ki||S===co?O=n.DEPTH24_STENCIL8:S===An?O=n.DEPTH32F_STENCIL8:S===lo&&(O=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):S===null||S===Ki||S===co?O=n.DEPTH_COMPONENT24:S===An?O=n.DEPTH_COMPONENT32F:S===lo&&(O=n.DEPTH_COMPONENT16),O}function w(T,S){return g(T)===!0||T.isFramebufferTexture&&T.minFilter!==Kt&&T.minFilter!==zt?Math.log2(Math.max(S.width,S.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?S.mipmaps.length:1}function A(T){const S=T.target;S.removeEventListener("dispose",A),I(S),S.isVideoTexture&&u.delete(S)}function C(T){const S=T.target;S.removeEventListener("dispose",C),M(S)}function I(T){const S=i.get(T);if(S.__webglInit===void 0)return;const O=T.source,G=f.get(O);if(G){const Z=G[S.__cacheKey];Z.usedTimes--,Z.usedTimes===0&&b(T),Object.keys(G).length===0&&f.delete(O)}i.remove(T)}function b(T){const S=i.get(T);n.deleteTexture(S.__webglTexture);const O=T.source,G=f.get(O);delete G[S.__cacheKey],o.memory.textures--}function M(T){const S=i.get(T);if(T.depthTexture&&(T.depthTexture.dispose(),i.remove(T.depthTexture)),T.isWebGLCubeRenderTarget)for(let G=0;G<6;G++){if(Array.isArray(S.__webglFramebuffer[G]))for(let Z=0;Z=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+s.maxTextures),L+=1,T}function K(T){const S=[];return S.push(T.wrapS),S.push(T.wrapT),S.push(T.wrapR||0),S.push(T.magFilter),S.push(T.minFilter),S.push(T.anisotropy),S.push(T.internalFormat),S.push(T.format),S.push(T.type),S.push(T.generateMipmaps),S.push(T.premultiplyAlpha),S.push(T.flipY),S.push(T.unpackAlignment),S.push(T.colorSpace),S.join()}function J(T,S){const O=i.get(T);if(T.isVideoTexture&&V(T),T.isRenderTargetTexture===!1&&T.version>0&&O.__version!==T.version){const G=T.image;if(G===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(G.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ie(O,T,S);return}}t.bindTexture(n.TEXTURE_2D,O.__webglTexture,n.TEXTURE0+S)}function k(T,S){const O=i.get(T);if(T.version>0&&O.__version!==T.version){ie(O,T,S);return}t.bindTexture(n.TEXTURE_2D_ARRAY,O.__webglTexture,n.TEXTURE0+S)}function re(T,S){const O=i.get(T);if(T.version>0&&O.__version!==T.version){ie(O,T,S);return}t.bindTexture(n.TEXTURE_3D,O.__webglTexture,n.TEXTURE0+S)}function Y(T,S){const O=i.get(T);if(T.version>0&&O.__version!==T.version){de(O,T,S);return}t.bindTexture(n.TEXTURE_CUBE_MAP,O.__webglTexture,n.TEXTURE0+S)}const he={[Pa]:n.REPEAT,[Xn]:n.CLAMP_TO_EDGE,[La]:n.MIRRORED_REPEAT},me={[Kt]:n.NEAREST,[Pp]:n.NEAREST_MIPMAP_NEAREST,[Yr]:n.NEAREST_MIPMAP_LINEAR,[zt]:n.LINEAR,[aa]:n.LINEAR_MIPMAP_NEAREST,[_i]:n.LINEAR_MIPMAP_LINEAR},ee={[cx]:n.NEVER,[mx]:n.ALWAYS,[ux]:n.LESS,[zp]:n.LEQUAL,[hx]:n.EQUAL,[px]:n.GEQUAL,[fx]:n.GREATER,[dx]:n.NOTEQUAL};function ge(T,S){if(S.type===An&&e.has("OES_texture_float_linear")===!1&&(S.magFilter===zt||S.magFilter===aa||S.magFilter===Yr||S.magFilter===_i||S.minFilter===zt||S.minFilter===aa||S.minFilter===Yr||S.minFilter===_i)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(T,n.TEXTURE_WRAP_S,he[S.wrapS]),n.texParameteri(T,n.TEXTURE_WRAP_T,he[S.wrapT]),(T===n.TEXTURE_3D||T===n.TEXTURE_2D_ARRAY)&&n.texParameteri(T,n.TEXTURE_WRAP_R,he[S.wrapR]),n.texParameteri(T,n.TEXTURE_MAG_FILTER,me[S.magFilter]),n.texParameteri(T,n.TEXTURE_MIN_FILTER,me[S.minFilter]),S.compareFunction&&(n.texParameteri(T,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(T,n.TEXTURE_COMPARE_FUNC,ee[S.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(S.magFilter===Kt||S.minFilter!==Yr&&S.minFilter!==_i||S.type===An&&e.has("OES_texture_float_linear")===!1)return;if(S.anisotropy>1||i.get(S).__currentAnisotropy){const O=e.get("EXT_texture_filter_anisotropic");n.texParameterf(T,O.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(S.anisotropy,s.getMaxAnisotropy())),i.get(S).__currentAnisotropy=S.anisotropy}}}function Fe(T,S){let O=!1;T.__webglInit===void 0&&(T.__webglInit=!0,S.addEventListener("dispose",A));const G=S.source;let Z=f.get(G);Z===void 0&&(Z={},f.set(G,Z));const $=K(S);if($!==T.__cacheKey){Z[$]===void 0&&(Z[$]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,O=!0),Z[$].usedTimes++;const pe=Z[T.__cacheKey];pe!==void 0&&(Z[T.__cacheKey].usedTimes--,pe.usedTimes===0&&b(S)),T.__cacheKey=$,T.__webglTexture=Z[$].texture}return O}function ie(T,S,O){let G=n.TEXTURE_2D;(S.isDataArrayTexture||S.isCompressedArrayTexture)&&(G=n.TEXTURE_2D_ARRAY),S.isData3DTexture&&(G=n.TEXTURE_3D);const Z=Fe(T,S),$=S.source;t.bindTexture(G,T.__webglTexture,n.TEXTURE0+O);const pe=i.get($);if($.version!==pe.__version||Z===!0){t.activeTexture(n.TEXTURE0+O);const le=tt.getPrimaries(tt.workingColorSpace),Ae=S.colorSpace===Vi?null:tt.getPrimaries(S.colorSpace),Pe=S.colorSpace===Vi||le===Ae?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,S.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,S.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Pe);let ce=_(S.image,!1,s.maxTextureSize);ce=ne(S,ce);const ye=r.convert(S.format,S.colorSpace),Ue=r.convert(S.type);let ze=v(S.internalFormat,ye,Ue,S.colorSpace,S.isVideoTexture);ge(G,S);let xe;const Ge=S.mipmaps,je=S.isVideoTexture!==!0,yt=pe.__version===void 0||Z===!0,H=$.dataReady,Se=w(S,ce);if(S.isDepthTexture)ze=y(S.format===ho,S.type),yt&&(je?t.texStorage2D(n.TEXTURE_2D,1,ze,ce.width,ce.height):t.texImage2D(n.TEXTURE_2D,0,ze,ce.width,ce.height,0,ye,Ue,null));else if(S.isDataTexture)if(Ge.length>0){je&&yt&&t.texStorage2D(n.TEXTURE_2D,Se,ze,Ge[0].width,Ge[0].height);for(let se=0,ae=Ge.length;se0){const we=Pd(xe.width,xe.height,S.format,S.type);for(const Ee of S.layerUpdates){const Je=xe.data.subarray(Ee*we/xe.data.BYTES_PER_ELEMENT,(Ee+1)*we/xe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,se,0,0,Ee,xe.width,xe.height,1,ye,Je)}S.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,se,0,0,0,xe.width,xe.height,ce.depth,ye,xe.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,se,ze,xe.width,xe.height,ce.depth,0,xe.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else je?H&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,se,0,0,0,xe.width,xe.height,ce.depth,ye,Ue,xe.data):t.texImage3D(n.TEXTURE_2D_ARRAY,se,ze,xe.width,xe.height,ce.depth,0,ye,Ue,xe.data)}else{je&&yt&&t.texStorage2D(n.TEXTURE_2D,Se,ze,Ge[0].width,Ge[0].height);for(let se=0,ae=Ge.length;se0){const se=Pd(ce.width,ce.height,S.format,S.type);for(const ae of S.layerUpdates){const we=ce.data.subarray(ae*se/ce.data.BYTES_PER_ELEMENT,(ae+1)*se/ce.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,ae,ce.width,ce.height,1,ye,Ue,we)}S.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,ce.width,ce.height,ce.depth,ye,Ue,ce.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,ze,ce.width,ce.height,ce.depth,0,ye,Ue,ce.data);else if(S.isData3DTexture)je?(yt&&t.texStorage3D(n.TEXTURE_3D,Se,ze,ce.width,ce.height,ce.depth),H&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,ce.width,ce.height,ce.depth,ye,Ue,ce.data)):t.texImage3D(n.TEXTURE_3D,0,ze,ce.width,ce.height,ce.depth,0,ye,Ue,ce.data);else if(S.isFramebufferTexture){if(yt)if(je)t.texStorage2D(n.TEXTURE_2D,Se,ze,ce.width,ce.height);else{let se=ce.width,ae=ce.height;for(let we=0;we>=1,ae>>=1}}else if(Ge.length>0){if(je&&yt){const se=W(Ge[0]);t.texStorage2D(n.TEXTURE_2D,Se,ze,se.width,se.height)}for(let se=0,ae=Ge.length;se0&&Se++;const ae=W(ye[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Se,Ge,ae.width,ae.height)}for(let ae=0;ae<6;ae++)if(ce){je?H&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ae,0,0,0,ye[ae].width,ye[ae].height,ze,xe,ye[ae].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ae,0,Ge,ye[ae].width,ye[ae].height,0,ze,xe,ye[ae].data);for(let we=0;we>$),Ue=Math.max(1,S.height>>$);Z===n.TEXTURE_3D||Z===n.TEXTURE_2D_ARRAY?t.texImage3D(Z,$,Ae,ye,Ue,S.depth,0,pe,le,null):t.texImage2D(Z,$,Ae,ye,Ue,0,pe,le,null)}t.bindFramebuffer(n.FRAMEBUFFER,T),z(S)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,G,Z,ce.__webglTexture,0,F(S)):(Z===n.TEXTURE_2D||Z>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Z<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,G,Z,ce.__webglTexture,$),t.bindFramebuffer(n.FRAMEBUFFER,null)}function _e(T,S,O){if(n.bindRenderbuffer(n.RENDERBUFFER,T),S.depthBuffer){const G=S.depthTexture,Z=G&&G.isDepthTexture?G.type:null,$=y(S.stencilBuffer,Z),pe=S.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,le=F(S);z(S)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,le,$,S.width,S.height):O?n.renderbufferStorageMultisample(n.RENDERBUFFER,le,$,S.width,S.height):n.renderbufferStorage(n.RENDERBUFFER,$,S.width,S.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,pe,n.RENDERBUFFER,T)}else{const G=S.textures;for(let Z=0;Z{delete S.__boundDepthTexture,delete S.__depthDisposeCallback,G.removeEventListener("dispose",Z)};G.addEventListener("dispose",Z),S.__depthDisposeCallback=Z}S.__boundDepthTexture=G}if(T.depthTexture&&!S.__autoAllocateDepthBuffer){if(O)throw new Error("target.depthTexture not supported in Cube render targets");const G=T.texture.mipmaps;G&&G.length>0?Oe(S.__webglFramebuffer[0],T):Oe(S.__webglFramebuffer,T)}else if(O){S.__webglDepthbuffer=[];for(let G=0;G<6;G++)if(t.bindFramebuffer(n.FRAMEBUFFER,S.__webglFramebuffer[G]),S.__webglDepthbuffer[G]===void 0)S.__webglDepthbuffer[G]=n.createRenderbuffer(),_e(S.__webglDepthbuffer[G],T,!1);else{const Z=T.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,$=S.__webglDepthbuffer[G];n.bindRenderbuffer(n.RENDERBUFFER,$),n.framebufferRenderbuffer(n.FRAMEBUFFER,Z,n.RENDERBUFFER,$)}}else{const G=T.texture.mipmaps;if(G&&G.length>0?t.bindFramebuffer(n.FRAMEBUFFER,S.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,S.__webglFramebuffer),S.__webglDepthbuffer===void 0)S.__webglDepthbuffer=n.createRenderbuffer(),_e(S.__webglDepthbuffer,T,!1);else{const Z=T.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,$=S.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,$),n.framebufferRenderbuffer(n.FRAMEBUFFER,Z,n.RENDERBUFFER,$)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function De(T,S,O){const G=i.get(T);S!==void 0&&Te(G.__webglFramebuffer,T,T.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),O!==void 0&&Xe(T)}function Et(T){const S=T.texture,O=i.get(T),G=i.get(S);T.addEventListener("dispose",C);const Z=T.textures,$=T.isWebGLCubeRenderTarget===!0,pe=Z.length>1;if(pe||(G.__webglTexture===void 0&&(G.__webglTexture=n.createTexture()),G.__version=S.version,o.memory.textures++),$){O.__webglFramebuffer=[];for(let le=0;le<6;le++)if(S.mipmaps&&S.mipmaps.length>0){O.__webglFramebuffer[le]=[];for(let Ae=0;Ae0){O.__webglFramebuffer=[];for(let le=0;le0&&z(T)===!1){O.__webglMultisampledFramebuffer=n.createFramebuffer(),O.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,O.__webglMultisampledFramebuffer);for(let le=0;le0)for(let Ae=0;Ae0)for(let Ae=0;Ae0){if(z(T)===!1){const S=T.textures,O=T.width,G=T.height;let Z=n.COLOR_BUFFER_BIT;const $=T.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,pe=i.get(T),le=S.length>1;if(le)for(let Pe=0;Pe0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,pe.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,pe.__webglFramebuffer);for(let Pe=0;Pe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&S.__useRenderToTexture!==!1}function V(T){const S=o.render.frame;u.get(T)!==S&&(u.set(T,S),T.update())}function ne(T,S){const O=T.colorSpace,G=T.format,Z=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||O!==gr&&O!==Vi&&(tt.getTransfer(O)===ht?(G!==yn||Z!==oi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",O)),S}function W(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=B,this.resetTextureUnits=N,this.setTexture2D=J,this.setTexture2DArray=k,this.setTexture3D=re,this.setTextureCube=Y,this.rebindTextures=De,this.setupRenderTarget=Et,this.updateRenderTargetMipmap=D,this.updateMultisampleRenderTarget=q,this.setupDepthRenderbuffer=Xe,this.setupFrameBufferTexture=Te,this.useMultisampledRTT=z}function Eb(n,e){function t(i,s=Vi){let r;const o=tt.getTransfer(s);if(i===oi)return n.UNSIGNED_BYTE;if(i===rh)return n.UNSIGNED_SHORT_4_4_4_4;if(i===oh)return n.UNSIGNED_SHORT_5_5_5_1;if(i===Op)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Lp)return n.BYTE;if(i===Dp)return n.SHORT;if(i===lo)return n.UNSIGNED_SHORT;if(i===sh)return n.INT;if(i===Ki)return n.UNSIGNED_INT;if(i===An)return n.FLOAT;if(i===bi)return n.HALF_FLOAT;if(i===Up)return n.ALPHA;if(i===Np)return n.RGB;if(i===yn)return n.RGBA;if(i===uo)return n.DEPTH_COMPONENT;if(i===ho)return n.DEPTH_STENCIL;if(i===ah)return n.RED;if(i===il)return n.RED_INTEGER;if(i===Fp)return n.RG;if(i===lh)return n.RG_INTEGER;if(i===ch)return n.RGBA_INTEGER;if(i===la||i===ca||i===ua||i===ha)if(o===ht)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===la)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===ca)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===ua)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===ha)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===la)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===ca)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===ua)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===ha)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===ou||i===au||i===lu||i===cu)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===ou)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===au)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===lu)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===cu)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===uu||i===hu||i===fu)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===uu||i===hu)return o===ht?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===fu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===du||i===pu||i===mu||i===gu||i===_u||i===vu||i===yu||i===xu||i===bu||i===Mu||i===Su||i===Eu||i===Tu||i===wu)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===du)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===pu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===mu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===gu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===_u)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===vu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===yu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===xu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===bu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Mu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Su)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Eu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Tu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===wu)return o===ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===fa||i===Au||i===Cu)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===fa)return o===ht?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Au)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Cu)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Bp||i===Ru||i===Iu||i===Pu)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===fa)return r.COMPRESSED_RED_RGTC1_EXT;if(i===Ru)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Iu)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Pu)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===co?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const v2=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,y2=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class x2{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const s=new Pt,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new jt({vertexShader:v2,fragmentShader:y2,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new It(new Ao(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class b2 extends Ei{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,f=null,d=null,p=null;const _=new x2,g=t.getContextAttributes();let m=null,x=null;const v=[],y=[],w=new oe;let A=null;const C=new Ft;C.viewport=new at;const I=new Ft;I.viewport=new at;const b=[C,I],M=new db;let L=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ie){let de=v[ie];return de===void 0&&(de=new Rc,v[ie]=de),de.getTargetRaySpace()},this.getControllerGrip=function(ie){let de=v[ie];return de===void 0&&(de=new Rc,v[ie]=de),de.getGripSpace()},this.getHand=function(ie){let de=v[ie];return de===void 0&&(de=new Rc,v[ie]=de),de.getHandSpace()};function B(ie){const de=y.indexOf(ie.inputSource);if(de===-1)return;const Te=v[de];Te!==void 0&&(Te.update(ie.inputSource,ie.frame,c||o),Te.dispatchEvent({type:ie.type,data:ie.inputSource}))}function K(){s.removeEventListener("select",B),s.removeEventListener("selectstart",B),s.removeEventListener("selectend",B),s.removeEventListener("squeeze",B),s.removeEventListener("squeezestart",B),s.removeEventListener("squeezeend",B),s.removeEventListener("end",K),s.removeEventListener("inputsourceschange",J);for(let ie=0;ie=0&&(y[_e]=null,v[_e].disconnect(Te))}for(let de=0;de=y.length){y.push(Te),_e=Xe;break}else if(y[Xe]===null){y[Xe]=Te,_e=Xe;break}if(_e===-1)break}const Oe=v[_e];Oe&&Oe.connect(Te)}}const k=new P,re=new P;function Y(ie,de,Te){k.setFromMatrixPosition(de.matrixWorld),re.setFromMatrixPosition(Te.matrixWorld);const _e=k.distanceTo(re),Oe=de.projectionMatrix.elements,Xe=Te.projectionMatrix.elements,De=Oe[14]/(Oe[10]-1),Et=Oe[14]/(Oe[10]+1),D=(Oe[9]+1)/Oe[5],U=(Oe[9]-1)/Oe[5],E=(Oe[8]-1)/Oe[0],q=(Xe[8]+1)/Xe[0],F=De*E,z=De*q,V=_e/(-E+q),ne=V*-E;if(de.matrixWorld.decompose(ie.position,ie.quaternion,ie.scale),ie.translateX(ne),ie.translateZ(V),ie.matrixWorld.compose(ie.position,ie.quaternion,ie.scale),ie.matrixWorldInverse.copy(ie.matrixWorld).invert(),Oe[10]===-1)ie.projectionMatrix.copy(de.projectionMatrix),ie.projectionMatrixInverse.copy(de.projectionMatrixInverse);else{const W=De+V,T=Et+V,S=F-ne,O=z+(_e-ne),G=D*Et/T*W,Z=U*Et/T*W;ie.projectionMatrix.makePerspective(S,O,G,Z,W,T),ie.projectionMatrixInverse.copy(ie.projectionMatrix).invert()}}function he(ie,de){de===null?ie.matrixWorld.copy(ie.matrix):ie.matrixWorld.multiplyMatrices(de.matrixWorld,ie.matrix),ie.matrixWorldInverse.copy(ie.matrixWorld).invert()}this.updateCamera=function(ie){if(s===null)return;let de=ie.near,Te=ie.far;_.texture!==null&&(_.depthNear>0&&(de=_.depthNear),_.depthFar>0&&(Te=_.depthFar)),M.near=I.near=C.near=de,M.far=I.far=C.far=Te,(L!==M.near||N!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,N=M.far),C.layers.mask=ie.layers.mask|2,I.layers.mask=ie.layers.mask|4,M.layers.mask=C.layers.mask|I.layers.mask;const _e=ie.parent,Oe=M.cameras;he(M,_e);for(let Xe=0;Xe0&&(g.alphaTest.value=m.alphaTest);const x=e.get(m),v=x.envMap,y=x.envMapRotation;v&&(g.envMap.value=v,qs.copy(y),qs.x*=-1,qs.y*=-1,qs.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(qs.y*=-1,qs.z*=-1),g.envMapRotation.value.setFromMatrix4(M2.makeRotationFromEuler(qs)),g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function a(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,x,v){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*x,g.scale.value=v*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function h(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,x){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===xn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const x=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(x.matrixWorld),g.nearDistance.value=x.shadow.camera.near,g.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function E2(n,e,t,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,v){const y=v.program;i.uniformBlockBinding(x,y)}function c(x,v){let y=s[x.id];y===void 0&&(p(x),y=u(x),s[x.id]=y,x.addEventListener("dispose",g));const w=v.program;i.updateUBOMapping(x,w);const A=e.render.frame;r[x.id]!==A&&(f(x),r[x.id]=A)}function u(x){const v=h();x.__bindingPointIndex=v;const y=n.createBuffer(),w=x.__size,A=x.usage;return n.bindBuffer(n.UNIFORM_BUFFER,y),n.bufferData(n.UNIFORM_BUFFER,w,A),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,y),y}function h(){for(let x=0;x0&&(y+=w-A),x.__size=y,x.__cache={},this}function _(x){const v={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(v.boundary=4,v.storage=4):x.isVector2?(v.boundary=8,v.storage=8):x.isVector3||x.isColor?(v.boundary=16,v.storage=12):x.isVector4?(v.boundary=16,v.storage=16):x.isMatrix3?(v.boundary=48,v.storage=48):x.isMatrix4?(v.boundary=64,v.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),v}function g(x){const v=x.target;v.removeEventListener("dispose",g);const y=o.indexOf(v.__bindingPointIndex);o.splice(y,1),n.deleteBuffer(s[v.id]),delete s[v.id],delete r[v.id]}function m(){for(const x in s)n.deleteBuffer(s[x]);o=[],s={},r={}}return{bind:l,update:c,dispose:m}}class Pc{constructor(e={}){const{canvas:t=_x(),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:f=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const p=new Uint32Array(4),_=new Int32Array(4);let g=null,m=null;const x=[],v=[];this.domElement=t,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.toneMapping=xi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const y=this;let w=!1;this._outputColorSpace=nn;let A=0,C=0,I=null,b=-1,M=null;const L=new at,N=new at;let B=null;const K=new ve(0);let J=0,k=t.width,re=t.height,Y=1,he=null,me=null;const ee=new at(0,0,k,re),ge=new at(0,0,k,re);let Fe=!1;const ie=new wo;let de=!1,Te=!1;const _e=new ke,Oe=new ke,Xe=new P,De=new at,Et={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let D=!1;function U(){return I===null?Y:1}let E=i;function q(R,X){return t.getContext(R,X)}try{const R={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${tl}`),t.addEventListener("webglcontextlost",ae,!1),t.addEventListener("webglcontextrestored",we,!1),t.addEventListener("webglcontextcreationerror",Ee,!1),E===null){const X="webgl2";if(E=q(X,R),E===null)throw q(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(R){throw console.error("THREE.WebGLRenderer: "+R.message),R}let F,z,V,ne,W,T,S,O,G,Z,$,pe,le,Ae,Pe,ce,ye,Ue,ze,xe,Ge,je,yt,H;function Se(){F=new NP(E),F.init(),je=new Eb(E,F),z=new RP(E,F,e,je),V=new g2(E,F),z.reverseDepthBuffer&&f&&V.buffers.depth.setReversed(!0),ne=new kP(E),W=new i2,T=new _2(E,F,V,W,z,je,ne),S=new PP(y),O=new UP(y),G=new XC(E),yt=new AP(E,G),Z=new FP(E,G,ne,yt),$=new VP(E,Z,G,ne),ze=new zP(E,z,T),ce=new IP(W),pe=new n2(y,S,O,F,z,yt,ce),le=new S2(y,W),Ae=new r2,Pe=new h2(F),Ue=new wP(y,S,O,V,$,d,l),ye=new p2(y,$,z),H=new E2(E,ne,z,V),xe=new CP(E,F,ne),Ge=new BP(E,F,ne),ne.programs=pe.programs,y.capabilities=z,y.extensions=F,y.properties=W,y.renderLists=Ae,y.shadowMap=ye,y.state=V,y.info=ne}Se();const se=new b2(y,E);this.xr=se,this.getContext=function(){return E},this.getContextAttributes=function(){return E.getContextAttributes()},this.forceContextLoss=function(){const R=F.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=F.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(R){R!==void 0&&(Y=R,this.setSize(k,re,!1))},this.getSize=function(R){return R.set(k,re)},this.setSize=function(R,X,Q=!0){if(se.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=R,re=X,t.width=Math.floor(R*Y),t.height=Math.floor(X*Y),Q===!0&&(t.style.width=R+"px",t.style.height=X+"px"),this.setViewport(0,0,R,X)},this.getDrawingBufferSize=function(R){return R.set(k*Y,re*Y).floor()},this.setDrawingBufferSize=function(R,X,Q){k=R,re=X,Y=Q,t.width=Math.floor(R*Q),t.height=Math.floor(X*Q),this.setViewport(0,0,R,X)},this.getCurrentViewport=function(R){return R.copy(L)},this.getViewport=function(R){return R.copy(ee)},this.setViewport=function(R,X,Q,te){R.isVector4?ee.set(R.x,R.y,R.z,R.w):ee.set(R,X,Q,te),V.viewport(L.copy(ee).multiplyScalar(Y).round())},this.getScissor=function(R){return R.copy(ge)},this.setScissor=function(R,X,Q,te){R.isVector4?ge.set(R.x,R.y,R.z,R.w):ge.set(R,X,Q,te),V.scissor(N.copy(ge).multiplyScalar(Y).round())},this.getScissorTest=function(){return Fe},this.setScissorTest=function(R){V.setScissorTest(Fe=R)},this.setOpaqueSort=function(R){he=R},this.setTransparentSort=function(R){me=R},this.getClearColor=function(R){return R.copy(Ue.getClearColor())},this.setClearColor=function(){Ue.setClearColor(...arguments)},this.getClearAlpha=function(){return Ue.getClearAlpha()},this.setClearAlpha=function(){Ue.setClearAlpha(...arguments)},this.clear=function(R=!0,X=!0,Q=!0){let te=0;if(R){let j=!1;if(I!==null){const fe=I.texture.format;j=fe===ch||fe===lh||fe===il}if(j){const fe=I.texture.type,Me=fe===oi||fe===Ki||fe===lo||fe===co||fe===rh||fe===oh,Ie=Ue.getClearColor(),Le=Ue.getClearAlpha(),We=Ie.r,He=Ie.g,Ne=Ie.b;Me?(p[0]=We,p[1]=He,p[2]=Ne,p[3]=Le,E.clearBufferuiv(E.COLOR,0,p)):(_[0]=We,_[1]=He,_[2]=Ne,_[3]=Le,E.clearBufferiv(E.COLOR,0,_))}else te|=E.COLOR_BUFFER_BIT}X&&(te|=E.DEPTH_BUFFER_BIT),Q&&(te|=E.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),E.clear(te)},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(){t.removeEventListener("webglcontextlost",ae,!1),t.removeEventListener("webglcontextrestored",we,!1),t.removeEventListener("webglcontextcreationerror",Ee,!1),Ue.dispose(),Ae.dispose(),Pe.dispose(),W.dispose(),S.dispose(),O.dispose(),$.dispose(),yt.dispose(),H.dispose(),pe.dispose(),se.dispose(),se.removeEventListener("sessionstart",qm),se.removeEventListener("sessionend",jm),Rs.stop()};function ae(R){R.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function we(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const R=ne.autoReset,X=ye.enabled,Q=ye.autoUpdate,te=ye.needsUpdate,j=ye.type;Se(),ne.autoReset=R,ye.enabled=X,ye.autoUpdate=Q,ye.needsUpdate=te,ye.type=j}function Ee(R){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",R.statusMessage)}function Je(R){const X=R.target;X.removeEventListener("dispose",Je),At(X)}function At(R){Jt(R),W.remove(R)}function Jt(R){const X=W.get(R).programs;X!==void 0&&(X.forEach(function(Q){pe.releaseProgram(Q)}),R.isShaderMaterial&&pe.releaseShaderCache(R))}this.renderBufferDirect=function(R,X,Q,te,j,fe){X===null&&(X=Et);const Me=j.isMesh&&j.matrixWorld.determinant()<0,Ie=pS(R,X,Q,te,j);V.setMaterial(te,Me);let Le=Q.index,We=1;if(te.wireframe===!0){if(Le=Z.getWireframeAttribute(Q),Le===void 0)return;We=2}const He=Q.drawRange,Ne=Q.attributes.position;let rt=He.start*We,ct=(He.start+He.count)*We;fe!==null&&(rt=Math.max(rt,fe.start*We),ct=Math.min(ct,(fe.start+fe.count)*We)),Le!==null?(rt=Math.max(rt,0),ct=Math.min(ct,Le.count)):Ne!=null&&(rt=Math.max(rt,0),ct=Math.min(ct,Ne.count));const Ut=ct-rt;if(Ut<0||Ut===1/0)return;yt.setup(j,te,Ie,Q,Le);let Ct,lt=xe;if(Le!==null&&(Ct=G.get(Le),lt=Ge,lt.setIndex(Ct)),j.isMesh)te.wireframe===!0?(V.setLineWidth(te.wireframeLinewidth*U()),lt.setMode(E.LINES)):lt.setMode(E.TRIANGLES);else if(j.isLine){let Be=te.linewidth;Be===void 0&&(Be=1),V.setLineWidth(Be*U()),j.isLineSegments?lt.setMode(E.LINES):j.isLineLoop?lt.setMode(E.LINE_LOOP):lt.setMode(E.LINE_STRIP)}else j.isPoints?lt.setMode(E.POINTS):j.isSprite&<.setMode(E.TRIANGLES);if(j.isBatchedMesh)if(j._multiDrawInstances!==null)Cc("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),lt.renderMultiDrawInstances(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount,j._multiDrawInstances);else if(F.get("WEBGL_multi_draw"))lt.renderMultiDraw(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount);else{const Be=j._multiDrawStarts,Yt=j._multiDrawCounts,ut=j._multiDrawCount,Kn=Le?G.get(Le).bytesPerElement:1,Tr=W.get(te).currentProgram.getUniforms();for(let Pn=0;Pn{function fe(){if(te.forEach(function(Me){W.get(Me).currentProgram.isReady()&&te.delete(Me)}),te.size===0){j(R);return}setTimeout(fe,10)}F.get("KHR_parallel_shader_compile")!==null?fe():setTimeout(fe,10)})};let $n=null;function Ci(R){$n&&$n(R)}function qm(){Rs.stop()}function jm(){Rs.start()}const Rs=new yb;Rs.setAnimationLoop(Ci),typeof self<"u"&&Rs.setContext(self),this.setAnimationLoop=function(R){$n=R,se.setAnimationLoop(R),R===null?Rs.stop():Rs.start()},se.addEventListener("sessionstart",qm),se.addEventListener("sessionend",jm),this.render=function(R,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),se.enabled===!0&&se.isPresenting===!0&&(se.cameraAutoUpdate===!0&&se.updateCamera(X),X=se.getCamera()),R.isScene===!0&&R.onBeforeRender(y,R,X,I),m=Pe.get(R,v.length),m.init(X),v.push(m),Oe.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),ie.setFromProjectionMatrix(Oe),Te=this.localClippingEnabled,de=ce.init(this.clippingPlanes,Te),g=Ae.get(R,x.length),g.init(),x.push(g),se.enabled===!0&&se.isPresenting===!0){const fe=y.xr.getDepthSensingMesh();fe!==null&&Hh(fe,X,-1/0,y.sortObjects)}Hh(R,X,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(he,me),D=se.enabled===!1||se.isPresenting===!1||se.hasDepthSensing()===!1,D&&Ue.addToRenderList(g,R),this.info.render.frame++,de===!0&&ce.beginShadows();const Q=m.state.shadowsArray;ye.render(Q,R,X),de===!0&&ce.endShadows(),this.info.autoReset===!0&&this.info.reset();const te=g.opaque,j=g.transmissive;if(m.setupLights(),X.isArrayCamera){const fe=X.cameras;if(j.length>0)for(let Me=0,Ie=fe.length;Me0&&$m(te,j,R,X),D&&Ue.render(R),Ym(g,R,X);I!==null&&C===0&&(T.updateMultisampleRenderTarget(I),T.updateRenderTargetMipmap(I)),R.isScene===!0&&R.onAfterRender(y,R,X),yt.resetDefaultState(),b=-1,M=null,v.pop(),v.length>0?(m=v[v.length-1],de===!0&&ce.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,x.pop(),x.length>0?g=x[x.length-1]:g=null};function Hh(R,X,Q,te){if(R.visible===!1)return;if(R.layers.test(X.layers)){if(R.isGroup)Q=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(X);else if(R.isLight)m.pushLight(R),R.castShadow&&m.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||ie.intersectsSprite(R)){te&&De.setFromMatrixPosition(R.matrixWorld).applyMatrix4(Oe);const Me=$.update(R),Ie=R.material;Ie.visible&&g.push(R,Me,Ie,Q,De.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||ie.intersectsObject(R))){const Me=$.update(R),Ie=R.material;if(te&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),De.copy(R.boundingSphere.center)):(Me.boundingSphere===null&&Me.computeBoundingSphere(),De.copy(Me.boundingSphere.center)),De.applyMatrix4(R.matrixWorld).applyMatrix4(Oe)),Array.isArray(Ie)){const Le=Me.groups;for(let We=0,He=Le.length;We0&&Ml(j,X,Q),fe.length>0&&Ml(fe,X,Q),Me.length>0&&Ml(Me,X,Q),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1)}function $m(R,X,Q,te){if((Q.isScene===!0?Q.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[te.id]===void 0&&(m.state.transmissionRenderTarget[te.id]=new Cn(1,1,{generateMipmaps:!0,type:F.has("EXT_color_buffer_half_float")||F.has("EXT_color_buffer_float")?bi:oi,minFilter:_i,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:tt.workingColorSpace}));const fe=m.state.transmissionRenderTarget[te.id],Me=te.viewport||L;fe.setSize(Me.z*y.transmissionResolutionScale,Me.w*y.transmissionResolutionScale);const Ie=y.getRenderTarget();y.setRenderTarget(fe),y.getClearColor(K),J=y.getClearAlpha(),J<1&&y.setClearColor(16777215,.5),y.clear(),D&&Ue.render(Q);const Le=y.toneMapping;y.toneMapping=xi;const We=te.viewport;if(te.viewport!==void 0&&(te.viewport=void 0),m.setupLightsView(te),de===!0&&ce.setGlobalState(y.clippingPlanes,te),Ml(R,Q,te),T.updateMultisampleRenderTarget(fe),T.updateRenderTargetMipmap(fe),F.has("WEBGL_multisampled_render_to_texture")===!1){let He=!1;for(let Ne=0,rt=X.length;Ne0),Ne=!!Q.morphAttributes.position,rt=!!Q.morphAttributes.normal,ct=!!Q.morphAttributes.color;let Ut=xi;te.toneMapped&&(I===null||I.isXRRenderTarget===!0)&&(Ut=y.toneMapping);const Ct=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,lt=Ct!==void 0?Ct.length:0,Be=W.get(te),Yt=m.state.lights;if(de===!0&&(Te===!0||R!==M)){const cn=R===M&&te.id===b;ce.setState(te,R,cn)}let ut=!1;te.version===Be.__version?(Be.needsLights&&Be.lightsStateVersion!==Yt.state.version||Be.outputColorSpace!==Ie||j.isBatchedMesh&&Be.batching===!1||!j.isBatchedMesh&&Be.batching===!0||j.isBatchedMesh&&Be.batchingColor===!0&&j.colorTexture===null||j.isBatchedMesh&&Be.batchingColor===!1&&j.colorTexture!==null||j.isInstancedMesh&&Be.instancing===!1||!j.isInstancedMesh&&Be.instancing===!0||j.isSkinnedMesh&&Be.skinning===!1||!j.isSkinnedMesh&&Be.skinning===!0||j.isInstancedMesh&&Be.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&Be.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&Be.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&Be.instancingMorph===!1&&j.morphTexture!==null||Be.envMap!==Le||te.fog===!0&&Be.fog!==fe||Be.numClippingPlanes!==void 0&&(Be.numClippingPlanes!==ce.numPlanes||Be.numIntersection!==ce.numIntersection)||Be.vertexAlphas!==We||Be.vertexTangents!==He||Be.morphTargets!==Ne||Be.morphNormals!==rt||Be.morphColors!==ct||Be.toneMapping!==Ut||Be.morphTargetsCount!==lt)&&(ut=!0):(ut=!0,Be.__version=te.version);let Kn=Be.currentProgram;ut===!0&&(Kn=Sl(te,X,j));let Tr=!1,Pn=!1,Lo=!1;const Tt=Kn.getUniforms(),kn=Be.uniforms;if(V.useProgram(Kn.program)&&(Tr=!0,Pn=!0,Lo=!0),te.id!==b&&(b=te.id,Pn=!0),Tr||M!==R){V.buffers.depth.getReversed()?(_e.copy(R.projectionMatrix),uA(_e),hA(_e),Tt.setValue(E,"projectionMatrix",_e)):Tt.setValue(E,"projectionMatrix",R.projectionMatrix),Tt.setValue(E,"viewMatrix",R.matrixWorldInverse);const Mn=Tt.map.cameraPosition;Mn!==void 0&&Mn.setValue(E,Xe.setFromMatrixPosition(R.matrixWorld)),z.logarithmicDepthBuffer&&Tt.setValue(E,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&Tt.setValue(E,"isOrthographic",R.isOrthographicCamera===!0),M!==R&&(M=R,Pn=!0,Lo=!0)}if(j.isSkinnedMesh){Tt.setOptional(E,j,"bindMatrix"),Tt.setOptional(E,j,"bindMatrixInverse");const cn=j.skeleton;cn&&(cn.boneTexture===null&&cn.computeBoneTexture(),Tt.setValue(E,"boneTexture",cn.boneTexture,T))}j.isBatchedMesh&&(Tt.setOptional(E,j,"batchingTexture"),Tt.setValue(E,"batchingTexture",j._matricesTexture,T),Tt.setOptional(E,j,"batchingIdTexture"),Tt.setValue(E,"batchingIdTexture",j._indirectTexture,T),Tt.setOptional(E,j,"batchingColorTexture"),j._colorsTexture!==null&&Tt.setValue(E,"batchingColorTexture",j._colorsTexture,T));const zn=Q.morphAttributes;if((zn.position!==void 0||zn.normal!==void 0||zn.color!==void 0)&&ze.update(j,Q,Kn),(Pn||Be.receiveShadow!==j.receiveShadow)&&(Be.receiveShadow=j.receiveShadow,Tt.setValue(E,"receiveShadow",j.receiveShadow)),te.isMeshGouraudMaterial&&te.envMap!==null&&(kn.envMap.value=Le,kn.flipEnvMap.value=Le.isCubeTexture&&Le.isRenderTargetTexture===!1?-1:1),te.isMeshStandardMaterial&&te.envMap===null&&X.environment!==null&&(kn.envMapIntensity.value=X.environmentIntensity),Pn&&(Tt.setValue(E,"toneMappingExposure",y.toneMappingExposure),Be.needsLights&&mS(kn,Lo),fe&&te.fog===!0&&le.refreshFogUniforms(kn,fe),le.refreshMaterialUniforms(kn,te,Y,re,m.state.transmissionRenderTarget[R.id]),Ic.upload(E,Zm(Be),kn,T)),te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(Ic.upload(E,Zm(Be),kn,T),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&Tt.setValue(E,"center",j.center),Tt.setValue(E,"modelViewMatrix",j.modelViewMatrix),Tt.setValue(E,"normalMatrix",j.normalMatrix),Tt.setValue(E,"modelMatrix",j.matrixWorld),te.isShaderMaterial||te.isRawShaderMaterial){const cn=te.uniformsGroups;for(let Mn=0,Gh=cn.length;Mn0&&T.useMultisampledRTT(R)===!1?j=W.get(R).__webglMultisampledFramebuffer:Array.isArray(He)?j=He[Q]:j=He,L.copy(R.viewport),N.copy(R.scissor),B=R.scissorTest}else L.copy(ee).multiplyScalar(Y).floor(),N.copy(ge).multiplyScalar(Y).floor(),B=Fe;if(Q!==0&&(j=_S),V.bindFramebuffer(E.FRAMEBUFFER,j)&&te&&V.drawBuffers(R,j),V.viewport(L),V.scissor(N),V.setScissorTest(B),fe){const Le=W.get(R.texture);E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_CUBE_MAP_POSITIVE_X+X,Le.__webglTexture,Q)}else if(Me){const Le=W.get(R.texture),We=X;E.framebufferTextureLayer(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,Le.__webglTexture,Q,We)}else if(R!==null&&Q!==0){const Le=W.get(R.texture);E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_2D,Le.__webglTexture,Q)}b=-1},this.readRenderTargetPixels=function(R,X,Q,te,j,fe,Me){if(!(R&&R.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ie=W.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Me!==void 0&&(Ie=Ie[Me]),Ie){V.bindFramebuffer(E.FRAMEBUFFER,Ie);try{const Le=R.texture,We=Le.format,He=Le.type;if(!z.textureFormatReadable(We)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!z.textureTypeReadable(He)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=R.width-te&&Q>=0&&Q<=R.height-j&&E.readPixels(X,Q,te,j,je.convert(We),je.convert(He),fe)}finally{const Le=I!==null?W.get(I).__webglFramebuffer:null;V.bindFramebuffer(E.FRAMEBUFFER,Le)}}},this.readRenderTargetPixelsAsync=async function(R,X,Q,te,j,fe,Me){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ie=W.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Me!==void 0&&(Ie=Ie[Me]),Ie)if(X>=0&&X<=R.width-te&&Q>=0&&Q<=R.height-j){V.bindFramebuffer(E.FRAMEBUFFER,Ie);const Le=R.texture,We=Le.format,He=Le.type;if(!z.textureFormatReadable(We))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!z.textureTypeReadable(He))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ne=E.createBuffer();E.bindBuffer(E.PIXEL_PACK_BUFFER,Ne),E.bufferData(E.PIXEL_PACK_BUFFER,fe.byteLength,E.STREAM_READ),E.readPixels(X,Q,te,j,je.convert(We),je.convert(He),0);const rt=I!==null?W.get(I).__webglFramebuffer:null;V.bindFramebuffer(E.FRAMEBUFFER,rt);const ct=E.fenceSync(E.SYNC_GPU_COMMANDS_COMPLETE,0);return E.flush(),await cA(E,ct,4),E.bindBuffer(E.PIXEL_PACK_BUFFER,Ne),E.getBufferSubData(E.PIXEL_PACK_BUFFER,0,fe),E.deleteBuffer(Ne),E.deleteSync(ct),fe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,X=null,Q=0){const te=Math.pow(2,-Q),j=Math.floor(R.image.width*te),fe=Math.floor(R.image.height*te),Me=X!==null?X.x:0,Ie=X!==null?X.y:0;T.setTexture2D(R,0),E.copyTexSubImage2D(E.TEXTURE_2D,Q,0,0,Me,Ie,j,fe),V.unbindTexture()};const vS=E.createFramebuffer(),yS=E.createFramebuffer();this.copyTextureToTexture=function(R,X,Q=null,te=null,j=0,fe=null){fe===null&&(j!==0?(Cc("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),fe=j,j=0):fe=0);let Me,Ie,Le,We,He,Ne,rt,ct,Ut;const Ct=R.isCompressedTexture?R.mipmaps[fe]:R.image;if(Q!==null)Me=Q.max.x-Q.min.x,Ie=Q.max.y-Q.min.y,Le=Q.isBox3?Q.max.z-Q.min.z:1,We=Q.min.x,He=Q.min.y,Ne=Q.isBox3?Q.min.z:0;else{const zn=Math.pow(2,-j);Me=Math.floor(Ct.width*zn),Ie=Math.floor(Ct.height*zn),R.isDataArrayTexture?Le=Ct.depth:R.isData3DTexture?Le=Math.floor(Ct.depth*zn):Le=1,We=0,He=0,Ne=0}te!==null?(rt=te.x,ct=te.y,Ut=te.z):(rt=0,ct=0,Ut=0);const lt=je.convert(X.format),Be=je.convert(X.type);let Yt;X.isData3DTexture?(T.setTexture3D(X,0),Yt=E.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(T.setTexture2DArray(X,0),Yt=E.TEXTURE_2D_ARRAY):(T.setTexture2D(X,0),Yt=E.TEXTURE_2D),E.pixelStorei(E.UNPACK_FLIP_Y_WEBGL,X.flipY),E.pixelStorei(E.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),E.pixelStorei(E.UNPACK_ALIGNMENT,X.unpackAlignment);const ut=E.getParameter(E.UNPACK_ROW_LENGTH),Kn=E.getParameter(E.UNPACK_IMAGE_HEIGHT),Tr=E.getParameter(E.UNPACK_SKIP_PIXELS),Pn=E.getParameter(E.UNPACK_SKIP_ROWS),Lo=E.getParameter(E.UNPACK_SKIP_IMAGES);E.pixelStorei(E.UNPACK_ROW_LENGTH,Ct.width),E.pixelStorei(E.UNPACK_IMAGE_HEIGHT,Ct.height),E.pixelStorei(E.UNPACK_SKIP_PIXELS,We),E.pixelStorei(E.UNPACK_SKIP_ROWS,He),E.pixelStorei(E.UNPACK_SKIP_IMAGES,Ne);const Tt=R.isDataArrayTexture||R.isData3DTexture,kn=X.isDataArrayTexture||X.isData3DTexture;if(R.isDepthTexture){const zn=W.get(R),cn=W.get(X),Mn=W.get(zn.__renderTarget),Gh=W.get(cn.__renderTarget);V.bindFramebuffer(E.READ_FRAMEBUFFER,Mn.__webglFramebuffer),V.bindFramebuffer(E.DRAW_FRAMEBUFFER,Gh.__webglFramebuffer);for(let Is=0;Is{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return xs(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const Gf=new WeakMap,w2=(...n)=>{var e;const t=n[0],i=(e=ji())==null?void 0:e.proxy;if(i==null&&!cy())throw new Error("injectLocal must be called in setup");return i&&Gf.has(i)&&t in Gf.get(i)?Gf.get(i)[t]:ar(...n)},Od=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const A2=n=>n!=null,C2=Object.prototype.toString,R2=n=>C2.call(n)==="[object Object]",Ud=()=>{};function I2(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}function P2(n,e={}){let t,i,s=Ud;const r=l=>{clearTimeout(l),s(),s=Ud};let o;return l=>{const c=Vt(n),u=Vt(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((h,f)=>{s=e.rejectOnCancel?f:h,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,h(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,h(l())},c)})}}function h0(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function L2(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function D2(n){return ji()}function ga(n){return Array.isArray(n)?n:[n]}function O2(n,e=200,t={}){return I2(P2(e,t),n)}function f0(n,e=200,t={}){const i=vt(n.value),s=O2(()=>{i.value=n.value},e,t);return pt(n,()=>s()),i}function U2(n,e={}){if(!Bt(n))return aE(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=oE(()=>({get(){return n.value[i]},set(s){var r;if((r=Vt(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}const $t=Vt;function mm(n,e=!0,t){D2()?_s(n,t):e?n():$v(n)}function N2(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t;let r=null;const o=it(!1);function a(){r&&(clearInterval(r),r=null)}function l(){o.value=!1,a()}function c(){const u=Vt(e);u<=0||(o.value=!0,s&&n(),a(),o.value&&(r=setInterval(n,u)))}if(i&&Od&&c(),Bt(e)||typeof e=="function"){const u=pt(e,()=>{o.value&&Od&&c()});xs(u)}return xs(l),{isActive:o,pause:l,resume:c}}function Tb(n,e,t){return pt(n,e,{...t,immediate:!0})}const Qi=Od?window:void 0;function ii(n){var e;const t=Vt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function yr(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=bt(()=>{const a=ga(Vt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=Tb(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>ii(c)))!=null?l:[Qi].filter(c=>c!=null),ga(Vt(s.value?n[1]:n[0])),ga(gt(s.value?n[2]:n[1])),Vt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=R2(u)?{...u}:u;e.push(...a.flatMap(f=>l.flatMap(d=>c.map(p=>i(f,d,p,h)))))},{flush:"post"}),o=()=>{r(),t()};return xs(t),o}function F2(){const n=it(!1),e=ji();return e&&_s(()=>{n.value=!0},e),n}function Uh(n){const e=F2();return bt(()=>(e.value,!!n()))}function B2(n,e,t={}){const{window:i=Qi,...s}=t;let r;const o=Uh(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=bt(()=>{const f=Vt(n),d=ga(f).map(ii).filter(A2);return new Set(d)}),c=pt(()=>l.value,f=>{a(),o.value&&f.size&&(r=new MutationObserver(e),f.forEach(d=>r.observe(d,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),a()};return xs(h),{isSupported:o,stop:h,takeRecords:u}}function gm(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:s=Qi,once:r=!1}=e,o=it(!1),a=bt(()=>i?1e3/Vt(i):null);let l=0,c=null;function u(d){if(!o.value||!s)return;l||(l=d);const p=d-l;if(a.value&&pt&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=it(typeof i=="number"),o=it(),a=it(!1),l=c=>{a.value=c.matches};return Qu(()=>{if(r.value){r.value=!s.value;const c=Vt(n).split(",");a.value=c.some(u=>{const h=u.includes("not all"),f=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),d=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(f||d);return f&&p&&(p=i>=h0(f[1])),d&&p&&(p=i<=h0(d[1])),h?!p:p});return}s.value&&(o.value=t.matchMedia(Vt(n)),a.value=o.value.matches)}),yr(o,"change",l,{passive:!0}),bt(()=>a.value)}function V2(n={}){const{window:e=Qi}=n,t=it(1),i=wb(()=>`(resolution: ${t.value}dppx)`,n);let s=Ud;return e&&(s=Tb(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:hr(t),stop:s}}function Ab(n,e,t={}){const{window:i=Qi,...s}=t;let r;const o=Uh(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=bt(()=>{const h=Vt(n);return Array.isArray(h)?h.map(f=>ii(f)):[ii(h)]}),c=pt(l,h=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return xs(u),{isSupported:o,stop:u}}function H2(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=it(0),l=it(0),c=it(0),u=it(0),h=it(0),f=it(0),d=it(0),p=it(0);function _(){const m=ii(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,d.value=0,p.value=0);return}const x=m.getBoundingClientRect();a.value=x.height,l.value=x.bottom,c.value=x.left,u.value=x.right,h.value=x.top,f.value=x.width,d.value=x.x,p.value=x.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return Ab(n,g),pt(()=>ii(n),m=>!m&&g()),B2(n,g,{attributeFilter:["style","class"]}),s&&yr("scroll",g,{capture:!0,passive:!0}),i&&yr("resize",g,{passive:!0}),mm(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:h,width:f,x:d,y:p,update:g}}function G2(n,e={width:0,height:0},t={}){const{window:i=Qi,box:s="content-box"}=t,r=bt(()=>{var h,f;return(f=(h=ii(n))==null?void 0:h.namespaceURI)==null?void 0:f.includes("svg")}),o=it(e.width),a=it(e.height),{stop:l}=Ab(n,([h])=>{const f=s==="border-box"?h.borderBoxSize:s==="content-box"?h.contentBoxSize:h.devicePixelContentBoxSize;if(i&&r.value){const d=ii(n);if(d){const p=d.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(f){const d=ga(f);o.value=d.reduce((p,{inlineSize:_})=>p+_,0),a.value=d.reduce((p,{blockSize:_})=>p+_,0)}else o.value=h.contentRect.width,a.value=h.contentRect.height},t);mm(()=>{const h=ii(n);h&&(o.value="offsetWidth"in h?h.offsetWidth:e.width,a.value="offsetHeight"in h?h.offsetHeight:e.height)});const c=pt(()=>ii(n),h=>{o.value=h?e.width:0,a.value=h?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function W2(n){var e;const t=it(0);if(typeof performance>"u")return t;const i=(e=n==null?void 0:n.every)!=null?e:10;let s=performance.now(),r=0;return gm(()=>{if(r+=1,r>=i){const o=performance.now(),a=o-s;t.value=Math.round(1e3/(a/r)),s=o,r=0}}),t}function X2(n={}){const e=vt(),t=Uh(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;N2(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const Cb={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},q2=Object.keys(Cb);function j2(n={}){const{target:e=Qi}=n,t=it(!1),i=vt(n.initialValue||{});Object.assign(i.value,Cb,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=L2(r,q2,!1))};if(e){const r={passive:!0};yr(e,["pointerdown","pointermove","pointerup"],s,r),yr(e,"pointerleave",()=>t.value=!1,r)}return{...U2(i),isInside:t}}function Y2(n={}){const{window:e=Qi,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=it(t),l=it(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:h,height:f,scale:d}=e.visualViewport;a.value=Math.round(h*d),l.value=Math.round(f*d)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),mm(c);const u={passive:!0};if(yr("resize",c,u),e&&o==="visual"&&e.visualViewport&&yr(e.visualViewport,"resize",c,u),s){const h=wb("(orientation: portrait)");pt(h,()=>c())}return{width:a,height:l}}var $2=Object.defineProperty,K2=(n,e,t)=>e in n?$2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,d0=(n,e,t)=>K2(n,typeof e!="symbol"?e+"":e,t);const Z2="@tresjs/core",J2="module",Q2="4.3.4",eD="pnpm@10.6.3",tD="Declarative ThreeJS using Vue Components",nD="Alvaro Saburido (https://github.com/alvarosabu/)",iD="MIT",sD={type:"git",url:"git+https://github.com/Tresjs/tres.git"},rD=["vue","3d","threejs","three","threejs-vue"],oD=!1,aD={".":{types:"./dist/index.d.ts",import:"./dist/tres.js",require:"./dist/tres.umd.cjs"},"./components":{types:"./dist/src/components/index.d.ts"},"./composables":{types:"./dist/src/composables/index.d.ts"},"./types":{types:"./dist/src/types/index.d.ts"},"./utils":{types:"./dist/src/utils/index.d.ts"},"./*":"./*"},lD="./dist/tres.js",cD="./dist/tres.js",uD="./dist/index.d.ts",hD=["*.d.ts","dist"],fD={access:"public"},dD={dev:"pnpm --filter='./playground/vue' dev","dev:nuxt":"pnpm --filter='./playground/nuxt' dev",build:"vite build",test:"vitest","test:ci":"vitest run","test:ui":"vitest --ui --coverage.enabled=true",release:"release-it",coverage:"vitest run --coverage",lint:"eslint .","lint:fix":"eslint . --fix","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:serve":"vitepress serve docs","docs:preview":"vitepress preview docs","docs:contributors":"esno scripts/update-contributors.ts"},pD={three:">=0.133",vue:">=3.4"},mD={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},gD={"@release-it/conventional-changelog":"^10.0.0","@stackblitz/sdk":"^1.11.0","@tresjs/cientos":"4.1.0","@tresjs/eslint-config":"^1.4.0","@types/three":"^0.173.0","@typescript-eslint/eslint-plugin":"^8.23.0","@typescript-eslint/parser":"^8.23.0","@vitejs/plugin-vue":"^5.2.1","@vitest/coverage-c8":"^0.33.0","@vitest/coverage-v8":"^3.0.5","@vitest/ui":"^3.0.5","@vue/test-utils":"^2.4.6",eslint:"^9.19.0","eslint-plugin-vue":"^9.32.0",esno:"^4.8.0",gsap:"^3.12.7",jsdom:"^26.0.0",kolorist:"^1.8.0",ohmyfetch:"^0.4.21",pathe:"^2.0.2","release-it":"^18.1.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-visualizer":"^5.14.0",sponsorkit:"^16.3.0",three:"^0.173.0",unocss:"^65.4.3",unplugin:"^2.1.2","unplugin-vue-components":"^28.0.0",vite:"^6.1.0","vite-plugin-banner":"^0.8.0","vite-plugin-dts":"4.5.0","vite-plugin-inspect":"^10.1.0","vite-plugin-require-transform":"^1.0.21","vite-svg-loader":"^5.1.0",vitepress:"1.6.3",vitest:"3.0.5",vue:"3.5.13","vue-demi":"^0.14.10"},_D={name:Z2,type:J2,version:Q2,packageManager:eD,description:tD,author:nD,license:iD,repository:sD,keywords:rD,sideEffects:oD,exports:aD,main:lD,module:cD,types:uD,files:hD,publishConfig:fD,scripts:dD,peerDependencies:pD,dependencies:mD,devDependencies:gD};class vD extends It{constructor(...e){super(...e),d0(this,"type","HightlightMesh"),d0(this,"createTime"),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}}function Nd(n){return typeof n>"u"}function _m(n){return Array.isArray(n)}function yD(n){return typeof n=="number"}function Rb(n){return typeof n=="string"}function Jr(n){return typeof n=="function"}function Ai(n){return n===Object(n)&&!_m(n)&&!Jr(n)}function ps(n){return Ai(n)&&!!n.isObject3D}function Ib(n){return Ai(n)&&!!n.isColor}function xD(n){return n!=null&&(typeof n=="string"||typeof n=="number"||Ib(n))}function Fd(n){return n!==null&&typeof n=="object"&&"set"in n&&typeof n.set=="function"}function bD(n){return Fd(n)&&"copy"in n&&typeof n.copy=="function"}function MD(n){return!!(n!=null&&n.constructor)}function p0(n){return n instanceof rl}function m0(n){return Ai(n)&&!!n.isCamera}function SD(n){return Ai(n)&&!!n.isBufferGeometry}function ED(n){return Ai(n)&&!!n.isMaterial}function TD(n){return Ai(n)&&!!n.isLight}function wD(n){return Ai(n)&&!!n.isFog}function AD(n){return Ai(n)&&!!n.isScene}function yc(n){return ps(n)||SD(n)||ED(n)||wD(n)}function CD(n){return Ai(n)&&!!n.isPrimitive}const Pb=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],Pb(n[t],e[t]));return Object.assign(n||{},e),n},RD="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",ID=DD(RD);function g0(n){return n&&n.nodeType===1}function Wf(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const PD=/\B([A-Z])/g;function LD(n){return n.replace(PD,"-$1").toLowerCase()}function DD(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const _0=(n,e)=>{if(!e)return;const t=Array.isArray(e)?e:e.match(/([^[.\]])+/g);return t==null?void 0:t.reduce((i,s)=>i&&i[s],n)},OD=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(/([^[.\]])+/g);i&&i.reduce((s,r,o)=>(s[r]===void 0&&(s[r]={}),o===i.length-1&&(s[r]=t),s[r]),n)};function Lb(n,e){if(g0(n)&&g0(e)){const s=n.attributes,r=e.attributes;return s.length!==r.length?!1:Array.from(s).every(({name:o,value:a})=>e.getAttribute(o)===a)}if(n===e)return!0;if(n===null||typeof n!="object"||e===null||typeof e!="object")return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const s of t)if(!i.includes(s)||!Lb(n[s],e[s]))return!1;return!0}function UD(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t{if(l.uuid===e)return l;for(const c of l.children){const u=s(c);if(u)return u}},r=s(n);if(!r){console.warn("Object with UUID not found in the scene.");return}let o=r;for(let l=0;lDb(i)),!(n instanceof mh)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(s=>v0(s)):i.material&&v0(i.material)}}function kD(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const x0=/-\d+$/;function zD(n,e,t){if(Rb(t)){if(x0.test(t)){const r=t.replace(x0,""),{target:o,key:a}=Bd(n,r);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>Nd(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:s}=Bd(n,t);e.__tres.previousAttach=i[s],i[s]=vo(e)}else e.__tres.previousAttach=t(n,e)}function VD(n,e,t){var i,s,r;if(Rb(t)){const{target:o,key:a}=Bd(n,t),l=e.__tres.previousAttach;l===void 0?delete o[a]:o[a]=l,"__tresDetach"in o&&o.__tresDetach()}else(s=(i=e.__tres)==null?void 0:i.previousAttach)==null||s.call(i,n,e);(r=e.__tres)==null||delete r.previousAttach}function Js(n,e,t){const i=n;return i.__tres={type:"unknown",eventCount:0,root:t,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(i.isMaterial?i.__tres.attach="material":i.isBufferGeometry?i.__tres.attach="geometry":i.isFog&&(i.__tres.attach="fog")),i}function Ob(n){var e;const t=(e=n==null?void 0:n.__tres)==null?void 0:e.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function HD(n,e,t){var i;if(!Jr(n.setPixelRatio))return;let s=0;if(t&&_m(t)&&t.length>=2){const[r,o]=t;s=Hp.clamp(e,r,o)}else yD(t)?s=t:s=e;s!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(s)}function GD(n,e,t,i,s){const r=[...e.__tres.objects],o=vo(e);if(n=vo(n),o===n)return!0;const a=Js(n,e.__tres??{},s),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of r)Ub(u,s),Nb(u,s);o.__tres.objects=[],i.remove(e);for(const[u,h]of Object.entries(c))i.patchProp(a,u,a[u],h);t(n),i.insert(e,l);for(const u of r)i.insert(u,e);return!0}function vo(n){return CD(n)?(n.object.__tres=n.__tres,n.object):n}function Ub(n,e){var t,i,s,r;const o=((t=n.__tres)==null?void 0:t.parent)||e.scene.value;n.__tres&&(n.__tres.parent=null),o&&o.__tres&&"objects"in o.__tres&&kD(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?VD(o,n,n.__tres.attach):((r=(s=n.parent)==null?void 0:s.remove)==null||r.call(s,vo(n)),n.parent=null)}function Nb(n,e){var t;(t=n.traverse)==null||t.call(n,i=>{var s;e.deregisterCamera(i),(s=e.eventManager)==null||s.deregisterPointerMissedObject(i)}),e.deregisterCamera(n),Ob(n)}const WD=({sizes:n})=>{const e=vt([]),t=bt(()=>e.value[0]),i=o=>{const a=o instanceof ol?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},s=(o,a=!1)=>{if(m0(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},r=o=>{if(m0(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return Qu(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof Ft||XD(o))&&(o instanceof Ft?o.aspect=n.aspectRatio.value:(o.left=n.width.value*-.5,o.right=n.width.value*.5,o.top=n.height.value*.5,o.bottom=n.height.value*-.5),o.updateProjectionMatrix())})}),qi(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:s,deregisterCamera:r,setCameraActive:i}};function XD(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Fu="[TresJS ▲ ■ ●] ";function qD(...n){typeof n[0]=="string"?n[0]=Fu+n[0]:n.unshift(Fu),console.error(...n)}function jD(...n){typeof n[0]=="string"?n[0]=Fu+n[0]:n.unshift(Fu),console.warn(...n)}function YD(n,e){}function Fb(){return{logError:qD,logWarning:jD,logMessage:YD}}const kd=vt({}),Bu=n=>Object.assign(kd.value,n);function Xf(){const n=new Map,e=new Set;let t=0,i=!1;const s=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},r=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>r(o);return xs(l),i=!0,{off:l}},off:r,trigger:(...o)=>{i&&(s(),i=!1),e.forEach(a=>a(...o))},dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}function $D(){let n=!0,e=!0,t=!1;const i=new gl(!1),s=vt(i.running),r=vt(!1);let o;const a=Hp.generateUUID();let l=null;const c=Xf(),u=Xf(),h=Xf();A();let f={};function d(C){f=C}function p(C,I,b=0){switch(I){case"before":return c.on(C,b);case"render":return l||(l=C),u.dispose(),u.on(C);case"after":return h.on(C,b)}}function _(){e&&(e=!1,A(),w())}function g(){e=!0,A(),cancelAnimationFrame(o)}function m(){t=!1,A()}function x(){t=!0,A()}function v(){r.value=!0}function y(){r.value=!1}function w(){if(!n){o=requestAnimationFrame(w);return}const C=i.getDelta(),I=i.getElapsedTime(),b={camera:gt(f.camera),scene:gt(f.scene),renderer:gt(f.renderer),raycaster:gt(f.raycaster),controls:gt(f.controls),invalidate:f.invalidate,advance:f.advance},M={delta:C,elapsed:I,clock:i,...b};s.value&&c.trigger(M),r.value||(u.count?u.trigger(M):l&&l(M)),s.value&&h.trigger(M),o=requestAnimationFrame(w)}function A(){const C=!e&&!t;i.running!==C&&(i.running?i.stop():i.start()),s.value=i.running}return{loopId:a,register:(C,I,b)=>p(C,I,b),start:_,stop:g,pause:x,resume:m,pauseRender:v,resumeRender:y,isRenderPaused:r,isActive:s,setContext:d,setReady:C=>n=C}}function vm(n){let e=0;return n.traverse(t=>{if(t.isMesh&&t.geometry&&t.type!=="HightlightMesh"){const i=t.geometry,s=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,r=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=s+r+o+a;e+=l}}),e}function KD(n){return(n/1024).toFixed(2)}const ZD=Number.parseInt(tl.replace("dev",""));function JD(n){return n instanceof ve?n:Array.isArray(n)?new ve(...n):new ve(n)}const xc={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:nn,toneMapping:So,toneMappingExposure:3,shadowMap:{enabled:!0,type:Ep}},flat:{toneMapping:xi,toneMappingExposure:1}};function QD({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:s,advance:r}}){const o=bt(()=>({alpha:$t(e.alpha)??!0,depth:$t(e.depth),canvas:ii(n),context:$t(e.context),stencil:$t(e.stencil),antialias:$t(e.antialias)??!0,precision:$t(e.precision),powerPreference:$t(e.powerPreference),premultipliedAlpha:$t(e.premultipliedAlpha),preserveDrawingBuffer:$t(e.preserveDrawingBuffer),logarithmicDepthBuffer:$t(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:$t(e.failIfMajorPerformanceCaveat)})),a=it(new Pc(o.value));function l(){e.renderMode==="on-demand"&&s()}pt(o,()=>{a.value.dispose(),a.value=new Pc(o.value),l()}),pt([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),pt(()=>e.clearColor,l);const{pixelRatio:c}=V2(),{logError:u}=Fb(),h=(()=>{const d=new Pc,p={shadowMap:{enabled:d.shadowMap.enabled,type:d.shadowMap.type},toneMapping:d.toneMapping,toneMappingExposure:d.toneMappingExposure,outputColorSpace:d.outputColorSpace};return d.dispose(),p})(),f=$t(e.renderMode);return f==="on-demand"&&s(),f==="manual"&&setTimeout(()=>{r()},100),Qu(()=>{const d=$t(e.preset);d&&(d in xc||u(`Renderer Preset must be one of these: ${Object.keys(xc).join(", ")}`),Pb(a.value,xc[d])),HD(a.value,c.value,$t(e.dpr)),f==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,x)=>{const v=$t(m),y=()=>{if(d)return _0(xc[d],x)};if(v!==void 0)return v;const w=y();return w!==void 0?w:_0(h,x)},_=(m,x)=>OD(a.value,x,p(m,x));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??So,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),ZD<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?JD(g):new ve(0))}),qi(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function eO(n,e,t=10){const i=$t(n)?Y2():G2(bt(()=>$t(e).parentElement)),s=hr(f0(i.width,t)),r=hr(f0(i.height,t)),o=bt(()=>s.value/r.value);return{height:r,width:s,aspectRatio:o}}const tO=(n,e)=>{const t=bt(()=>e.renderer.value.domElement),i=it([]),{x:s,y:r}=j2({target:t});let o=0;const{width:a,height:l,top:c,left:u}=H2(t),h=({x:ee,y:ge})=>{if(t.value)return{x:(ee-u.value)/a.value*2-1,y:-((ge-c.value)/l.value)*2+1}},f=({x:ee,y:ge})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new oe(ee,ge),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},d=ee=>{const ge=h({x:(ee==null?void 0:ee.clientX)??s.value,y:(ee==null?void 0:ee.clientY)??r.value});return ge?f(ge)||[]:[]},p=Wn(),_=Wn(),g=Wn(),m=Wn(),x=Wn(),v=Wn(),y=Wn(),w=Wn();function A(ee){const ge={};for(const Fe in ee)typeof Fe!="function"&&(ge[Fe]=ee[Fe]);return ge}const C=(ee,ge)=>{var Fe,ie,de;const Te=A(ge),_e=new P(ge==null?void 0:ge.clientX,ge==null?void 0:ge.clientY,0).unproject((Fe=e.camera)==null?void 0:Fe.value);ee.trigger({...Te,intersections:i.value,unprojectedPoint:_e,ray:(ie=e.raycaster)==null?void 0:ie.value.ray,camera:(de=e.camera)==null?void 0:de.value,sourceEvent:ge,delta:o,stopPropagating:!1})};let I;const b=ee=>{d(ee),C(g,ee),I=ee},M=()=>{I&&b(I)};let L,N,B;const K=ee=>{var ge;L=(ge=i.value[0])==null?void 0:ge.object,o=0,N=new oe((ee==null?void 0:ee.clientX)??s.value,(ee==null?void 0:ee.clientY)??r.value),C(x,ee)};let J,k=!1;const re=ee=>{var ge,Fe,ie;ee instanceof PointerEvent&&(i.value.length===0&&C(v,ee),L===((ge=i.value[0])==null?void 0:ge.object)&&(B=new oe((ee==null?void 0:ee.clientX)??s.value,(ee==null?void 0:ee.clientY)??r.value),o=N==null?void 0:N.distanceTo(B),ee.button===0?(C(p,ee),J===((Fe=i.value[0])==null?void 0:Fe.object)?k=!0:(J=(ie=i.value[0])==null?void 0:ie.object,k=!1)):ee.button===2&&C(y,ee)),C(m,ee))},Y=ee=>{k&&(C(_,ee),J=void 0,k=!1)},he=ee=>C(g,ee),me=ee=>C(w,ee);return t.value.addEventListener("pointerup",re),t.value.addEventListener("pointerdown",K),t.value.addEventListener("pointermove",b),t.value.addEventListener("pointerleave",he),t.value.addEventListener("dblclick",Y),t.value.addEventListener("wheel",me),qi(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",re),t.value.removeEventListener("pointerdown",K),t.value.removeEventListener("pointermove",b),t.value.removeEventListener("pointerleave",he),t.value.removeEventListener("dblclick",Y),t.value.removeEventListener("wheel",me))}),{intersects:i,onClick:ee=>p.on(ee).off,onDblClick:ee=>_.on(ee).off,onContextMenu:ee=>y.on(ee).off,onPointerMove:ee=>g.on(ee).off,onPointerUp:ee=>m.on(ee).off,onPointerDown:ee=>x.on(ee).off,onPointerMissed:ee=>v.on(ee).off,onWheel:ee=>w.on(ee).off,forceUpdate:M}};function qf(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function nO(n,e,t){var i;const s=it(),r=it();n&&(s.value=n),e&&(r.value=e);const o=b=>{var M;return((M=b.__tres)==null?void 0:M.eventCount)>0},a=b=>{var M;return((M=b.children)==null?void 0:M.some(L=>a(L)))||o(b)},l=it(((i=s.value)==null?void 0:i.children).filter(a)||[]);function c(b,M){const L=[],N=()=>M.stopPropagating=!0;M.stopPropagation=N;for(const B of M==null?void 0:M.intersections){if(M.stopPropagating)return;M={...M,...B};const{object:K}=B;M.eventObject=K,qf(K[b],M),L.push(K);let J=K.parent;for(;J!==null&&!M.stopPropagating&&!L.includes(J);)M.eventObject=J,qf(J[b],M),L.push(J),J=J.parent;const k=LD(b.slice(2));t(k,{intersection:B,event:M})}}const{onClick:u,onDblClick:h,onContextMenu:f,onPointerMove:d,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:x}=tO(l,e);_(b=>c("onPointerUp",b)),p(b=>c("onPointerDown",b)),u(b=>c("onClick",b)),h(b=>c("onDoubleClick",b)),f(b=>c("onContextMenu",b)),m(b=>c("onWheel",b));let v=[];d(b=>{const M=b.intersections.map(({object:N})=>N),L=b.intersections;v.forEach(({object:N})=>{M.includes(N)||(b.intersections=v,c("onPointerLeave",b),c("onPointerOut",b))}),b.intersections=L,b.intersections.forEach(({object:N})=>{v.includes(N)||(c("onPointerEnter",b),c("onPointerOver",b))}),c("onPointerMove",b),v=b.intersections});const y=[];g(b=>{const M=()=>b.stopPropagating=!0;b.stopPropagation=M,y.forEach(L=>{b.stopPropagating||(b.eventObject=L,qf(L.onPointerMissed,b))}),t("pointer-missed",{event:b})});function w(b){yc(b)&&ps(b)&&l.value.push(b)}function A(b){if(yc(b)&&ps(b)){const M=l.value.indexOf(b);M>-1&&l.value.splice(M,1)}}function C(b){yc(b)&&ps(b)&&b.onPointerMissed&&y.push(b)}function I(b){if(yc(b)&&ps(b)){const M=y.indexOf(b);M>-1&&y.splice(M,1)}}return e.eventManager={forceUpdate:x,registerObject:w,deregisterObject:A,registerPointerMissedObject:C,deregisterPointerMissedObject:I},{forceUpdate:x,registerObject:w,deregisterObject:A,registerPointerMissedObject:C,deregisterPointerMissedObject:I}}function iO(n,e,t=100){t=t<=0?100:t;const i=Wn(),s=new Set;let r=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!r&&n()?(i.trigger(e),s.forEach(h=>h()),s.clear(),r=!0):!o&&!r&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(h,...f)=>{h(...f)};return{on:h=>{if(r)return u(h,e),{off:()=>{}};{const f=i.on(h);return s.add(f.off),i.on(h)}},off:i.off,trigger:i.trigger,clear:i.clear,cancel:c}}const jf=new WeakMap;function sO(n){if(n=n||ym(),jf.has(n))return jf.get(n);const e=100,t=Date.now(),i=iO(()=>{if(Date.now()-t>=e)return!0;{const s=n.renderer.value,r=(s==null?void 0:s.domElement)||{width:0,height:0};return!!(s&&r.width>0&&r.height>0)}},n);return jf.set(n,i),i}function rO({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:s}){const r=it(n),o=eO(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:h}=WD({sizes:o}),f={mode:vt(i.renderMode||"always"),priority:vt(0),frames:vt(0),maxFrames:60,canBeInvalidated:bt(()=>f.mode.value==="on-demand"&&f.frames.value===0)};function d(B=1){i.renderMode==="on-demand"&&(f.frames.value=Math.min(f.maxFrames,f.frames.value+B))}function p(){i.renderMode==="manual"&&(f.frames.value=1)}const{renderer:_}=QD({canvas:e,options:i,contextParts:{sizes:o,render:f,invalidate:d,advance:p}}),g={sizes:o,scene:r,camera:a,cameras:hr(l),renderer:_,raycaster:it(new _b),controls:vt(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:f,advance:p,extend:Bu,invalidate:d,registerCamera:c,setCameraActive:h,deregisterCamera:u,loop:$D()};ra("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&f.frames.value>0&&(_.value.render(n,a.value),s("render",g.renderer.value)),f.priority.value=0,f.mode.value==="always"?f.frames.value=1:f.frames.value=Math.max(0,f.frames.value-1)},"render");const{on:m,cancel:x}=sO(g);g.loop.setReady(!1),g.loop.start(),m(()=>{s("ready",g),g.loop.setReady(!0),nO(n,g,s)}),qi(()=>{x(),g.loop.stop()});const v=100,y=W2({every:v}),{isSupported:w,memory:A}=X2({interval:v}),C=160;let I=performance.now();const b=({timestamp:B})=>{g.scene.value&&(g.perf.memory.allocatedMem=vm(g.scene.value)),B-I>=v&&(I=B,g.perf.fps.accumulator.push(y.value),g.perf.fps.accumulator.length>C&&g.perf.fps.accumulator.shift(),g.perf.fps.value=y.value,w.value&&A.value&&(g.perf.memory.accumulator.push(A.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>C&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce((K,J)=>K+J,0)/g.perf.memory.accumulator.length))};let M=0;const L=1,{pause:N}=gm(({delta:B})=>{window.__TRES__DEVTOOLS__&&(b({timestamp:performance.now()}),M+=B,M>=L&&(window.__TRES__DEVTOOLS__.cb(g),M=0))},{immediate:!0});return qi(()=>{N()}),g}function ym(){const n=ar("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}const oO=ym;function aO(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:s,controls:r,invalidate:o,advance:a}=ym();i.setContext({camera:n,scene:e,renderer:t,raycaster:s,controls:r,invalidate:o,advance:a});function l(h,f=0){return i.register(h,"before",f)}function c(h){return i.register(h,"render")}function u(h,f=0){return i.register(h,"after",f)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const Bb=Wn(),kb=Wn(),xm=Wn(),_a=new gl;let Lc=0,Dc=0;const{pause:lO,resume:b0,isActive:cO}=gm(()=>{Bb.trigger({delta:Lc,elapsed:Dc,clock:_a}),kb.trigger({delta:Lc,elapsed:Dc,clock:_a}),xm.trigger({delta:Lc,elapsed:Dc,clock:_a})},{immediate:!1});xm.on(()=>{Lc=_a.getDelta(),Dc=_a.getElapsedTime()});let M0=!1;const uO=()=>(M0||(M0=!0,b0()),{onBeforeLoop:Bb.on,onLoop:kb.on,onAfterLoop:xm.on,pause:lO,resume:b0,isActive:cO});function hO(n,e={},t={}){let i=n;const s=a=>{i=a};let r=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){return t[l]?t[l](c,i,r,s):i[l]=c,!0}};return r=new Proxy({},o),r}const{logError:S0}=Fb(),E0=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],fO=n=>{const e=n.scene.value;function t(c,u,h,f){if(f||(f={}),f.args||(f.args=[]),c==="template"||ID(c))return null;let d=c.replace("Tres",""),p;if(c==="primitive"){(!Ai(f.object)||Bt(f.object))&&S0("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),d=f.object.type;const _={};p=hO(f.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,x,v)=>{GD(g,x,v,{patchProp:r,remove:s,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=kd.value[d];_||S0(`${d} is not defined on the THREE namespace. Use extend to add it to the catalog.`),p=new _(...f.args)}return p?(p.isCamera&&(f!=null&&f.position||p.position.set(3,3,3),f!=null&&f.lookAt||p.lookAt(0,0,0)),p=Js(p,{...p.__tres,type:d,memoizedProps:f,eventCount:0,primitive:c==="primitive",attach:f.attach},n),p):null}function i(c,u){var h,f,d;if(!c)return;u=u||e;const p=c.__tres?c:Js(c,{},n),_=u.__tres?u:Js(u,{},n);c=vo(p),u=vo(_),c.__tres&&((h=c.__tres)==null?void 0:h.eventCount)>0&&((f=n.eventManager)==null||f.registerObject(c)),n.registerCamera(c),(d=n.eventManager)==null||d.registerPointerMissedObject(c),p.__tres.attach?zD(_,p,p.__tres.attach):ps(c)&&ps(_)&&(_.add(c),c.dispatchEvent({type:"added"})),p.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(p)&&_.__tres.objects.push(p)}function s(c,u){var h,f,d,p;if(!c)return;c!=null&&c.__tres&&((h=c.__tres)==null?void 0:h.eventCount)>0&&((f=n.eventManager)==null||f.deregisterObject(c)),u=Nd(u)?"default":u;const _=(d=c.__tres)==null?void 0:d.dispose;Nd(_)||(_===null?u=!1:u=_);const g=(p=c.__tres)==null?void 0:p.primitive,m=u==="default"?!g:!!u;if(c.__tres&&"objects"in c.__tres&&[...c.__tres.objects].forEach(x=>s(x,u)),m&&c.children&&[...c.children].forEach(x=>s(x,u)),Ub(c,n),Nb(c,n),m&&!AD(c)){if(Jr(u))u(c);else if(Jr(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function r(c,u,h,f){var d,p;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=f),u==="attach"){const y=((d=c.__tres)==null?void 0:d.parent)||c.parent;s(c),Js(c,{attach:f},n),y&&i(c,y);return}if(u==="dispose"){c.__tres||(c=Js(c,{},n)),c.__tres.dispose=f;return}if(ps(c)&&g==="blocks-pointer-events"){f||f===""?c[g]=f:delete c[g];return}E0.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=Wf(g),x=_==null?void 0:_[m];if(g==="args"){const y=c,w=h??[],A=f??[],C=((p=c.__tres)==null?void 0:p.type)||c.type;C&&w.length&&!UD(w,A)&&(_=Object.assign(y,new kd.value[C](...f)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(Wf(g),new mt(...f));return}if(g.includes("-")&&x===void 0){x=_;for(const y of g.split("-"))m=g=Wf(y),_=x,x=x==null?void 0:x[g]}let v=f;if(v===""&&(v=!0),Jr(x)){E0.includes(u)||(_m(v)?c[m](...v):c[m](v)),m.startsWith("on")&&Jr(v)&&(_[m]=v);return}p0(x)&&p0(v)?x.mask=v.mask:Ib(x)&&xD(v)?x.set(v):bD(x)&&MD(v)&&x.constructor===v.constructor?x.copy(v):Fd(x)&&Array.isArray(v)?"fromArray"in x&&typeof x.fromArray=="function"?x.fromArray(v):x.set(...v):Fd(x)&&typeof v=="number"?"setScalar"in x&&typeof x.setScalar=="function"?x.setScalar(v):x.set(v):_[g]=v,Ob(c)}function o(c){var u;return((u=c==null?void 0:c.__tres)==null?void 0:u.parent)||null}function a(c){const u=Js(new st,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const h=o(c),f=((u=h==null?void 0:h.__tres)==null?void 0:u.objects)||[],d=f.indexOf(c);return d<0||d>=f.length-1?null:f[d+1]}return{insert:i,remove:s,createElement:t,patchProp:r,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};var dO=Object.create,zb=Object.defineProperty,pO=Object.getOwnPropertyDescriptor,bm=Object.getOwnPropertyNames,mO=Object.getPrototypeOf,gO=Object.prototype.hasOwnProperty,_O=(n,e)=>function(){return n&&(e=(0,n[bm(n)[0]])(n=0)),e},vO=(n,e)=>function(){return e||(0,n[bm(n)[0]])((e={exports:{}}).exports,e),e.exports},yO=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of bm(e))!gO.call(n,s)&&s!==t&&zb(n,s,{get:()=>e[s],enumerable:!(i=pO(e,s))||i.enumerable});return n},xO=(n,e,t)=>(t=n!=null?dO(mO(n)):{},yO(zb(t,"default",{value:n,enumerable:!0}),n)),_l=_O({"../../node_modules/.pnpm/tsup@8.3.5_@microsoft+api-extractor@7.48.1_@types+node@22.10.5__jiti@2.4.2_postcss@8.4.49_tsx_s7k37zks4wtn7x2grzma6lrsfa/node_modules/tsup/assets/esm_shims.js"(){}}),bO=vO({"../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(n,e){_l(),e.exports=i;function t(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function i(r){if(r=r||{},r.circles)return s(r);const o=new Map;if(o.set(Date,h=>new Date(h)),o.set(Map,(h,f)=>new Map(l(Array.from(h),f))),o.set(Set,(h,f)=>new Set(l(Array.from(h),f))),r.constructorHandlers)for(const h of r.constructorHandlers)o.set(h[0],h[1]);let a=null;return r.proto?u:c;function l(h,f){const d=Object.keys(h),p=new Array(d.length);for(let _=0;_new Date(d)),l.set(Map,(d,p)=>new Map(u(Array.from(d),p))),l.set(Set,(d,p)=>new Set(u(Array.from(d),p))),r.constructorHandlers)for(const d of r.constructorHandlers)l.set(d[0],d[1]);let c=null;return r.proto?f:h;function u(d,p){const _=Object.keys(d),g=new Array(_.length);for(let m=0;m<_.length;m++){const x=_[m],v=d[x];if(typeof v!="object"||v===null)g[x]=v;else if(v.constructor!==Object&&(c=l.get(v.constructor)))g[x]=c(v,p);else if(ArrayBuffer.isView(v))g[x]=t(v);else{const y=o.indexOf(v);y!==-1?g[x]=a[y]:g[x]=p(v)}}return g}function h(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return u(d,h);if(d.constructor!==Object&&(c=l.get(d.constructor)))return c(d,h);const p={};o.push(d),a.push(p);for(const _ in d){if(Object.hasOwnProperty.call(d,_)===!1)continue;const g=d[_];if(typeof g!="object"||g===null)p[_]=g;else if(g.constructor!==Object&&(c=l.get(g.constructor)))p[_]=c(g,h);else if(ArrayBuffer.isView(g))p[_]=t(g);else{const m=o.indexOf(g);m!==-1?p[_]=a[m]:p[_]=h(g)}}return o.pop(),a.pop(),p}function f(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return u(d,f);if(d.constructor!==Object&&(c=l.get(d.constructor)))return c(d,f);const p={};o.push(d),a.push(p);for(const _ in d){const g=d[_];if(typeof g!="object"||g===null)p[_]=g;else if(g.constructor!==Object&&(c=l.get(g.constructor)))p[_]=c(g,f);else if(ArrayBuffer.isView(g))p[_]=t(g);else{const m=o.indexOf(g);m!==-1?p[_]=a[m]:p[_]=f(g)}}return o.pop(),a.pop(),p}}}});_l();_l();_l();var Vb=typeof navigator<"u",Ce=typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof global<"u"?global:{};typeof Ce.chrome<"u"&&Ce.chrome.devtools;Vb&&(Ce.self,Ce.top);var T0;typeof navigator<"u"&&((T0=navigator.userAgent)==null||T0.toLowerCase().includes("electron"));_l();var MO=xO(bO()),SO=/(?:^|[-_/])(\w)/g;function EO(n,e){return e?e.toUpperCase():""}function TO(n){return n&&`${n}`.replace(SO,EO)}function wO(n,e){let t=n.replace(/^[a-z]:/i,"").replace(/\\/g,"/");t.endsWith(`index${e}`)&&(t=t.replace(`/index${e}`,e));const i=t.lastIndexOf("/"),s=t.substring(i+1);{const r=s.lastIndexOf(e);return s.substring(0,r)}}var w0=(0,MO.default)({circles:!0});const AO={trailing:!0};function yo(n,e=25,t={}){if(t={...AO,...t},!Number.isFinite(e))throw new TypeError("Expected `wait` to be a finite number");let i,s,r=[],o,a;const l=(c,u)=>(o=CO(n,c,u),o.finally(()=>{if(o=null,t.trailing&&a&&!s){const h=l(c,a);return a=null,h}}),o);return function(...c){return o?(t.trailing&&(a=c),o):new Promise(u=>{const h=!s&&t.leading;clearTimeout(s),s=setTimeout(()=>{s=null;const f=t.leading?i:l(this,c);for(const d of r)d(f);r=[]},e),h?(i=l(this,c),u(i)):r.push(u)})}}async function CO(n,e,t){return await n.apply(e,t)}function zd(n,e={},t){for(const i in n){const s=n[i],r=t?`${t}:${i}`:i;typeof s=="object"&&s!==null?zd(s,e,r):typeof s=="function"&&(e[r]=s)}return e}const RO={run:n=>n()},IO=()=>RO,Hb=typeof console.createTask<"u"?console.createTask:IO;function PO(n,e){const t=e.shift(),i=Hb(t);return n.reduce((s,r)=>s.then(()=>i.run(()=>r(...e))),Promise.resolve())}function LO(n,e){const t=e.shift(),i=Hb(t);return Promise.all(n.map(s=>i.run(()=>s(...e))))}function Yf(n,e){for(const t of[...n])t(e)}class DO{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,i={}){if(!e||typeof t!="function")return()=>{};const s=e;let r;for(;this._deprecatedHooks[e];)r=this._deprecatedHooks[e],e=r.to;if(r&&!i.allowDeprecated){let o=r.message;o||(o=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(o)||(console.warn(o),this._deprecatedMessages.add(o))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&(this.removeHook(e,t),t=void 0)}}hookOnce(e,t){let i,s=(...r)=>(typeof i=="function"&&i(),i=void 0,s=void 0,t(...r));return i=this.hook(e,s),i}removeHook(e,t){if(this._hooks[e]){const i=this._hooks[e].indexOf(t);i!==-1&&this._hooks[e].splice(i,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t=="string"?{to:t}:t;const i=this._hooks[e]||[];delete this._hooks[e];for(const s of i)this.hook(e,s)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const t in e)this.deprecateHook(t,e[t])}addHooks(e){const t=zd(e),i=Object.keys(t).map(s=>this.hook(s,t[s]));return()=>{for(const s of i.splice(0,i.length))s()}}removeHooks(e){const t=zd(e);for(const i in t)this.removeHook(i,t[i])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...t){return t.unshift(e),this.callHookWith(PO,e,...t)}callHookParallel(e,...t){return t.unshift(e),this.callHookWith(LO,e,...t)}callHookWith(e,t,...i){const s=this._before||this._after?{name:t,args:i,context:{}}:void 0;this._before&&Yf(this._before,s);const r=e(t in this._hooks?[...this._hooks[t]]:[],i);return r instanceof Promise?r.finally(()=>{this._after&&s&&Yf(this._after,s)}):(this._after&&s&&Yf(this._after,s),r)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}}function Gb(){return new DO}var OO=Object.create,Wb=Object.defineProperty,UO=Object.getOwnPropertyDescriptor,Mm=Object.getOwnPropertyNames,NO=Object.getPrototypeOf,FO=Object.prototype.hasOwnProperty,BO=(n,e)=>function(){return n&&(e=(0,n[Mm(n)[0]])(n=0)),e},Xb=(n,e)=>function(){return e||(0,n[Mm(n)[0]])((e={exports:{}}).exports,e),e.exports},kO=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mm(e))!FO.call(n,s)&&s!==t&&Wb(n,s,{get:()=>e[s],enumerable:!(i=UO(e,s))||i.enumerable});return n},zO=(n,e,t)=>(t=n!=null?OO(NO(n)):{},kO(Wb(t,"default",{value:n,enumerable:!0}),n)),ue=BO({"../../node_modules/.pnpm/tsup@8.3.5_@microsoft+api-extractor@7.48.1_@types+node@22.10.5__jiti@2.4.2_postcss@8.4.49_tsx_s7k37zks4wtn7x2grzma6lrsfa/node_modules/tsup/assets/esm_shims.js"(){}}),VO=Xb({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(n,e){ue(),function(t){var i={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"Ae",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"Oe",Ő:"O",Ø:"O",Ù:"U",Ú:"U",Û:"U",Ü:"Ue",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"ae",å:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"oe",ő:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"ue",ű:"u",ý:"y",þ:"th",ÿ:"y","ẞ":"SS",ا:"a",أ:"a",إ:"i",آ:"aa",ؤ:"u",ئ:"e",ء:"a",ب:"b",ت:"t",ث:"th",ج:"j",ح:"h",خ:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",ش:"sh",ص:"s",ض:"dh",ط:"t",ظ:"z",ع:"a",غ:"gh",ف:"f",ق:"q",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"w",ي:"y",ى:"a",ة:"h",ﻻ:"la",ﻷ:"laa",ﻹ:"lai",ﻵ:"laa",گ:"g",چ:"ch",پ:"p",ژ:"zh",ک:"k",ی:"y","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9",က:"k",ခ:"kh",ဂ:"g",ဃ:"ga",င:"ng",စ:"s",ဆ:"sa",ဇ:"z","စျ":"za",ည:"ny",ဋ:"t",ဌ:"ta",ဍ:"d",ဎ:"da",ဏ:"na",တ:"t",ထ:"ta",ဒ:"d",ဓ:"da",န:"n",ပ:"p",ဖ:"pa",ဗ:"b",ဘ:"ba",မ:"m",ယ:"y",ရ:"ya",လ:"l",ဝ:"w",သ:"th",ဟ:"h",ဠ:"la",အ:"a","ြ":"y","ျ":"ya","ွ":"w","ြွ":"yw","ျွ":"ywa","ှ":"h",ဧ:"e","၏":"-e",ဣ:"i",ဤ:"-i",ဉ:"u",ဦ:"-u",ဩ:"aw","သြော":"aw",ဪ:"aw","၀":"0","၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","္":"","့":"","း":"",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z",ހ:"h",ށ:"sh",ނ:"n",ރ:"r",ބ:"b",ޅ:"lh",ކ:"k",އ:"a",ވ:"v",މ:"m",ފ:"f",ދ:"dh",ތ:"th",ލ:"l",ގ:"g",ޏ:"gn",ސ:"s",ޑ:"d",ޒ:"z",ޓ:"t",ޔ:"y",ޕ:"p",ޖ:"j",ޗ:"ch",ޘ:"tt",ޙ:"hh",ޚ:"kh",ޛ:"th",ޜ:"z",ޝ:"sh",ޞ:"s",ޟ:"d",ޠ:"t",ޡ:"z",ޢ:"a",ޣ:"gh",ޤ:"q",ޥ:"w","ަ":"a","ާ":"aa","ި":"i","ީ":"ee","ު":"u","ޫ":"oo","ެ":"e","ޭ":"ey","ޮ":"o","ޯ":"oa","ް":"",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",α:"a",β:"v",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"ks",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"o",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"i",ώ:"o",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"I",Θ:"TH",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"KS",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Υ:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"O",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"I",Ώ:"O",Ϊ:"I",Ϋ:"Y",ā:"a",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",ū:"u",Ā:"A",Ē:"E",Ģ:"G",Ī:"I",Ķ:"k",Ļ:"L",Ņ:"N",Ū:"U",Ќ:"Kj",ќ:"kj",Љ:"Lj",љ:"lj",Њ:"Nj",њ:"nj",Тс:"Ts",тс:"ts",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Ż:"Z",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",ă:"a",Ă:"A",ș:"s",Ș:"S",ț:"t",Ț:"T",ţ:"t",Ţ:"T",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"I",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Х:"Kh",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",ђ:"dj",ј:"j",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Ћ:"C",Џ:"Dz",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",ả:"a",Ả:"A",ẳ:"a",Ẳ:"A",ẩ:"a",Ẩ:"A",đ:"d",Đ:"D",ẹ:"e",Ẹ:"E",ẽ:"e",Ẽ:"E",ẻ:"e",Ẻ:"E",ế:"e",Ế:"E",ề:"e",Ề:"E",ệ:"e",Ệ:"E",ễ:"e",Ễ:"E",ể:"e",Ể:"E",ỏ:"o",ọ:"o",Ọ:"o",ố:"o",Ố:"O",ồ:"o",Ồ:"O",ổ:"o",Ổ:"O",ộ:"o",Ộ:"O",ỗ:"o",Ỗ:"O",ơ:"o",Ơ:"O",ớ:"o",Ớ:"O",ờ:"o",Ờ:"O",ợ:"o",Ợ:"O",ỡ:"o",Ỡ:"O",Ở:"o",ở:"o",ị:"i",Ị:"I",ĩ:"i",Ĩ:"I",ỉ:"i",Ỉ:"i",ủ:"u",Ủ:"U",ụ:"u",Ụ:"U",ũ:"u",Ũ:"U",ư:"u",Ư:"U",ứ:"u",Ứ:"U",ừ:"u",Ừ:"U",ự:"u",Ự:"U",ữ:"u",Ữ:"U",ử:"u",Ử:"ư",ỷ:"y",Ỷ:"y",ỳ:"y",Ỳ:"Y",ỵ:"y",Ỵ:"Y",ỹ:"y",Ỹ:"Y",ạ:"a",Ạ:"A",ấ:"a",Ấ:"A",ầ:"a",Ầ:"A",ậ:"a",Ậ:"A",ẫ:"a",Ẫ:"A",ắ:"a",Ắ:"A",ằ:"a",Ằ:"A",ặ:"a",Ặ:"A",ẵ:"a",Ẵ:"A","⓪":"0","①":"1","②":"2","③":"3","④":"4","⑤":"5","⑥":"6","⑦":"7","⑧":"8","⑨":"9","⑩":"10","⑪":"11","⑫":"12","⑬":"13","⑭":"14","⑮":"15","⑯":"16","⑰":"17","⑱":"18","⑲":"18","⑳":"18","⓵":"1","⓶":"2","⓷":"3","⓸":"4","⓹":"5","⓺":"6","⓻":"7","⓼":"8","⓽":"9","⓾":"10","⓿":"0","⓫":"11","⓬":"12","⓭":"13","⓮":"14","⓯":"15","⓰":"16","⓱":"17","⓲":"18","⓳":"19","⓴":"20","Ⓐ":"A","Ⓑ":"B","Ⓒ":"C","Ⓓ":"D","Ⓔ":"E","Ⓕ":"F","Ⓖ":"G","Ⓗ":"H","Ⓘ":"I","Ⓙ":"J","Ⓚ":"K","Ⓛ":"L","Ⓜ":"M","Ⓝ":"N","Ⓞ":"O","Ⓟ":"P","Ⓠ":"Q","Ⓡ":"R","Ⓢ":"S","Ⓣ":"T","Ⓤ":"U","Ⓥ":"V","Ⓦ":"W","Ⓧ":"X","Ⓨ":"Y","Ⓩ":"Z","ⓐ":"a","ⓑ":"b","ⓒ":"c","ⓓ":"d","ⓔ":"e","ⓕ":"f","ⓖ":"g","ⓗ":"h","ⓘ":"i","ⓙ":"j","ⓚ":"k","ⓛ":"l","ⓜ":"m","ⓝ":"n","ⓞ":"o","ⓟ":"p","ⓠ":"q","ⓡ":"r","ⓢ":"s","ⓣ":"t","ⓤ":"u","ⓦ":"v","ⓥ":"w","ⓧ":"x","ⓨ":"y","ⓩ":"z","“":'"',"”":'"',"‘":"'","’":"'","∂":"d",ƒ:"f","™":"(TM)","©":"(C)",œ:"oe",Œ:"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o",º:"o",ª:"a","•":"*","၊":",","။":".",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY",元:"CNY",円:"YEN","﷼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","₺":"TRY","؋":"AFN","₼":"AZN",лв:"BGN","៛":"KHR","₡":"CRC","₸":"KZT",ден:"MKD",zł:"PLN","₽":"RUB","₾":"GEL"},s=["်","ް"],r={"ာ":"a","ါ":"a","ေ":"e","ဲ":"e","ိ":"i","ီ":"i","ို":"o","ု":"u","ူ":"u","ေါင်":"aung","ော":"aw","ော်":"aw","ေါ":"aw","ေါ်":"aw","်":"်","က်":"et","ိုက်":"aik","ောက်":"auk","င်":"in","ိုင်":"aing","ောင်":"aung","စ်":"it","ည်":"i","တ်":"at","ိတ်":"eik","ုတ်":"ok","ွတ်":"ut","ေတ်":"it","ဒ်":"d","ိုဒ်":"ok","ုဒ်":"ait","န်":"an","ာန်":"an","ိန်":"ein","ုန်":"on","ွန်":"un","ပ်":"at","ိပ်":"eik","ုပ်":"ok","ွပ်":"ut","န်ုပ်":"nub","မ်":"an","ိမ်":"ein","ုမ်":"on","ွမ်":"un","ယ်":"e","ိုလ်":"ol","ဉ်":"in","ံ":"an","ိံ":"ein","ုံ":"on","ައް":"ah","ަށް":"ah"},o={en:{},az:{ç:"c",ə:"e",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"C",Ə:"E",Ğ:"G",İ:"I",Ö:"O",Ş:"S",Ü:"U"},cs:{č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z"},fi:{ä:"a",Ä:"A",ö:"o",Ö:"O"},hu:{ä:"a",Ä:"A",ö:"o",Ö:"O",ü:"u",Ü:"U",ű:"u",Ű:"U"},lt:{ą:"a",č:"c",ę:"e",ė:"e",į:"i",š:"s",ų:"u",ū:"u",ž:"z",Ą:"A",Č:"C",Ę:"E",Ė:"E",Į:"I",Š:"S",Ų:"U",Ū:"U"},lv:{ā:"a",č:"c",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",š:"s",ū:"u",ž:"z",Ā:"A",Č:"C",Ē:"E",Ģ:"G",Ī:"i",Ķ:"k",Ļ:"L",Ņ:"N",Š:"S",Ū:"u",Ž:"Z"},pl:{ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ó:"o",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"e",Ł:"L",Ń:"N",Ó:"O",Ś:"S",Ź:"Z",Ż:"Z"},sv:{ä:"a",Ä:"A",ö:"o",Ö:"O"},sk:{ä:"a",Ä:"A"},sr:{љ:"lj",њ:"nj",Љ:"Lj",Њ:"Nj",đ:"dj",Đ:"Dj"},tr:{Ü:"U",Ö:"O",ü:"u",ö:"o"}},a={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},az:{},ca:{"∆":"delta","∞":"infinit","♥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","∑":"suma dels","¤":"moneda"},cs:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},dv:{"∆":"delta","∞":"kolunulaa","♥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","∑":"jumula","¤":"faisaa"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fa:{"∆":"delta","∞":"bi-nahayat","♥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","∑":"majmooe","¤":"vahed"},fi:{"∆":"delta","∞":"aarettomyys","♥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","∑":"summa","¤":"valuutta"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},ge:{"∆":"delta","∞":"usasruloba","♥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","∑":"jami","¤":"valuta"},gr:{},hu:{"∆":"delta","∞":"vegtelen","♥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","∑":"szumma","¤":"penznem"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},lt:{"∆":"delta","∞":"begalybe","♥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","∑":"suma","¤":"valiuta"},lv:{"∆":"delta","∞":"bezgaliba","♥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","∑":"summa","¤":"valuta"},my:{"∆":"kwahkhyaet","∞":"asaonasme","♥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","∑":"paungld","¤":"ngwekye"},mk:{},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pl:{"∆":"delta","∞":"nieskonczonosc","♥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","∑":"suma","¤":"waluta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ro:{"∆":"delta","∞":"infinit","♥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","∑":"suma","¤":"valuta"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},sr:{},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},uk:{"∆":"delta","∞":"bezkinechnist","♥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","∑":"suma","¤":"valjuta"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}},l=[";","?",":","@","&","=","+","$",",","/"].join(""),c=[";","?",":","@","&","=","+","$",","].join(""),u=[".","!","~","*","'","(",")"].join(""),h=function(_,g){var m="-",x="",v="",y=!0,w={},A,C,I,b,M,L,N,B,K,J,k,re,Y,he,me="";if(typeof _!="string")return"";if(typeof g=="string"&&(m=g),N=a.en,B=o.en,typeof g=="object"){A=g.maintainCase||!1,w=g.custom&&typeof g.custom=="object"?g.custom:w,I=+g.truncate>1&&g.truncate||!1,b=g.uric||!1,M=g.uricNoSlash||!1,L=g.mark||!1,y=!(g.symbols===!1||g.lang===!1),m=g.separator||m,b&&(me+=l),M&&(me+=c),L&&(me+=u),N=g.lang&&a[g.lang]&&y?a[g.lang]:y?a.en:{},B=g.lang&&o[g.lang]?o[g.lang]:g.lang===!1||g.lang===!0?{}:o.en,g.titleCase&&typeof g.titleCase.length=="number"&&Array.prototype.toString.call(g.titleCase)?(g.titleCase.forEach(function(ee){w[ee+""]=ee+""}),C=!0):C=!!g.titleCase,g.custom&&typeof g.custom.length=="number"&&Array.prototype.toString.call(g.custom)&&g.custom.forEach(function(ee){w[ee+""]=ee+""}),Object.keys(w).forEach(function(ee){var ge;ee.length>1?ge=new RegExp("\\b"+d(ee)+"\\b","gi"):ge=new RegExp(d(ee),"gi"),_=_.replace(ge,w[ee])});for(k in w)me+=k}for(me+=m,me=d(me),_=_.replace(/(^\s+|\s+$)/g,""),Y=!1,he=!1,J=0,re=_.length;J=0?(v+=k,k=""):he===!0?(k=r[v]+i[k],v=""):k=Y&&i[k].match(/[A-Za-z0-9]/)?" "+i[k]:i[k],Y=!1,he=!1):k in r?(v+=k,k="",J===re-1&&(k=r[v]),he=!0):N[k]&&!(b&&l.indexOf(k)!==-1)&&!(M&&c.indexOf(k)!==-1)?(k=Y||x.substr(-1).match(/[A-Za-z0-9]/)?m+N[k]:N[k],k+=_[J+1]!==void 0&&_[J+1].match(/[A-Za-z0-9]/)?m:"",Y=!0):(he===!0?(k=r[v]+k,v="",he=!1):Y&&(/[A-Za-z0-9]/.test(k)||x.substr(-1).match(/A-Za-z0-9]/))&&(k=" "+k),Y=!1),x+=k.replace(new RegExp("[^\\w\\s"+me+"_-]","g"),m);return C&&(x=x.replace(/(\w)(\S*)/g,function(ee,ge,Fe){var ie=ge.toUpperCase()+(Fe!==null?Fe:"");return Object.keys(w).indexOf(ie.toLowerCase())<0?ie:ie.toLowerCase()})),x=x.replace(/\s+/g,m).replace(new RegExp("\\"+m+"+","g"),m).replace(new RegExp("(^\\"+m+"+|\\"+m+"+$)","g"),""),I&&x.length>I&&(K=x.charAt(I)===m,x=x.slice(0,I),K||(x=x.slice(0,x.lastIndexOf(m)))),!A&&!C&&(x=x.toLowerCase()),x},f=function(_){return function(g){return h(g,_)}},d=function(_){return _.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},p=function(_,g){for(var m in g)if(g[m]===_)return!0};if(typeof e<"u"&&e.exports)e.exports=h,e.exports.createSlug=f;else if(typeof define<"u"&&define.amd)define([],function(){return h});else try{if(t.getSlug||t.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";t.getSlug=h,t.createSlug=f}catch{}}(n)}}),HO=Xb({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(n,e){ue(),e.exports=VO()}});ue();ue();ue();ue();ue();ue();ue();ue();function GO(n){var e;const t=n.name||n._componentTag||n.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||n.__name;return t==="index"&&(e=n.__file)!=null&&e.endsWith("index.vue")?"":t}function WO(n){const e=n.__file;if(e)return TO(wO(e,".vue"))}function A0(n,e){return n.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=e,e}function Sm(n){if(n.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return n.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(n.root)return n.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function qb(n){var e,t;const i=(e=n.subTree)==null?void 0:e.type,s=Sm(n);return s?((t=s==null?void 0:s.types)==null?void 0:t.Fragment)===i:!1}function Nh(n){var e,t,i;const s=GO((n==null?void 0:n.type)||{});if(s)return s;if((n==null?void 0:n.root)===n)return"Root";for(const o in(t=(e=n.parent)==null?void 0:e.type)==null?void 0:t.components)if(n.parent.type.components[o]===(n==null?void 0:n.type))return A0(n,o);for(const o in(i=n.appContext)==null?void 0:i.components)if(n.appContext.components[o]===(n==null?void 0:n.type))return A0(n,o);return WO((n==null?void 0:n.type)||{})||"Anonymous Component"}function XO(n){var e,t,i;const s=(i=(t=(e=n==null?void 0:n.appContext)==null?void 0:e.app)==null?void 0:t.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__)!=null?i:0,r=n===(n==null?void 0:n.root)?"root":n.uid;return`${s}:${r}`}function Vd(n,e){return e=e||`${n.id}:root`,n.instanceMap.get(e)||n.instanceMap.get(":root")}function qO(){const n={top:0,bottom:0,left:0,right:0,get width(){return n.right-n.left},get height(){return n.bottom-n.top}};return n}var bc;function jO(n){return bc||(bc=document.createRange()),bc.selectNode(n),bc.getBoundingClientRect()}function YO(n){const e=qO();if(!n.children)return e;for(let t=0,i=n.children.length;tn.bottom)&&(n.bottom=e.bottom),(!n.left||e.leftn.right)&&(n.right=e.right),n}var C0={top:0,left:0,right:0,bottom:0,width:0,height:0};function xr(n){const e=n.subTree.el;return typeof window>"u"?C0:qb(n)?YO(n.subTree):(e==null?void 0:e.nodeType)===1?e==null?void 0:e.getBoundingClientRect():n.subTree.component?xr(n.subTree.component):C0}ue();function Em(n){return qb(n)?KO(n.subTree):n.subTree?[n.subTree.el]:[]}function KO(n){if(!n.children)return[];const e=[];return n.children.forEach(t=>{t.component?e.push(...Em(t.component)):t!=null&&t.el&&e.push(t.el)}),e}var jb="__vue-devtools-component-inspector__",Yb="__vue-devtools-component-inspector__card__",$b="__vue-devtools-component-inspector__name__",Kb="__vue-devtools-component-inspector__indicator__",Zb={display:"block",zIndex:2147483640,position:"fixed",backgroundColor:"#42b88325",border:"1px solid #42b88350",borderRadius:"5px",transition:"all 0.1s ease-in",pointerEvents:"none"},ZO={fontFamily:"Arial, Helvetica, sans-serif",padding:"5px 8px",borderRadius:"4px",textAlign:"left",position:"absolute",left:0,color:"#e9e9e9",fontSize:"14px",fontWeight:600,lineHeight:"24px",backgroundColor:"#42b883",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"},JO={display:"inline-block",fontWeight:400,fontStyle:"normal",fontSize:"12px",opacity:.7};function Ro(){return document.getElementById(jb)}function QO(){return document.getElementById(Yb)}function eU(){return document.getElementById(Kb)}function tU(){return document.getElementById($b)}function Tm(n){return{left:`${Math.round(n.left*100)/100}px`,top:`${Math.round(n.top*100)/100}px`,width:`${Math.round(n.width*100)/100}px`,height:`${Math.round(n.height*100)/100}px`}}function wm(n){var e;const t=document.createElement("div");t.id=(e=n.elementId)!=null?e:jb,Object.assign(t.style,{...Zb,...Tm(n.bounds),...n.style});const i=document.createElement("span");i.id=Yb,Object.assign(i.style,{...ZO,top:n.bounds.top<35?0:"-35px"});const s=document.createElement("span");s.id=$b,s.innerHTML=`<${n.name}>  `;const r=document.createElement("i");return r.id=Kb,r.innerHTML=`${Math.round(n.bounds.width*100)/100} x ${Math.round(n.bounds.height*100)/100}`,Object.assign(r.style,JO),i.appendChild(s),i.appendChild(r),t.appendChild(i),document.body.appendChild(t),t}function Am(n){const e=Ro(),t=QO(),i=tU(),s=eU();e&&(Object.assign(e.style,{...Zb,...Tm(n.bounds)}),Object.assign(t.style,{top:n.bounds.top<35?0:"-35px"}),i.innerHTML=`<${n.name}>  `,s.innerHTML=`${Math.round(n.bounds.width*100)/100} x ${Math.round(n.bounds.height*100)/100}`)}function nU(n){const e=xr(n);if(!e.width&&!e.height)return;const t=Nh(n);Ro()?Am({bounds:e,name:t}):wm({bounds:e,name:t})}function Jb(){const n=Ro();n&&(n.style.display="none")}var Hd=null;function Gd(n){const e=n.target;if(e){const t=e.__vueParentComponent;if(t&&(Hd=t,t.vnode.el)){const i=xr(t),s=Nh(t);Ro()?Am({bounds:i,name:s}):wm({bounds:i,name:s})}}}function iU(n,e){if(n.preventDefault(),n.stopPropagation(),Hd){const t=XO(Hd);e(t)}}var ku=null;function sU(){Jb(),window.removeEventListener("mouseover",Gd),window.removeEventListener("click",ku,!0),ku=null}function rU(){return window.addEventListener("mouseover",Gd),new Promise(n=>{function e(t){t.preventDefault(),t.stopPropagation(),iU(t,i=>{window.removeEventListener("click",e,!0),ku=null,window.removeEventListener("mouseover",Gd);const s=Ro();s&&(s.style.display="none"),n(JSON.stringify({id:i}))})}ku=e,window.addEventListener("click",e,!0)})}function oU(n){const e=Vd(gn.value,n.id);if(e){const[t]=Em(e);if(typeof t.scrollIntoView=="function")t.scrollIntoView({behavior:"smooth"});else{const i=xr(e),s=document.createElement("div"),r={...Tm(i),position:"absolute"};Object.assign(s.style,r),document.body.appendChild(s),s.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{document.body.removeChild(s)},2e3)}setTimeout(()=>{const i=xr(e);if(i.width||i.height){const s=Nh(e),r=Ro();r?Am({...n,name:s,bounds:i}):wm({...n,name:s,bounds:i}),setTimeout(()=>{r&&(r.style.display="none")},1500)}},1200)}}ue();var R0;(R0=Ce).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__!=null||(R0.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__=!0);function aU(n){let e=0;const t=setInterval(()=>{Ce.__VUE_INSPECTOR__&&(clearInterval(t),e+=30,n()),e>=5e3&&clearInterval(t)},30)}function lU(){const n=Ce.__VUE_INSPECTOR__,e=n.openInEditor;n.openInEditor=async(...t)=>{n.disable(),e(...t)}}function cU(){return new Promise(n=>{function e(){lU(),n(Ce.__VUE_INSPECTOR__)}Ce.__VUE_INSPECTOR__?e():aU(()=>{e()})})}ue();ue();function uU(n){return!!(n&&n.__v_isReadonly)}function Qb(n){return uU(n)?Qb(n.__v_raw):!!(n&&n.__v_isReactive)}function $f(n){return!!(n&&n.__v_isRef===!0)}function Jo(n){const e=n&&n.__v_raw;return e?Jo(e):n}var hU=class{constructor(){this.refEditor=new fU}set(n,e,t,i){const s=Array.isArray(e)?e:e.split(".");for(;s.length>1;){const a=s.shift();n instanceof Map&&(n=n.get(a)),n instanceof Set?n=Array.from(n.values())[a]:n=n[a],this.refEditor.isRef(n)&&(n=this.refEditor.get(n))}const r=s[0],o=this.refEditor.get(n)[r];i?i(n,r,t):this.refEditor.isRef(o)?this.refEditor.set(o,t):n[r]=t}get(n,e){const t=Array.isArray(e)?e:e.split(".");for(let i=0;i"u")return!1;const i=Array.isArray(e)?e.slice():e.split("."),s=t?2:1;for(;n&&i.length>s;){const r=i.shift();n=n[r],this.refEditor.isRef(n)&&(n=this.refEditor.get(n))}return n!=null&&Object.prototype.hasOwnProperty.call(n,i[0])}createDefaultSetCallback(n){return(e,t,i)=>{if((n.remove||n.newKey)&&(Array.isArray(e)?e.splice(t,1):Jo(e)instanceof Map?e.delete(t):Jo(e)instanceof Set?e.delete(Array.from(e.values())[t]):Reflect.deleteProperty(e,t)),!n.remove){const s=e[n.newKey||t];this.refEditor.isRef(s)?this.refEditor.set(s,i):Jo(e)instanceof Map?e.set(n.newKey||t,i):Jo(e)instanceof Set?e.add(i):e[n.newKey||t]=i}}}},fU=class{set(n,e){if($f(n))n.value=e;else{if(n instanceof Set&&Array.isArray(e)){n.clear(),e.forEach(s=>n.add(s));return}const t=Object.keys(e);if(n instanceof Map){const s=new Set(n.keys());t.forEach(r=>{n.set(r,Reflect.get(e,r)),s.delete(r)}),s.forEach(r=>n.delete(r));return}const i=new Set(Object.keys(n));t.forEach(s=>{Reflect.set(n,s,Reflect.get(e,s)),i.delete(s)}),i.forEach(s=>Reflect.deleteProperty(n,s))}}get(n){return $f(n)?n.value:n}isRef(n){return $f(n)||Qb(n)}};ue();ue();ue();var dU="__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";function pU(){if(!Vb||typeof localStorage>"u"||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""};const n=localStorage.getItem(dU);return n?JSON.parse(n):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""}}ue();ue();ue();var I0;(I0=Ce).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS!=null||(I0.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS=[]);var mU=new Proxy(Ce.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(n,e,t){return Reflect.get(n,e,t)}});function gU(n,e){kt.timelineLayersState[e.id]=!1,mU.push({...n,descriptorId:e.id,appRecord:Sm(e.app)})}var P0;(P0=Ce).__VUE_DEVTOOLS_KIT_INSPECTOR__!=null||(P0.__VUE_DEVTOOLS_KIT_INSPECTOR__=[]);var Cm=new Proxy(Ce.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(n,e,t){return Reflect.get(n,e,t)}}),eM=yo(()=>{Io.hooks.callHook("sendInspectorToClient",tM())});function _U(n,e){var t,i;Cm.push({options:n,descriptor:e,treeFilterPlaceholder:(t=n.treeFilterPlaceholder)!=null?t:"Search tree...",stateFilterPlaceholder:(i=n.stateFilterPlaceholder)!=null?i:"Search state...",treeFilter:"",selectedNodeId:"",appRecord:Sm(e.app)}),eM()}function tM(){return Cm.filter(n=>n.descriptor.app===gn.value.app).filter(n=>n.descriptor.id!=="components").map(n=>{var e;const t=n.descriptor,i=n.options;return{id:i.id,label:i.label,logo:t.logo,icon:`custom-ic-baseline-${(e=i==null?void 0:i.icon)==null?void 0:e.replace(/_/g,"-")}`,packageName:t.packageName,homepage:t.homepage,pluginId:t.id}})}function Oc(n,e){return Cm.find(t=>t.options.id===n&&(e?t.descriptor.app===e:!0))}function vU(){const n=Gb();n.hook("addInspector",({inspector:i,plugin:s})=>{_U(i,s.descriptor)});const e=yo(async({inspectorId:i,plugin:s})=>{var r;if(!i||!((r=s==null?void 0:s.descriptor)!=null&&r.app)||kt.highPerfModeEnabled)return;const o=Oc(i,s.descriptor.app),a={app:s.descriptor.app,inspectorId:i,filter:(o==null?void 0:o.treeFilter)||"",rootNodes:[]};await new Promise(l=>{n.callHookWith(async c=>{await Promise.all(c.map(u=>u(a))),l()},"getInspectorTree")}),n.callHookWith(async l=>{await Promise.all(l.map(c=>c({inspectorId:i,rootNodes:a.rootNodes})))},"sendInspectorTreeToClient")},120);n.hook("sendInspectorTree",e);const t=yo(async({inspectorId:i,plugin:s})=>{var r;if(!i||!((r=s==null?void 0:s.descriptor)!=null&&r.app)||kt.highPerfModeEnabled)return;const o=Oc(i,s.descriptor.app),a={app:s.descriptor.app,inspectorId:i,nodeId:(o==null?void 0:o.selectedNodeId)||"",state:null},l={currentTab:`custom-inspector:${i}`};a.nodeId&&await new Promise(c=>{n.callHookWith(async u=>{await Promise.all(u.map(h=>h(a,l))),c()},"getInspectorState")}),n.callHookWith(async c=>{await Promise.all(c.map(u=>u({inspectorId:i,nodeId:a.nodeId,state:a.state})))},"sendInspectorStateToClient")},120);return n.hook("sendInspectorState",t),n.hook("customInspectorSelectNode",({inspectorId:i,nodeId:s,plugin:r})=>{const o=Oc(i,r.descriptor.app);o&&(o.selectedNodeId=s)}),n.hook("timelineLayerAdded",({options:i,plugin:s})=>{gU(i,s.descriptor)}),n.hook("timelineEventAdded",({options:i,plugin:s})=>{var r;const o=["performance","component-event","keyboard","mouse"];kt.highPerfModeEnabled||!((r=kt.timelineLayersState)!=null&&r[s.descriptor.id])&&!o.includes(i.layerId)||n.callHookWith(async a=>{await Promise.all(a.map(l=>l(i)))},"sendTimelineEventToClient")}),n.hook("getComponentInstances",async({app:i})=>{const s=i.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!s)return null;const r=s.id.toString();return[...s.instanceMap].filter(([o])=>o.split(":")[0]===r).map(([,o])=>o)}),n.hook("getComponentBounds",async({instance:i})=>xr(i)),n.hook("getComponentName",({instance:i})=>Nh(i)),n.hook("componentHighlight",({uid:i})=>{const s=gn.value.instanceMap.get(i);s&&nU(s)}),n.hook("componentUnhighlight",()=>{Jb()}),n}var L0;(L0=Ce).__VUE_DEVTOOLS_KIT_APP_RECORDS__!=null||(L0.__VUE_DEVTOOLS_KIT_APP_RECORDS__=[]);var D0;(D0=Ce).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__!=null||(D0.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__={});var O0;(O0=Ce).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__!=null||(O0.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__="");var U0;(U0=Ce).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__!=null||(U0.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__=[]);var N0;(N0=Ce).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__!=null||(N0.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__=[]);var ir="__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";function yU(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:"",tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:pU()}}var F0;(F0=Ce)[ir]!=null||(F0[ir]=yU());var xU=yo(n=>{Io.hooks.callHook("devtoolsStateUpdated",{state:n})});yo((n,e)=>{Io.hooks.callHook("devtoolsConnectedUpdated",{state:n,oldState:e})});var Fh=new Proxy(Ce.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(n,e,t){return e==="value"?Ce.__VUE_DEVTOOLS_KIT_APP_RECORDS__:Ce.__VUE_DEVTOOLS_KIT_APP_RECORDS__[e]}}),gn=new Proxy(Ce.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(n,e,t){return e==="value"?Ce.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:e==="id"?Ce.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:Ce.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[e]}});function nM(){xU({...Ce[ir],appRecords:Fh.value,activeAppRecordId:gn.id,tabs:Ce.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:Ce.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function bU(n){Ce.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=n,nM()}function MU(n){Ce.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=n,nM()}var kt=new Proxy(Ce[ir],{get(n,e){return e==="appRecords"?Fh:e==="activeAppRecordId"?gn.id:e==="tabs"?Ce.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:e==="commands"?Ce.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:Ce[ir][e]},deleteProperty(n,e){return delete n[e],!0},set(n,e,t){return{...Ce[ir]},n[e]=t,Ce[ir][e]=t,!0}});function SU(n={}){var e,t,i;const{file:s,host:r,baseUrl:o=window.location.origin,line:a=0,column:l=0}=n;if(s){if(r==="chrome-extension"){const c=s.replace(/\\/g,"\\\\"),u=(t=(e=window.VUE_DEVTOOLS_CONFIG)==null?void 0:e.openInEditorHost)!=null?t:"/";fetch(`${u}__open-in-editor?file=${encodeURI(s)}`).then(h=>{if(!h.ok){const f=`Opening component ${c} failed`;console.log(`%c${f}`,"color:red")}})}else if(kt.vitePluginDetected){const c=(i=Ce.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__)!=null?i:o;Ce.__VUE_INSPECTOR__.openInEditor(c,s,a,l)}}}ue();ue();ue();ue();ue();var B0;(B0=Ce).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__!=null||(B0.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__=[]);var Rm=new Proxy(Ce.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(n,e,t){return Reflect.get(n,e,t)}});function Wd(n){const e={};return Object.keys(n).forEach(t=>{e[t]=n[t].defaultValue}),e}function Im(n){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${n}__`}function EU(n){var e,t,i;const s=(t=(e=Rm.find(r=>{var o;return r[0].id===n&&!!((o=r[0])!=null&&o.settings)}))==null?void 0:e[0])!=null?t:null;return(i=s==null?void 0:s.settings)!=null?i:null}function iM(n,e){var t,i,s;const r=Im(n);if(r){const o=localStorage.getItem(r);if(o)return JSON.parse(o)}if(n){const o=(i=(t=Rm.find(a=>a[0].id===n))==null?void 0:t[0])!=null?i:null;return Wd((s=o==null?void 0:o.settings)!=null?s:{})}return Wd(e)}function TU(n,e){const t=Im(n);localStorage.getItem(t)||localStorage.setItem(t,JSON.stringify(Wd(e)))}function wU(n,e,t){const i=Im(n),s=localStorage.getItem(i),r=JSON.parse(s||"{}"),o={...r,[e]:t};localStorage.setItem(i,JSON.stringify(o)),Io.hooks.callHookWith(a=>{a.forEach(l=>l({pluginId:n,key:e,oldValue:r[e],newValue:t,settings:o}))},"setPluginSettings")}ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();var k0,z0,Un=(z0=(k0=Ce).__VUE_DEVTOOLS_HOOK)!=null?z0:k0.__VUE_DEVTOOLS_HOOK=Gb(),AU={vueAppInit(n){Un.hook("app:init",n)},vueAppUnmount(n){Un.hook("app:unmount",n)},vueAppConnected(n){Un.hook("app:connected",n)},componentAdded(n){return Un.hook("component:added",n)},componentEmit(n){return Un.hook("component:emit",n)},componentUpdated(n){return Un.hook("component:updated",n)},componentRemoved(n){return Un.hook("component:removed",n)},setupDevtoolsPlugin(n){Un.hook("devtools-plugin:setup",n)},perfStart(n){return Un.hook("perf:start",n)},perfEnd(n){return Un.hook("perf:end",n)}},sM={on:AU,setupDevToolsPlugin(n,e){return Un.callHook("devtools-plugin:setup",n,e)}},CU=class{constructor({plugin:n,ctx:e}){this.hooks=e.hooks,this.plugin=n}get on(){return{visitComponentTree:n=>{this.hooks.hook("visitComponentTree",n)},inspectComponent:n=>{this.hooks.hook("inspectComponent",n)},editComponentState:n=>{this.hooks.hook("editComponentState",n)},getInspectorTree:n=>{this.hooks.hook("getInspectorTree",n)},getInspectorState:n=>{this.hooks.hook("getInspectorState",n)},editInspectorState:n=>{this.hooks.hook("editInspectorState",n)},inspectTimelineEvent:n=>{this.hooks.hook("inspectTimelineEvent",n)},timelineCleared:n=>{this.hooks.hook("timelineCleared",n)},setPluginSettings:n=>{this.hooks.hook("setPluginSettings",n)}}}notifyComponentUpdate(n){var e;if(kt.highPerfModeEnabled)return;const t=tM().find(i=>i.packageName===this.plugin.descriptor.packageName);if(t!=null&&t.id){if(n){const i=[n.appContext.app,n.uid,(e=n.parent)==null?void 0:e.uid,n];Un.callHook("component:updated",...i)}else Un.callHook("component:updated");this.hooks.callHook("sendInspectorState",{inspectorId:t.id,plugin:this.plugin})}}addInspector(n){this.hooks.callHook("addInspector",{inspector:n,plugin:this.plugin}),this.plugin.descriptor.settings&&TU(n.id,this.plugin.descriptor.settings)}sendInspectorTree(n){kt.highPerfModeEnabled||this.hooks.callHook("sendInspectorTree",{inspectorId:n,plugin:this.plugin})}sendInspectorState(n){kt.highPerfModeEnabled||this.hooks.callHook("sendInspectorState",{inspectorId:n,plugin:this.plugin})}selectInspectorNode(n,e){this.hooks.callHook("customInspectorSelectNode",{inspectorId:n,nodeId:e,plugin:this.plugin})}visitComponentTree(n){return this.hooks.callHook("visitComponentTree",n)}now(){return kt.highPerfModeEnabled?0:Date.now()}addTimelineLayer(n){this.hooks.callHook("timelineLayerAdded",{options:n,plugin:this.plugin})}addTimelineEvent(n){kt.highPerfModeEnabled||this.hooks.callHook("timelineEventAdded",{options:n,plugin:this.plugin})}getSettings(n){return iM(n??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(n){return this.hooks.callHook("getComponentInstances",{app:n})}getComponentBounds(n){return this.hooks.callHook("getComponentBounds",{instance:n})}getComponentName(n){return this.hooks.callHook("getComponentName",{instance:n})}highlightElement(n){const e=n.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook("componentHighlight",{uid:e})}unhighlightElement(){return this.hooks.callHook("componentUnhighlight")}},RU=CU;ue();ue();ue();ue();var IU="__vue_devtool_undefined__",PU="__vue_devtool_infinity__",LU="__vue_devtool_negative_infinity__",DU="__vue_devtool_nan__";ue();ue();var OU={[IU]:"undefined",[DU]:"NaN",[PU]:"Infinity",[LU]:"-Infinity"};Object.entries(OU).reduce((n,[e,t])=>(n[t]=e,n),{});ue();ue();ue();ue();ue();var V0;(V0=Ce).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__!=null||(V0.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__=new Set);function UU(n,e){return sM.setupDevToolsPlugin(n,e)}function NU(n,e){const[t,i]=n;if(t.app!==e)return;const s=new RU({plugin:{setupFn:i,descriptor:t},ctx:Io});t.packageName==="vuex"&&s.on.editInspectorState(r=>{s.sendInspectorState(r.inspectorId)}),i(s)}function rM(n,e){Ce.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(n)||kt.highPerfModeEnabled&&!(e!=null&&e.inspectingComponent)||(Ce.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(n),Rm.forEach(t=>{NU(t,n)}))}ue();ue();var qa="__VUE_DEVTOOLS_ROUTER__",xo="__VUE_DEVTOOLS_ROUTER_INFO__",H0;(H0=Ce)[xo]!=null||(H0[xo]={currentRoute:null,routes:[]});var G0;(G0=Ce)[qa]!=null||(G0[qa]={});new Proxy(Ce[xo],{get(n,e){return Ce[xo][e]}});new Proxy(Ce[qa],{get(n,e){if(e==="value")return Ce[qa]}});function FU(n){const e=new Map;return((n==null?void 0:n.getRoutes())||[]).filter(t=>!e.has(t.path)&&e.set(t.path,1))}function Pm(n){return n.map(e=>{let{path:t,name:i,children:s,meta:r}=e;return s!=null&&s.length&&(s=Pm(s)),{path:t,name:i,children:s,meta:r}})}function BU(n){if(n){const{fullPath:e,hash:t,href:i,path:s,name:r,matched:o,params:a,query:l}=n;return{fullPath:e,hash:t,href:i,path:s,name:r,params:a,query:l,matched:Pm(o)}}return n}function kU(n,e){function t(){var i;const s=(i=n.app)==null?void 0:i.config.globalProperties.$router,r=BU(s==null?void 0:s.currentRoute.value),o=Pm(FU(s)),a=console.warn;console.warn=()=>{},Ce[xo]={currentRoute:r?w0(r):{},routes:w0(o)},Ce[qa]=s,console.warn=a}t(),sM.on.componentUpdated(yo(()=>{var i;((i=e.value)==null?void 0:i.app)===n.app&&(t(),!kt.highPerfModeEnabled&&Io.hooks.callHook("routerInfoUpdated",{state:Ce[xo]}))},200))}function zU(n){return{async getInspectorTree(e){const t={...e,app:gn.value.app,rootNodes:[]};return await new Promise(i=>{n.callHookWith(async s=>{await Promise.all(s.map(r=>r(t))),i()},"getInspectorTree")}),t.rootNodes},async getInspectorState(e){const t={...e,app:gn.value.app,state:null},i={currentTab:`custom-inspector:${e.inspectorId}`};return await new Promise(s=>{n.callHookWith(async r=>{await Promise.all(r.map(o=>o(t,i))),s()},"getInspectorState")}),t.state},editInspectorState(e){const t=new hU,i={...e,app:gn.value.app,set:(s,r=e.path,o=e.state.value,a)=>{t.set(s,r,o,a||t.createDefaultSetCallback(e.state))}};n.callHookWith(s=>{s.forEach(r=>r(i))},"editInspectorState")},sendInspectorState(e){const t=Oc(e);n.callHook("sendInspectorState",{inspectorId:e,plugin:{descriptor:t.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return rU()},cancelInspectComponentInspector(){return sU()},getComponentRenderCode(e){const t=Vd(gn.value,e);if(t)return(t==null?void 0:t.type)instanceof Function?t.type.toString():t.render.toString()},scrollToComponent(e){return oU({id:e})},openInEditor:SU,getVueInspector:cU,toggleApp(e,t){const i=Fh.value.find(s=>s.id===e);i&&(MU(e),bU(i),kU(i,gn),eM(),rM(i.app,t))},inspectDOM(e){const t=Vd(gn.value,e);if(t){const[i]=Em(t);i&&(Ce.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=i)}},updatePluginSettings(e,t,i){wU(e,t,i)},getPluginSettings(e){return{options:EU(e),values:iM(e)}}}}ue();var W0;(W0=Ce).__VUE_DEVTOOLS_ENV__!=null||(W0.__VUE_DEVTOOLS_ENV__={vitePluginDetected:!1});var X0=vU(),q0;(q0=Ce).__VUE_DEVTOOLS_KIT_CONTEXT__!=null||(q0.__VUE_DEVTOOLS_KIT_CONTEXT__={hooks:X0,get state(){return{...kt,activeAppRecordId:gn.id,activeAppRecord:gn.value,appRecords:Fh.value}},api:zU(X0)});var Io=Ce.__VUE_DEVTOOLS_KIT_CONTEXT__;ue();zO(HO());var j0;(j0=Ce).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__!=null||(j0.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__={id:0,appIds:new Set});ue();function VU(n){kt.highPerfModeEnabled=n??!kt.highPerfModeEnabled,!n&&gn.value&&rM(gn.value.app)}ue();ue();ue();function HU(n){kt.devtoolsClientDetected={...kt.devtoolsClientDetected,...n};const e=Object.values(kt.devtoolsClientDetected).some(Boolean);VU(!e)}var Y0;(Y0=Ce).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__!=null||(Y0.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__=HU);ue();ue();ue();ue();ue();ue();ue();var GU=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(n,e){this.keyToValue.set(n,e),this.valueToKey.set(e,n)}getByKey(n){return this.keyToValue.get(n)}getByValue(n){return this.valueToKey.get(n)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},oM=class{constructor(n){this.generateIdentifier=n,this.kv=new GU}register(n,e){this.kv.getByValue(n)||(e||(e=this.generateIdentifier(n)),this.kv.set(e,n))}clear(){this.kv.clear()}getIdentifier(n){return this.kv.getByValue(n)}getValue(n){return this.kv.getByKey(n)}},WU=class extends oM{constructor(){super(n=>n.name),this.classToAllowedProps=new Map}register(n,e){typeof e=="object"?(e.allowProps&&this.classToAllowedProps.set(n,e.allowProps),super.register(n,e.identifier)):super.register(n,e)}getAllowedProps(n){return this.classToAllowedProps.get(n)}};ue();ue();function XU(n){if("values"in Object)return Object.values(n);const e=[];for(const t in n)n.hasOwnProperty(t)&&e.push(n[t]);return e}function qU(n,e){const t=XU(n);if("find"in t)return t.find(e);const i=t;for(let s=0;se(i,t))}function Uc(n,e){return n.indexOf(e)!==-1}function $0(n,e){for(let t=0;te.isApplicable(n))}findByName(n){return this.transfomers[n]}};ue();ue();var YU=n=>Object.prototype.toString.call(n).slice(8,-1),aM=n=>typeof n>"u",$U=n=>n===null,ja=n=>typeof n!="object"||n===null||n===Object.prototype?!1:Object.getPrototypeOf(n)===null?!0:Object.getPrototypeOf(n)===Object.prototype,Xd=n=>ja(n)&&Object.keys(n).length===0,bs=n=>Array.isArray(n),KU=n=>typeof n=="string",ZU=n=>typeof n=="number"&&!isNaN(n),JU=n=>typeof n=="boolean",QU=n=>n instanceof RegExp,Ya=n=>n instanceof Map,$a=n=>n instanceof Set,lM=n=>YU(n)==="Symbol",eN=n=>n instanceof Date&&!isNaN(n.valueOf()),tN=n=>n instanceof Error,K0=n=>typeof n=="number"&&isNaN(n),nN=n=>JU(n)||$U(n)||aM(n)||ZU(n)||KU(n)||lM(n),iN=n=>typeof n=="bigint",sN=n=>n===1/0||n===-1/0,rN=n=>ArrayBuffer.isView(n)&&!(n instanceof DataView),oN=n=>n instanceof URL;ue();var cM=n=>n.replace(/\./g,"\\."),Kf=n=>n.map(String).map(cM).join("."),va=n=>{const e=[];let t="";for(let s=0;snull,()=>{}),hi(iN,"bigint",n=>n.toString(),n=>typeof BigInt<"u"?BigInt(n):(console.error("Please add a BigInt polyfill."),n)),hi(eN,"Date",n=>n.toISOString(),n=>new Date(n)),hi(tN,"Error",(n,e)=>{const t={name:n.name,message:n.message};return e.allowedErrorProps.forEach(i=>{t[i]=n[i]}),t},(n,e)=>{const t=new Error(n.message);return t.name=n.name,t.stack=n.stack,e.allowedErrorProps.forEach(i=>{t[i]=n[i]}),t}),hi(QU,"regexp",n=>""+n,n=>{const e=n.slice(1,n.lastIndexOf("/")),t=n.slice(n.lastIndexOf("/")+1);return new RegExp(e,t)}),hi($a,"set",n=>[...n.values()],n=>new Set(n)),hi(Ya,"map",n=>[...n.entries()],n=>new Map(n)),hi(n=>K0(n)||sN(n),"number",n=>K0(n)?"NaN":n>0?"Infinity":"-Infinity",Number),hi(n=>n===0&&1/n===-1/0,"number",()=>"-0",Number),hi(oN,"URL",n=>n.toString(),n=>new URL(n))];function Bh(n,e,t,i){return{isApplicable:n,annotation:e,transform:t,untransform:i}}var hM=Bh((n,e)=>lM(n)?!!e.symbolRegistry.getIdentifier(n):!1,(n,e)=>["symbol",e.symbolRegistry.getIdentifier(n)],n=>n.description,(n,e,t)=>{const i=t.symbolRegistry.getValue(e[1]);if(!i)throw new Error("Trying to deserialize unknown symbol");return i}),aN=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((n,e)=>(n[e.name]=e,n),{}),fM=Bh(rN,n=>["typed-array",n.constructor.name],n=>[...n],(n,e)=>{const t=aN[e[1]];if(!t)throw new Error("Trying to deserialize unknown typed array");return new t(n)});function dM(n,e){return n!=null&&n.constructor?!!e.classRegistry.getIdentifier(n.constructor):!1}var pM=Bh(dM,(n,e)=>["class",e.classRegistry.getIdentifier(n.constructor)],(n,e)=>{const t=e.classRegistry.getAllowedProps(n.constructor);if(!t)return{...n};const i={};return t.forEach(s=>{i[s]=n[s]}),i},(n,e,t)=>{const i=t.classRegistry.getValue(e[1]);if(!i)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(i.prototype),n)}),mM=Bh((n,e)=>!!e.customTransformerRegistry.findApplicable(n),(n,e)=>["custom",e.customTransformerRegistry.findApplicable(n).name],(n,e)=>e.customTransformerRegistry.findApplicable(n).serialize(n),(n,e,t)=>{const i=t.customTransformerRegistry.findByName(e[1]);if(!i)throw new Error("Trying to deserialize unknown custom value");return i.deserialize(n)}),lN=[pM,hM,mM,fM],Z0=(n,e)=>{const t=$0(lN,s=>s.isApplicable(n,e));if(t)return{value:t.transform(n,e),type:t.annotation(n,e)};const i=$0(uM,s=>s.isApplicable(n,e));if(i)return{value:i.transform(n,e),type:i.annotation}},gM={};uM.forEach(n=>{gM[n.annotation]=n});var cN=(n,e,t)=>{if(bs(e))switch(e[0]){case"symbol":return hM.untransform(n,e,t);case"class":return pM.untransform(n,e,t);case"custom":return mM.untransform(n,e,t);case"typed-array":return fM.untransform(n,e,t);default:throw new Error("Unknown transformation: "+e)}else{const i=gM[e];if(!i)throw new Error("Unknown transformation: "+e);return i.untransform(n,t)}};ue();var Qr=(n,e)=>{if(e>n.size)throw new Error("index out of bounds");const t=n.keys();for(;e>0;)t.next(),e--;return t.next().value};function _M(n){if(Uc(n,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Uc(n,"prototype"))throw new Error("prototype is not allowed as a property");if(Uc(n,"constructor"))throw new Error("constructor is not allowed as a property")}var uN=(n,e)=>{_M(e);for(let t=0;t{if(_M(e),e.length===0)return t(n);let i=n;for(let r=0;rjd(r,e,[...t,...va(o)]));return}const[i,s]=n;s&&bo(s,(r,o)=>{jd(r,e,[...t,...va(o)])}),e(i,t)}function hN(n,e,t){return jd(e,(i,s)=>{n=qd(n,s,r=>cN(r,i,t))}),n}function fN(n,e){function t(i,s){const r=uN(n,va(s));i.map(va).forEach(o=>{n=qd(n,o,()=>r)})}if(bs(e)){const[i,s]=e;i.forEach(r=>{n=qd(n,va(r),()=>n)}),s&&bo(s,t)}else bo(e,t);return n}var dN=(n,e)=>ja(n)||bs(n)||Ya(n)||$a(n)||dM(n,e);function pN(n,e,t){const i=t.get(n);i?i.push(e):t.set(n,[e])}function mN(n,e){const t={};let i;return n.forEach(s=>{if(s.length<=1)return;e||(s=s.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[r,...o]=s;r.length===0?i=o.map(Kf):t[Kf(r)]=o.map(Kf)}),i?Xd(t)?[i]:[i,t]:Xd(t)?void 0:t}var vM=(n,e,t,i,s=[],r=[],o=new Map)=>{var a;const l=nN(n);if(!l){pN(n,s,e);const p=o.get(n);if(p)return i?{transformedValue:null}:p}if(!dN(n,t)){const p=Z0(n,t),_=p?{transformedValue:p.value,annotations:[p.type]}:{transformedValue:n};return l||o.set(n,_),_}if(Uc(r,n))return{transformedValue:null};const c=Z0(n,t),u=(a=c==null?void 0:c.value)!=null?a:n,h=bs(u)?[]:{},f={};bo(u,(p,_)=>{if(_==="__proto__"||_==="constructor"||_==="prototype")throw new Error(`Detected property ${_}. This is a prototype pollution risk, please remove it from your object.`);const g=vM(p,e,t,i,[...s,_],[...r,n],o);h[_]=g.transformedValue,bs(g.annotations)?f[_]=g.annotations:ja(g.annotations)&&bo(g.annotations,(m,x)=>{f[cM(_)+"."+x]=m})});const d=Xd(f)?{transformedValue:h,annotations:c?[c.type]:void 0}:{transformedValue:h,annotations:c?[c.type,f]:f};return l||o.set(n,d),d};ue();ue();function yM(n){return Object.prototype.toString.call(n).slice(8,-1)}function J0(n){return yM(n)==="Array"}function gN(n){if(yM(n)!=="Object")return!1;const e=Object.getPrototypeOf(n);return!!e&&e.constructor===Object&&e===Object.prototype}function _N(n,e,t,i,s){const r={}.propertyIsEnumerable.call(i,e)?"enumerable":"nonenumerable";r==="enumerable"&&(n[e]=t),s&&r==="nonenumerable"&&Object.defineProperty(n,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}function Yd(n,e={}){if(J0(n))return n.map(s=>Yd(s,e));if(!gN(n))return n;const t=Object.getOwnPropertyNames(n),i=Object.getOwnPropertySymbols(n);return[...t,...i].reduce((s,r)=>{if(J0(e.props)&&!e.props.includes(r))return s;const o=n[r],a=Yd(o,e);return _N(s,r,a,n,e.nonenumerable),s},{})}var Mt=class{constructor({dedupe:n=!1}={}){this.classRegistry=new WU,this.symbolRegistry=new oM(e=>{var t;return(t=e.description)!=null?t:""}),this.customTransformerRegistry=new jU,this.allowedErrorProps=[],this.dedupe=n}serialize(n){const e=new Map,t=vM(n,e,this,this.dedupe),i={json:t.transformedValue};t.annotations&&(i.meta={...i.meta,values:t.annotations});const s=mN(e,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i}deserialize(n){const{json:e,meta:t}=n;let i=Yd(e);return t!=null&&t.values&&(i=hN(i,t.values,this)),t!=null&&t.referentialEqualities&&(i=fN(i,t.referentialEqualities)),i}stringify(n){return JSON.stringify(this.serialize(n))}parse(n){return this.deserialize(JSON.parse(n))}registerClass(n,e){this.classRegistry.register(n,e)}registerSymbol(n,e){this.symbolRegistry.register(n,e)}registerCustom(n,e){this.customTransformerRegistry.register({name:e,...n})}allowErrorProps(...n){this.allowedErrorProps.push(...n)}};Mt.defaultInstance=new Mt;Mt.serialize=Mt.defaultInstance.serialize.bind(Mt.defaultInstance);Mt.deserialize=Mt.defaultInstance.deserialize.bind(Mt.defaultInstance);Mt.stringify=Mt.defaultInstance.stringify.bind(Mt.defaultInstance);Mt.parse=Mt.defaultInstance.parse.bind(Mt.defaultInstance);Mt.registerClass=Mt.defaultInstance.registerClass.bind(Mt.defaultInstance);Mt.registerSymbol=Mt.defaultInstance.registerSymbol.bind(Mt.defaultInstance);Mt.registerCustom=Mt.defaultInstance.registerCustom.bind(Mt.defaultInstance);Mt.allowErrorProps=Mt.defaultInstance.allowErrorProps.bind(Mt.defaultInstance);ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();ue();var Q0;(Q0=Ce).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__!=null||(Q0.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__=[]);var ev;(ev=Ce).__VUE_DEVTOOLS_KIT_RPC_CLIENT__!=null||(ev.__VUE_DEVTOOLS_KIT_RPC_CLIENT__=null);var tv;(tv=Ce).__VUE_DEVTOOLS_KIT_RPC_SERVER__!=null||(tv.__VUE_DEVTOOLS_KIT_RPC_SERVER__=null);var nv;(nv=Ce).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__!=null||(nv.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__=null);var iv;(iv=Ce).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__!=null||(iv.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__=null);var sv;(sv=Ce).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__!=null||(sv.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__=null);ue();ue();ue();ue();ue();ue();ue();function vN(n,e){const t=`▲ ■ ●${n}`;typeof rv=="function"?rv(t,e):console.log(t)}function rv(n,e){throw new Error(n+e)}const xM=n=>{const e={id:n.uuid,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=vm(n);return t>0&&e.tags.push({label:`${KD(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(TD(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new ve(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function bM(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const s=xM(i);e.children.push(s),bM(i,s,t)})}const yN=[],jo="tres:inspector",xN=Ts({sceneGraph:null});function bN(n,e){UU({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:yN,app:n},t=>{typeof t.now!="function"&&vN("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),t.addInspector({id:jo,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(jo)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(r=>{if(r.inspectorId===jo){const o=xM(e.scene.value);bM(e.scene.value,o,r.filter),xN.sceneGraph=o,r.rootNodes=[o]}});let i=null,s=null;t.on.getInspectorState(r=>{var o;if(r.inspectorId===jo){const[a]=e.scene.value.getObjectsByProperty("uuid",r.nodeId);if(!a)return;if(s&&i&&i.parent&&s.remove(i),a.isMesh){const l=FD(a);a.add(l),i=l,s=a}r.state={object:Object.entries(a).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},a.isScene&&(r.state={...r.state,state:[{key:"Scene Info",value:{objects:a.children.length,memory:vm(a),calls:e.renderer.value.info.render.calls,triangles:e.renderer.value.info.render.triangles,points:e.renderer.value.info.render.points,lines:e.renderer.value.info.render.lines}},{key:"Programs",value:((o=e.renderer.value.info.programs)==null?void 0:o.map(l=>({...l,programName:l.name})))||[]}]})}}),t.on.editInspectorState(r=>{r.inspectorId===jo&&ND(e.scene.value,r.nodeId,r.path,r.state.value)})})}const MN=["data-scene","data-tres"],MM=dr({__name:"TresCanvas",props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:"always"},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:["render","click","double-click","context-menu","pointer-move","pointer-up","pointer-down","pointer-enter","pointer-leave","pointer-over","pointer-out","pointer-missed","wheel","ready"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=yp(),o=vt(),a=it(new mh),l=ji();Bu(T2);const c=(p,_=!1)=>dr({setup(){var g;const m=(g=ji())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const x={};function v(y){y&&(y.parent&&v(y.parent),y.provides&&Object.assign(x,y.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(v(l.parent),Reflect.ownKeys(x).forEach(y=>{ra(y,x[y])})),ra("useTres",p),ra("extend",Bu),typeof window<"u"&&bN(m==null?void 0:m.app,p),()=>Yc(mn,null,_?[]:r.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=yy(fO(p));m(Yc(g),a.value)},h=(p,_=!1)=>{Db(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},f=it(null);e({context:f,dispose:()=>h(f.value,!0)});const d=()=>{h(f.value),u(f.value,!0)};return _s(()=>{const p=o;f.value=rO({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i,emit:s});const{registerCamera:_,camera:g,cameras:m,deregisterCamera:x}=f.value;u(f.value);const v=()=>{const y=new Ft(45,window.innerWidth/window.innerHeight,.1,1e3);y.position.set(3,3,3),y.lookAt(0,0,0),_(y);const w=Qu(()=>{m.value.length>=2&&(y.removeFromParent(),x(y),w==null||w())})};pt(()=>i.camera,(y,w)=>{y&&_(y),w&&(w.removeFromParent(),x(w))},{immediate:!0}),g.value||v()}),qi(d),(p,_)=>(Fi(),Bi("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:Ja(p.$attrs.class),"data-tres":`tresjs ${gt(_D).version}`,style:Yu({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,MN))}}),SN={install(n){n.component("TresCanvas",MM)}};function Zf(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function $d(n,e,t=".",i){if(!Zf(e))return $d(n,{},t,i);const s=Object.assign({},e);for(const r in n){if(r==="__proto__"||r==="constructor")continue;const o=n[r];o!=null&&(i&&i(s,r,o,t)||(Array.isArray(o)&&Array.isArray(s[r])?s[r]=[...o,...s[r]]:Zf(o)&&Zf(s[r])?s[r]=$d(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function EN(n){return(...e)=>e.reduce((t,i)=>$d(t,i,"",n),{})}const SM=EN();function Lm(n){return hp()?(Pv(n),!0):!1}const TN=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const wN=n=>n!=null,AN=Object.prototype.toString,zu=n=>AN.call(n)==="[object Object]",Jf=()=>{};function Nc(n){return Array.isArray(n)?n:[n]}function CN(n,e,t){return pt(n,e,{...t,immediate:!0})}const Dm=TN?window:void 0;function ya(n){var e;const t=Vt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function fi(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=bt(()=>{const a=Nc(Vt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=CN(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>ya(c)))!=null?l:[Dm].filter(c=>c!=null),Nc(Vt(s.value?n[1]:n[0])),Nc(gt(s.value?n[2]:n[1])),Vt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=zu(u)?{...u}:u;e.push(...a.flatMap(f=>l.flatMap(d=>c.map(p=>i(f,d,p,h)))))},{flush:"post"}),o=()=>{r(),t()};return Lm(t),o}function RN(){const n=it(!1),e=ji();return e&&_s(()=>{n.value=!0},e),n}function IN(n){const e=RN();return bt(()=>(e.value,!!n()))}function PN(n,e,t={}){const{root:i,rootMargin:s="0px",threshold:r=0,window:o=Dm,immediate:a=!0}=t,l=IN(()=>o&&"IntersectionObserver"in o),c=bt(()=>{const p=Vt(n);return Nc(p).map(ya).filter(wN)});let u=Jf;const h=it(a),f=l.value?pt(()=>[c.value,ya(i),h.value],([p,_])=>{if(u(),!h.value||!p.length)return;const g=new IntersectionObserver(e,{root:ya(_),rootMargin:s,threshold:r});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=Jf}},{immediate:a,flush:"post"}):Jf,d=()=>{u(),f(),h.value=!1};return Lm(d),{isSupported:l,isActive:h,pause(){u(),h.value=!1},resume(){h.value=!0},stop:d}}function LN(n,e,t){const{window:i=Dm}={},s=vt(null),r=it(),o=(...l)=>{r.value&&r.value.postMessage(...l)},a=function(){r.value&&r.value.terminate()};return i&&(r.value=new Worker(n,e),r.value.onmessage=l=>{s.value=l.data},Lm(()=>{r.value&&r.value.terminate()})),{data:s,post:o,terminate:a,worker:r}}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function DN(n){return ji()}function ON(n,e){DN()&&qi(n,e)}const EM=1/60*1e3,UN=typeof performance<"u"?()=>performance.now():()=>Date.now(),TM=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(UN()),EM);function NN(n){let e=[],t=[],i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const h=u&&s,f=h?e:t;return c&&o.add(l),f.indexOf(l)===-1&&(f.push(l),h&&s&&(i=e.length)),l},cancel:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c(n[e]=NN(()=>Ka=!0),n),{}),Jd=vl.reduce((n,e)=>{const t=kh[e];return n[e]=(i,s=!1,r=!1)=>(Ka||zN(),t.schedule(i,s,r)),n},{}),BN=vl.reduce((n,e)=>(n[e]=kh[e].cancel,n),{});vl.reduce((n,e)=>(n[e]=()=>kh[e].process(ro),n),{});const kN=n=>kh[n].process(ro),wM=n=>{Ka=!1,ro.delta=Kd?EM:Math.max(Math.min(n-ro.timestamp,FN),1),ro.timestamp=n,Zd=!0,vl.forEach(kN),Zd=!1,Ka&&(Kd=!1,TM(wM))},zN=()=>{Ka=!0,Kd=!0,Zd||TM(wM)},AM=()=>ro;function CM(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);sMath.min(Math.max(t,n),e),av=.001,VN=.01,HN=10,GN=.05,WN=1;function XN({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let s,r,o=1-e;o=Qd(GN,WN,o),n=Qd(VN,HN,n/1e3),o<1?(s=c=>{const u=c*o,h=u*n,f=u-t,d=ep(c,o),p=Math.exp(-h);return av-f/d*p},r=c=>{const h=c*o*n,f=h*t+t,d=Math.pow(o,2)*Math.pow(c,2)*n,p=Math.exp(-h),_=ep(Math.pow(c,2),o);return(-s(c)+av>0?-1:1)*((f-d)*p)/_}):(s=c=>{const u=Math.exp(-c*n),h=(c-t)*n+1;return-.001+u*h},r=c=>{const u=Math.exp(-c*n),h=(t-c)*(n*n);return u*h});const a=5/n,l=jN(s,r,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const qN=12;function jN(n,e,t){let i=t;for(let s=1;sn[t]!==void 0)}function KN(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!lv(n,$N)&&lv(n,YN)){const t=XN(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Om(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:s}=n,r=CM(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:h,isResolvedFromDuration:f}=KN(r),d=cv,p=cv;function _(){const g=u?-(u/1e3):0,m=t-e,x=l/(2*Math.sqrt(a*c)),v=Math.sqrt(a/c)/1e3;if(s===void 0&&(s=Math.min(Math.abs(t-e)/100,.4)),x<1){const y=ep(v,x);d=w=>{const A=Math.exp(-x*v*w);return t-A*((g+x*v*m)/y*Math.sin(y*w)+m*Math.cos(y*w))},p=w=>{const A=Math.exp(-x*v*w);return x*v*A*(Math.sin(y*w)*(g+x*v*m)/y+m*Math.cos(y*w))-A*(Math.cos(y*w)*(g+x*v*m)-y*m*Math.sin(y*w))}}else if(x===1)d=y=>t-Math.exp(-v*y)*(m+(g+v*m)*y);else{const y=v*Math.sqrt(x*x-1);d=w=>{const A=Math.exp(-x*v*w),C=Math.min(y*w,300);return t-A*((g+x*v*m)*Math.sinh(C)+y*m*Math.cosh(C))/y}}}return _(),{next:g=>{const m=d(g);if(f)o.done=g>=h;else{const x=p(g)*1e3,v=Math.abs(x)<=i,y=Math.abs(t-m)<=s;o.done=v&&y}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}Om.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const cv=n=>0,RM=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},Um=(n,e,t)=>-t*n+t*e+n,IM=(n,e)=>t=>Math.max(Math.min(t,e),n),xa=n=>n%1?Number(n.toFixed(5)):n,Za=/(-)?([\d]*\.?[\d])+/g,tp=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,ZN=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function yl(n){return typeof n=="string"}const xl={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ba=Object.assign(Object.assign({},xl),{transform:IM(0,1)}),Mc=Object.assign(Object.assign({},xl),{default:1}),Nm=n=>({test:e=>yl(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),js=Nm("deg"),Ma=Nm("%"),Qe=Nm("px"),uv=Object.assign(Object.assign({},Ma),{parse:n=>Ma.parse(n)/100,transform:n=>Ma.transform(n*100)}),Fm=(n,e)=>t=>!!(yl(t)&&ZN.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),PM=(n,e,t)=>i=>{if(!yl(i))return i;const[s,r,o,a]=i.match(Za);return{[n]:parseFloat(s),[e]:parseFloat(r),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},sr={test:Fm("hsl","hue"),parse:PM("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Ma.transform(xa(e))+", "+Ma.transform(xa(t))+", "+xa(ba.transform(i))+")"},JN=IM(0,255),Qf=Object.assign(Object.assign({},xl),{transform:n=>Math.round(JN(n))}),ms={test:Fm("rgb","red"),parse:PM("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+Qf.transform(n)+", "+Qf.transform(e)+", "+Qf.transform(t)+", "+xa(ba.transform(i))+")"};function QN(n){let e="",t="",i="",s="";return n.length>5?(e=n.substr(1,2),t=n.substr(3,2),i=n.substr(5,2),s=n.substr(7,2)):(e=n.substr(1,1),t=n.substr(2,1),i=n.substr(3,1),s=n.substr(4,1),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const np={test:Fm("#"),parse:QN,transform:ms.transform},Tn={test:n=>ms.test(n)||np.test(n)||sr.test(n),parse:n=>ms.test(n)?ms.parse(n):sr.test(n)?sr.parse(n):np.parse(n),transform:n=>yl(n)?n:n.hasOwnProperty("red")?ms.transform(n):sr.transform(n)},LM="${c}",DM="${n}";function e3(n){var e,t,i,s;return isNaN(n)&&yl(n)&&((t=(e=n.match(Za))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((s=(i=n.match(tp))===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)>0}function OM(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(tp);i&&(t=i.length,n=n.replace(tp,LM),e.push(...i.map(Tn.parse)));const s=n.match(Za);return s&&(n=n.replace(Za,DM),e.push(...s.map(xl.parse))),{values:e,numColors:t,tokenised:n}}function UM(n){return OM(n).values}function NM(n){const{values:e,numColors:t,tokenised:i}=OM(n),s=e.length;return r=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function n3(n){const e=UM(n);return NM(n)(e.map(t3))}const bl={test:e3,parse:UM,createTransformer:NM,getAnimatableNone:n3},i3=new Set(["brightness","contrast","saturate","opacity"]);function s3(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(Za)||[];if(!i)return n;const s=t.replace(i,"");let r=i3.has(e)?1:0;return i!==t&&(r*=100),e+"("+r+s+")"}const r3=/([a-z-]*)\(.*?\)/g,ip=Object.assign(Object.assign({},bl),{getAnimatableNone:n=>{const e=n.match(r3);return e?e.map(s3).join(" "):n}});function ed(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function hv({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let s=0,r=0,o=0;if(!e)s=r=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;s=ed(l,a,n+1/3),r=ed(l,a,n),o=ed(l,a,n-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const o3=(n,e,t)=>{const i=n*n,s=e*e;return Math.sqrt(Math.max(0,t*(s-i)+i))},a3=[np,ms,sr],fv=n=>a3.find(e=>e.test(n)),FM=(n,e)=>{let t=fv(n),i=fv(e),s=t.parse(n),r=i.parse(e);t===sr&&(s=hv(s),t=ms),i===sr&&(r=hv(r),i=ms);const o=Object.assign({},s);return a=>{for(const l in o)l!=="alpha"&&(o[l]=o3(s[l],r[l],a));return o.alpha=Um(s.alpha,r.alpha,a),t.transform(o)}},l3=n=>typeof n=="number",c3=(n,e)=>t=>e(n(t)),BM=(...n)=>n.reduce(c3);function kM(n,e){return l3(n)?t=>Um(n,e,t):Tn.test(n)?FM(n,e):VM(n,e)}const zM=(n,e)=>{const t=[...n],i=t.length,s=n.map((r,o)=>kM(r,e[o]));return r=>{for(let o=0;o{const t=Object.assign(Object.assign({},n),e),i={};for(const s in t)n[s]!==void 0&&e[s]!==void 0&&(i[s]=kM(n[s],e[s]));return s=>{for(const r in i)t[r]=i[r](s);return t}};function dv(n){const e=bl.parse(n),t=e.length;let i=0,s=0,r=0;for(let o=0;o{const t=bl.createTransformer(e),i=dv(n),s=dv(e);return i.numHSL===s.numHSL&&i.numRGB===s.numRGB&&i.numNumbers>=s.numNumbers?BM(zM(i.parsed,s.parsed),t):o=>`${o>0?e:n}`},h3=(n,e)=>t=>Um(n,e,t);function f3(n){if(typeof n=="number")return h3;if(typeof n=="string")return Tn.test(n)?FM:VM;if(Array.isArray(n))return zM;if(typeof n=="object")return u3}function d3(n,e,t){const i=[],s=t||f3(n[0]),r=n.length-1;for(let o=0;ot(RM(n,e,i))}function m3(n,e){const t=n.length,i=t-1;return s=>{let r=0,o=!1;if(s<=n[0]?o=!0:s>=n[i]&&(r=i-1,o=!0),!o){let l=1;for(;ls||l===i);l++);r=l-1}const a=RM(n[r],n[r+1],s);return e[r](a)}}function HM(n,e,{clamp:t=!0,ease:i,mixer:s}={}){const r=n.length;ov(r===e.length),ov(!i||!Array.isArray(i)||i.length===r-1),n[0]>n[r-1]&&(n=[].concat(n),e=[].concat(e),n.reverse(),e.reverse());const o=d3(e,i,s),a=r===2?p3(n,o):m3(n,o);return t?l=>a(Qd(n[0],n[r-1],l)):a}const zh=n=>e=>1-n(1-e),Bm=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,g3=n=>e=>Math.pow(e,n),GM=n=>e=>e*e*((n+1)*e-n),_3=n=>{const e=GM(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},WM=1.525,v3=4/11,y3=8/11,x3=9/10,XM=n=>n,km=g3(2),b3=zh(km),qM=Bm(km),jM=n=>1-Math.sin(Math.acos(n)),YM=zh(jM),M3=Bm(YM),zm=GM(WM),S3=zh(zm),E3=Bm(zm),T3=_3(WM),w3=4356/361,A3=35442/1805,C3=16061/1805,Vu=n=>{if(n===1||n===0)return n;const e=n*n;return nn<.5?.5*(1-Vu(1-n*2)):.5*Vu(n*2-1)+.5;function P3(n,e){return n.map(()=>e||qM).splice(0,n.length-1)}function L3(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function D3(n,e){return n.map(t=>t*e)}function Fc({from:n=0,to:e=1,ease:t,offset:i,duration:s=300}){const r={done:!1,value:n},o=Array.isArray(e)?e:[n,e],a=D3(i&&i.length===o.length?i:L3(o),s);function l(){return HM(a,o,{ease:Array.isArray(t)?t:P3(o,t)})}let c=l();return{next:u=>(r.value=c(u),r.done=u>=s,r),flipTarget:()=>{o.reverse(),c=l()}}}function O3({velocity:n=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:s=.5,modifyTarget:r}){const o={done:!1,value:e};let a=t*n;const l=e+a,c=r===void 0?l:r(l);return c!==l&&(a=c-e),{next:u=>{const h=-a*Math.exp(-u/i);return o.done=!(h>s||h<-s),o.value=o.done?c:c+h,o},flipTarget:()=>{}}}const pv={keyframes:Fc,spring:Om,decay:O3};function U3(n){if(Array.isArray(n.to))return Fc;if(pv[n.type])return pv[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Fc:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Om:Fc}function $M(n,e,t=0){return n-e-t}function N3(n,e,t=0,i=!0){return i?$M(e+-n,e,t):e-(n-e)+t}function F3(n,e,t,i){return i?n>=e+t:n<=-t}const B3=n=>{const e=({delta:t})=>n(t);return{start:()=>Jd.update(e,!0),stop:()=>BN.update(e)}};function KM(n){var e,t,{from:i,autoplay:s=!0,driver:r=B3,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:h,onComplete:f,onRepeat:d,onUpdate:p}=n,_=CM(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,x=0,v=_.duration,y,w=!1,A=!0,C;const I=U3(_);!((t=(e=I).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(C=HM([0,100],[i,g],{clamp:!1}),i=0,g=100);const b=I(Object.assign(Object.assign({},_),{from:i,to:g}));function M(){x++,l==="reverse"?(A=x%2===0,o=N3(o,v,c,A)):(o=$M(o,v,c),l==="mirror"&&b.flipTarget()),w=!1,d&&d()}function L(){m.stop(),f&&f()}function N(K){if(A||(K=-K),o+=K,!w){const J=b.next(Math.max(0,o));y=J.value,C&&(y=C(y)),w=A?J.done:o<=0}p==null||p(y),w&&(x===0&&(v??(v=o)),x{h==null||h(),m.stop()}}}function ZM(n,e){return e?n*(1e3/e):0}function k3({from:n=0,velocity:e=0,min:t,max:i,power:s=.8,timeConstant:r=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:h,onComplete:f,onStop:d}){let p;function _(v){return t!==void 0&&vi}function g(v){return t===void 0?i:i===void 0||Math.abs(t-v){var w;h==null||h(y),(w=v.onUpdate)===null||w===void 0||w.call(v,y)},onComplete:f,onStop:d}))}function x(v){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},v))}if(_(n))x({from:n,velocity:e,to:g(n)});else{let v=s*e+n;typeof c<"u"&&(v=c(v));const y=g(v),w=y===t?-1:1;let A,C;const I=b=>{A=C,C=b,e=ZM(b-A,AM().delta),(w===1&&b>y||w===-1&&bp==null?void 0:p.stop()}}const JM=(n,e)=>1-3*e+3*n,QM=(n,e)=>3*e-6*n,eS=n=>3*n,Hu=(n,e,t)=>((JM(e,t)*n+QM(e,t))*n+eS(e))*n,tS=(n,e,t)=>3*JM(e,t)*n*n+2*QM(e,t)*n+eS(e),z3=1e-7,V3=10;function H3(n,e,t,i,s){let r,o,a=0;do o=e+(t-e)/2,r=Hu(o,i,s)-n,r>0?t=o:e=o;while(Math.abs(r)>z3&&++a=W3?X3(o,h,n,t):f===0?h:H3(o,a,a+Sc,n,t)}return o=>o===0||o===1?o:Hu(r(o),e,i)}const Xi={},td={};class j3{constructor(){Vn(this,"subscriptions",new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,i){if(this.subscriptions.size)for(const s of this.subscriptions)s(e,t,i)}clear(){this.subscriptions.clear()}}function mv(n){return!Number.isNaN(Number.parseFloat(n))}class Y3{constructor(e){Vn(this,"current");Vn(this,"prev");Vn(this,"timeDelta",0);Vn(this,"lastUpdated",0);Vn(this,"updateSubscribers",new j3);Vn(this,"stopAnimation");Vn(this,"canTrackVelocity",!1);Vn(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=AM();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),Jd.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});Vn(this,"scheduleVelocityCheck",()=>Jd.postRender(this.velocityCheck));Vn(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=mv(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=mv(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ZM(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{const{stop:i}=e(t);this.stopAnimation=i}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}}function $3(n){return new Y3(n)}const{isArray:K3}=Array;function Z3(){const n=vt({}),e=i=>{const s=r=>{n.value[r]&&(n.value[r].stop(),n.value[r].destroy(),delete n.value[r])};i?K3(i)?i.forEach(s):s(i):Object.keys(n.value).forEach(s)},t=(i,s,r)=>{if(n.value[i])return n.value[i];const o=$3(s);return o.onChange(a=>r[i]=a),n.value[i]=o,o};return ON(e),{motionValues:n,get:t,stop:e}}function J3(n){return Array.isArray(n)}function Ys(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function nd(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Q3(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function id(){return{type:"keyframes",ease:"linear",duration:300}}function eF(n){return{type:"keyframes",duration:800,values:n}}const gv={default:Q3,x:Ys,y:Ys,z:Ys,rotate:Ys,rotateX:Ys,rotateY:Ys,rotateZ:Ys,scaleX:nd,scaleY:nd,scale:nd,backgroundColor:id,color:id,opacity:id};function nS(n,e){let t;return J3(e)?t=eF:t=gv[n]||gv.default,{to:e,...t(e)}}const _v={...xl,transform:Math.round},iS={color:Tn,backgroundColor:Tn,outlineColor:Tn,fill:Tn,stroke:Tn,borderColor:Tn,borderTopColor:Tn,borderRightColor:Tn,borderBottomColor:Tn,borderLeftColor:Tn,borderWidth:Qe,borderTopWidth:Qe,borderRightWidth:Qe,borderBottomWidth:Qe,borderLeftWidth:Qe,borderRadius:Qe,radius:Qe,borderTopLeftRadius:Qe,borderTopRightRadius:Qe,borderBottomRightRadius:Qe,borderBottomLeftRadius:Qe,width:Qe,maxWidth:Qe,height:Qe,maxHeight:Qe,size:Qe,top:Qe,right:Qe,bottom:Qe,left:Qe,padding:Qe,paddingTop:Qe,paddingRight:Qe,paddingBottom:Qe,paddingLeft:Qe,margin:Qe,marginTop:Qe,marginRight:Qe,marginBottom:Qe,marginLeft:Qe,rotate:js,rotateX:js,rotateY:js,rotateZ:js,scale:Mc,scaleX:Mc,scaleY:Mc,scaleZ:Mc,skew:js,skewX:js,skewY:js,distance:Qe,translateX:Qe,translateY:Qe,translateZ:Qe,x:Qe,y:Qe,z:Qe,perspective:Qe,transformPerspective:Qe,opacity:ba,originX:uv,originY:uv,originZ:Qe,zIndex:_v,filter:ip,WebkitFilter:ip,fillOpacity:ba,strokeOpacity:ba,numOctaves:_v},Vm=n=>iS[n];function sp(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function tF(n,e){let t=Vm(n);return t!==ip&&(t=bl),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const nF={linear:XM,easeIn:km,easeInOut:qM,easeOut:b3,circIn:jM,circInOut:M3,circOut:YM,backIn:zm,backInOut:E3,backOut:S3,anticipate:T3,bounceIn:R3,bounceInOut:I3,bounceOut:Vu};function vv(n){if(Array.isArray(n)){const[e,t,i,s]=n;return q3(e,t,i,s)}else if(typeof n=="string")return nF[n];return n}function iF(n){return Array.isArray(n)&&typeof n[0]!="number"}function yv(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&bl.test(e)&&!e.startsWith("url("))}function sF(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function rF({ease:n,times:e,delay:t,...i}){const s={...i};return e&&(s.offset=e),n&&(s.ease=iF(n)?n.map(vv):vv(n)),t&&(s.elapsed=-t),s}function oF(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),sF(e),aF(n)||(n={...n,...nS(t,e.to)}),{...e,...rF(n)}}function aF({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:s,...r}){return!!Object.keys(r).length}function lF(n,e){return n[e]||n.default||n}function cF(n,e,t,i,s){const r=lF(i,n);let o=r.from===null||r.from===void 0?e.get():r.from;const a=yv(n,t);o==="none"&&a&&typeof t=="string"&&(o=tF(n,t));const l=yv(n,o);function c(h){const f={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:d=>e.set(d)};return r.type==="inertia"||r.type==="decay"?k3({...f,...r}):KM({...oF(r,f,n),onUpdate:d=>{f.onUpdate(d),r.onUpdate&&r.onUpdate(d)},onComplete:()=>{s&&s(),h&&h()}})}function u(h){return e.set(t),s&&s(),h&&h(),{stop:()=>{}}}return!l||!a||r.type===!1?u:c}function uF(){const{motionValues:n,stop:e,get:t}=Z3();return{motionValues:n,stop:e,push:(s,r,o,a={},l)=>{const c=o[s],u=t(s,c,o);if(a&&a.immediate){u.set(r);return}const h=cF(s,u,r,a,l);u.start(h)}}}function hF(n,e={},{motionValues:t,push:i,stop:s}=uF()){const r=gt(e),o=vt(!1);pt(t,h=>{o.value=Object.values(h).filter(f=>f.isAnimating()).length>0},{immediate:!0,deep:!0});const a=h=>{if(!r||!r[h])throw new Error(`The variant ${h} does not exist.`);return r[h]},l=h=>{typeof h=="string"&&(h=a(h));const f=Object.entries(h).map(([p,_])=>{if(p!=="transition")return new Promise(g=>i(p,_,n,h.transition||nS(p,h[p]),g))}).filter(Boolean);async function d(){var p,_;await Promise.all(f),(_=(p=h.transition)==null?void 0:p.onComplete)==null||_.call(p)}return Promise.all([d()])};return{isAnimating:o,apply:l,set:h=>{const f=zu(h)?h:a(h);Object.entries(f).forEach(([d,p])=>{d!=="transition"&&i(d,p,n,{immediate:!0})})},leave:async h=>{let f;if(r&&(r.leave&&(f=r.leave),!r.leave&&r.initial&&(f=r.initial)),!f){h();return}await l(f),h()},stop:s}}const Hm=typeof window<"u",fF=()=>Hm&&(window.onpointerdown===null||(Xi==null?void 0:Xi.TEST)),dF=()=>Hm&&(window.ontouchstart===null||(Xi==null?void 0:Xi.TEST)),pF=()=>Hm&&(window.onmousedown===null||(Xi==null?void 0:Xi.TEST));function mF({target:n,state:e,variants:t,apply:i}){const s=gt(t),r=vt(!1),o=vt(!1),a=vt(!1),l=bt(()=>{let u=[...Object.keys(e.value||{})];return s&&(s.hovered&&(u=[...u,...Object.keys(s.hovered)]),s.tapped&&(u=[...u,...Object.keys(s.tapped)]),s.focused&&(u=[...u,...Object.keys(s.focused)])),u}),c=bt(()=>{const u={};Object.assign(u,e.value),r.value&&s.hovered&&Object.assign(u,s.hovered),o.value&&s.tapped&&Object.assign(u,s.tapped),a.value&&s.focused&&Object.assign(u,s.focused);for(const h in u)l.value.includes(h)||delete u[h];return u});s.hovered&&(fi(n,"mouseenter",()=>r.value=!0),fi(n,"mouseleave",()=>{r.value=!1,o.value=!1})),s.tapped&&(pF()&&(fi(n,"mousedown",()=>o.value=!0),fi(n,"mouseup",()=>o.value=!1)),fF()&&(fi(n,"pointerdown",()=>o.value=!0),fi(n,"pointerup",()=>o.value=!1)),dF()&&(fi(n,"touchstart",()=>o.value=!0),fi(n,"touchend",()=>o.value=!1))),s.focused&&(fi(n,"focus",()=>a.value=!0),fi(n,"blur",()=>a.value=!1)),pt([r,o,a],()=>{i(c.value)})}function gF({set:n,target:e,variants:t,variant:i}){const s=gt(t);pt(()=>e,()=>{s&&(s.initial&&(n("initial"),i.value="initial"),s.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function _F({state:n,apply:e}){pt(n,t=>{t&&e(t)},{immediate:!0})}function sS({target:n,variants:e,variant:t}){const i=gt(e);i&&(i.visible||i.visibleOnce)&&PN(n,([{isIntersecting:s}])=>{i.visible?s?t.value="visible":t.value="initial":i.visibleOnce&&(s&&t.value!=="visibleOnce"?t.value="visibleOnce":t.value||(t.value="initial"))})}function vF(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&gF(n),e.syncVariants&&_F(n),e.visibilityHooks&&sS(n),e.eventListeners&&mF(n)}function rS(n={}){const e=Ts({...n}),t=vt({});return pt(e,()=>{const i={};for(const[s,r]of Object.entries(e)){const o=Vm(s),a=sp(r,o);i[s]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function Gm(n,e){pt(()=>ya(n),t=>{t&&e(t)},{immediate:!0})}const yF={x:"translateX",y:"translateY",z:"translateZ"};function oS(n={},e=!0){const t=Ts({...n}),i=vt("");return pt(t,s=>{let r="",o=!1;if(e&&(s.x||s.y||s.z)){const a=[s.x||0,s.y||0,s.z||0].map(l=>sp(l,Qe)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,l]of Object.entries(s)){if(e&&(a==="x"||a==="y"||a==="z"))continue;const c=Vm(a),u=sp(l,c);r+=`${yF[a]||a}(${u}) `}e&&!o&&(r+="translateZ(0px) "),i.value=r.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const xF=["","X","Y","Z"],bF=["perspective","translate","scale","rotate","skew"],aS=["transformPerspective","x","y","z"];bF.forEach(n=>{xF.forEach(e=>{const t=n+e;aS.push(t)})});const MF=new Set(aS);function Wm(n){return MF.has(n)}const SF=new Set(["originX","originY","originZ"]);function lS(n){return SF.has(n)}function EF(n){const e={},t={};return Object.entries(n).forEach(([i,s])=>{Wm(i)||lS(i)?e[i]=s:t[i]=s}),{transform:e,style:t}}function Vh(n){const{transform:e,style:t}=EF(n),{transform:i}=oS(e),{style:s}=rS(t);return i.value&&(s.value.transform=i.value),s.value}function TF(n,e){let t,i;const{state:s,style:r}=rS();return Gm(n,o=>{i=o;for(const a of Object.keys(iS))o.style[a]===null||o.style[a]===""||Wm(a)||lS(a)||(s[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(s)}),pt(r,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:s}}function wF(n){const e=n.trim().split(/\) |\)/);if(e.length===1)return{};const t=i=>i.endsWith("px")||i.endsWith("deg")?Number.parseFloat(i):Number.isNaN(Number(i))?Number(i):i;return e.reduce((i,s)=>{if(!s)return i;const[r,o]=s.split("("),l=o.split(",").map(u=>t(u.endsWith(")")?u.replace(")",""):u.trim())),c=l.length===1?l[0]:l;return{...i,[r]:c}},{})}function AF(n,e){Object.entries(wF(e)).forEach(([t,i])=>{const s=["x","y","z"];if(t==="translate3d"){if(i===0){s.forEach(r=>n[r]=0);return}i.forEach((r,o)=>n[s[o]]=r);return}if(i=Number.parseFloat(`${i}`),t==="translateX"){n.x=i;return}if(t==="translateY"){n.y=i;return}if(t==="translateZ"){n.z=i;return}n[t]=i})}function CF(n,e){let t,i;const{state:s,transform:r}=oS();return Gm(n,o=>{i=o,o.style.transform&&AF(s,o.style.transform),t&&(o.style.transform=t),e&&e(s)}),pt(r,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:s}}function RF(n){return Object.entries(n)}function IF(n,e){const t=Ts({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:s}=TF(n,i),{transform:r}=CF(n,i);return pt(t,o=>{RF(o).forEach(([a,l])=>{const c=Wm(a)?r:s;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),Gm(n,()=>e),{motionProperties:t,style:s,transform:r}}function PF(n={}){const e=gt(n),t=vt();return{state:bt(()=>{if(t.value)return e[t.value]}),variant:t}}function cS(n,e={},t){const{motionProperties:i}=IF(n),{variant:s,state:r}=PF(e),o=hF(i,e),a={target:n,variant:s,variants:e,state:r,motionProperties:i,...o};return vF(a,t),a}const uS=["delay","duration"],LF=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...uS];function DF(n){return uS.includes(n)}function OF(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&zu(t.variants)&&(e.value={...e.value,...t.variants});for(let i of LF)if(!(!t||!t[i])){if(DF(i)&&typeof t[i]=="number"){for(const s of["enter","visible","visibleOnce"]){const r=e.value[s];r!=null&&(r.transition??(r.transition={}),r.transition[i]=t[i])}continue}if(zu(t[i])){const s=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=s}}}}function sd(n,e=!1){return{created:(s,r,o)=>{const a=r.value&&typeof r.value=="string"?r.value:o.key;a&&td[a]&&td[a].stop();const l=e?structuredClone(nt(n)||{}):n||{},c=vt(l);typeof r.value=="object"&&(c.value=r.value),OF(o,c);const h=cS(s,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});s.motionInstance=h,a&&(td[a]=h)},mounted:(s,r,o)=>{s.motionInstance&&sS(s.motionInstance)},getSSRProps(s,r){let{initial:o}=s.value||r&&(r==null?void 0:r.props)||{};o=gt(o);const a=SM({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:Vh(a)}}}}const UF={initial:{opacity:0},enter:{opacity:1}},NF={initial:{opacity:0},visible:{opacity:1}},FF={initial:{opacity:0},visibleOnce:{opacity:1}},BF={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},kF={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},zF={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},VF={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},HF={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},GF={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},WF={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},XF={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},qF={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},jF={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},YF={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},$F={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},KF={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},ZF={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},JF={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},QF={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},eB={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},tB={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},nB={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},iB={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},sB={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},rB={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},oB={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},aB={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},lB={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},cB={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},uB={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Gu={__proto__:null,fade:UF,fadeVisible:NF,fadeVisibleOnce:FF,pop:BF,popVisible:kF,popVisibleOnce:zF,rollBottom:KF,rollLeft:VF,rollRight:WF,rollTop:jF,rollVisibleBottom:ZF,rollVisibleLeft:HF,rollVisibleOnceBottom:JF,rollVisibleOnceLeft:GF,rollVisibleOnceRight:qF,rollVisibleOnceTop:$F,rollVisibleRight:XF,rollVisibleTop:YF,slideBottom:lB,slideLeft:QF,slideRight:nB,slideTop:rB,slideVisibleBottom:cB,slideVisibleLeft:eB,slideVisibleOnceBottom:uB,slideVisibleOnceLeft:tB,slideVisibleOnceRight:sB,slideVisibleOnceTop:aB,slideVisibleRight:iB,slideVisibleTop:oB};function hB(n){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",t="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",i=new RegExp(e.split("").join("|"),"g");return n.toString().replace(/[A-Z]/g,s=>`-${s}`).toLowerCase().replace(/\s+/g,"-").replace(i,s=>t.charAt(e.indexOf(s))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const hS=Symbol(""),fS={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function fB(n){return Object.prototype.toString.call(n)==="[object Object]"}function rp(n){if(Array.isArray(n))return n.map(rp);if(fB(n)){const e={};for(const t in n)e[t]=rp(n[t]);return e}return n}function dS(n){const e=Ts({}),t=ar(hS,{}),i=bt(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(nt(t)[n.preset]):n.preset in Gu?structuredClone(Gu[n.preset]):{}),s=bt(()=>({initial:n.initial,enter:n.enter,leave:n.leave,visible:n.visible,visibleOnce:n.visibleOnce,hovered:n.hovered,tapped:n.tapped,focused:n.focused}));function r(l,c){for(const u of["delay","duration"]){if(c[u]==null)continue;const h=Number.parseInt(c[u]);for(const f of["enter","visible","visibleOnce"]){const d=l[f];d!=null&&(d.transition??(d.transition={}),d.transition[u]=h)}}return l}const o=bt(()=>{const l=SM({},s.value,i.value,n.variants||{});return r({...l},n)});function a(l,c,u){var f;l.props??(l.props={}),(f=l.props).style??(f.style={}),l.props.style={...l.props.style,...u};const h=r(rp(o.value),l.props);return l.props.onVnodeMounted=({el:d})=>{e[c]=cS(d,h)},l.props.onVnodeUpdated=({el:d})=>{const p=Vh(e[c].state);for(const[_,g]of Object.entries(p))d.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const dB=dr({name:"Motion",props:{...fS,is:{type:[String,Object],default:"div"}},setup(n){const e=yp(),{motionConfig:t,setNodeInstance:i}=dS(n);return()=>{const s=Vh(t.value.initial||{}),r=Yc(n.is,void 0,e);return i(r,0,s),r}}}),pB=dr({name:"MotionGroup",props:{...fS,is:{type:[String,Object],required:!1}},setup(n){const e=yp(),{motionConfig:t,setNodeInstance:i}=dS(n);return()=>{var o;const s=Vh(t.value.initial||{}),r=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a({red:e.ready?e.active?1:0:.1,green:e.ready?e.active?0:1:.1,blue:e.ready?e.active?1:0:.1})),s=vt(),r=bt(()=>new ul(3,20)),o=bt(()=>new jt({uniforms:{u_time:{value:0},u_frequency:{value:0},u_red:{value:0},u_green:{value:0},u_blue:{value:0}},vertexShader:document.getElementById("vertexshader").textContent||"",fragmentShader:document.getElementById("fragmentshader").textContent||"",wireframe:!0})),a=o.value.uniforms;return t(({clock:l})=>{const c=l.getElapsedTime();a.u_time.value=c,a.u_frequency.value=Math.min(_B+vB*e.frequency,yB),a.u_red.value=i.value.red,a.u_green.value=i.value.green,a.u_blue.value=i.value.blue}),(l,c)=>(Fi(),Bi("TresMesh",{ref_key:"mesh",ref:s,geometry:r.value,material:o.value},null,8,gB))}}),kc={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:` + + varying vec2 vUv; + + void main() { + + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + }`,fragmentShader:` + + uniform float opacity; + + uniform sampler2D tDiffuse; + + varying vec2 vUv; + + void main() { + + vec4 texel = texture2D( tDiffuse, vUv ); + gl_FragColor = opacity * texel; + + + }`};class Po{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const bB=new ml(-1,1,1,-1,0,1);class MB extends Ke{constructor(){super(),this.setAttribute("position",new Re([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Re([0,2,0,0,2,0],2))}}const SB=new MB;class Xm{constructor(e){this._mesh=new It(SB,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,bB)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class EB extends Po{constructor(e,t="tDiffuse"){super(),this.textureID=t,this.uniforms=null,this.material=null,e instanceof jt?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=mo.clone(e.uniforms),this.material=new jt({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this._fsQuad=new Xm(this.material)}render(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this._fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this._fsQuad.render(e))}dispose(){this.material.dispose(),this._fsQuad.dispose()}}class xv extends Po{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,i){const s=e.getContext(),r=e.state;r.buffers.color.setMask(!1),r.buffers.depth.setMask(!1),r.buffers.color.setLocked(!0),r.buffers.depth.setLocked(!0);let o,a;this.inverse?(o=0,a=1):(o=1,a=0),r.buffers.stencil.setTest(!0),r.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),r.buffers.stencil.setFunc(s.ALWAYS,o,4294967295),r.buffers.stencil.setClear(a),r.buffers.stencil.setLocked(!0),e.setRenderTarget(i),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),r.buffers.color.setLocked(!1),r.buffers.depth.setLocked(!1),r.buffers.color.setMask(!0),r.buffers.depth.setMask(!0),r.buffers.stencil.setLocked(!1),r.buffers.stencil.setFunc(s.EQUAL,1,4294967295),r.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),r.buffers.stencil.setLocked(!0)}}class TB extends Po{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class wB{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const i=e.getSize(new oe);this._width=i.width,this._height=i.height,t=new Cn(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:bi}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new EB(kc),this.copyPass.material.blending=yi,this.clock=new gl}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t + #include + + varying vec2 vUv; + + void main() { + + gl_FragColor = texture2D( tDiffuse, vUv ); + + // tone mapping + + #ifdef LINEAR_TONE_MAPPING + + gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); + + #elif defined( REINHARD_TONE_MAPPING ) + + gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); + + #elif defined( CINEON_TONE_MAPPING ) + + gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); + + #elif defined( ACES_FILMIC_TONE_MAPPING ) + + gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); + + #elif defined( AGX_TONE_MAPPING ) + + gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); + + #elif defined( NEUTRAL_TONE_MAPPING ) + + gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); + + #elif defined( CUSTOM_TONE_MAPPING ) + + gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); + + #endif + + // color space + + #ifdef SRGB_TRANSFER + + gl_FragColor = sRGBTransferOETF( gl_FragColor ); + + #endif + + }`};class AB extends Po{constructor(){super(),this.uniforms=mo.clone(Ec.uniforms),this.material=new em({name:Ec.name,uniforms:this.uniforms,vertexShader:Ec.vertexShader,fragmentShader:Ec.fragmentShader}),this._fsQuad=new Xm(this.material),this._outputColorSpace=null,this._toneMapping=null}render(e,t,i){this.uniforms.tDiffuse.value=i.texture,this.uniforms.toneMappingExposure.value=e.toneMappingExposure,(this._outputColorSpace!==e.outputColorSpace||this._toneMapping!==e.toneMapping)&&(this._outputColorSpace=e.outputColorSpace,this._toneMapping=e.toneMapping,this.material.defines={},tt.getTransfer(this._outputColorSpace)===ht&&(this.material.defines.SRGB_TRANSFER=""),this._toneMapping===Tp?this.material.defines.LINEAR_TONE_MAPPING="":this._toneMapping===wp?this.material.defines.REINHARD_TONE_MAPPING="":this._toneMapping===Ap?this.material.defines.CINEON_TONE_MAPPING="":this._toneMapping===So?this.material.defines.ACES_FILMIC_TONE_MAPPING="":this._toneMapping===Rp?this.material.defines.AGX_TONE_MAPPING="":this._toneMapping===Ip?this.material.defines.NEUTRAL_TONE_MAPPING="":this._toneMapping===Cp&&(this.material.defines.CUSTOM_TONE_MAPPING=""),this.material.needsUpdate=!0),this.renderToScreen===!0?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this._fsQuad.render(e))}dispose(){this.material.dispose(),this._fsQuad.dispose()}}class CB extends Po{constructor(e,t,i=null,s=null,r=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=i,this.clearColor=s,this.clearAlpha=r,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new ve}render(e,t,i){const s=e.autoClear;e.autoClear=!1;let r,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),this.clearAlpha!==null&&(r=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:i),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(r),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=s}}const RB={uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new ve(0)},defaultOpacity:{value:0}},vertexShader:` + + varying vec2 vUv; + + void main() { + + vUv = uv; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + }`,fragmentShader:` + + uniform sampler2D tDiffuse; + uniform vec3 defaultColor; + uniform float defaultOpacity; + uniform float luminosityThreshold; + uniform float smoothWidth; + + varying vec2 vUv; + + void main() { + + vec4 texel = texture2D( tDiffuse, vUv ); + + float v = luminance( texel.xyz ); + + vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity ); + + float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v ); + + gl_FragColor = mix( outputColor, texel, alpha ); + + }`};class Mo extends Po{constructor(e,t=1,i,s){super(),this.strength=t,this.radius=i,this.threshold=s,this.resolution=e!==void 0?new oe(e.x,e.y):new oe(256,256),this.clearColor=new ve(0,0,0),this.needsSwap=!1,this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let r=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new Cn(r,o,{type:bi}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let u=0;u + varying vec2 vUv; + uniform sampler2D colorTexture; + uniform vec2 invSize; + uniform vec2 direction; + uniform float gaussianCoefficients[KERNEL_RADIUS]; + + void main() { + float weightSum = gaussianCoefficients[0]; + vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum; + for( int i = 1; i < KERNEL_RADIUS; i ++ ) { + float x = float(i); + float w = gaussianCoefficients[i]; + vec2 uvOffset = direction * invSize * x; + vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb; + vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb; + diffuseSum += (sample1 + sample2) * w; + weightSum += 2.0 * w; + } + gl_FragColor = vec4(diffuseSum/weightSum, 1.0); + }`})}_getCompositeMaterial(e){return new jt({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + }`,fragmentShader:`varying vec2 vUv; + uniform sampler2D blurTexture1; + uniform sampler2D blurTexture2; + uniform sampler2D blurTexture3; + uniform sampler2D blurTexture4; + uniform sampler2D blurTexture5; + uniform float bloomStrength; + uniform float bloomRadius; + uniform float bloomFactors[NUM_MIPS]; + uniform vec3 bloomTintColors[NUM_MIPS]; + + float lerpBloomFactor(const in float factor) { + float mirrorFactor = 1.2 - factor; + return mix(factor, mirrorFactor, bloomRadius); + } + + void main() { + gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + + lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + + lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + + lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + + lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) ); + }`})}}Mo.BlurDirectionX=new oe(1,0);Mo.BlurDirectionY=new oe(0,1);const IB=["args","set-size"],PB=["args"],LB=["args","strength"],DB=["set-size"],OB=dr({__name:"BloomScene",props:{frequency:{}},setup(n){const e=n;Bu({EffectComposer:wB,OutputPass:AB,UnrealBloomPass:Mo,RenderPass:CB});const{renderer:t,scene:i,camera:s,sizes:r}=oO(),o=it();return aO().render(()=>{o.value&&o.value.render()}),pt([r.width,r.height],()=>{var a;(a=o.value)==null||a.setSize(r.width.value,r.height.value)}),(a,l)=>(Fi(),Bi("TresEffectComposer",{ref_key:"composer",ref:o,args:[gt(t)],"set-size":[gt(r).width.value,gt(r).height.value]},[Dt("TresRenderPass",{args:[gt(i),gt(s)],attach:"passes-0"},null,8,PB),Dt("TresUnrealBloomPass",{args:[[gt(r).width,gt(r).height],.2,1,0],strength:.2+e.frequency/1e3,attach:"passes-1"},null,8,LB),Dt("TresOutputPass",{attach:"passes-2","set-size":[gt(r).width.value,gt(r).height.value]},null,8,DB)],8,IB))}}),bv=16e3,UB="/assets/processor-0sEQXaXZ.js";var Qo=(n=>(n.Status="status",n.Output="output",n.Info="info",n.Request="request",n.Error="error",n.Load="load",n))(Qo||{});const NB="/assets/worker-G6bmn4hY.js";function Mv(n){return new Date(n).toLocaleString("zh",{hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3})}const FB={class:"h-full w-screen flex flex-col items-center justify-center bg-gray-900"},BB={initial:{opacity:0},enter:{opacity:100},visible:{opacity:0},class:"fixed inset-0 z-20 h-full w-full flex flex-col items-center justify-center bg-black/90 p-2 text-center text-black backdrop-blur-md transition-all duration-2000 delay-1500 ease-in-out"},kB={key:0,class:"h-full flex flex-col justify-center p-2 text-center"},zB={class:"text-xl text-red-300"},VB={class:"absolute bottom-0 z-10 w-full overflow-hidden pb-8 text-center text-white"},HB={class:"absolute bottom-6 right-6 z-10 flex flex-col space-y-2"},GB=dr({__name:"App",setup(n){const e=vt(null),t=vt(null),i=vt([]),s=vt(0),{post:r,data:o}=LN(NB,{type:"module"});function a(c){t.value=c.message}pt(o,()=>{if("error"in o.value)return a(o.value.error);o.value.type===Qo.Status?(e.value=o.value.message,i.value.push(o.value),i.value.length>1&&(i.value=i.value.slice(-1))):(i.value.push(o.value),i.value.length>1&&(i.value=i.value.slice(-1)))}),_s(()=>{r({type:Qo.Load})}),_s(()=>{let c=!1;const u=navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0,sampleRate:bv}});let h,f,d;return u.then(async p=>{if(c)return;f=new(window.AudioContext||"webkitAudioContext"in window&&window.webkitAudioContext)({sampleRate:bv,latencyHint:"interactive"});const _=f.createAnalyser();_.fftSize=32,d=f.createMediaStreamSource(p),d.connect(_);const g=new Uint8Array(_.frequencyBinCount),m=()=>(_.getByteFrequencyData(g),g.reduce((v,y)=>v+y,0)/g.length),x=()=>{const v=m();s.value=v,requestAnimationFrame(x)};x(),await f.audioWorklet.addModule(new URL(UB,import.meta.url)),h=new AudioWorkletNode(f,"vad-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"}),d.connect(h),h.port.onmessage=v=>{const{buffer:y}=v.data;r({type:Qo.Request,buffer:y})}}).catch(p=>{t.value=p.message,console.error(p)}),()=>{c=!0,u.then(p=>p.getTracks().forEach(_=>_.stop())),d==null||d.disconnect(),h==null||h.disconnect(),f==null||f.close()}});function l(){const c=i.value.filter(d=>d.type===Qo.Output).map(d=>`${Mv(d.start)} - ${Mv(d.end)} | ${d.message}`).join(` +`),u=new Blob([c],{type:"text/plain"}),h=URL.createObjectURL(u),f=document.createElement("a");f.href=h,f.download="transcript.txt",f.click(),URL.revokeObjectURL(h)}return(c,u)=>{const h=OE("motion");return Fi(),Bi("div",FB,[_E((Fi(),Bi("div",BB,u[1]||(u[1]=[Dt("h1",{class:"text-6xl text-white font-bold lg:text-8xl sm:text-7xl"}," Moonshine Web ",-1),Dt("h2",{class:"text-2xl text-white"}," Real-time in-browser speech recognition, powered by Transformers.js ",-1)]))),[[h]]),t.value?(Fi(),Bi("div",kB,[u[2]||(u[2]=Dt("div",{class:"mb-1 text-4xl text-white font-semibold md:text-5xl"}," An error occurred ",-1)),Dt("div",zB,rd(t.value),1)])):(Fi(),Bi(mn,{key:1},[Dt("div",VB,[on(KT,{name:"fade-up",tag:"div"},{default:ud(()=>[(Fi(!0),Bi(mn,null,NE(i.value,f=>(Fi(),Bi("div",{key:f.message||"",initial:{opacity:0,y:25},enter:{opacity:1,y:0},duration:200,class:Ja(["mb-1",[f.type==="output"?"text-5xl":"text-2xl text-green-300 font-light"]])},[Dt("div",null,rd(f.message),1)],2))),128))]),_:1})]),on(gt(MM),{"window-size":"",alpha:!0,antialias:!0,"power-preference":"high-performance","output-color-space":gt(nn),"tone-mapping":gt(So)},{default:ud(()=>[u[3]||(u[3]=Dt("TresPerspectiveCamera",{position:[0,0,8],fov:75,near:.1,far:1e3},null,-1)),u[4]||(u[4]=Dt("TresAmbientLight",{intensity:.5},null,-1)),on(xB,{ready:e.value!==null,active:e.value==="recording_start",frequency:s.value},null,8,["ready","active","frequency"]),on(OB,{frequency:s.value},null,8,["frequency"])]),_:1},8,["output-color-space","tone-mapping"]),Dt("div",HB,[Dt("button",{class:"h-10 w-10 flex items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Download Transcript",onClick:u[0]||(u[0]=()=>l())},u[5]||(u[5]=[Dt("svg",{class:"h-7 w-7 cursor-pointer text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Dt("path",{fillRule:"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z",clipRule:"evenodd"}),Dt("path",{fillRule:"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z",clipRule:"evenodd"})],-1)])),u[6]||(u[6]=Dt("a",{href:"https://github.com/huggingface/transformers.js-examples/tree/main/moonshine-web",target:"_blank",class:"h-10 w-10 flex cursor-pointer items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Source Code"},[Dt("svg",{class:"h-7 w-7 text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Dt("path",{fillRule:"evenodd",d:"M12.006 2a9.847 9.847 0 0 0-6.484 2.44 10.32 10.32 0 0 0-3.393 6.17 10.48 10.48 0 0 0 1.317 6.955 10.045 10.045 0 0 0 5.4 4.418c.504.095.683-.223.683-.494 0-.245-.01-1.052-.014-1.908-2.78.62-3.366-1.21-3.366-1.21a2.711 2.711 0 0 0-1.11-1.5c-.907-.637.07-.621.07-.621.317.044.62.163.885.346.266.183.487.426.647.71.135.253.318.476.538.655a2.079 2.079 0 0 0 2.37.196c.045-.52.27-1.006.635-1.37-2.219-.259-4.554-1.138-4.554-5.07a4.022 4.022 0 0 1 1.031-2.75 3.77 3.77 0 0 1 .096-2.713s.839-.275 2.749 1.05a9.26 9.26 0 0 1 5.004 0c1.906-1.325 2.74-1.05 2.74-1.05.37.858.406 1.828.101 2.713a4.017 4.017 0 0 1 1.029 2.75c0 3.939-2.339 4.805-4.564 5.058a2.471 2.471 0 0 1 .679 1.897c0 1.372-.012 2.477-.012 2.814 0 .272.18.592.687.492a10.05 10.05 0 0 0 5.388-4.421 10.473 10.473 0 0 0 1.313-6.948 10.32 10.32 0 0 0-3.39-6.165A9.847 9.847 0 0 0 12.007 2Z",clipRule:"evenodd"})])],-1))])],64))])}}}),WB=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},XB=WB(GB,[["__scopeId","data-v-47bddffd"]]);iw(XB).use(mB).use(SN).mount("#app");