diff --git "a/assets/index-C7yPk9ix.js" "b/assets/index-C7yPk9ix.js" new file mode 100644--- /dev/null +++ "b/assets/index-C7yPk9ix.js" @@ -0,0 +1,3903 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-CvOBokII.js","assets/HeaderLink-BT1UbrBs.js","assets/HeaderLink-DsxHr3rn.css","assets/index-bzfv-iWV.js","assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-5a7efeDn.js","assets/Stage-DJa62QX2.css","assets/index-EBG0-rIq.js","assets/providers-BoT-ND26.js","assets/queue-hacC1a1w.js","assets/queues-HlFBHM4M.js","assets/speech-CHesdnZU.js","assets/Model.vue_vue_type_script_setup_true_lang-CK7ARx4t.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-CLgZzOKn.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-C055zR6k.js","assets/consciousness-CH9V_IjY.js","assets/index-C--I5H1f.js","assets/route-block-B_A1xBdJ.js","assets/index-BeuidkcH.css","assets/image-BxcCkdE8.js","assets/image-BhuwcwI9.css","assets/queue-TS7Fz0FT.js","assets/index-D0jMP3xk.js","assets/index-D8H15aMF.js","assets/index-C7BYzN-U.js","assets/IconStatusItem-DHQ1KxY_.js","assets/consciousness-C4MOcIR6.js","assets/RadioCardSimple-BH-EVIu9.js","assets/Input.vue_vue_type_script_setup_true_lang-BwWSjrH2.js","assets/speech-CnDlxNlO.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-Ct8t5zjW.js","assets/index-_295WTtQ.js","assets/cloudflare-workers-ai-CkK42CBn.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Bvgbmlrr.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-oqGLmA_W.js","assets/deepseek-DBHLmjpH.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Cx6uAvS4.js","assets/elevenlabs-BQEIxzhu.js","assets/fireworks-ai-DDTHcmAg.js","assets/mistral-ai-CTYLTfIh.js","assets/moonshot-ai-BNdaKLJP.js","assets/novita-ai-CHSGv0Ll.js","assets/ollama-CVZEXaao.js","assets/openai-D5A0m4W4.js","assets/openrouter-ai-CmMwHzhi.js","assets/together-ai-D-AmgLNo.js","assets/xai-BWuCWE-g.js","assets/index-BvyuWAgp.js","assets/index-DfgF6wHE.css","assets/delays-CdpjnCha.js","assets/emotions-1nOYob19.js","assets/messages-gfH6DehG.js"])))=>i.map(i=>d[i]); +var fw=Object.defineProperty;var hw=(n,e,t)=>e in n?fw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ii=(n,e,t)=>hw(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)}})();const dw="modulepreload",pw=function(n){return"/"+n},L_={},vt=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(t.map(l=>{if(l=pw(l),l in L_)return;L_[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":dw,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,d)=>{f.addEventListener("load",h),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function Hm(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const pt={},Ko=[],zi=()=>{},mw=()=>!1,sh=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Gm=n=>n.startsWith("onUpdate:"),Zt=Object.assign,Wm=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},gw=Object.prototype.hasOwnProperty,xt=(n,e)=>gw.call(n,e),Be=Array.isArray,Zo=n=>tc(n)==="[object Map]",ma=n=>tc(n)==="[object Set]",D_=n=>tc(n)==="[object Date]",$e=n=>typeof n=="function",Lt=n=>typeof n=="string",Ai=n=>typeof n=="symbol",At=n=>n!==null&&typeof n=="object",Ix=n=>(At(n)||$e(n))&&$e(n.then)&&$e(n.catch),Lx=Object.prototype.toString,tc=n=>Lx.call(n),_w=n=>tc(n).slice(8,-1),Dx=n=>tc(n)==="[object Object]",Xm=n=>Lt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,qa=Hm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),rh=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},vw=/-(\w)/g,Qn=rh(n=>n.replace(vw,(e,t)=>t?t.toUpperCase():"")),yw=/\B([A-Z])/g,As=rh(n=>n.replace(yw,"-$1").toLowerCase()),oh=rh(n=>n.charAt(0).toUpperCase()+n.slice(1)),Fu=rh(n=>n?`on${oh(n)}`:""),Vn=(n,e)=>!Object.is(n,e),Bu=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Qu=n=>{const e=parseFloat(n);return isNaN(e)?n:e},xw=n=>{const e=Lt(n)?Number(n):NaN;return isNaN(e)?n:e};let O_;const ah=()=>O_||(O_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function mi(n){if(Be(n)){const e={};for(let t=0;t{if(t){const i=t.split(Sw);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ga(n){let e="";if(Lt(n))e=n;else if(Be(n))for(let t=0;tio(t,e))}const Ux=n=>!!(n&&n.__v_isRef===!0),Cw=n=>Lt(n)?n:n==null?"":Be(n)||At(n)&&(n.toString===Lx||!$e(n.toString))?Ux(n)?Cw(n.value):JSON.stringify(n,Fx,2):String(n),Fx=(n,e)=>Ux(e)?Fx(n,e.value):Zo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[pd(i,r)+" =>"]=s,t),{})}:ma(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>pd(t))}:Ai(e)?pd(e):At(e)&&!Be(e)&&!Dx(e)?String(e):e,pd=(n,e="")=>{var t;return Ai(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 An;class Bx{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=An,!e&&An&&(this.index=(An.scopes||(An.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(ja){let e=ja;for(ja=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ya;){let e=Ya;for(Ya=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 Hx(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Gx(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),Zm(i),Rw(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function Lp(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Wx(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Wx(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===vl))return;n.globalVersion=vl;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Lp(n)){n.flags&=-3;return}const t=Rt,i=wi;Rt=n,wi=!0;try{Hx(n);const s=n.fn(n._value);(e.version===0||Vn(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{Rt=t,wi=i,Gx(n),n.flags&=-3}}function Zm(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)Zm(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Rw(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let wi=!0;const Xx=[];function ar(){Xx.push(wi),wi=!1}function lr(){const n=Xx.pop();wi=n===void 0?!0:n}function N_(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Rt;Rt=void 0;try{e()}finally{Rt=t}}}let vl=0;class Pw{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 ch{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(!Rt||!wi||Rt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Rt)t=this.activeLink=new Pw(Rt,this),Rt.deps?(t.prevDep=Rt.depsTail,Rt.depsTail.nextDep=t,Rt.depsTail=t):Rt.deps=Rt.depsTail=t,$x(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=Rt.depsTail,t.nextDep=void 0,Rt.depsTail.nextDep=t,Rt.depsTail=t,Rt.deps===t&&(Rt.deps=i)}return t}trigger(e){this.version++,vl++,this.notify(e)}notify(e){jm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Km()}}}function $x(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)$x(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const ef=new WeakMap,Zr=Symbol(""),Dp=Symbol(""),yl=Symbol("");function pn(n,e,t){if(wi&&Rt){let i=ef.get(n);i||ef.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new ch),s.map=i,s.key=t),s.track()}}function cs(n,e,t,i,s,r){const o=ef.get(n);if(!o){vl++;return}const a=l=>{l&&l.trigger()};if(jm(),e==="clear")o.forEach(a);else{const l=Be(n),c=l&&Xm(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,h)=>{(h==="length"||h===yl||!Ai(h)&&h>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(yl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Zr)),Zo(n)&&a(o.get(Dp)));break;case"delete":l||(a(o.get(Zr)),Zo(n)&&a(o.get(Dp)));break;case"set":Zo(n)&&a(o.get(Zr));break}}Km()}function Iw(n,e){const t=ef.get(n);return t&&t.get(e)}function bo(n){const e=ot(n);return e===n?e:(pn(e,"iterate",yl),ci(n)?e:e.map(mn))}function uh(n){return pn(n=ot(n),"iterate",yl),n}const Lw={__proto__:null,[Symbol.iterator](){return gd(this,Symbol.iterator,mn)},concat(...n){return bo(this).concat(...n.map(e=>Be(e)?bo(e):e))},entries(){return gd(this,"entries",n=>(n[1]=mn(n[1]),n))},every(n,e){return Ji(this,"every",n,e,void 0,arguments)},filter(n,e){return Ji(this,"filter",n,e,t=>t.map(mn),arguments)},find(n,e){return Ji(this,"find",n,e,mn,arguments)},findIndex(n,e){return Ji(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Ji(this,"findLast",n,e,mn,arguments)},findLastIndex(n,e){return Ji(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Ji(this,"forEach",n,e,void 0,arguments)},includes(...n){return _d(this,"includes",n)},indexOf(...n){return _d(this,"indexOf",n)},join(n){return bo(this).join(n)},lastIndexOf(...n){return _d(this,"lastIndexOf",n)},map(n,e){return Ji(this,"map",n,e,void 0,arguments)},pop(){return Ta(this,"pop")},push(...n){return Ta(this,"push",n)},reduce(n,...e){return U_(this,"reduce",n,e)},reduceRight(n,...e){return U_(this,"reduceRight",n,e)},shift(){return Ta(this,"shift")},some(n,e){return Ji(this,"some",n,e,void 0,arguments)},splice(...n){return Ta(this,"splice",n)},toReversed(){return bo(this).toReversed()},toSorted(n){return bo(this).toSorted(n)},toSpliced(...n){return bo(this).toSpliced(...n)},unshift(...n){return Ta(this,"unshift",n)},values(){return gd(this,"values",mn)}};function gd(n,e,t){const i=uh(n),s=i[e]();return i!==n&&!ci(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const Dw=Array.prototype;function Ji(n,e,t,i,s,r){const o=uh(n),a=o!==n&&!ci(n),l=o[e];if(l!==Dw[e]){const f=l.apply(n,r);return a?mn(f):f}let c=t;o!==n&&(a?c=function(f,h){return t.call(this,mn(f),h,n)}:t.length>2&&(c=function(f,h){return t.call(this,f,h,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function U_(n,e,t,i){const s=uh(n);let r=t;return s!==n&&(ci(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,mn(a),l,n)}),s[e](r,...i)}function _d(n,e,t){const i=ot(n);pn(i,"iterate",yl);const s=i[e](...t);return(s===-1||s===!1)&&Jm(t[0])?(t[0]=ot(t[0]),i[e](...t)):s}function Ta(n,e,t=[]){ar(),jm();const i=ot(n)[e].apply(n,t);return Km(),lr(),i}const Ow=Hm("__proto__,__v_isRef,__isVue"),qx=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ai));function Nw(n){Ai(n)||(n=String(n));const e=ot(this);return pn(e,"has",n),e.hasOwnProperty(n)}class Yx{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?eb:Qx:r?Jx:Zx).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Be(e);if(!s){let l;if(o&&(l=Lw[t]))return l;if(t==="hasOwnProperty")return Nw}const a=Reflect.get(e,t,wt(e)?e:i);return(Ai(t)?qx.has(t):Ow(t))||(s||pn(e,"get",t),r)?a:wt(a)?o&&Xm(t)?a:a.value:At(a)?s?di(a):hi(a):a}}class jx extends Yx{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=so(r);if(!ci(i)&&!so(i)&&(r=ot(r),i=ot(i)),!Be(e)&&wt(r)&&!wt(i))return l?!1:(r.value=i,!0)}const o=Be(e)&&Xm(t)?Number(t)n,Cc=n=>Reflect.getPrototypeOf(n);function Vw(n,e,t){return function(...i){const s=this.__v_raw,r=ot(s),o=Zo(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=t?Op:e?Np:mn;return!e&&pn(r,"iterate",l?Dp:Zr),{next(){const{value:f,done:h}=c.next();return h?{value:f,done:h}:{value:a?[u(f[0]),u(f[1])]:u(f),done:h}},[Symbol.iterator](){return this}}}}function Rc(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function zw(n,e){const t={get(s){const r=this.__v_raw,o=ot(r),a=ot(s);n||(Vn(s,a)&&pn(o,"get",s),pn(o,"get",a));const{has:l}=Cc(o),c=e?Op:n?Np:mn;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&&pn(ot(s),"iterate",Zr),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=ot(r),a=ot(s);return n||(Vn(s,a)&&pn(o,"has",s),pn(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=ot(a),c=e?Op:n?Np:mn;return!n&&pn(l,"iterate",Zr),a.forEach((u,f)=>s.call(r,c(u),c(f),o))}};return Zt(t,n?{add:Rc("add"),set:Rc("set"),delete:Rc("delete"),clear:Rc("clear")}:{add(s){!e&&!ci(s)&&!so(s)&&(s=ot(s));const r=ot(this);return Cc(r).has.call(r,s)||(r.add(s),cs(r,"add",s,s)),this},set(s,r){!e&&!ci(r)&&!so(r)&&(r=ot(r));const o=ot(this),{has:a,get:l}=Cc(o);let c=a.call(o,s);c||(s=ot(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?Vn(r,u)&&cs(o,"set",s,r):cs(o,"add",s,r),this},delete(s){const r=ot(this),{has:o,get:a}=Cc(r);let l=o.call(r,s);l||(s=ot(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&cs(r,"delete",s,void 0),c},clear(){const s=ot(this),r=s.size!==0,o=s.clear();return r&&cs(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Vw(s,n,e)}),t}function fh(n,e){const t=zw(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(xt(t,s)&&s in i?t:i,s,r)}const Hw={get:fh(!1,!1)},Gw={get:fh(!1,!0)},Ww={get:fh(!0,!1)},Xw={get:fh(!0,!0)},Zx=new WeakMap,Jx=new WeakMap,Qx=new WeakMap,eb=new WeakMap;function $w(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qw(n){return n.__v_skip||!Object.isExtensible(n)?0:$w(_w(n))}function hi(n){return so(n)?n:hh(n,!1,Uw,Hw,Zx)}function tb(n){return hh(n,!1,Bw,Gw,Jx)}function di(n){return hh(n,!0,Fw,Ww,Qx)}function I4(n){return hh(n,!0,kw,Xw,eb)}function hh(n,e,t,i,s){if(!At(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=qw(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function vs(n){return so(n)?vs(n.__v_raw):!!(n&&n.__v_isReactive)}function so(n){return!!(n&&n.__v_isReadonly)}function ci(n){return!!(n&&n.__v_isShallow)}function Jm(n){return n?!!n.__v_raw:!1}function ot(n){const e=n&&n.__v_raw;return e?ot(e):n}function Qm(n){return!xt(n,"__v_skip")&&Object.isExtensible(n)&&Ox(n,"__v_skip",!0),n}const mn=n=>At(n)?hi(n):n,Np=n=>At(n)?di(n):n;function wt(n){return n?n.__v_isRef===!0:!1}function Ze(n){return nb(n,!1)}function Ie(n){return nb(n,!0)}function nb(n,e){return wt(n)?n:new Yw(n,e)}class Yw{constructor(e,t){this.dep=new ch,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ot(e),this._value=t?e:mn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||ci(e)||so(e);e=i?e:ot(e),Vn(e,t)&&(this._rawValue=e,this._value=i?e:mn(e),this.dep.trigger())}}function It(n){return wt(n)?n.value:n}function et(n){return $e(n)?n():It(n)}const jw={get:(n,e,t)=>e==="__v_raw"?n:It(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return wt(s)&&!wt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function ib(n){return vs(n)?n:new Proxy(n,jw)}class Kw{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new ch,{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 eg(n){return new Kw(n)}function sb(n){const e=Be(n)?new Array(n.length):{};for(const t in n)e[t]=ob(n,t);return e}class Zw{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 Iw(ot(this._object),this._key)}}class Jw{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function rb(n,e,t){return wt(n)?n:$e(n)?new Jw(n):At(n)&&arguments.length>1?ob(n,e,t):Ze(n)}function ob(n,e,t){const i=n[e];return wt(i)?i:new Zw(n,e,t)}class Qw{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ch(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=vl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Rt!==this)return zx(this,!0),!0}get value(){const e=this.dep.track();return Wx(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function eA(n,e,t=!1){let i,s;return $e(n)?i=n:(i=n.get,s=n.set),new Qw(i,s,t)}const Pc={},tf=new WeakMap;let Br;function tA(n,e=!1,t=Br){if(t){let i=tf.get(t);i||tf.set(t,i=[]),i.push(n)}}function nA(n,e,t=pt){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=v=>s?v:ci(v)||s===!1||s===0?us(v,1):us(v);let u,f,h,d,p=!1,_=!1;if(wt(n)?(f=()=>n.value,p=ci(n)):vs(n)?(f=()=>c(n),p=!0):Be(n)?(_=!0,p=n.some(v=>vs(v)||ci(v)),f=()=>n.map(v=>{if(wt(v))return v.value;if(vs(v))return c(v);if($e(v))return l?l(v,2):v()})):$e(n)?e?f=l?()=>l(n,2):n:f=()=>{if(h){ar();try{h()}finally{lr()}}const v=Br;Br=u;try{return l?l(n,3,[d]):n(d)}finally{Br=v}}:f=zi,e&&s){const v=f,E=s===!0?1/0:s;f=()=>us(v(),E)}const g=lh(),m=()=>{u.stop(),g&&g.active&&Wm(g.effects,u)};if(r&&e){const v=e;e=(...E)=>{v(...E),m()}}let y=_?new Array(n.length).fill(Pc):Pc;const x=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const E=u.run();if(s||p||(_?E.some((T,M)=>Vn(T,y[M])):Vn(E,y))){h&&h();const T=Br;Br=u;try{const M=[E,y===Pc?void 0:_&&y[0]===Pc?[]:y,d];l?l(e,3,M):e(...M),y=E}finally{Br=T}}}else u.run()};return a&&a(x),u=new kx(f),u.scheduler=o?()=>o(x,!1):x,d=v=>tA(v,!1,u),h=u.onStop=()=>{const v=tf.get(u);if(v){if(l)l(v,4);else for(const E of v)E();tf.delete(u)}},e?i?x(!0):y=u.run():o?o(x.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function us(n,e=1/0,t){if(e<=0||!At(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,wt(n))us(n.value,e,t);else if(Be(n))for(let i=0;i{us(i,e,t)});else if(Dx(n)){for(const i in n)us(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&us(n[i],e,t)}return n}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function nc(n,e,t,i){try{return i?n(...i):n()}catch(s){dh(s,e,t)}}function Ci(n,e,t,i){if($e(n)){const s=nc(n,e,t,i);return s&&Ix(s)&&s.catch(r=>{dh(r,e,t)}),s}if(Be(n)){const s=[];for(let r=0;r>>1,s=Rn[i],r=xl(s);r=xl(t)?Rn.push(n):Rn.splice(sA(e),0,n),n.flags|=1,lb()}}function lb(){nf||(nf=ab.then(ub))}function rA(n){Be(n)?Jo.push(...n):Ws&&n.id===-1?Ws.splice(zo+1,0,n):n.flags&1||(Jo.push(n),n.flags|=1),lb()}function F_(n,e,t=Ui+1){for(;txl(t)-xl(i));if(Jo.length=0,Ws){Ws.push(...e);return}for(Ws=e,zo=0;zon.id==null?n.flags&2?-1:1/0:n.id;function ub(n){try{for(Ui=0;Ui{i._d&&K_(-1);const r=sf(e);let o;try{o=n(...s)}finally{sf(r),i._d&&K_(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function L4(n,e){if(Yt===null)return n;const t=_h(Yt),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,Ka=n=>n&&(n.disabled||n.disabled===""),B_=n=>n&&(n.defer||n.defer===""),k_=n=>typeof SVGElement<"u"&&n instanceof SVGElement,V_=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Up=(n,e)=>{const t=n&&n.to;return Lt(t)?e?e(t):null:t},mb={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,r,o,a,l,c){const{mc:u,pc:f,pbc:h,o:{insert:d,querySelector:p,createText:_,createComment:g}}=c,m=Ka(e.props);let{shapeFlag:y,children:x,dynamicChildren:v}=e;if(n==null){const E=e.el=_(""),T=e.anchor=_("");d(E,t,i),d(T,t,i);const M=(b,S)=>{y&16&&(s&&s.isCE&&(s.ce._teleportTarget=b),u(x,b,S,s,r,o,a,l))},P=()=>{const b=e.target=Up(e.props,p),S=gb(b,e,_,d);b&&(o!=="svg"&&k_(b)?o="svg":o!=="mathml"&&V_(b)&&(o="mathml"),m||(M(b,S),ku(e,!1)))};m&&(M(t,T),ku(e,!0)),B_(e.props)?wn(()=>{P(),e.el.__isMounted=!0},r):P()}else{if(B_(e.props)&&!n.el.__isMounted){wn(()=>{mb.process(n,e,t,i,s,r,o,a,l,c),delete n.el.__isMounted},r);return}e.el=n.el,e.targetStart=n.targetStart;const E=e.anchor=n.anchor,T=e.target=n.target,M=e.targetAnchor=n.targetAnchor,P=Ka(n.props),b=P?t:T,S=P?E:M;if(o==="svg"||k_(T)?o="svg":(o==="mathml"||V_(T))&&(o="mathml"),v?(h(n.dynamicChildren,v,b,s,r,o,a),og(n,e,!0)):l||f(n,e,b,S,s,r,o,a,!1),m)P?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):Ic(e,t,E,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const D=e.target=Up(e.props,p);D&&Ic(e,D,null,c,0)}else P&&Ic(e,T,M,c,1);ku(e,m)}},remove(n,e,t,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:f,props:h}=n;if(f&&(s(c),s(u)),r&&s(l),o&16){const d=r||!Ka(h);for(let p=0;p{n.isMounted=!0}),Eb(()=>{n.isUnmounting=!0}),n}const si=[Function,Array],_b={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:si,onEnter:si,onAfterEnter:si,onEnterCancelled:si,onBeforeLeave:si,onLeave:si,onAfterLeave:si,onLeaveCancelled:si,onBeforeAppear:si,onAppear:si,onAfterAppear:si,onAppearCancelled:si},vb=n=>{const e=n.subTree;return e.component?vb(e.component):e},lA={name:"BaseTransition",props:_b,setup(n,{slots:e}){const t=vn(),i=aA();return()=>{const s=e.default&&bb(e.default(),!0);if(!s||!s.length)return;const r=yb(s),o=ot(n),{mode:a}=o;if(i.isLeaving)return vd(r);const l=z_(r);if(!l)return vd(r);let c=Fp(l,o,i,t,f=>c=f);l.type!==Pn&&bl(l,c);let u=t.subTree&&z_(t.subTree);if(u&&u.type!==Pn&&!Gr(l,u)&&vb(t).type!==Pn){let f=Fp(u,o,i,t);if(bl(u,f),a==="out-in"&&l.type!==Pn)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},vd(r);a==="in-out"&&l.type!==Pn?f.delayLeave=(h,d,p)=>{const _=xb(i,u);_[String(u.key)]=u,h[Xs]=()=>{d(),h[Xs]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function yb(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==Pn){e=t;break}}return e}const cA=lA;function xb(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 Fp(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:h,onLeave:d,onAfterLeave:p,onLeaveCancelled:_,onBeforeAppear:g,onAppear:m,onAfterAppear:y,onAppearCancelled:x}=e,v=String(n.key),E=xb(t,n),T=(b,S)=>{b&&Ci(b,i,9,S)},M=(b,S)=>{const D=S[1];T(b,S),Be(b)?b.every(B=>B.length<=1)&&D():b.length<=1&&D()},P={mode:o,persisted:a,beforeEnter(b){let S=l;if(!t.isMounted)if(r)S=g||l;else return;b[Xs]&&b[Xs](!0);const D=E[v];D&&Gr(n,D)&&D.el[Xs]&&D.el[Xs](),T(S,[b])},enter(b){let S=c,D=u,B=f;if(!t.isMounted)if(r)S=m||c,D=y||u,B=x||f;else return;let H=!1;const $=b[Lc]=ee=>{H||(H=!0,ee?T(B,[b]):T(D,[b]),P.delayedLeave&&P.delayedLeave(),b[Lc]=void 0)};S?M(S,[b,$]):$()},leave(b,S){const D=String(n.key);if(b[Lc]&&b[Lc](!0),t.isUnmounting)return S();T(h,[b]);let B=!1;const H=b[Xs]=$=>{B||(B=!0,S(),$?T(_,[b]):T(p,[b]),b[Xs]=void 0,E[D]===n&&delete E[D])};E[D]=n,d?M(d,[b,H]):H()},clone(b){const S=Fp(b,e,t,i,s);return s&&s(S),S}};return P}function vd(n){if(ph(n))return n=tr(n),n.children=null,n}function z_(n){if(!ph(n))return pb(n.type)&&n.children?yb(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&$e(t.default))return t.default()}}function bl(n,e){n.shapeFlag&6&&n.component?(n.transition=e,bl(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 bb(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rrf(p,e&&(Be(e)?e[_]:e),t,i,s));return}if(Qo(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&rf(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?_h(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,u=a.refs===pt?a.refs={}:a.refs,f=a.setupState,h=ot(f),d=f===pt?()=>!1:p=>xt(h,p);if(c!=null&&c!==l&&(Lt(c)?(u[c]=null,d(c)&&(f[c]=null)):wt(c)&&(c.value=null)),$e(l))nc(l,a,12,[o,u]);else{const p=Lt(l),_=wt(l);if(p||_){const g=()=>{if(n.f){const m=p?d(l)?f[l]:u[l]:l.value;s?Be(m)&&Wm(m,r):Be(m)?m.includes(r)||m.push(r):p?(u[l]=[r],d(l)&&(f[l]=u[l])):(l.value=[r],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,d(l)&&(f[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,wn(g,t)):g()}}}ah().requestIdleCallback;ah().cancelIdleCallback;const Qo=n=>!!n.type.__asyncLoader,ph=n=>n.type.__isKeepAlive;function uA(n,e){Mb(n,"a",e)}function fA(n,e){Mb(n,"da",e)}function Mb(n,e,t=tn){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(mh(e,i,t),t){let s=t.parent;for(;s&&s.parent;)ph(s.parent.vnode)&&hA(i,e,t,s),s=s.parent}}function hA(n,e,t,i){const s=mh(e,n,i,!0);$i(()=>{Wm(i[e],s)},t)}function mh(n,e,t=tn,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{ar();const a=ac(t),l=Ci(e,t,n,o);return a(),lr(),l});return i?s.unshift(r):s.push(r),r}}const Cs=n=>(e,t=tn)=>{(!wl||n==="sp")&&mh(n,(...i)=>e(...i),t)},dA=Cs("bm"),yn=Cs("m"),pA=Cs("bu"),mA=Cs("u"),Eb=Cs("bum"),$i=Cs("um"),gA=Cs("sp"),_A=Cs("rtg"),vA=Cs("rtc");function yA(n,e=tn){mh("ec",n,e)}const ng="components",xA="directives";function N4(n,e){return ig(ng,n,!0,e)||n}const Tb=Symbol.for("v-ndc");function bA(n){return Lt(n)?ig(ng,n,!1)||n:n||Tb}function U4(n){return ig(xA,n)}function ig(n,e,t=!0,i=!1){const s=Yt||tn;if(s){const r=s.type;if(n===ng){const a=c1(r,!1);if(a&&(a===e||a===Qn(e)||a===oh(Qn(e))))return r}const o=H_(s[n]||r[n],e)||H_(s.appContext[n],e);return!o&&i?r:o}}function H_(n,e){return n&&(n[e]||n[Qn(e)]||n[oh(Qn(e))])}function SA(n,e,t,i){let s;const r=t,o=Be(n);if(o||Lt(n)){const a=o&&vs(n);let l=!1;a&&(l=!ci(n),n=uh(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;lTl(e)?!(e.type===Pn||e.type===Xt&&!wb(e.children)):!0)?n:null}function F4(n,e){const t={};for(const i in n)t[Fu(i)]=n[i];return t}const Bp=n=>n?Yb(n)?_h(n):Bp(n.parent):null,Za=Zt(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=>Bp(n.parent),$root:n=>Bp(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Rb(n),$forceUpdate:n=>n.f||(n.f=()=>{tg(n.update)}),$nextTick:n=>n.n||(n.n=cr.bind(n.proxy)),$watch:n=>WA.bind(n)}),yd=(n,e)=>n!==pt&&!n.__isScriptSetup&&xt(n,e),EA={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(yd(i,e))return o[e]=1,i[e];if(s!==pt&&xt(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&xt(c,e))return o[e]=3,r[e];if(t!==pt&&xt(t,e))return o[e]=4,t[e];kp&&(o[e]=0)}}const u=Za[e];let f,h;if(u)return e==="$attrs"&&pn(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==pt&&xt(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,xt(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return yd(s,e)?(s[e]=t,!0):i!==pt&&xt(i,e)?(i[e]=t,!0):xt(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!==pt&&xt(n,o)||yd(e,o)||(a=r[0])&&xt(a,o)||xt(i,o)||xt(Za,o)||xt(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:xt(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function sg(){return Ab().slots}function B4(){return Ab().attrs}function Ab(){const n=vn();return n.setupContext||(n.setupContext=Kb(n))}function Sl(n){return Be(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function k4(n,e){const t=Sl(n);for(const i in e){if(i.startsWith("__skip"))continue;let s=t[i];s?Be(s)||$e(s)?s=t[i]={type:s,default:e[i]}:s.default=e[i]:s===null&&(s=t[i]={default:e[i]}),s&&e[`__skip_${i}`]&&(s.skipFactory=!0)}return t}function V4(n,e){return!n||!e?n||e:Be(n)&&Be(e)?n.concat(e):Zt({},Sl(n),Sl(e))}let kp=!0;function TA(n){const e=Rb(n),t=n.proxy,i=n.ctx;kp=!1,e.beforeCreate&&G_(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:h,beforeUpdate:d,updated:p,activated:_,deactivated:g,beforeDestroy:m,beforeUnmount:y,destroyed:x,unmounted:v,render:E,renderTracked:T,renderTriggered:M,errorCaptured:P,serverPrefetch:b,expose:S,inheritAttrs:D,components:B,directives:H,filters:$}=e;if(c&&wA(c,i,null),o)for(const te in o){const Q=o[te];$e(Q)&&(i[te]=Q.bind(t))}if(s){const te=s.call(t,t);At(te)&&(n.data=hi(te))}if(kp=!0,r)for(const te in r){const Q=r[te],pe=$e(Q)?Q.bind(t,t):$e(Q.get)?Q.get.bind(t,t):zi,ve=!$e(Q)&&$e(Q.set)?Q.set.bind(t):zi,se=Se({get:pe,set:ve});Object.defineProperty(i,te,{enumerable:!0,configurable:!0,get:()=>se.value,set:xe=>se.value=xe})}if(a)for(const te in a)Cb(a[te],i,t,te);if(l){const te=$e(l)?l.call(t):l;Reflect.ownKeys(te).forEach(Q=>{er(Q,te[Q])})}u&&G_(u,n,"c");function Z(te,Q){Be(Q)?Q.forEach(pe=>te(pe.bind(t))):Q&&te(Q.bind(t))}if(Z(dA,f),Z(yn,h),Z(pA,d),Z(mA,p),Z(uA,_),Z(fA,g),Z(yA,P),Z(vA,T),Z(_A,M),Z(Eb,y),Z($i,v),Z(gA,b),Be(S))if(S.length){const te=n.exposed||(n.exposed={});S.forEach(Q=>{Object.defineProperty(te,Q,{get:()=>t[Q],set:pe=>t[Q]=pe})})}else n.exposed||(n.exposed={});E&&n.render===zi&&(n.render=E),D!=null&&(n.inheritAttrs=D),B&&(n.components=B),H&&(n.directives=H),b&&Sb(n)}function wA(n,e,t=zi){Be(n)&&(n=Vp(n));for(const i in n){const s=n[i];let r;At(s)?"default"in s?r=gn(s.from||i,s.default,!0):r=gn(s.from||i):r=gn(s),wt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function G_(n,e,t){Ci(Be(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function Cb(n,e,t,i){let s=i.includes(".")?Hb(t,i):()=>t[i];if(Lt(n)){const r=e[n];$e(r)&&Ge(s,r)}else if($e(n))Ge(s,n.bind(t));else if(At(n))if(Be(n))n.forEach(r=>Cb(r,e,t,i));else{const r=$e(n.handler)?n.handler.bind(t):e[n.handler];$e(r)&&Ge(s,r,n)}}function Rb(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=>of(l,c,o,!0)),of(l,e,o)),At(e)&&r.set(e,l),l}function of(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&of(n,r,t,!0),s&&s.forEach(o=>of(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=AA[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const AA={data:W_,props:X_,emits:X_,methods:Ga,computed:Ga,beforeCreate:Mn,created:Mn,beforeMount:Mn,mounted:Mn,beforeUpdate:Mn,updated:Mn,beforeDestroy:Mn,beforeUnmount:Mn,destroyed:Mn,unmounted:Mn,activated:Mn,deactivated:Mn,errorCaptured:Mn,serverPrefetch:Mn,components:Ga,directives:Ga,watch:RA,provide:W_,inject:CA};function W_(n,e){return e?n?function(){return Zt($e(n)?n.call(this,this):n,$e(e)?e.call(this,this):e)}:e:n}function CA(n,e){return Ga(Vp(n),Vp(e))}function Vp(n){if(Be(n)){const e={};for(let t=0;t1)return t&&$e(e)?e.call(i&&i.proxy):e}}function ic(){return!!(tn||Yt||Jr)}const Ib={},Lb=()=>Object.create(Ib),Db=n=>Object.getPrototypeOf(n)===Ib;function LA(n,e,t,i=!1){const s={},r=Lb();n.propsDefaults=Object.create(null),Ob(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:tb(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function DA(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=ot(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f{l=!0;const[h,d]=Nb(f,e,!0);Zt(o,h),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 At(n)&&i.set(n,Ko),Ko;if(Be(r))for(let u=0;un[0]==="_"||n==="$stable",rg=n=>Be(n)?n.map(ki):[ki(n)],NA=(n,e,t)=>{if(e._n)return e;const i=hb((...s)=>rg(e(...s)),t);return i._c=!1,i},Fb=(n,e,t)=>{const i=n._ctx;for(const s in n){if(Ub(s))continue;const r=n[s];if($e(r))e[s]=NA(s,r,i);else if(r!=null){const o=rg(r);e[s]=()=>o}}},Bb=(n,e)=>{const t=rg(e);n.slots.default=()=>t},kb=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},UA=(n,e,t)=>{const i=n.slots=Lb();if(n.vnode.shapeFlag&32){const s=e._;s?(kb(i,e,t),t&&Ox(i,"_",s,!0)):Fb(e,i)}else e&&Bb(n,e)},FA=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=pt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:kb(s,e,t):(r=!e.$stable,Fb(e,s)),o=e}else e&&(Bb(n,e),o={default:1});if(r)for(const a in s)!Ub(a)&&o[a]==null&&delete s[a]},wn=KA;function Vb(n){return BA(n)}function BA(n,e){const t=ah();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:h,setScopeId:d=zi,insertStaticContent:p}=n,_=(I,L,w,j=null,G=null,q=null,R=void 0,N=null,V=!!L.dynamicChildren)=>{if(I===L)return;I&&!Gr(I,L)&&(j=W(I),xe(I,G,q,!0),I=null),L.patchFlag===-2&&(V=!1,L.dynamicChildren=null);const{type:A,ref:C,shapeFlag:k}=L;switch(A){case oc:g(I,L,w,j);break;case Pn:m(I,L,w,j);break;case Vu:I==null&&y(L,w,j,R);break;case Xt:B(I,L,w,j,G,q,R,N,V);break;default:k&1?E(I,L,w,j,G,q,R,N,V):k&6?H(I,L,w,j,G,q,R,N,V):(k&64||k&128)&&A.process(I,L,w,j,G,q,R,N,V,le)}C!=null&&G&&rf(C,I&&I.ref,q,L||I,!L)},g=(I,L,w,j)=>{if(I==null)i(L.el=a(L.children),w,j);else{const G=L.el=I.el;L.children!==I.children&&c(G,L.children)}},m=(I,L,w,j)=>{I==null?i(L.el=l(L.children||""),w,j):L.el=I.el},y=(I,L,w,j)=>{[I.el,I.anchor]=p(I.children,L,w,j,I.el,I.anchor)},x=({el:I,anchor:L},w,j)=>{let G;for(;I&&I!==L;)G=h(I),i(I,w,j),I=G;i(L,w,j)},v=({el:I,anchor:L})=>{let w;for(;I&&I!==L;)w=h(I),s(I),I=w;s(L)},E=(I,L,w,j,G,q,R,N,V)=>{L.type==="svg"?R="svg":L.type==="math"&&(R="mathml"),I==null?T(L,w,j,G,q,R,N,V):b(I,L,G,q,R,N,V)},T=(I,L,w,j,G,q,R,N)=>{let V,A;const{props:C,shapeFlag:k,transition:U,dirs:z}=I;if(V=I.el=o(I.type,q,C&&C.is,C),k&8?u(V,I.children):k&16&&P(I.children,V,null,j,G,xd(I,q),R,N),z&&yr(I,null,j,"created"),M(V,I,I.scopeId,R,j),C){for(const he in C)he!=="value"&&!qa(he)&&r(V,he,null,C[he],q,j);"value"in C&&r(V,"value",null,C.value,q),(A=C.onVnodeBeforeMount)&&Oi(A,j,I)}z&&yr(I,null,j,"beforeMount");const Y=kA(G,U);Y&&U.beforeEnter(V),i(V,L,w),((A=C&&C.onVnodeMounted)||Y||z)&&wn(()=>{A&&Oi(A,j,I),Y&&U.enter(V),z&&yr(I,null,j,"mounted")},G)},M=(I,L,w,j,G)=>{if(w&&d(I,w),j)for(let q=0;q{for(let A=V;A{const N=L.el=I.el;let{patchFlag:V,dynamicChildren:A,dirs:C}=L;V|=I.patchFlag&16;const k=I.props||pt,U=L.props||pt;let z;if(w&&xr(w,!1),(z=U.onVnodeBeforeUpdate)&&Oi(z,w,L,I),C&&yr(L,I,w,"beforeUpdate"),w&&xr(w,!0),(k.innerHTML&&U.innerHTML==null||k.textContent&&U.textContent==null)&&u(N,""),A?S(I.dynamicChildren,A,N,w,j,xd(L,G),q):R||Q(I,L,N,null,w,j,xd(L,G),q,!1),V>0){if(V&16)D(N,k,U,w,G);else if(V&2&&k.class!==U.class&&r(N,"class",null,U.class,G),V&4&&r(N,"style",k.style,U.style,G),V&8){const Y=L.dynamicProps;for(let he=0;he{z&&Oi(z,w,L,I),C&&yr(L,I,w,"updated")},j)},S=(I,L,w,j,G,q,R)=>{for(let N=0;N{if(L!==w){if(L!==pt)for(const q in L)!qa(q)&&!(q in w)&&r(I,q,L[q],null,G,j);for(const q in w){if(qa(q))continue;const R=w[q],N=L[q];R!==N&&q!=="value"&&r(I,q,N,R,G,j)}"value"in w&&r(I,"value",L.value,w.value,G)}},B=(I,L,w,j,G,q,R,N,V)=>{const A=L.el=I?I.el:a(""),C=L.anchor=I?I.anchor:a("");let{patchFlag:k,dynamicChildren:U,slotScopeIds:z}=L;z&&(N=N?N.concat(z):z),I==null?(i(A,w,j),i(C,w,j),P(L.children||[],w,C,G,q,R,N,V)):k>0&&k&64&&U&&I.dynamicChildren?(S(I.dynamicChildren,U,w,G,q,R,N),(L.key!=null||G&&L===G.subTree)&&og(I,L,!0)):Q(I,L,w,C,G,q,R,N,V)},H=(I,L,w,j,G,q,R,N,V)=>{L.slotScopeIds=N,I==null?L.shapeFlag&512?G.ctx.activate(L,w,j,R,V):$(L,w,j,G,q,R,V):ee(I,L,V)},$=(I,L,w,j,G,q,R)=>{const N=I.component=r1(I,j,G);if(ph(I)&&(N.ctx.renderer=le),o1(N,!1,R),N.asyncDep){if(G&&G.registerDep(N,Z,R),!I.el){const V=N.subTree=an(Pn);m(null,V,L,w)}}else Z(N,I,L,w,G,q,R)},ee=(I,L,w)=>{const j=L.component=I.component;if(YA(I,L,w))if(j.asyncDep&&!j.asyncResolved){te(j,L,w);return}else j.next=L,j.update();else L.el=I.el,j.vnode=L},Z=(I,L,w,j,G,q,R)=>{const N=()=>{if(I.isMounted){let{next:k,bu:U,u:z,parent:Y,vnode:he}=I;{const Te=zb(I);if(Te){k&&(k.el=he.el,te(I,k,R)),Te.asyncDep.then(()=>{I.isUnmounted||N()});return}}let ce=k,ye;xr(I,!1),k?(k.el=he.el,te(I,k,R)):k=he,U&&Bu(U),(ye=k.props&&k.props.onVnodeBeforeUpdate)&&Oi(ye,Y,k,he),xr(I,!0);const Fe=Y_(I),me=I.subTree;I.subTree=Fe,_(me,Fe,f(me.el),W(me),I,G,q),k.el=Fe.el,ce===null&&jA(I,Fe.el),z&&wn(z,G),(ye=k.props&&k.props.onVnodeUpdated)&&wn(()=>Oi(ye,Y,k,he),G)}else{let k;const{el:U,props:z}=L,{bm:Y,m:he,parent:ce,root:ye,type:Fe}=I,me=Qo(L);xr(I,!1),Y&&Bu(Y),!me&&(k=z&&z.onVnodeBeforeMount)&&Oi(k,ce,L),xr(I,!0);{ye.ce&&ye.ce._injectChildStyle(Fe);const Te=I.subTree=Y_(I);_(null,Te,w,j,I,G,q),L.el=Te.el}if(he&&wn(he,G),!me&&(k=z&&z.onVnodeMounted)){const Te=L;wn(()=>Oi(k,ce,Te),G)}(L.shapeFlag&256||ce&&Qo(ce.vnode)&&ce.vnode.shapeFlag&256)&&I.a&&wn(I.a,G),I.isMounted=!0,L=w=j=null}};I.scope.on();const V=I.effect=new kx(N);I.scope.off();const A=I.update=V.run.bind(V),C=I.job=V.runIfDirty.bind(V);C.i=I,C.id=I.uid,V.scheduler=()=>tg(C),xr(I,!0),A()},te=(I,L,w)=>{L.component=I;const j=I.vnode.props;I.vnode=L,I.next=null,DA(I,L.props,j,w),FA(I,L.children,w),ar(),F_(I),lr()},Q=(I,L,w,j,G,q,R,N,V=!1)=>{const A=I&&I.children,C=I?I.shapeFlag:0,k=L.children,{patchFlag:U,shapeFlag:z}=L;if(U>0){if(U&128){ve(A,k,w,j,G,q,R,N,V);return}else if(U&256){pe(A,k,w,j,G,q,R,N,V);return}}z&8?(C&16&&be(A,G,q),k!==A&&u(w,k)):C&16?z&16?ve(A,k,w,j,G,q,R,N,V):be(A,G,q,!0):(C&8&&u(w,""),z&16&&P(k,w,j,G,q,R,N,V))},pe=(I,L,w,j,G,q,R,N,V)=>{I=I||Ko,L=L||Ko;const A=I.length,C=L.length,k=Math.min(A,C);let U;for(U=0;UC?be(I,G,q,!0,!1,k):P(L,w,j,G,q,R,N,V,k)},ve=(I,L,w,j,G,q,R,N,V)=>{let A=0;const C=L.length;let k=I.length-1,U=C-1;for(;A<=k&&A<=U;){const z=I[A],Y=L[A]=V?qs(L[A]):ki(L[A]);if(Gr(z,Y))_(z,Y,w,null,G,q,R,N,V);else break;A++}for(;A<=k&&A<=U;){const z=I[k],Y=L[U]=V?qs(L[U]):ki(L[U]);if(Gr(z,Y))_(z,Y,w,null,G,q,R,N,V);else break;k--,U--}if(A>k){if(A<=U){const z=U+1,Y=zU)for(;A<=k;)xe(I[A],G,q,!0),A++;else{const z=A,Y=A,he=new Map;for(A=Y;A<=U;A++){const Me=L[A]=V?qs(L[A]):ki(L[A]);Me.key!=null&&he.set(Me.key,A)}let ce,ye=0;const Fe=U-Y+1;let me=!1,Te=0;const ke=new Array(Fe);for(A=0;A=Fe){xe(Me,G,q,!0);continue}let qe;if(Me.key!=null)qe=he.get(Me.key);else for(ce=Y;ce<=U;ce++)if(ke[ce-Y]===0&&Gr(Me,L[ce])){qe=ce;break}qe===void 0?xe(Me,G,q,!0):(ke[qe-Y]=A+1,qe>=Te?Te=qe:me=!0,_(Me,L[qe],w,null,G,q,R,N,V),ye++)}const We=me?VA(ke):Ko;for(ce=We.length-1,A=Fe-1;A>=0;A--){const Me=Y+A,qe=L[Me],Je=Me+1{const{el:q,type:R,transition:N,children:V,shapeFlag:A}=I;if(A&6){se(I.component.subTree,L,w,j);return}if(A&128){I.suspense.move(L,w,j);return}if(A&64){R.move(I,L,w,le);return}if(R===Xt){i(q,L,w);for(let k=0;kN.enter(q),G);else{const{leave:k,delayLeave:U,afterLeave:z}=N,Y=()=>i(q,L,w),he=()=>{k(q,()=>{Y(),z&&z()})};U?U(q,Y,he):he()}else i(q,L,w)},xe=(I,L,w,j=!1,G=!1)=>{const{type:q,props:R,ref:N,children:V,dynamicChildren:A,shapeFlag:C,patchFlag:k,dirs:U,cacheIndex:z}=I;if(k===-2&&(G=!1),N!=null&&rf(N,null,w,I,!0),z!=null&&(L.renderCache[z]=void 0),C&256){L.ctx.deactivate(I);return}const Y=C&1&&U,he=!Qo(I);let ce;if(he&&(ce=R&&R.onVnodeBeforeUnmount)&&Oi(ce,L,I),C&6)ge(I.component,w,j);else{if(C&128){I.suspense.unmount(w,j);return}Y&&yr(I,null,L,"beforeUnmount"),C&64?I.type.remove(I,L,w,le,j):A&&!A.hasOnce&&(q!==Xt||k>0&&k&64)?be(A,L,w,!1,!0):(q===Xt&&k&384||!G&&C&16)&&be(V,L,w),j&&ze(I)}(he&&(ce=R&&R.onVnodeUnmounted)||Y)&&wn(()=>{ce&&Oi(ce,L,I),Y&&yr(I,null,L,"unmounted")},w)},ze=I=>{const{type:L,el:w,anchor:j,transition:G}=I;if(L===Xt){re(w,j);return}if(L===Vu){v(I);return}const q=()=>{s(w),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(I.shapeFlag&1&&G&&!G.persisted){const{leave:R,delayLeave:N}=G,V=()=>R(w,q);N?N(I.el,q,V):V()}else q()},re=(I,L)=>{let w;for(;I!==L;)w=h(I),s(I),I=w;s(L)},ge=(I,L,w)=>{const{bum:j,scope:G,job:q,subTree:R,um:N,m:V,a:A}=I;q_(V),q_(A),j&&Bu(j),G.stop(),q&&(q.flags|=8,xe(R,I,L,w)),N&&wn(N,L),wn(()=>{I.isUnmounted=!0},L),L&&L.pendingBranch&&!L.isUnmounted&&I.asyncDep&&!I.asyncResolved&&I.suspenseId===L.pendingId&&(L.deps--,L.deps===0&&L.resolve())},be=(I,L,w,j=!1,G=!1,q=0)=>{for(let R=q;R{if(I.shapeFlag&6)return W(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const L=h(I.anchor||I.el),w=L&&L[db];return w?h(w):L};let ae=!1;const ue=(I,L,w)=>{I==null?L._vnode&&xe(L._vnode,null,null,!0):_(L._vnode||null,I,L,null,null,null,w),L._vnode=I,ae||(ae=!0,F_(),cb(),ae=!1)},le={p:_,um:xe,m:se,r:ze,mt:$,mc:P,pc:Q,pbc:S,n:W,o:n};return{render:ue,hydrate:void 0,createApp:IA(ue)}}function xd({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 xr({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function kA(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function og(n,e,t=!1){const i=n.children,s=e.children;if(Be(i)&&Be(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 zb(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:zb(e)}function q_(n){if(n)for(let e=0;egn(zA);function sc(n,e){return rc(n,null,e)}function z4(n,e){return rc(n,null,{flush:"post"})}function GA(n,e){return rc(n,null,{flush:"sync"})}function Ge(n,e,t){return rc(n,e,t)}function rc(n,e,t=pt){const{immediate:i,deep:s,flush:r,once:o}=t,a=Zt({},t),l=e&&i||!e&&r!=="post";let c;if(wl){if(r==="sync"){const d=HA();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=zi,d.resume=zi,d.pause=zi,d}}const u=tn;a.call=(d,p,_)=>Ci(d,u,p,_);let f=!1;r==="post"?a.scheduler=d=>{wn(d,u&&u.suspense)}:r!=="sync"&&(f=!0,a.scheduler=(d,p)=>{p?d():tg(d)}),a.augmentJob=d=>{e&&(d.flags|=4),f&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const h=nA(n,e,a);return wl&&(c?c.push(h):l&&h()),h}function WA(n,e,t){const i=this.proxy,s=Lt(n)?n.includes(".")?Hb(i,n):()=>i[n]:n.bind(i,i);let r;$e(e)?r=e:(r=e.handler,t=e);const o=ac(this),a=rc(s,r.bind(i),t);return o(),a}function Hb(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{let u,f=pt,h;return GA(()=>{const d=n[s];Vn(u,d)&&(u=d,c())}),{get(){return l(),t.get?t.get(u):u},set(d){const p=t.set?t.set(d):d;if(!Vn(p,u)&&!(f!==pt&&Vn(d,f)))return;const _=i.vnode.props;_&&(e in _||s in _||r in _)&&(`onUpdate:${e}`in _||`onUpdate:${s}`in _||`onUpdate:${r}`in _)||(u=d,c()),i.emit(`update:${e}`,p),Vn(d,p)&&Vn(d,f)&&!Vn(p,h)&&c(),f=d,h=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||pt:a,done:!1}:{done:!0}}}},a}const Gb=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${Qn(e)}Modifiers`]||n[`${As(e)}Modifiers`];function XA(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||pt;let s=t;const r=e.startsWith("update:"),o=r&&Gb(i,e.slice(7));o&&(o.trim&&(s=t.map(u=>Lt(u)?u.trim():u)),o.number&&(s=t.map(Qu)));let a,l=i[a=Fu(e)]||i[a=Fu(Qn(e))];!l&&r&&(l=i[a=Fu(As(e))]),l&&Ci(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,Ci(c,n,6,s)}}function Wb(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=Wb(c,e,!0);u&&(a=!0,Zt(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(At(n)&&i.set(n,null),null):(Be(r)?r.forEach(l=>o[l]=null):Zt(o,r),At(n)&&i.set(n,o),o)}function gh(n,e){return!n||!sh(e)?!1:(e=e.slice(2).replace(/Once$/,""),xt(n,e[0].toLowerCase()+e.slice(1))||xt(n,As(e))||xt(n,e))}function Y_(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:f,data:h,setupState:d,ctx:p,inheritAttrs:_}=n,g=sf(n);let m,y;try{if(t.shapeFlag&4){const v=s||i,E=v;m=ki(c.call(E,v,u,f,d,h,p)),y=a}else{const v=e;m=ki(v.length>1?v(f,{attrs:a,slots:o,emit:l}):v(f,null)),y=e.props?a:$A(a)}}catch(v){Ja.length=0,dh(v,n,1),m=an(Pn)}let x=m;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:E}=x;v.length&&E&7&&(r&&v.some(Gm)&&(y=qA(y,r)),x=tr(x,y,!1,!0))}return t.dirs&&(x=tr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition&&bl(x,t.transition),m=x,sf(g),m}const $A=n=>{let e;for(const t in n)(t==="class"||t==="style"||sh(t))&&((e||(e={}))[t]=n[t]);return e},qA=(n,e)=>{const t={};for(const i in n)(!Gm(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function YA(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?j_(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function KA(n,e){e&&e.pendingBranch?Be(n)?e.effects.push(...n):e.effects.push(n):rA(n)}const Xt=Symbol.for("v-fgt"),oc=Symbol.for("v-txt"),Pn=Symbol.for("v-cmt"),Vu=Symbol.for("v-stc"),Ja=[];let Kn=null;function ln(n=!1){Ja.push(Kn=n?null:[])}function ZA(){Ja.pop(),Kn=Ja[Ja.length-1]||null}let Ml=1;function K_(n,e=!1){Ml+=n,n<0&&Kn&&e&&(Kn.hasOnce=!0)}function $b(n){return n.dynamicChildren=Ml>0?Kn||Ko:null,ZA(),Ml>0&&Kn&&Kn.push(n),n}function ui(n,e,t,i,s,r){return $b($s(n,e,t,i,s,r,!0))}function El(n,e,t,i,s){return $b(an(n,e,t,i,s,!0))}function Tl(n){return n?n.__v_isVNode===!0:!1}function Gr(n,e){return n.type===e.type&&n.key===e.key}const qb=({key:n})=>n??null,zu=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Lt(n)||wt(n)||$e(n)?{i:Yt,r:n,k:e,f:!!t}:n:null);function $s(n,e=null,t=null,i=0,s=null,r=n===Xt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&qb(e),ref:e&&zu(e),scopeId:fb,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:Yt};return a?(ag(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=Lt(t)?8:16),Ml>0&&!o&&Kn&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&Kn.push(l),l}const an=JA;function JA(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===Tb)&&(n=Pn),Tl(n)){const a=tr(n,e,!0);return t&&ag(a,t),Ml>0&&!r&&Kn&&(a.shapeFlag&6?Kn[Kn.indexOf(n)]=a:Kn.push(a)),a.patchFlag=-2,a}if(u1(n)&&(n=n.__vccOpts),e){e=QA(e);let{class:a,style:l}=e;a&&!Lt(a)&&(e.class=ga(a)),At(l)&&(Jm(l)&&!Be(l)&&(l=Zt({},l)),e.style=mi(l))}const o=Lt(n)?1:Xb(n)?128:pb(n)?64:At(n)?4:$e(n)?2:0;return $s(n,e,t,i,s,o,r,!0)}function QA(n){return n?Jm(n)||Db(n)?Zt({},n):n:null}function tr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?n1(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&qb(c),ref:e&&e.ref?t&&r?Be(r)?r.concat(zu(e)):[r,zu(e)]:zu(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!==Xt?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&&tr(n.ssContent),ssFallback:n.ssFallback&&tr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&bl(u,l.clone(u)),u}function e1(n=" ",e=0){return an(oc,null,n,e)}function t1(n,e){const t=an(Vu,null,n);return t.staticCount=e,t}function Z_(n="",e=!1){return e?(ln(),El(Pn,null,n)):an(Pn,null,n)}function ki(n){return n==null||typeof n=="boolean"?an(Pn):Be(n)?an(Xt,null,n.slice()):Tl(n)?qs(n):an(oc,null,String(n))}function qs(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:tr(n)}function ag(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Be(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),ag(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!Db(e)?e._ctx=Yt:s===3&&Yt&&(Yt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else $e(e)?(e={default:e,_ctx:Yt},t=32):(e=String(e),i&64?(t=16,e=[e1(e)]):t=8);n.children=e,n.shapeFlag|=t}function n1(...n){const e={};for(let t=0;ttn||Yt;let af,Hp;{const n=ah(),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)}};af=e("__VUE_INSTANCE_SETTERS__",t=>tn=t),Hp=e("__VUE_SSR_SETTERS__",t=>wl=t)}const ac=n=>{const e=tn;return af(n),n.scope.on(),()=>{n.scope.off(),af(e)}},J_=()=>{tn&&tn.scope.off(),af(null)};function Yb(n){return n.vnode.shapeFlag&4}let wl=!1;function o1(n,e=!1,t=!1){e&&Hp(e);const{props:i,children:s}=n.vnode,r=Yb(n);LA(n,i,r,e),UA(n,s,t);const o=r?a1(n,e):void 0;return e&&Hp(!1),o}function a1(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,EA);const{setup:i}=t;if(i){ar();const s=n.setupContext=i.length>1?Kb(n):null,r=ac(n),o=nc(i,n,0,[n.props,s]),a=Ix(o);if(lr(),r(),(a||n.sp)&&!Qo(n)&&Sb(n),a){if(o.then(J_,J_),e)return o.then(l=>{Q_(n,l)}).catch(l=>{dh(l,n,0)});n.asyncDep=o}else Q_(n,o)}else jb(n)}function Q_(n,e,t){$e(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:At(e)&&(n.setupState=ib(e)),jb(n)}function jb(n,e,t){const i=n.type;n.render||(n.render=i.render||zi);{const s=ac(n);ar();try{TA(n)}finally{lr(),s()}}}const l1={get(n,e){return pn(n,"get",""),n[e]}};function Kb(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,l1),slots:n.slots,emit:n.emit,expose:e}}function _h(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(ib(Qm(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Za)return Za[t](n)},has(e,t){return t in e||t in Za}})):n.proxy}function c1(n,e=!0){return $e(n)?n.displayName||n.name:n.name||e&&n.__name}function u1(n){return $e(n)&&"__vccOpts"in n}const Se=(n,e)=>eA(n,e,wl);function Ss(n,e,t){const i=arguments.length;return i===2?At(e)&&!Be(e)?Tl(e)?an(n,null,[e]):an(n,e):an(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Tl(t)&&(t=[t]),an(n,e,t))}const f1="3.5.13";/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Gp;const e0=typeof window<"u"&&window.trustedTypes;if(e0)try{Gp=e0.createPolicy("vue",{createHTML:n=>n})}catch{}const Zb=Gp?n=>Gp.createHTML(n):n=>n,h1="http://www.w3.org/2000/svg",d1="http://www.w3.org/1998/Math/MathML",ls=typeof document<"u"?document:null,t0=ls&&ls.createElement("template"),p1={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"?ls.createElementNS(h1,n):e==="mathml"?ls.createElementNS(d1,n):t?ls.createElement(n,{is:t}):ls.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>ls.createTextNode(n),createComment:n=>ls.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>ls.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{t0.innerHTML=Zb(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=t0.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]}},Ls="transition",wa="animation",Al=Symbol("_vtc"),Jb={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},m1=Zt({},_b,Jb),g1=n=>(n.displayName="Transition",n.props=m1,n),G4=g1((n,{slots:e})=>Ss(cA,_1(n),e)),br=(n,e=[])=>{Be(n)?n.forEach(t=>t(...e)):n&&n(...e)},n0=n=>n?Be(n)?n.some(e=>e.length>1):n.length>1:!1;function _1(n){const e={};for(const B in n)B in Jb||(e[B]=n[B]);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:f=`${t}-leave-from`,leaveActiveClass:h=`${t}-leave-active`,leaveToClass:d=`${t}-leave-to`}=n,p=v1(s),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:y,onEnterCancelled:x,onLeave:v,onLeaveCancelled:E,onBeforeAppear:T=m,onAppear:M=y,onAppearCancelled:P=x}=e,b=(B,H,$,ee)=>{B._enterCancelled=ee,Sr(B,H?u:a),Sr(B,H?c:o),$&&$()},S=(B,H)=>{B._isLeaving=!1,Sr(B,f),Sr(B,d),Sr(B,h),H&&H()},D=B=>(H,$)=>{const ee=B?M:y,Z=()=>b(H,B,$);br(ee,[H,Z]),i0(()=>{Sr(H,B?l:r),Qi(H,B?u:a),n0(ee)||s0(H,i,_,Z)})};return Zt(e,{onBeforeEnter(B){br(m,[B]),Qi(B,r),Qi(B,o)},onBeforeAppear(B){br(T,[B]),Qi(B,l),Qi(B,c)},onEnter:D(!1),onAppear:D(!0),onLeave(B,H){B._isLeaving=!0;const $=()=>S(B,H);Qi(B,f),B._enterCancelled?(Qi(B,h),a0()):(a0(),Qi(B,h)),i0(()=>{B._isLeaving&&(Sr(B,f),Qi(B,d),n0(v)||s0(B,i,g,$))}),br(v,[B,$])},onEnterCancelled(B){b(B,!1,void 0,!0),br(x,[B])},onAppearCancelled(B){b(B,!0,void 0,!0),br(P,[B])},onLeaveCancelled(B){S(B),br(E,[B])}})}function v1(n){if(n==null)return null;if(At(n))return[bd(n.enter),bd(n.leave)];{const e=bd(n);return[e,e]}}function bd(n){return xw(n)}function Qi(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Al]||(n[Al]=new Set)).add(e)}function Sr(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Al];t&&(t.delete(e),t.size||(n[Al]=void 0))}function i0(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let y1=0;function s0(n,e,t,i){const s=n._endId=++y1,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=x1(n,e);if(!o)return i();const c=o+"end";let u=0;const f=()=>{n.removeEventListener(c,h),r()},h=d=>{d.target===n&&++u>=l&&f()};setTimeout(()=>{u(t[p]||"").split(", "),s=i(`${Ls}Delay`),r=i(`${Ls}Duration`),o=r0(s,r),a=i(`${wa}Delay`),l=i(`${wa}Duration`),c=r0(a,l);let u=null,f=0,h=0;e===Ls?o>0&&(u=Ls,f=o,h=r.length):e===wa?c>0&&(u=wa,f=c,h=l.length):(f=Math.max(o,c),u=f>0?o>c?Ls:wa:null,h=u?u===Ls?r.length:l.length:0);const d=u===Ls&&/\b(transform|all)(,|$)/.test(i(`${Ls}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:d}}function r0(n,e){for(;n.lengtho0(t)+o0(n[i])))}function o0(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function a0(){return document.body.offsetHeight}function b1(n,e,t){const i=n[Al];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const l0=Symbol("_vod"),S1=Symbol("_vsh"),M1=Symbol(""),E1=/(^|;)\s*display\s*:/;function T1(n,e,t){const i=n.style,s=Lt(t);let r=!1;if(t&&!s){if(e)if(Lt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Hu(i,a,"")}else for(const o in e)t[o]==null&&Hu(i,o,"");for(const o in t)o==="display"&&(r=!0),Hu(i,o,t[o])}else if(s){if(e!==t){const o=i[M1];o&&(t+=";"+o),i.cssText=t,r=E1.test(t)}}else e&&n.removeAttribute("style");l0 in n&&(n[l0]=r?i.display:"",n[S1]&&(i.display="none"))}const c0=/\s*!important$/;function Hu(n,e,t){if(Be(t))t.forEach(i=>Hu(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=w1(n,e);c0.test(t)?n.setProperty(As(i),t.replace(c0,""),"important"):n[i]=t}}const u0=["Webkit","Moz","ms"],Sd={};function w1(n,e){const t=Sd[e];if(t)return t;let i=Qn(e);if(i!=="filter"&&i in n)return Sd[e]=i;i=oh(i);for(let s=0;sMd||(P1.then(()=>Md=0),Md=Date.now());function L1(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Ci(D1(i,t.value),e,5,[i])};return t.value=n,t.attached=I1(),t}function D1(n,e){if(Be(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 g0=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,O1=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?b1(n,i,o):e==="style"?T1(n,t,i):sh(e)?Gm(e)||C1(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):N1(n,e,i,o))?(d0(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&h0(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Lt(i))?d0(n,Qn(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),h0(n,e,i,o))};function N1(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&g0(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 g0(e)&&Lt(t)?!1:e in n}const nr=n=>{const e=n.props["onUpdate:modelValue"]||!1;return Be(e)?t=>Bu(e,t):e};function U1(n){n.target.composing=!0}function _0(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const fi=Symbol("_assign"),v0={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[fi]=nr(s);const r=i||s.props&&s.props.type==="number";fs(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=Qu(a)),n[fi](a)}),t&&fs(n,"change",()=>{n.value=n.value.trim()}),e||(fs(n,"compositionstart",U1),fs(n,"compositionend",_0),fs(n,"change",_0))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[fi]=nr(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?Qu(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===l)||(n.value=l))}},F1={deep:!0,created(n,e,t){n[fi]=nr(t),fs(n,"change",()=>{const i=n._modelValue,s=na(n),r=n.checked,o=n[fi];if(Be(i)){const a=$m(i,s),l=a!==-1;if(r&&!l)o(i.concat(s));else if(!r&&l){const c=[...i];c.splice(a,1),o(c)}}else if(ma(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(Qb(n,r))})},mounted:y0,beforeUpdate(n,e,t){n[fi]=nr(t),y0(n,e,t)}};function y0(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(Be(e))s=$m(e,i.props.value)>-1;else if(ma(e))s=e.has(i.props.value);else{if(e===t)return;s=io(e,Qb(n,!0))}n.checked!==s&&(n.checked=s)}const B1={created(n,{value:e},t){n.checked=io(e,t.props.value),n[fi]=nr(t),fs(n,"change",()=>{n[fi](na(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[fi]=nr(i),e!==t&&(n.checked=io(e,i.props.value))}},k1={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const s=ma(e);fs(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?Qu(na(o)):na(o));n[fi](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,cr(()=>{n._assigning=!1})}),n[fi]=nr(i)},mounted(n,{value:e}){x0(n,e)},beforeUpdate(n,e,t){n[fi]=nr(t)},updated(n,{value:e}){n._assigning||x0(n,e)}};function x0(n,e){const t=n.multiple,i=Be(e);if(!(t&&!i&&!ma(e))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=$m(e,a)>-1}else o.selected=e.has(a);else if(io(na(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function na(n){return"_value"in n?n._value:n.value}function Qb(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const W4={created(n,e,t){Dc(n,e,t,null,"created")},mounted(n,e,t){Dc(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){Dc(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){Dc(n,e,t,i,"updated")}};function V1(n,e){switch(n){case"SELECT":return k1;case"TEXTAREA":return v0;default:switch(e){case"checkbox":return F1;case"radio":return B1;default:return v0}}}function Dc(n,e,t,i,s){const o=V1(n.tagName,t.props&&t.props.type)[s];o&&o(n,e,t,i)}const z1=["ctrl","shift","alt","meta"],H1={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>z1.some(t=>n[`${t}Key`]&&!e.includes(t))},X4=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(s,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=s=>{if(!("key"in s))return;const r=As(s.key);if(e.some(o=>o===r||G1[o]===r))return n(s)})},W1=Zt({patchProp:O1},p1);let b0;function eS(){return b0||(b0=Vb(W1))}const q4=(...n)=>{eS().render(...n)},X1=(...n)=>{const e=eS().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=q1(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,$1(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function $1(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function q1(n){return Lt(n)?document.querySelector(n):n}const tS=new Set,Gn=new WeakMap,ia=new WeakMap,ro=new WeakMap,Wp=new WeakMap,Y1=new WeakMap,sa=new WeakMap,lf=new WeakMap,Wa=new WeakSet;let ir,lg=0,cg=0;const ps="__aa_tgt",Cl="__aa_del",cf="__aa_new",j1=n=>{const e=tC(n);e&&e.forEach(t=>nC(t))},K1=n=>{n.forEach(e=>{e.target===ir&&J1(),Gn.has(e.target)&&po(e.target)})};function Z1(n){const e=Wp.get(n);e==null||e.disconnect();let t=Gn.get(n),i=0;const s=5;t||(t=ra(n),Gn.set(n,t));const{offsetWidth:r,offsetHeight:o}=ir,l=[t.top-s,r-(t.left+s+t.width),o-(t.top+s+t.height),t.left-s].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++i>1&&po(n)},{root:ir,threshold:1,rootMargin:l});c.observe(n),Wp.set(n,c)}function po(n){clearTimeout(lf.get(n));const e=vh(n),t=Rl(e)?500:e.duration;lf.set(n,setTimeout(async()=>{const i=ro.get(n);try{await(i==null?void 0:i.finished),Gn.set(n,ra(n)),Z1(n)}catch{}},t))}function J1(){clearTimeout(lf.get(ir)),lf.set(ir,setTimeout(()=>{tS.forEach(n=>rS(n,e=>nS(()=>po(e))))},100))}function Q1(n){setTimeout(()=>{Y1.set(n,setInterval(()=>nS(po.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function nS(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let Xp,Wo;const eC=typeof window<"u"&&"ResizeObserver"in window;eC&&(ir=document.documentElement,Xp=new MutationObserver(j1),Wo=new ResizeObserver(K1),window.addEventListener("scroll",()=>{cg=window.scrollY,lg=window.scrollX}),Wo.observe(ir));function tC(n){return n.reduce((i,s)=>[...i,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:n.reduce((i,s)=>{if(i===!1)return!1;if(s.target instanceof Element){if(Ed(s.target),!i.has(s.target)){i.add(s.target);for(let r=0;rt(n,sa.has(n)));for(let t=0;ts(i,sa.has(i)))}}function fg(n){return Array.isArray(n)?n:[n]}function Rl(n){return typeof n=="function"}function sC(n){const e=Gn.get(n),t=ra(n);if(!ug(n))return Gn.set(n,t);let i;if(!e)return;const s=vh(n);if(typeof s!="function"){const r=e.left-t.left,o=e.top-t.top,[a,l,c,u]=iS(n,e,t),f={transform:`translate(${r}px, ${o}px)`},h={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,h.width=`${l}px`),c!==u&&(f.height=`${c}px`,h.height=`${u}px`),i=n.animate([f,h],{duration:s.duration,easing:s.easing})}else{const[r]=fg(s(n,"remain",e,t));i=new Animation(r),i.play()}ro.set(n,i),Gn.set(n,t),i.addEventListener("finish",po.bind(null,n))}function S0(n){cf in n&&delete n[cf];const e=ra(n);Gn.set(n,e);const t=vh(n);if(!ug(n))return;let i;if(typeof t!="function")i=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:t.duration*1.5,easing:"ease-in"});else{const[s]=fg(t(n,"add",e));i=new Animation(s),i.play()}ro.set(n,i),i.addEventListener("finish",po.bind(null,n))}function M0(n,e){var t;n.remove(),Gn.delete(n),ia.delete(n),ro.delete(n),(t=Wp.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(Cl in n&&delete n[Cl],Object.defineProperty(n,cf,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function rC(n){var e;if(!ia.has(n)||!Gn.has(n))return;const[t,i]=ia.get(n);Object.defineProperty(n,Cl,{value:!0,configurable:!0});const s=window.scrollX,r=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(n,i):t&&t.parentNode?t.parentNode.appendChild(n):(e=sS(n))===null||e===void 0||e.appendChild(n),!ug(n))return M0(n);const[o,a,l,c]=aC(n),u=vh(n),f=Gn.get(n);(s!==lg||r!==cg)&&oC(n,s,r,u);let h,d={position:"absolute",top:`${o}px`,left:`${a}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Rl(u))Object.assign(n.style,d),h=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[p,_]=fg(u(n,"remove",f));(_==null?void 0:_.styleReset)!==!1&&(d=(_==null?void 0:_.styleReset)||d,Object.assign(n.style,d)),h=new Animation(p),h.play()}ro.set(n,h),h.addEventListener("finish",M0.bind(null,n,d))}function oC(n,e,t,i){const s=lg-e,r=cg-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(ir).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+r),!n.parentElement)return;const l=n.parentElement;let c=l.clientHeight,u=l.clientWidth;const f=performance.now();function h(){requestAnimationFrame(()=>{if(!Rl(i)){const d=c-l.clientHeight,p=u-l.clientWidth;f+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-d}),c=l.clientHeight,u=l.clientWidth,h()):document.documentElement.style.scrollBehavior=o}})}h()}function aC(n){const e=Gn.get(n),[t,,i]=iS(n,e,ra(n));let s=n.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const r=getComputedStyle(s),o=Gn.get(s)||ra(s),a=Math.round(e.top-o.top)-Fi(r.borderTopWidth),l=Math.round(e.left-o.left)-Fi(r.borderLeftWidth);return[a,l,t,i]}function lC(n,e={}){return Xp&&Wo&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Rl(e)&&!e.disrespectUserMotionPreference||(Wa.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),rS(n,po,Q1,s=>Wo==null?void 0:Wo.observe(s)),Rl(e)?sa.set(n,e):sa.set(n,{duration:250,easing:"ease-in-out",...e}),Xp.observe(n,{childList:!0}),tS.add(n))),Object.freeze({parent:n,enable:()=>{Wa.add(n)},disable:()=>{Wa.delete(n)},isEnabled:()=>Wa.has(n)})}const cC={mounted:(n,e)=>{lC(n,e.value||{})},getSSRProps:()=>({})},uC=cC,fC={install(n){n.directive("auto-animate",uC)}};/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */const lc="174",hC={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},dC={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},oS=0,$p=1,aS=2,pC=3,mC=0,hg=1,dg=2,Bi=3,Ms=0,Dn=1,Si=2,ys=0,Qr=1,qp=2,Yp=3,jp=4,lS=5,Ks=100,cS=101,uS=102,fS=103,hS=104,dS=200,pS=201,mS=202,gS=203,uf=204,ff=205,_S=206,vS=207,yS=208,xS=209,bS=210,SS=211,MS=212,ES=213,TS=214,hf=0,df=1,pf=2,oo=3,mf=4,gf=5,_f=6,vf=7,cc=0,wS=1,AS=2,Hi=0,CS=1,RS=2,PS=3,yh=4,IS=5,LS=6,DS=7,Kp="attached",OS="detached",xh=300,Es=301,sr=302,Pl=303,Il=304,_a=306,Ll=1e3,li=1001,Dl=1002,cn=1003,pg=1004,gC=1004,Xo=1005,_C=1005,jt=1006,Qa=1007,vC=1007,Vi=1008,yC=1008,qi=1009,mg=1010,gg=1011,oa=1012,bh=1013,Ts=1014,Hn=1015,va=1016,Sh=1017,Mh=1018,ao=1020,_g=35902,vg=1021,yg=1022,Ln=1023,xg=1024,bg=1025,eo=1026,lo=1027,Eh=1028,uc=1029,Sg=1030,Th=1031,xC=1032,wh=1033,el=33776,tl=33777,nl=33778,il=33779,yf=35840,xf=35841,bf=35842,Sf=35843,Mf=36196,Ef=37492,Tf=37496,wf=37808,Af=37809,Cf=37810,Rf=37811,Pf=37812,If=37813,Lf=37814,Df=37815,Of=37816,Nf=37817,Uf=37818,Ff=37819,Bf=37820,kf=37821,sl=36492,Vf=36494,zf=36495,Mg=36283,Hf=36284,Gf=36285,Wf=36286,NS=2200,US=2201,FS=2202,Ol=2300,Xf=2301,Gu=2302,qr=2400,Yr=2401,Nl=2402,Ah=2500,Eg=2501,bC=0,SC=1,MC=2,BS=3200,kS=3201,EC=3202,TC=3203,ur=0,VS=1,hs="",Cn="srgb",co="srgb-linear",Ul="linear",St="srgb",wC=0,kr=7680,AC=7681,CC=7682,RC=7683,PC=34055,IC=34056,LC=5386,DC=512,OC=513,NC=514,UC=515,FC=516,BC=517,kC=518,Zp=519,zS=512,HS=513,GS=514,Tg=515,WS=516,XS=517,$S=518,qS=519,Fl=35044,VC=35048,zC=35040,HC=35045,GC=35049,WC=35041,XC=35046,$C=35050,qC=35042,YC="100",Jp="300 es",Mi=2e3,Bl=2001,jC={COMPUTE:"compute",RENDER:"render"};class ji{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]+fn[n>>16&255]+fn[n>>24&255]+"-"+fn[e&255]+fn[e>>8&255]+"-"+fn[e>>16&15|64]+fn[e>>24&255]+"-"+fn[t&63|128]+fn[t>>8&255]+"-"+fn[t>>16&255]+fn[t>>24&255]+fn[i&255]+fn[i>>8&255]+fn[i>>16&255]+fn[i>>24&255]).toLowerCase()}function Ke(n,e,t){return Math.max(e,Math.min(t,n))}function wg(n,e){return(n%e+e)%e}function KC(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function ZC(n,e,t){return n!==e?(t-n)/(e-n):0}function rl(n,e,t){return(1-t)*n+t*e}function JC(n,e,t,i){return rl(n,e,1-Math.exp(-t*i))}function QC(n,e=1){return e-Math.abs(wg(n,e*2)-e)}function eR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function tR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function nR(n,e){return n+Math.floor(Math.random()*(e-n+1))}function iR(n,e){return n+Math.random()*(e-n)}function sR(n){return n*(.5-Math.random())}function rR(n){n!==void 0&&(E0=n);let e=E0+=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 oR(n){return n*to}function aR(n){return n*aa}function lR(n){return(n&n-1)===0&&n!==0}function cR(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function uR(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function fR(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),f=r((e-i)/2),h=o((e-i)/2),d=r((i-e)/2),p=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*f,l*h,a*c);break;case"YZY":n.set(l*h,a*u,l*f,a*c);break;case"ZXZ":n.set(l*f,l*h,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 In(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 tt(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 Ag={DEG2RAD:to,RAD2DEG:aa,generateUUID:Zn,clamp:Ke,euclideanModulo:wg,mapLinear:KC,inverseLerp:ZC,lerp:rl,damp:JC,pingpong:QC,smoothstep:eR,smootherstep:tR,randInt:nR,randFloat:iR,randFloatSpread:sR,seededRandom:rR,degToRad:oR,radToDeg:aR,isPowerOfTwo:lR,ceilPowerOfTwo:cR,floorPowerOfTwo:uR,setQuaternionFromProperEuler:fR,normalize:tt,denormalize:In};class fe{constructor(e=0,t=0){fe.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=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(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(Ke(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 Qe{constructor(e,t,i,s,r,o,a,l,c){Qe.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],f=i[7],h=i[2],d=i[5],p=i[8],_=s[0],g=s[3],m=s[6],y=s[1],x=s[4],v=s[7],E=s[2],T=s[5],M=s[8];return r[0]=o*_+a*y+l*E,r[3]=o*g+a*x+l*T,r[6]=o*m+a*v+l*M,r[1]=c*_+u*y+f*E,r[4]=c*g+u*x+f*T,r[7]=c*m+u*v+f*M,r[2]=h*_+d*y+p*E,r[5]=h*g+d*x+p*T,r[8]=h*m+d*v+p*M,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],f=u*o-a*c,h=a*l-u*r,d=c*r-o*l,p=t*f+i*h+s*d;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=f*_,e[1]=(s*c-u*i)*_,e[2]=(a*i-s*o)*_,e[3]=h*_,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(Td.makeScale(e,t)),this}rotate(e){return this.premultiply(Td.makeRotation(-e)),this}translate(e,t){return this.premultiply(Td.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 Td=new Qe;function YS(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const hR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function $o(n,e){return new hR[n](e)}function kl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function jS(){const n=kl("canvas");return n.style.display="block",n}const T0={};function Vr(n){n in T0||(T0[n]=!0,console.warn(n))}function dR(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 pR(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 mR(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 w0=new Qe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),A0=new Qe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function gR(){const n={enabled:!0,workingColorSpace:co,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===St&&(s.r=xs(s.r),s.g=xs(s.g),s.b=xs(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===St&&(s.r=ea(s.r),s.g=ea(s.g),s.b=ea(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===hs?Ul: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({[co]:{primaries:e,whitePoint:i,transfer:Ul,toXYZ:w0,fromXYZ:A0,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Cn},outputColorSpaceConfig:{drawingBufferColorSpace:Cn}},[Cn]:{primaries:e,whitePoint:i,transfer:St,toXYZ:w0,fromXYZ:A0,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Cn}}}),n}const at=gR();function xs(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ea(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let So;class KS{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{So===void 0&&(So=kl("canvas")),So.width=e.width,So.height=e.height;const i=So.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=So}return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=kl("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!==xh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ll:e.x=e.x-Math.floor(e.x);break;case li:e.x=e.x<0?0:1;break;case Dl: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 Ll:e.y=e.y-Math.floor(e.y);break;case li:e.y=e.y<0?0:1;break;case Dl: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++}}Vt.DEFAULT_IMAGE=null;Vt.DEFAULT_MAPPING=xh;Vt.DEFAULT_ANISOTROPY=1;class ht{constructor(e=0,t=0,i=0,s=1){ht.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],f=l[8],h=l[1],d=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+_)<.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 x=(c+1)/2,v=(d+1)/2,E=(m+1)/2,T=(u+h)/4,M=(f+_)/4,P=(p+g)/4;return x>v&&x>E?x<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(x),s=T/i,r=M/i):v>E?v<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(v),i=T/s,r=P/s):E<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(E),i=M/r,s=P/r),this.set(i,s,r,t),this}let y=Math.sqrt((g-p)*(g-p)+(f-_)*(f-_)+(h-u)*(h-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-_)/y,this.z=(h-u)/y,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=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this.z=Ke(this.z,e.z,t.z),this.w=Ke(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this.z=Ke(this.z,e,t),this.w=Ke(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(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 Ch extends ji{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ht(0,0,e,t),this.scissorTest=!1,this.viewport=new ht(0,0,e,t);const s={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new Vt(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,x=1-m*m;if(x>Number.EPSILON){const E=Math.sqrt(x),T=Math.atan2(E,m*y);g=Math.sin(g*T)/E,a=Math.sin(a*T)/E}const v=a*y;if(l=l*g+h*v,c=c*g+d*v,u=u*g+p*v,f=f*g+_*v,g===1-a){const E=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=E,c*=E,u*=E,f*=E}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],f=r[o],h=r[o+1],d=r[o+2],p=r[o+3];return e[t]=a*p+u*f+l*d-c*h,e[t+1]=l*p+u*h+c*f-a*d,e[t+2]=c*p+u*d+a*h-l*f,e[t+3]=u*p-a*f-l*h-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),f=a(r/2),h=l(i/2),d=l(s/2),p=l(r/2);switch(o){case"XYZ":this._x=h*u*f+c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f-h*d*p;break;case"YXZ":this._x=h*u*f+c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f+h*d*p;break;case"ZXY":this._x=h*u*f-c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f-h*d*p;break;case"ZYX":this._x=h*u*f-c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f+h*d*p;break;case"YZX":this._x=h*u*f+c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f-h*d*p;break;case"XZY":this._x=h*u*f-c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f+h*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],f=t[10],h=i+a+f;if(h>0){const d=.5/Math.sqrt(h+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>f){const d=2*Math.sqrt(1+i-a-f);this._w=(u-l)/d,this._x=.25*d,this._y=(s+o)/d,this._z=(r+c)/d}else if(a>f){const d=2*Math.sqrt(1+a-i-f);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+f-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(Ke(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),f=Math.sin((1-t)*u)/c,h=Math.sin(t*u)/c;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=s*f+this._y*h,this._z=r*f+this._z*h,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 F{constructor(e=0,t=0,i=0){F.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(C0.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(C0.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),f=2*(r*i-o*t);return this.x=t+l*c+o*f-a*u,this.y=i+l*u+a*c-r*f,this.z=s+l*f+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=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this.z=Ke(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this.z=Ke(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(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 Ad.copy(this).projectOnVector(e),this.sub(Ad)}reflect(e){return this.sub(Ad.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(Ke(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 Ad=new F,C0=new Wn;class On{constructor(e=new F(1/0,1/0,1/0),t=new F(-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,vi),vi.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(Aa),Nc.subVectors(this.max,Aa),Mo.subVectors(e.a,Aa),Eo.subVectors(e.b,Aa),To.subVectors(e.c,Aa),Ds.subVectors(Eo,Mo),Os.subVectors(To,Eo),Mr.subVectors(Mo,To);let t=[0,-Ds.z,Ds.y,0,-Os.z,Os.y,0,-Mr.z,Mr.y,Ds.z,0,-Ds.x,Os.z,0,-Os.x,Mr.z,0,-Mr.x,-Ds.y,Ds.x,0,-Os.y,Os.x,0,-Mr.y,Mr.x,0];return!Cd(t,Mo,Eo,To,Nc)||(t=[1,0,0,0,1,0,0,0,1],!Cd(t,Mo,Eo,To,Nc))?!1:(Uc.crossVectors(Ds,Os),t=[Uc.x,Uc.y,Uc.z],Cd(t,Mo,Eo,To,Nc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vi).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:(es[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),es[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),es[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),es[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),es[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),es[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),es[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),es[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(es),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 es=[new F,new F,new F,new F,new F,new F,new F,new F],vi=new F,Oc=new On,Mo=new F,Eo=new F,To=new F,Ds=new F,Os=new F,Mr=new F,Aa=new F,Nc=new F,Uc=new F,Er=new F;function Cd(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Er.fromArray(n,r);const a=s.x*Math.abs(Er.x)+s.y*Math.abs(Er.y)+s.z*Math.abs(Er.z),l=e.dot(Er),c=t.dot(Er),u=i.dot(Er);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const bR=new On,Ca=new F,Rd=new F;class _n{constructor(e=new F,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):bR.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;Ca.subVectors(e,this.center);const t=Ca.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(Ca,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):(Rd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ca.copy(e.center).add(Rd)),this.expandByPoint(Ca.copy(e.center).sub(Rd))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ts=new F,Pd=new F,Fc=new F,Ns=new F,Id=new F,Bc=new F,Ld=new F;class ya{constructor(e=new F,t=new F(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,ts)),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=ts.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ts.copy(this.origin).addScaledVector(this.direction,t),ts.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Pd.copy(e).add(t).multiplyScalar(.5),Fc.copy(t).sub(e).normalize(),Ns.copy(this.origin).sub(Pd);const r=e.distanceTo(t)*.5,o=-this.direction.dot(Fc),a=Ns.dot(this.direction),l=-Ns.dot(Fc),c=Ns.lengthSq(),u=Math.abs(1-o*o);let f,h,d,p;if(u>0)if(f=o*l-a,h=o*a-l,p=r*u,f>=0)if(h>=-p)if(h<=p){const _=1/u;f*=_,h*=_,d=f*(f+o*h+2*a)+h*(o*f+h+2*l)+c}else h=r,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h=-r,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h<=-p?(f=Math.max(0,-(-o*r+a)),h=f>0?-r:Math.min(Math.max(-r,-l),r),d=-f*f+h*(h+2*l)+c):h<=p?(f=0,h=Math.min(Math.max(-r,-l),r),d=h*(h+2*l)+c):(f=Math.max(0,-(o*r+a)),h=f>0?r:Math.min(Math.max(-r,-l),r),d=-f*f+h*(h+2*l)+c);else h=o>0?-r:r,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),s&&s.copy(Pd).addScaledVector(Fc,h),d}intersectSphere(e,t){ts.subVectors(e.center,this.origin);const i=ts.dot(this.direction),s=ts.dot(ts)-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,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,s=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,s=(e.min.x-h.x)*c),u>=0?(r=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(a=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,ts)!==null}intersectTriangle(e,t,i,s,r){Id.subVectors(t,e),Bc.subVectors(i,e),Ld.crossVectors(Id,Bc);let o=this.direction.dot(Ld),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ns.subVectors(this.origin,e);const l=a*this.direction.dot(Bc.crossVectors(Ns,Bc));if(l<0)return null;const c=a*this.direction.dot(Id.cross(Ns));if(c<0||l+c>o)return null;const u=-a*Ns.dot(Ld);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 Xe{constructor(e,t,i,s,r,o,a,l,c,u,f,h,d,p,_,g){Xe.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,f,h,d,p,_,g)}set(e,t,i,s,r,o,a,l,c,u,f,h,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]=f,m[14]=h,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 Xe().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/wo.setFromMatrixColumn(e,0).length(),r=1/wo.setFromMatrixColumn(e,1).length(),o=1/wo.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),f=Math.sin(r);if(e.order==="XYZ"){const h=o*u,d=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=d+p*c,t[5]=h-_*c,t[9]=-a*l,t[2]=_-h*c,t[6]=p+d*c,t[10]=o*l}else if(e.order==="YXZ"){const h=l*u,d=l*f,p=c*u,_=c*f;t[0]=h+_*a,t[4]=p*a-d,t[8]=o*c,t[1]=o*f,t[5]=o*u,t[9]=-a,t[2]=d*a-p,t[6]=_+h*a,t[10]=o*l}else if(e.order==="ZXY"){const h=l*u,d=l*f,p=c*u,_=c*f;t[0]=h-_*a,t[4]=-o*f,t[8]=p+d*a,t[1]=d+p*a,t[5]=o*u,t[9]=_-h*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const h=o*u,d=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=p*c-d,t[8]=h*c+_,t[1]=l*f,t[5]=_*c+h,t[9]=d*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const h=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=_-h*f,t[8]=p*f+d,t[1]=f,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=d*f+p,t[10]=h-_*f}else if(e.order==="XZY"){const h=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=h*f+_,t[5]=o*u,t[9]=d*f-p,t[2]=p*f-d,t[6]=a*u,t[10]=_*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(SR,e,MR)}lookAt(e,t,i){const s=this.elements;return Yn.subVectors(e,t),Yn.lengthSq()===0&&(Yn.z=1),Yn.normalize(),Us.crossVectors(i,Yn),Us.lengthSq()===0&&(Math.abs(i.z)===1?Yn.x+=1e-4:Yn.z+=1e-4,Yn.normalize(),Us.crossVectors(i,Yn)),Us.normalize(),kc.crossVectors(Yn,Us),s[0]=Us.x,s[4]=kc.x,s[8]=Yn.x,s[1]=Us.y,s[5]=kc.y,s[9]=Yn.y,s[2]=Us.z,s[6]=kc.z,s[10]=Yn.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],f=i[5],h=i[9],d=i[13],p=i[2],_=i[6],g=i[10],m=i[14],y=i[3],x=i[7],v=i[11],E=i[15],T=s[0],M=s[4],P=s[8],b=s[12],S=s[1],D=s[5],B=s[9],H=s[13],$=s[2],ee=s[6],Z=s[10],te=s[14],Q=s[3],pe=s[7],ve=s[11],se=s[15];return r[0]=o*T+a*S+l*$+c*Q,r[4]=o*M+a*D+l*ee+c*pe,r[8]=o*P+a*B+l*Z+c*ve,r[12]=o*b+a*H+l*te+c*se,r[1]=u*T+f*S+h*$+d*Q,r[5]=u*M+f*D+h*ee+d*pe,r[9]=u*P+f*B+h*Z+d*ve,r[13]=u*b+f*H+h*te+d*se,r[2]=p*T+_*S+g*$+m*Q,r[6]=p*M+_*D+g*ee+m*pe,r[10]=p*P+_*B+g*Z+m*ve,r[14]=p*b+_*H+g*te+m*se,r[3]=y*T+x*S+v*$+E*Q,r[7]=y*M+x*D+v*ee+E*pe,r[11]=y*P+x*B+v*Z+E*ve,r[15]=y*b+x*H+v*te+E*se,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],f=e[6],h=e[10],d=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+r*l*f-s*c*f-r*a*h+i*c*h+s*a*d-i*l*d)+_*(+t*l*d-t*c*h+r*o*h-s*o*d+s*c*u-r*l*u)+g*(+t*c*f-t*a*d-r*o*f+i*o*d+r*a*u-i*c*u)+m*(-s*a*u-t*l*f+t*a*h+s*o*f-i*o*h+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const 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],f=e[9],h=e[10],d=e[11],p=e[12],_=e[13],g=e[14],m=e[15],y=f*g*c-_*h*c+_*l*d-a*g*d-f*l*m+a*h*m,x=p*h*c-u*g*c-p*l*d+o*g*d+u*l*m-o*h*m,v=u*_*c-p*f*c+p*a*d-o*_*d-u*a*m+o*f*m,E=p*f*l-u*_*l-p*a*h+o*_*h+u*a*g-o*f*g,T=t*y+i*x+s*v+r*E;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/T;return e[0]=y*M,e[1]=(_*h*r-f*g*r-_*s*d+i*g*d+f*s*m-i*h*m)*M,e[2]=(a*g*r-_*l*r+_*s*c-i*g*c-a*s*m+i*l*m)*M,e[3]=(f*l*r-a*h*r-f*s*c+i*h*c+a*s*d-i*l*d)*M,e[4]=x*M,e[5]=(u*g*r-p*h*r+p*s*d-t*g*d-u*s*m+t*h*m)*M,e[6]=(p*l*r-o*g*r-p*s*c+t*g*c+o*s*m-t*l*m)*M,e[7]=(o*h*r-u*l*r+u*s*c-t*h*c-o*s*d+t*l*d)*M,e[8]=v*M,e[9]=(p*f*r-u*_*r-p*i*d+t*_*d+u*i*m-t*f*m)*M,e[10]=(o*_*r-p*a*r+p*i*c-t*_*c-o*i*m+t*a*m)*M,e[11]=(u*a*r-o*f*r-u*i*c+t*f*c+o*i*d-t*a*d)*M,e[12]=E*M,e[13]=(u*_*s-p*f*s+p*i*h-t*_*h-u*i*g+t*f*g)*M,e[14]=(p*a*s-o*_*s-p*i*l+t*_*l+o*i*g-t*a*g)*M,e[15]=(o*f*s-u*a*s+u*i*l-t*f*l-o*i*h+t*a*h)*M,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,f=a+a,h=r*c,d=r*u,p=r*f,_=o*u,g=o*f,m=a*f,y=l*c,x=l*u,v=l*f,E=i.x,T=i.y,M=i.z;return s[0]=(1-(_+m))*E,s[1]=(d+v)*E,s[2]=(p-x)*E,s[3]=0,s[4]=(d-v)*T,s[5]=(1-(h+m))*T,s[6]=(g+y)*T,s[7]=0,s[8]=(p+x)*M,s[9]=(g-y)*M,s[10]=(1-(h+_))*M,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=wo.set(s[0],s[1],s[2]).length();const o=wo.set(s[4],s[5],s[6]).length(),a=wo.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],yi.copy(this);const c=1/r,u=1/o,f=1/a;return yi.elements[0]*=c,yi.elements[1]*=c,yi.elements[2]*=c,yi.elements[4]*=u,yi.elements[5]*=u,yi.elements[6]*=u,yi.elements[8]*=f,yi.elements[9]*=f,yi.elements[10]*=f,t.setFromRotationMatrix(yi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=Mi){const l=this.elements,c=2*r/(t-e),u=2*r/(i-s),f=(t+e)/(t-e),h=(i+s)/(i-s);let d,p;if(a===Mi)d=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===Bl)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]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,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=Mi){const l=this.elements,c=1/(t-e),u=1/(i-s),f=1/(o-r),h=(t+e)*c,d=(i+s)*u;let p,_;if(a===Mi)p=(o+r)*f,_=-2*f;else if(a===Bl)p=r*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,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 wo=new F,yi=new Xe,SR=new F(0,0,0),MR=new F(1,1,1),Us=new F,kc=new F,Yn=new F,R0=new Xe,P0=new Wn;class ei{constructor(e=0,t=0,i=0,s=ei.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],f=s[2],h=s[6],d=s[10];switch(t){case"XYZ":this._y=Math.asin(Ke(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ke(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ke(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Ke(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ke(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Ke(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,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 R0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(R0,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return P0.setFromEuler(this),this.setFromQuaternion(P0,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}}ei.DEFAULT_ORDER="XYZ";class Ph{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.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(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),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),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){xi.subVectors(s,t),is.subVectors(i,t),Od.subVectors(e,t);const o=xi.dot(xi),a=xi.dot(is),l=xi.dot(Od),c=is.dot(is),u=is.dot(Od),f=o*c-a*a;if(f===0)return r.set(0,0,0),null;const h=1/f,d=(c*l-a*u)*h,p=(o*u-a*l)*h;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,ss)===null?!1:ss.x>=0&&ss.y>=0&&ss.x+ss.y<=1}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ss)===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,ss.x),l.addScaledVector(o,ss.y),l.addScaledVector(a,ss.z),l)}static getInterpolatedAttribute(e,t,i,s,r,o){return Bd.setScalar(0),kd.setScalar(0),Vd.setScalar(0),Bd.fromBufferAttribute(e,t),kd.fromBufferAttribute(e,i),Vd.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(Bd,r.x),o.addScaledVector(kd,r.y),o.addScaledVector(Vd,r.z),o}static isFrontFacing(e,t,i,s){return xi.subVectors(i,t),is.subVectors(e,t),xi.cross(is).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 xi.subVectors(this.c,this.b),is.subVectors(this.a,this.b),xi.cross(is).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,s,r){return zn.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zn.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;Ro.subVectors(s,i),Po.subVectors(r,i),Nd.subVectors(e,i);const l=Ro.dot(Nd),c=Po.dot(Nd);if(l<=0&&c<=0)return t.copy(i);Ud.subVectors(e,s);const u=Ro.dot(Ud),f=Po.dot(Ud);if(u>=0&&f<=u)return t.copy(s);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Ro,o);Fd.subVectors(e,r);const d=Ro.dot(Fd),p=Po.dot(Fd);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(Po,a);const g=u*p-d*f;if(g<=0&&f-u>=0&&d-p>=0)return U0.subVectors(r,s),a=(f-u)/(f-u+(d-p)),t.copy(s).addScaledVector(U0,a);const m=1/(g+_+h);return o=_*m,a=h*m,t.copy(i).addScaledVector(Ro,o).addScaledVector(Po,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ZS={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},Fs={h:0,s:0,l:0},zc={h:0,s:0,l:0};function zd(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 we{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=Cn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,at.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=at.workingColorSpace){return this.r=e,this.g=t,this.b=i,at.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=at.workingColorSpace){if(e=wg(e,1),t=Ke(t,0,1),i=Ke(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=zd(o,r,e+1/3),this.g=zd(o,r,e),this.b=zd(o,r,e-1/3)}return at.toWorkingColorSpace(this,s),this}setStyle(e,t=Cn){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=Cn){const i=ZS[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=xs(e.r),this.g=xs(e.g),this.b=xs(e.b),this}copyLinearToSRGB(e){return this.r=ea(e.r),this.g=ea(e.g),this.b=ea(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cn){return at.fromWorkingColorSpace(hn.copy(this),e),Math.round(Ke(hn.r*255,0,255))*65536+Math.round(Ke(hn.g*255,0,255))*256+Math.round(Ke(hn.b*255,0,255))}getHexString(e=Cn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=at.workingColorSpace){at.fromWorkingColorSpace(hn.copy(this),t);const i=hn.r,s=hn.g,r=hn.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 f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case i:l=(s-r)/f+(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!==Qr&&(i.blending=this.blending),this.side!==Ms&&(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!==uf&&(i.blendSrc=this.blendSrc),this.blendDst!==ff&&(i.blendDst=this.blendDst),this.blendEquation!==Ks&&(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!==oo&&(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!==Zp&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==kr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==kr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==kr&&(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++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Rs extends xn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new we(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 ei,this.combine=cc,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 ds=RR();function RR(){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 Bn(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Ke(n,-65504,65504),ds.floatView[0]=n;const e=ds.uint32View[0],t=e>>23&511;return ds.baseTable[t]+((e&8388607)>>ds.shiftTable[t])}function Xa(n){const e=n>>10;return ds.uint32View[0]=ds.mantissaTable[ds.offsetTable[e]+(n&1023)]+ds.exponentTable[e],ds.floatView[0]}class PR{static toHalfFloat(e){return Bn(e)}static fromHalfFloat(e){return Xa(e)}}const Wt=new F,Hc=new fe;let IR=0;class Et{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:IR++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Fl,this.updateRanges=[],this.gpuType=Hn,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 On);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 F(-1/0,-1/0,-1/0),new F(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 f=0,h=c.length;f0&&(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(t));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=[],f=r[c];for(let h=0,d=f.length;h0){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))&&(F0.copy(r).invert(),Tr.copy(e.ray).applyMatrix4(F0),!(i.boundingBox!==null&&Tr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Tr)))}_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,f=r.attributes.normal,h=r.groups,d=r.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,_=h.length;p<_;p++){const g=h[p],m=o[g.materialIndex],y=Math.max(g.start,d.start),x=Math.min(a.count,Math.min(g.start+g.count,d.start+d.count));for(let v=y,E=x;vt.far?null:{distance:c,point:Yc.clone(),object:n}}function jc(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,Wc),n.getVertexPosition(l,Xc),n.getVertexPosition(c,$c);const u=kR(n,e,t,i,Wc,Xc,$c,k0);if(u){const f=new F;zn.getBarycoord(k0,Wc,Xc,$c,f),s&&(u.uv=zn.getInterpolatedAttribute(s,a,l,c,f,new fe)),r&&(u.uv1=zn.getInterpolatedAttribute(r,a,l,c,f,new fe)),o&&(u.normal=zn.getInterpolatedAttribute(o,a,l,c,f,new F),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new F,materialIndex:0};zn.getNormal(Wc,Xc,$c,h.normal),u.face=h,u.barycoord=f}return u}class mo extends rt{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=[],f=[];let h=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 Ue(c,3)),this.setAttribute("normal",new Ue(u,3)),this.setAttribute("uv",new Ue(f,2));function p(_,g,m,y,x,v,E,T,M,P,b){const S=v/M,D=E/P,B=v/2,H=E/2,$=T/2,ee=M+1,Z=P+1;let te=0,Q=0;const pe=new F;for(let ve=0;ve0?1:-1,u.push(pe.x,pe.y,pe.z),f.push(xe/M),f.push(1-ve/P),te+=1}}for(let ve=0;ve0&&(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 hc extends ct{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Xe,this.projectionMatrix=new Xe,this.projectionMatrixInverse=new Xe,this.coordinateSystem=Mi}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 Bs=new F,V0=new fe,z0=new fe;class $t extends hc{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=aa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(to*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return aa*2*Math.atan(Math.tan(to*.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){Bs.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Bs.x,Bs.y).multiplyScalar(-e/Bs.z),Bs.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Bs.x,Bs.y).multiplyScalar(-e/Bs.z)}getViewSize(e,t){return this.getViewBounds(e,V0,z0),t.subVectors(z0,V0)}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(to*.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 Lo=-90,Do=1;class eM extends ct{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new $t(Lo,Do,e,t);s.layers=this.layers,this.add(s);const r=new $t(Lo,Do,e,t);r.layers=this.layers,this.add(r);const o=new $t(Lo,Do,e,t);o.layers=this.layers,this.add(o);const a=new $t(Lo,Do,e,t);a.layers=this.layers,this.add(a);const l=new $t(Lo,Do,e,t);l.layers=this.layers,this.add(l);const c=new $t(Lo,Do,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===Mi)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===Bl)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,f=e.getRenderTarget(),h=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(f,h,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class dc extends Vt{constructor(e,t,i,s,r,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Es,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 tM extends Yi{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 dc(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:jt}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 mo(5,5,5),r=new Ri({name:"CubemapFromEquirect",uniforms:la(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Dn,blending:ys});r.uniforms.tEquirect.value=t;const o=new Ht(s,r),a=t.minFilter;return t.minFilter===Vi&&(t.minFilter=jt),new eM(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,s){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}class qo extends ct{constructor(){super(),this.isGroup=!0,this.type="Group"}}const GR={type:"move"};class Wu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qo,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 qo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),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"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,p=.005;c.inputState.pinching&&h>d+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=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(GR)))}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 qo;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class Ih{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new we(e),this.density=t}clone(){return new Ih(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Lh{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new we(e),this.near=t,this.far=i}clone(){return new Lh(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Dh extends ct{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 ei,this.environmentIntensity=1,this.environmentRotation=new ei,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 Oh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fl,this.updateRanges=[],this.version=0,this.uuid=Zn()}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:Ia.clone(),uv:zn.getInterpolation(Ia,Kc,Da,Zc,H0,Wd,G0,new fe),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 Jc(n,e,t,i,s,r){Fo.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(La.x=r*Fo.x-s*Fo.y,La.y=s*Fo.x+r*Fo.y):La.copy(Fo),n.copy(e),n.x+=La.x,n.y+=La.y,n.applyMatrix4(nM)}const Qc=new F,W0=new F;class sM extends ct{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){Qc.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Qc);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Qc.setFromMatrixPosition(e.matrixWorld),W0.setFromMatrixPosition(this.matrixWorld);const i=Qc.distanceTo(W0)/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||YR.getNormalMatrix(e),s=this.coplanarPoint(qd).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 wr=new _n,nu=new F;class pc{constructor(e=new Ys,t=new Ys,i=new Ys,s=new Ys,r=new Ys,o=new Ys){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=Mi){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],f=s[6],h=s[7],d=s[8],p=s[9],_=s[10],g=s[11],m=s[12],y=s[13],x=s[14],v=s[15];if(i[0].setComponents(l-r,h-c,g-d,v-m).normalize(),i[1].setComponents(l+r,h+c,g+d,v+m).normalize(),i[2].setComponents(l+o,h+u,g+p,v+y).normalize(),i[3].setComponents(l-o,h-u,g-p,v-y).normalize(),i[4].setComponents(l-a,h-f,g-_,v-x).normalize(),t===Mi)i[5].setComponents(l+a,h+f,g+_,v+x).normalize();else if(t===Bl)i[5].setComponents(a,f,_,x).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(),wr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),wr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(wr)}intersectsSprite(e){return wr.center.set(0,0,0),wr.radius=.7071067811865476,wr.applyMatrix4(e.matrixWorld),this.intersectsSphere(wr)}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,nu.y=s.normal.y>0?e.max.y:e.min.y,nu.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(nu)<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)}}function Yd(n,e){return n-e}function jR(n,e){return n.z-e.z}function KR(n,e){return e.z-n.z}class ZR{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,s){const r=this.pool,o=this.list;this.index>=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 Fn=new Xe,JR=new we(1,1,1),jd=new pc,iu=new On,Ar=new _n,Ua=new F,Q0=new F,QR=new F,Kd=new ZR,dn=new Ht,su=[];function eP(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 Et(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 On);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(Yd),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Fn.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const o=this._colorsTexture;return o&&(JR.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(Yd),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 f=t.getAttribute(u),h=i.getAttribute(u);eP(f,h,l);const d=f.itemSize;for(let p=f.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 On,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 _n;this.getBoundingBoxAt(e,iu),iu.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 rt,this._initializeGeometry(r));const o=this.geometry;r.index&&Cr(r.index.array,o.index.array);for(const a in r.attributes)Cr(r.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,o=this.geometry;dn.material=this.material,dn.geometry.index=o.index,dn.geometry.attributes=o.attributes,dn.geometry.boundingBox===null&&(dn.geometry.boundingBox=new On),dn.geometry.boundingSphere===null&&(dn.geometry.boundingSphere=new _n);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._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.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,f=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data;h&&(Fn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),jd.setFromProjectionMatrix(Fn,e.coordinateSystem));let _=0;if(this.sortObjects){Fn.copy(this.matrixWorld).invert(),Ua.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Fn),Q0.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Fn);for(let y=0,x=l.length;y0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;Zd.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Zd);if(!(ce.far))return{distance:c,point:tv.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const nv=new F,iv=new F;class Ki extends rr{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 uM extends Vt{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:jt,this.magFilter=r!==void 0?r:jt,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}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 tP extends uM{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 nP extends Vt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=cn,this.minFilter=cn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Uh extends Vt{constructor(e,t,i,s,r,o,a,l,c,u,f,h){super(null,o,a,l,c,u,s,r,f,h),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class iP extends Uh{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=li,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class sP extends Uh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Es),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class rP extends Vt{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 Dg extends Vt{constructor(e,t,i,s,r,o,a,l,c,u=eo){if(u!==eo&&u!==lo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===eo&&(i=Ts),i===void 0&&u===lo&&(i=ao),super(null,s,r,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:cn,this.minFilter=l!==void 0?l:cn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Zs(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 Li{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,s=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),r+=i.distanceTo(s),t.push(r),s=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let s=0;const r=i.length;let o;t?o=t:o=e*i[r-1];let a=0,l=r-1,c;for(;a<=l;)if(s=Math.floor(a+(l-a)/2),c=i[s]-o,c<0)a=s+1;else if(c>0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],h=i[s+1]-u,d=(o-u)/h;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 fe:new F);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 F,s=[],r=[],o=[],a=new F,l=new Xe;for(let d=0;d<=e;d++){const p=d/e;s[d]=this.getTangentAt(p,new F)}r[0]=new F,o[0]=new F;let c=Number.MAX_VALUE;const u=Math.abs(s[0].x),f=Math.abs(s[0].y),h=Math.abs(s[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),h<=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(Ke(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(Ke(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 Fh extends Li{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 fe){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]:(cu.subVectors(s[0],s[1]).add(s[0]),c=cu);const f=s[a%r],h=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],f=s[o>s.length-3?s.length-1:o+2];return i.set(ov(a,l.x,c.x,u.x,f.x),ov(a,l.y,c.y,u.y,f.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 f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.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 mc extends rt{constructor(e=[new fe(0,-.5),new fe(.5,0),new fe(0,.5)],t=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:s},t=Math.floor(t),s=Ke(s,0,Math.PI*2);const r=[],o=[],a=[],l=[],c=[],u=1/t,f=new F,h=new fe,d=new F,p=new F,_=new F;let g=0,m=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,_.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,p.copy(d),d.x+=_.x,d.y+=_.y,d.z+=_.z,d.normalize(),l.push(d.x,d.y,d.z),_.copy(p)}for(let y=0;y<=t;y++){const x=i+y*u*s,v=Math.sin(x),E=Math.cos(x);for(let T=0;T<=e.length-1;T++){f.x=e[T].x*v,f.y=e[T].y,f.z=e[T].x*E,o.push(f.x,f.y,f.z),h.x=y/t,h.y=T/(e.length-1),a.push(h.x,h.y);const M=l[3*T+0]*v,P=l[3*T+1],b=l[3*T+0]*E;c.push(M,P,b)}}for(let y=0;y0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new Ue(f,3)),this.setAttribute("normal",new Ue(h,3)),this.setAttribute("uv",new Ue(d,2));function y(){const v=new F,E=new F;let T=0;const M=(t-e)/i;for(let P=0;P<=r;P++){const b=[],S=P/r,D=S*(t-e)+e;for(let B=0;B<=s;B++){const H=B/s,$=H*l+a,ee=Math.sin($),Z=Math.cos($);E.x=D*ee,E.y=-S*i+g,E.z=D*Z,f.push(E.x,E.y,E.z),v.set(ee,M,Z).normalize(),h.push(v.x,v.y,v.z),d.push(H,1-S),b.push(p++)}_.push(b)}for(let P=0;P0||b!==0)&&(u.push(S,D,H),T+=3),(t>0||b!==r-1)&&(u.push(D,B,H),T+=3)}c.addGroup(m,T,0),m+=T}function x(v){const E=p,T=new fe,M=new F;let P=0;const b=v===!0?e:t,S=v===!0?1:-1;for(let B=1;B<=s;B++)f.push(0,g*S,0),h.push(0,S,0),d.push(.5,.5),p++;const D=p;for(let B=0;B<=s;B++){const $=B/s*l+a,ee=Math.cos($),Z=Math.sin($);M.x=b*Z,M.y=g*S,M.z=b*ee,f.push(M.x,M.y,M.z),h.push(0,S,0),T.x=ee*.5+.5,T.y=Z*.5*S+.5,d.push(T.x,T.y),p++}for(let B=0;B.9&&M<.1&&(x<.2&&(o[y+0]+=1),v<.2&&(o[y+2]+=1),E<.2&&(o[y+4]+=1))}}function h(y){r.push(y.x,y.y,y.z)}function d(y,x){const v=y*3;x.x=e[v+0],x.y=e[v+1],x.z=e[v+2]}function p(){const y=new F,x=new F,v=new F,E=new F,T=new fe,M=new fe,P=new fe;for(let b=0,S=0;b80*i){l=u=e[0],c=f=e[1];for(let _=i;_u&&(u=h),d>f&&(f=d);p=Math.max(u-l,f-c),p=p!==0?32767/p:0}return zl(o,a,i,l,c,p,0),a}}function _M(n,e,t,i,s){let r,o;if(s===RP(n,e,t,i)>0)for(r=e;r=e;r-=i)o=av(r,n[r],n[r+1],o);return o&&Hh(o,o.next)&&(Gl(o),o=o.next),o}function fo(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Hh(t,t.next)||Ut(t.prev,t,t.next)===0)){if(Gl(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function zl(n,e,t,i,s,r,o){if(!n)return;!o&&r&&MP(n,i,s,r);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,r?mP(n,i,s,r):pP(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),Gl(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=gP(fo(n),e,t),zl(n,e,t,i,s,r,2)):o===2&&_P(n,e,t,i,s,r):zl(fo(n),e,t,i,s,r,1);break}}}function pP(n){const e=n.prev,t=n,i=n.next;if(Ut(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=sr?s>o?s:o:r>o?r:o,d=a>l?a>c?a:c:l>c?l:c;let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=h&&p.y>=f&&p.y<=d&&Yo(s,a,r,l,o,c,p.x,p.y)&&Ut(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function mP(n,e,t,i){const s=n.prev,r=n,o=n.next;if(Ut(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,u=s.y,f=r.y,h=o.y,d=al?a>c?a:c:l>c?l:c,g=u>f?u>h?u:h:f>h?f:h,m=em(d,p,e,t,i),y=em(_,g,e,t,i);let x=n.prevZ,v=n.nextZ;for(;x&&x.z>=m&&v&&v.z<=y;){if(x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Yo(a,u,l,f,c,h,x.x,x.y)&&Ut(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Yo(a,u,l,f,c,h,v.x,v.y)&&Ut(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=m;){if(x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Yo(a,u,l,f,c,h,x.x,x.y)&&Ut(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Yo(a,u,l,f,c,h,v.x,v.y)&&Ut(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function gP(n,e,t){let i=n;do{const s=i.prev,r=i.next.next;!Hh(s,r)&&vM(s,i,i.next,r)&&Hl(s,r)&&Hl(r,s)&&(e.push(s.i/t|0),e.push(i.i/t|0),e.push(r.i/t|0),Gl(i),Gl(i.next),i=n=r),i=i.next}while(i!==n);return fo(i)}function _P(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&wP(o,a)){let l=yM(o,a);o=fo(o,o.next),l=fo(l,l.next),zl(o,e,t,i,s,r,0),zl(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function vP(n,e,t,i){const s=[];let r,o,a,l,c;for(r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const h=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=r&&h>i&&(i=h,s=t.x=t.x&&t.x>=l&&r!==t.x&&Yo(os.x||t.x===s.x&&SP(s,t)))&&(s=t,u=f)),t=t.next;while(t!==a);return s}function SP(n,e){return Ut(n.prev,n,e.prev)<0&&Ut(e.next,n,n.next)<0}function MP(n,e,t,i){let s=n;do s.z===0&&(s.z=em(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,EP(s)}function EP(n){let e,t,i,s,r,o,a,l,c=1;do{for(t=n,n=null,r=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(s=t,t=t.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;t=i}r.nextZ=null,c*=2}while(o>1);return n}function em(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 TP(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 wP(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!AP(n,e)&&(Hl(n,e)&&Hl(e,n)&&CP(n,e)&&(Ut(n.prev,n,e.prev)||Ut(n,e.prev,e))||Hh(n,e)&&Ut(n.prev,n,n.next)>0&&Ut(e.prev,e,e.next)>0)}function Ut(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Hh(n,e){return n.x===e.x&&n.y===e.y}function vM(n,e,t,i){const s=pu(Ut(n,e,t)),r=pu(Ut(n,e,i)),o=pu(Ut(t,i,n)),a=pu(Ut(t,i,e));return!!(s!==r&&o!==a||s===0&&du(n,t,e)||r===0&&du(n,i,e)||o===0&&du(t,n,i)||a===0&&du(t,e,i))}function du(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 pu(n){return n>0?1:n<0?-1:0}function AP(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&&vM(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Hl(n,e){return Ut(n.prev,n,n.next)<0?Ut(n,e,n.next)>=0&&Ut(n,n.prev,e)>=0:Ut(n,e,n.prev)<0||Ut(n,n.next,e)<0}function CP(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 yM(n,e){const t=new tm(n.i,n.x,n.y),i=new tm(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 av(n,e,t,i){const s=new tm(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 Gl(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 tm(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function RP(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function cv(n,e){for(let t=0;tNumber.EPSILON){const U=Math.sqrt(C),z=Math.sqrt(V*V+A*A),Y=L.x-N/U,he=L.y+R/U,ce=w.x-A/z,ye=w.y+V/z,Fe=((ce-Y)*A-(ye-he)*V)/(R*A-N*V);j=Y+R*Fe-I.x,G=he+N*Fe-I.y;const me=j*j+G*G;if(me<=2)return new fe(j,G);q=Math.sqrt(me/2)}else{let U=!1;R>Number.EPSILON?V>Number.EPSILON&&(U=!0):R<-Number.EPSILON?V<-Number.EPSILON&&(U=!0):Math.sign(N)===Math.sign(A)&&(U=!0),U?(j=-N,G=R,q=Math.sqrt(C)):(j=R,G=N,q=Math.sqrt(C/2))}return new fe(j/q,G/q)}const pe=[];for(let I=0,L=$.length,w=L-1,j=I+1;I=0;I--){const L=I/g,w=d*Math.cos(L*Math.PI/2),j=p*Math.sin(L*Math.PI/2)+_;for(let G=0,q=$.length;G=0;){const j=w;let G=w-1;G<0&&(G=I.length-1);for(let q=0,R=u+g*2;q0)&&d.push(x,v,T),(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 EM extends xn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new we(16777215),this.specular=new we(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,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 TM extends xn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new we(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(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 wM extends xn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(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 AM extends xn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new we(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,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 zg extends xn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BS,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 Hg extends xn{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 CM extends xn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new we(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(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 RM extends Nn{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 jr(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function PM(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function IM(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 nm(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 Gg(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 DP(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){f.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*f+u,y=m+f-u;_=a.values.slice(m,y)}else{const m=a.createInterpolant(),y=u,x=f-u;m.evaluate(r),_=m.resultBuffer.slice(y,x)}l==="quaternion"&&new Wn().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&&PM(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()===Gu,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}}Di.prototype.TimeBufferType=Float32Array;Di.prototype.ValueBufferType=Float32Array;Di.prototype.DefaultInterpolation=Xf;class go extends Di{constructor(e,t,i){super(e,t,i)}}go.prototype.ValueTypeName="bool";go.prototype.ValueBufferType=Array;go.prototype.DefaultInterpolation=Ol;go.prototype.InterpolantFactoryMethodLinear=void 0;go.prototype.InterpolantFactoryMethodSmooth=void 0;class Xg extends Di{}Xg.prototype.ValueTypeName="color";class Wl extends Di{}Wl.prototype.ValueTypeName="number";class OM extends vc{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)Wn.slerpFlat(r,0,o,c-a,o,c,l);return r}}class yc extends Di{InterpolantFactoryMethodLinear(e){return new OM(this.times,this.values,this.getValueSize(),e)}}yc.prototype.ValueTypeName="quaternion";yc.prototype.InterpolantFactoryMethodSmooth=void 0;class _o extends Di{constructor(e,t,i){super(e,t,i)}}_o.prototype.ValueTypeName="string";_o.prototype.ValueBufferType=Array;_o.prototype.DefaultInterpolation=Ol;_o.prototype.InterpolantFactoryMethodLinear=void 0;_o.prototype.InterpolantFactoryMethodSmooth=void 0;class Xl extends Di{}Xl.prototype.ValueTypeName="vector";class $l{constructor(e="",t=-1,i=[],s=Ah){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=Zn(),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(FP(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(Di.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const f=u[1];let h=s[f];h||(s[f]=h=[]),h.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(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,h,d,p,_){if(d.length!==0){const g=[],m=[];Gg(d,g,m,p),g.length!==0&&_.push(new f(h,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 f=0;f{t&&t(r),this.manager.itemEnd(e)},0),r;if(rs[e]!==void 0){rs[e].push({onLoad:t,onProgress:i,onError:s});return}rs[e]=[],rs[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=rs[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=h?parseInt(h):0,p=d!==0;let _=0;const g=new ReadableStream({start(m){y();function y(){f.read().then(({done:x,value:v})=>{if(x)m.close();else{_+=v.byteLength;const E=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:d});for(let T=0,M=u.length;T{m.error(x)})}}});return new Response(g)}else throw new BP(`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===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),h=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(h);return c.arrayBuffer().then(p=>d.decode(p))}}}).then(c=>{ms.add(e,c);const u=rs[e];delete rs[e];for(let f=0,h=u.length;f{const u=rs[e];if(u===void 0)throw this.manager.itemError(e),c;delete rs[e];for(let f=0,h=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class kP extends $n{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new ws(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 we().setHex(o.value);break;case"v2":s.uniforms[r].value=new fe().fromArray(o.value);break;case"v3":s.uniforms[r].value=new F().fromArray(o.value);break;case"v4":s.uniforms[r].value=new ht().fromArray(o.value);break;case"m3":s.uniforms[r].value=new Qe().fromArray(o.value);break;case"m4":s.uniforms[r].value=new Xe().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 fe().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 fe().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 Jh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:bM,SpriteMaterial:Pg,RawShaderMaterial:SM,ShaderMaterial:Ri,PointsMaterial:Lg,MeshPhysicalMaterial:MM,MeshStandardMaterial:Vg,MeshPhongMaterial:EM,MeshToonMaterial:TM,MeshNormalMaterial:wM,MeshLambertMaterial:AM,MeshDepthMaterial:zg,MeshDistanceMaterial:Hg,MeshBasicMaterial:Rs,MeshMatcapMaterial:CM,LineDashedMaterial:RM,LineBasicMaterial:Nn,Material:xn};return new t[e]}}class im{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i0){const l=new $g(t);r=new ql(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){s=new ql(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const g=new On;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const m=new _n;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:g,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new sM;break;case"Line":o=new rr(a(e.geometry),l(e.material));break;case"LineLoop":o=new lM(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ki(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new cM(a(e.geometry),l(e.material));break;case"Sprite":o=new iM(l(e.material));break;case"Group":o=new qo;break;case"Bone":o=new Ig;break;default:o=new ct}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 h=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=ms.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 ms.add(e,c),t&&t(c),r.manager.itemEnd(e),c}).catch(function(c){s&&s(c),ms.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});ms.add(e,l),r.manager.itemStart(e)}}let mu;class Yg{static getContext(){return mu===void 0&&(mu=new(window.AudioContext||window.webkitAudioContext)),mu}static setContext(e){mu=e}}class KP extends $n{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new ws(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);Yg.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}const _v=new Xe,vv=new Xe,Rr=new Xe;class ZP{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new $t,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new $t,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,Rr.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(to*t.fov*.5)/t.zoom;let a,l;vv.elements[12]=-s,_v.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,Rr.elements[0]=2*t.near/(l-a),Rr.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Rr),a=-o*t.aspect-r,l=o*t.aspect-r,Rr.elements[0]=2*t.near/(l-a),Rr.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Rr)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(vv),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(_v)}}class $M extends $t{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class Qh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=yv(),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=yv();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function yv(){return performance.now()}const Pr=new F,xv=new Wn,JP=new F,Ir=new F;class QP extends ct{constructor(){super(),this.type="AudioListener",this.context=Yg.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Qh}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(Pr,xv,JP),Ir.set(0,0,-1).applyQuaternion(xv),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Pr.x,s),t.positionY.linearRampToValueAtTime(Pr.y,s),t.positionZ.linearRampToValueAtTime(Pr.z,s),t.forwardX.linearRampToValueAtTime(Ir.x,s),t.forwardY.linearRampToValueAtTime(Ir.y,s),t.forwardZ.linearRampToValueAtTime(Ir.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(Pr.x,Pr.y,Pr.z),t.setOrientation(Ir.x,Ir.y,Ir.z,i.x,i.y,i.z)}}class qM extends ct{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){Wn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Wn.multiplyQuaternionsFlat(e,o,e,t,e,i),Wn.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 jg="\\[\\]\\.:\\/",iI=new RegExp("["+jg+"]","g"),Kg="[^"+jg+"]",sI="[^"+jg.replace("\\.","")+"]",rI=/((?:WC+[\/:])*)/.source.replace("WC",Kg),oI=/(WCOD+)?/.source.replace("WCOD",sI),aI=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kg),lI=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kg),cI=new RegExp("^"+rI+oI+aI+lI+"$"),uI=["material","materials","bones","map"];class fI{constructor(e,t,i){const s=i||ft.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 ft{constructor(e,t,i){this.path=t,this.parsedPath=i||ft.parseTrackName(t),this.node=ft.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 ft.Composite(e,t,i):new ft(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(iI,"")}static parseTrackName(e){const t=cI.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);uI.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 f=r++,h=e[f];t[h.uuid]=u,e[u]=h,t[c]=f,e[f]=l;for(let d=0,p=s;d!==p;++d){const _=i[d],g=_[f],m=_[u];_[u]=g,_[f]=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,f=t[u];if(f!==void 0)if(delete t[u],f0&&(t[d.uuid]=f),e[f]=d,e.pop();for(let p=0,_=s;p!==_;++p){const g=i[p];g[f]=g[h],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_,f=new Array(c);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(f);for(let h=u,d=l.length;h!==d;++h){const p=l[h];f[h]=new ft(p,e,t)}return f}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 jM{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:qr,endingEnd:qr};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=US,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){if(e.fadeOut(t),this.fadeIn(t),i){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){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 Eg:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case Ah:default:for(let u=0,f=l.length;u!==f;++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===FS;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===NS){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=Yr,s.endingEnd=Yr):(e?s.endingStart=this.zeroSlopeAtStart?Yr:qr:s.endingStart=Nl,t?s.endingEnd=this.zeroSlopeAtEnd?Yr:qr:s.endingEnd=Nl)}_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 dI=new Float32Array(1);class pI extends ji{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 f=0;f!==r;++f){const h=s[f],d=h.name;let p=u[d];if(p!==void 0)++p.referenceCount,o[f]=p;else{if(p=o[f],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,d));continue}const _=t&&t._propertyBindings[f].binding.parsedPath;p=new YM(ft.create(i,d,_),h.ValueTypeName,h.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,d),o[f]=p}a[f].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,Ev).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 Tv=new F,gu=new F;class EI{constructor(e=new F,t=new F){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){Tv.subVectors(e,this.start),gu.subVectors(this.end,this.start);const i=gu.dot(gu);let r=gu.dot(Tv)/i;return t&&(r=Ke(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 wv=new F;class TI extends ct{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new rt,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 f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Iv.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Iv,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 BI extends Ki{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 rt;s.setAttribute("position",new Ue(t,3)),s.setAttribute("color",new Ue(i,3));const r=new Nn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new we,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 kI{constructor(){this.type="ShapePath",this.color=new we,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Vl,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 y=[];for(let x=0,v=m.length;xNumber.EPSILON){if(S<0&&(M=y[T],b=-b,P=y[E],S=-S),m.yP.y)continue;if(m.y===M.y){if(m.x===M.x)return!0}else{const D=S*(m.x-M.x)-b*(m.y-M.y);if(D===0)return!0;if(D<0)continue;v=!v}}else{if(m.y!==M.y)continue;if(P.x<=m.x&&m.x<=M.x||M.x<=m.x&&m.x<=P.x)return!0}}return v}const s=Wi.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 no,l.curves=a.curves,c.push(l),c;let u=!s(r[0].getPoints());u=e?!u:u;const f=[],h=[];let d=[],p=0,_;h[p]=void 0,d[p]=[];for(let m=0,y=r.length;m1){let m=!1,y=0;for(let x=0,v=h.length;x0&&m===!1&&(d=f)}let g;for(let m=0,y=h.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 HI(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 GI(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function rm(n,e,t,i){const s=WI(i);switch(t){case vg:return n*e;case xg:return n*e;case bg:return n*e*2;case Eh:return n*e/s.components*s.byteLength;case uc:return n*e/s.components*s.byteLength;case Sg:return n*e*2/s.components*s.byteLength;case Th:return n*e*2/s.components*s.byteLength;case yg:return n*e*3/s.components*s.byteLength;case Ln:return n*e*4/s.components*s.byteLength;case wh:return n*e*4/s.components*s.byteLength;case el:case tl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case nl:case il:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case xf:case Sf:return Math.max(n,16)*Math.max(e,8)/4;case yf:case bf:return Math.max(n,8)*Math.max(e,8)/2;case Mf:case Ef:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Tf:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case wf:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Af:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case Cf:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case Rf:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case Pf:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case If:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case Lf:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case Df:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Of:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Nf:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Uf:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Ff:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Bf:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case kf:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case sl:case Vf:case zf:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Mg:case Hf:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Gf:case Wf:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function WI(n){switch(n){case qi:case mg:return{byteLength:1,components:1};case oa:case gg:case va:return{byteLength:2,components:1};case Sh:case Mh:return{byteLength:2,components:4};case Ts:case bh:case Hn:return{byteLength:4,components:1};case _g:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class XI{static contain(e,t){return zI(e,t)}static cover(e,t){return HI(e,t)}static fill(e){return GI(e)}static getByteLength(e,t,i,s){return rm(e,t,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:lc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=lc);/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */function JM(){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 $I(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,f=c.byteLength,h=n.createBuffer();n.bindBuffer(l,h),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:h,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const u=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,u);else{f.sort((d,p)=>d.start-p.start);let h=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`,cL=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,uL=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,fL=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,hL=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,dL=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,pL=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,mL=`#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`,gL=`#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`,_L=`#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`,vL=`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`,yL=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,xL=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,bL=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,SL=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,ML="gl_FragColor = linearToOutputTexel( gl_FragColor );",EL=`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 ); +}`,TL=`#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`,wL=`#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`,AL=`#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`,CL=`#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`,RL=`#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`,PL=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,IL=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,LL=`#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`,DL=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,OL=`#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 +}`,NL=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,UL=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,FL=`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`,BL=`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`,kL=`#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`,VL=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,zL=`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`,HL=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,GL=`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`,WL=`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`,XL=`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 ); +}`,$L=` +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`,qL=`#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`,YL=`#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`,jL=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,KL=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,ZL=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,JL=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,QL=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,e2=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,t2=`#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`,n2=`#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`,i2=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,s2=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,r2=`#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`,o2=`#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`,a2=`#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`,l2=`#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`,c2=`#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`,u2=`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;`,f2=`#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`,h2=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,d2=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,p2=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,m2=`#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`,g2=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,_2=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,v2=`#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`,y2=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,x2=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,b2=`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 ); +}`,S2=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,M2=`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;`,E2=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,T2=`#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`,w2=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,A2=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,C2=`#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`,R2=`#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`,P2=`#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`,I2=`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; +}`,L2=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,D2=`#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`,O2=`#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`,N2=`#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`,U2=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,F2=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,B2=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,k2=`#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; }`,V2=`#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`,z2=`#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`,H2=`#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`,G2=`#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`,W2=`#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`,X2=`#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 $2=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,q2=`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 +}`,Y2=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,j2=`#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 +}`,K2=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,Z2=`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 +}`,J2=`#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; +}`,Q2=`#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 +}`,e3=`#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; +}`,t3=`#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 ); +}`,n3=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,i3=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,s3=`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 +}`,r3=`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 +}`,o3=`#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 +}`,a3=`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 +}`,l3=`#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 +}`,c3=`#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 +}`,u3=`#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; +}`,f3=`#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 +}`,h3=`#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 +}`,d3=`#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 +}`,p3=`#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 +}`,m3=`#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 +}`,g3=`#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 +}`,_3=`#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 +}`,v3=`#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 +}`,y3=`#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 +}`,x3=`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 +}`,b3=`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 +}`,S3=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,M3=`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 +}`,E3=`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 +}`,T3=`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 +}`,st={alphahash_fragment:qI,alphahash_pars_fragment:YI,alphamap_fragment:jI,alphamap_pars_fragment:KI,alphatest_fragment:ZI,alphatest_pars_fragment:JI,aomap_fragment:QI,aomap_pars_fragment:eL,batching_pars_vertex:tL,batching_vertex:nL,begin_vertex:iL,beginnormal_vertex:sL,bsdfs:rL,iridescence_fragment:oL,bumpmap_pars_fragment:aL,clipping_planes_fragment:lL,clipping_planes_pars_fragment:cL,clipping_planes_pars_vertex:uL,clipping_planes_vertex:fL,color_fragment:hL,color_pars_fragment:dL,color_pars_vertex:pL,color_vertex:mL,common:gL,cube_uv_reflection_fragment:_L,defaultnormal_vertex:vL,displacementmap_pars_vertex:yL,displacementmap_vertex:xL,emissivemap_fragment:bL,emissivemap_pars_fragment:SL,colorspace_fragment:ML,colorspace_pars_fragment:EL,envmap_fragment:TL,envmap_common_pars_fragment:wL,envmap_pars_fragment:AL,envmap_pars_vertex:CL,envmap_physical_pars_fragment:kL,envmap_vertex:RL,fog_vertex:PL,fog_pars_vertex:IL,fog_fragment:LL,fog_pars_fragment:DL,gradientmap_pars_fragment:OL,lightmap_pars_fragment:NL,lights_lambert_fragment:UL,lights_lambert_pars_fragment:FL,lights_pars_begin:BL,lights_toon_fragment:VL,lights_toon_pars_fragment:zL,lights_phong_fragment:HL,lights_phong_pars_fragment:GL,lights_physical_fragment:WL,lights_physical_pars_fragment:XL,lights_fragment_begin:$L,lights_fragment_maps:qL,lights_fragment_end:YL,logdepthbuf_fragment:jL,logdepthbuf_pars_fragment:KL,logdepthbuf_pars_vertex:ZL,logdepthbuf_vertex:JL,map_fragment:QL,map_pars_fragment:e2,map_particle_fragment:t2,map_particle_pars_fragment:n2,metalnessmap_fragment:i2,metalnessmap_pars_fragment:s2,morphinstance_vertex:r2,morphcolor_vertex:o2,morphnormal_vertex:a2,morphtarget_pars_vertex:l2,morphtarget_vertex:c2,normal_fragment_begin:u2,normal_fragment_maps:f2,normal_pars_fragment:h2,normal_pars_vertex:d2,normal_vertex:p2,normalmap_pars_fragment:m2,clearcoat_normal_fragment_begin:g2,clearcoat_normal_fragment_maps:_2,clearcoat_pars_fragment:v2,iridescence_pars_fragment:y2,opaque_fragment:x2,packing:b2,premultiplied_alpha_fragment:S2,project_vertex:M2,dithering_fragment:E2,dithering_pars_fragment:T2,roughnessmap_fragment:w2,roughnessmap_pars_fragment:A2,shadowmap_pars_fragment:C2,shadowmap_pars_vertex:R2,shadowmap_vertex:P2,shadowmask_pars_fragment:I2,skinbase_vertex:L2,skinning_pars_vertex:D2,skinning_vertex:O2,skinnormal_vertex:N2,specularmap_fragment:U2,specularmap_pars_fragment:F2,tonemapping_fragment:B2,tonemapping_pars_fragment:k2,transmission_fragment:V2,transmission_pars_fragment:z2,uv_pars_fragment:H2,uv_pars_vertex:G2,uv_vertex:W2,worldpos_vertex:X2,background_vert:$2,background_frag:q2,backgroundCube_vert:Y2,backgroundCube_frag:j2,cube_vert:K2,cube_frag:Z2,depth_vert:J2,depth_frag:Q2,distanceRGBA_vert:e3,distanceRGBA_frag:t3,equirect_vert:n3,equirect_frag:i3,linedashed_vert:s3,linedashed_frag:r3,meshbasic_vert:o3,meshbasic_frag:a3,meshlambert_vert:l3,meshlambert_frag:c3,meshmatcap_vert:u3,meshmatcap_frag:f3,meshnormal_vert:h3,meshnormal_frag:d3,meshphong_vert:p3,meshphong_frag:m3,meshphysical_vert:g3,meshphysical_frag:_3,meshtoon_vert:v3,meshtoon_frag:y3,points_vert:x3,points_frag:b3,shadow_vert:S3,shadow_frag:M3,sprite_vert:E3,sprite_frag:T3},Ee={common:{diffuse:{value:new we(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Qe}},envmap:{envMap:{value:null},envMapRotation:{value:new Qe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Qe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Qe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Qe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Qe},normalScale:{value:new fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Qe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Qe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Qe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Qe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new we(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 we(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0},uvTransform:{value:new Qe}},sprite:{diffuse:{value:new we(16777215)},opacity:{value:1},center:{value:new fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}}},bi={basic:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.fog]),vertexShader:st.meshbasic_vert,fragmentShader:st.meshbasic_frag},lambert:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)}}]),vertexShader:st.meshlambert_vert,fragmentShader:st.meshlambert_frag},phong:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)},specular:{value:new we(1118481)},shininess:{value:30}}]),vertexShader:st.meshphong_vert,fragmentShader:st.meshphong_frag},standard:{uniforms:En([Ee.common,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.roughnessmap,Ee.metalnessmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:st.meshphysical_vert,fragmentShader:st.meshphysical_frag},toon:{uniforms:En([Ee.common,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.gradientmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)}}]),vertexShader:st.meshtoon_vert,fragmentShader:st.meshtoon_frag},matcap:{uniforms:En([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,{matcap:{value:null}}]),vertexShader:st.meshmatcap_vert,fragmentShader:st.meshmatcap_frag},points:{uniforms:En([Ee.points,Ee.fog]),vertexShader:st.points_vert,fragmentShader:st.points_frag},dashed:{uniforms:En([Ee.common,Ee.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:st.linedashed_vert,fragmentShader:st.linedashed_frag},depth:{uniforms:En([Ee.common,Ee.displacementmap]),vertexShader:st.depth_vert,fragmentShader:st.depth_frag},normal:{uniforms:En([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,{opacity:{value:1}}]),vertexShader:st.meshnormal_vert,fragmentShader:st.meshnormal_frag},sprite:{uniforms:En([Ee.sprite,Ee.fog]),vertexShader:st.sprite_vert,fragmentShader:st.sprite_frag},background:{uniforms:{uvTransform:{value:new Qe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:st.background_vert,fragmentShader:st.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Qe}},vertexShader:st.backgroundCube_vert,fragmentShader:st.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:st.cube_vert,fragmentShader:st.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:st.equirect_vert,fragmentShader:st.equirect_frag},distanceRGBA:{uniforms:En([Ee.common,Ee.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:st.distanceRGBA_vert,fragmentShader:st.distanceRGBA_frag},shadow:{uniforms:En([Ee.lights,Ee.fog,{color:{value:new we(0)},opacity:{value:1}}]),vertexShader:st.shadow_vert,fragmentShader:st.shadow_frag}};bi.physical={uniforms:En([bi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Qe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Qe},clearcoatNormalScale:{value:new fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Qe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Qe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Qe},sheen:{value:0},sheenColor:{value:new we(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Qe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Qe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Qe},transmissionSamplerSize:{value:new fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Qe},attenuationDistance:{value:0},attenuationColor:{value:new we(0)},specularColor:{value:new we(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Qe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Qe},anisotropyVector:{value:new fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Qe}}]),vertexShader:st.meshphysical_vert,fragmentShader:st.meshphysical_frag};const Su={r:0,b:0,g:0},Or=new ei,w3=new Xe;function A3(n,e,t,i,s,r,o){const a=new we(0);let l=r===!0?0:1,c,u,f=null,h=0,d=null;function p(x){let v=x.isScene===!0?x.background:null;return v&&v.isTexture&&(v=(x.backgroundBlurriness>0?t:e).get(v)),v}function _(x){let v=!1;const E=p(x);E===null?m(a,l):E&&E.isColor&&(m(E,1),v=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&(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(x,v){const E=p(v);E&&(E.isCubeTexture||E.mapping===_a)?(u===void 0&&(u=new Ht(new mo(1,1,1),new Ri({name:"BackgroundCubeMaterial",uniforms:la(bi.backgroundCube.uniforms),vertexShader:bi.backgroundCube.vertexShader,fragmentShader:bi.backgroundCube.fragmentShader,side:Dn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,M,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Or.copy(v.backgroundRotation),Or.x*=-1,Or.y*=-1,Or.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Or.y*=-1,Or.z*=-1),u.material.uniforms.envMap.value=E,u.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(w3.makeRotationFromEuler(Or)),u.material.toneMapped=at.getTransfer(E.colorSpace)!==St,(f!==E||h!==E.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,f=E,h=E.version,d=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):E&&E.isTexture&&(c===void 0&&(c=new Ht(new ba(2,2),new Ri({name:"BackgroundMaterial",uniforms:la(bi.background.uniforms),vertexShader:bi.background.vertexShader,fragmentShader:bi.background.fragmentShader,side:Ms,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=E,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=at.getTransfer(E.colorSpace)!==St,E.matrixAutoUpdate===!0&&E.updateMatrix(),c.material.uniforms.uvTransform.value.copy(E.matrix),(f!==E||h!==E.version||d!==n.toneMapping)&&(c.material.needsUpdate=!0,f=E,h=E.version,d=n.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function m(x,v){x.getRGB(Su,JS(n)),i.buffers.color.setClear(Su.r,Su.g,Su.b,v,o)}function y(){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(x,v=1){a.set(x),l=v,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,m(a,l)},render:_,addToRenderList:g,dispose:y}}function C3(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=h(null);let r=s,o=!1;function a(S,D,B,H,$){let ee=!1;const Z=f(H,B,D);r!==Z&&(r=Z,c(r.object)),ee=d(S,H,B,$),ee&&p(S,H,B,$),$!==null&&e.update($,n.ELEMENT_ARRAY_BUFFER),(ee||o)&&(o=!1,v(S,D,B,H),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return n.createVertexArray()}function c(S){return n.bindVertexArray(S)}function u(S){return n.deleteVertexArray(S)}function f(S,D,B){const H=B.wireframe===!0;let $=i[S.id];$===void 0&&($={},i[S.id]=$);let ee=$[D.id];ee===void 0&&(ee={},$[D.id]=ee);let Z=ee[H];return Z===void 0&&(Z=h(l()),ee[H]=Z),Z}function h(S){const D=[],B=[],H=[];for(let $=0;$=0){const ve=$[Q];let se=ee[Q];if(se===void 0&&(Q==="instanceMatrix"&&S.instanceMatrix&&(se=S.instanceMatrix),Q==="instanceColor"&&S.instanceColor&&(se=S.instanceColor)),ve===void 0||ve.attribute!==se||se&&ve.data!==se.data)return!0;Z++}return r.attributesNum!==Z||r.index!==H}function p(S,D,B,H){const $={},ee=D.attributes;let Z=0;const te=B.getAttributes();for(const Q in te)if(te[Q].location>=0){let ve=ee[Q];ve===void 0&&(Q==="instanceMatrix"&&S.instanceMatrix&&(ve=S.instanceMatrix),Q==="instanceColor"&&S.instanceColor&&(ve=S.instanceColor));const se={};se.attribute=ve,ve&&ve.data&&(se.data=ve.data),$[Q]=se,Z++}r.attributes=$,r.attributesNum=Z,r.index=H}function _(){const S=r.newAttributes;for(let D=0,B=S.length;D=0){let pe=$[te];if(pe===void 0&&(te==="instanceMatrix"&&S.instanceMatrix&&(pe=S.instanceMatrix),te==="instanceColor"&&S.instanceColor&&(pe=S.instanceColor)),pe!==void 0){const ve=pe.normalized,se=pe.itemSize,xe=e.get(pe);if(xe===void 0)continue;const ze=xe.buffer,re=xe.type,ge=xe.bytesPerElement,be=re===n.INT||re===n.UNSIGNED_INT||pe.gpuType===bh;if(pe.isInterleavedBufferAttribute){const W=pe.data,ae=W.stride,ue=pe.offset;if(W.isInstancedInterleavedBuffer){for(let le=0;le0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="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 f=t.logarithmicDepthBuffer===!0,h=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),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),E=p>0,T=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:y,maxVaryings:x,maxFragmentUniforms:v,vertexTextures:E,maxSamples:T}}function I3(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new Ys,a=new Qe,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const d=f.length!==0||h||i!==0||s;return s=h,i=f.length,d},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,h){t=u(f,h,0)},this.setState=function(f,h,d){const p=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,m=n.get(f);if(!s||p===null||p.length===0||r&&!g)r?u(null):c();else{const y=r?0:i,x=y*4;let v=m.clippingState||null;l.value=v,v=u(p,h,x,d);for(let E=0;E!==x;++E)v[E]=t[E];m.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,d,p){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=d+_*4,y=h.matrixWorldInverse;a.getNormalMatrix(y),(g===null||g.length0){const c=new tM(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 jo=4,Lv=[.125,.215,.35,.446,.526,.582],Wr=20,op=new Zh,Dv=new we;let ap=null,lp=0,cp=0,up=!1;const zr=(1+Math.sqrt(5))/2,ko=1/zr,Ov=[new F(-zr,ko,0),new F(zr,ko,0),new F(-ko,0,zr),new F(ko,0,zr),new F(0,zr,-ko),new F(0,zr,ko),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],D3=new F;class om{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=D3}=r;ap=this._renderer.getRenderTarget(),lp=this._renderer.getActiveCubeFace(),cp=this._renderer.getActiveMipmapLevel(),up=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=Fv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Uv(),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?v:0,v,v),f.setRenderTarget(s),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=d,f.autoClear=h,e.background=m}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===Es||e.mapping===sr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Fv()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Uv());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Ht(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Mu(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,op)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rWr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Wr}`);const m=[];let y=0;for(let M=0;Mx-jo?s-x+jo:0),T=4*(this._cubeSize-v);Mu(t,E,T,3*v,2*v),l.setRenderTarget(t),l.render(f,op)}}function O3(n){const e=[],t=[],i=[];let s=n;const r=n-jo+1+Lv.length;for(let o=0;on-jo?l=Lv[o-n+jo-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,p=6,_=3,g=2,m=1,y=new Float32Array(_*p*d),x=new Float32Array(g*p*d),v=new Float32Array(m*p*d);for(let T=0;T2?0:-1,b=[M,P,0,M+2/3,P,0,M+2/3,P+1,0,M,P,0,M+2/3,P+1,0,M,P+1,0];y.set(b,_*p*T),x.set(h,g*p*T);const S=[T,T,T,T,T,T];v.set(S,m*p*T)}const E=new rt;E.setAttribute("position",new Et(y,_)),E.setAttribute("uv",new Et(x,g)),E.setAttribute("faceIndex",new Et(v,m)),e.push(E),s>jo&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Nv(n,e,t){const i=new Yi(n,e,t);return i.texture.mapping=_a,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Mu(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function N3(n,e,t){const i=new Float32Array(Wr),s=new F(0,1,0);return new Ri({name:"SphericalGaussianBlur",defines:{n:Wr,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:Qg(),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:ys,depthTest:!1,depthWrite:!1})}function Uv(){return new Ri({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Qg(),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:ys,depthTest:!1,depthWrite:!1})}function Fv(){return new Ri({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Qg(),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:ys,depthTest:!1,depthWrite:!1})}function Qg(){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 U3(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Pl||l===Il,u=l===Es||l===sr;if(c||u){let f=e.get(a);const h=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return t===null&&(t=new om(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const d=a.image;return c&&d&&d.height>0||u&&d&&s(d)?(t===null&&(t=new om(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",r),f.texture):null}}}return a}function s(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const T=new Float32Array(v*E*4*f),M=new fc(T,v,E,f);M.type=Hn,M.needsUpdate=!0;const P=x*4;for(let S=0;S0)return n;const s=e*t;let r=kv[s];if(r===void 0&&(r=new Float32Array(s),kv[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 Jt(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}const $v=new Qe;function UD(n){at._getMatrix($v,at.workingColorSpace,n);const e=`mat3( ${$v.elements.map(t=>t.toFixed(4))} )`;switch(at.getTransfer(n)){case Ul:return[e,"LinearTransferOETF"];case St:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function qv(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+` + +`+ND(n.getShaderSource(e),o)}else return s}function FD(n,e){const t=UD(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` +`)}function BD(n,e){let t;switch(e){case CS:t="Linear";break;case RS:t="Reinhard";break;case PS:t="Cineon";break;case yh:t="ACESFilmic";break;case LS:t="AgX";break;case DS:t="Neutral";break;case IS:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Eu=new F;function kD(){at.getLuminanceCoefficients(Eu);const n=Eu.x.toFixed(4),e=Eu.y.toFixed(4),t=Eu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`)}function VD(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter($a).join(` +`)}function zD(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function HD(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function am(n){return n.replace(GD,XD)}const WD=new Map;function XD(n,e){let t=st[e];if(t===void 0){const i=WD.get(e);if(i!==void 0)t=st[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 am(t)}const $D=/#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 Kv(n){return n.replace($D,qD)}function qD(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($a).join(` +`),m.length>0&&(m+=` +`)):(g=[Zv(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($a).join(` +`),m=[Zv(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 "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.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!==Hi?"#define TONE_MAPPING":"",t.toneMapping!==Hi?st.tonemapping_pars_fragment:"",t.toneMapping!==Hi?BD("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",st.colorspace_pars_fragment,FD("linearToOutputTexel",t.outputColorSpace),kD(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter($a).join(` +`)),o=am(o),o=Yv(o,t),o=jv(o,t),a=am(a),a=Yv(a,t),a=jv(a,t),o=Kv(o),a=Kv(a),t.isRawShaderMaterial!==!0&&(y=`#version 300 es +`,g=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,m=["#define varying in",t.glslVersion===Jp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Jp?"":"#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 x=y+g+o,v=y+m+a,E=Xv(s,s.VERTEX_SHADER,x),T=Xv(s,s.FRAGMENT_SHADER,v);s.attachShader(_,E),s.attachShader(_,T),t.index0AttributeName!==void 0?s.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);function M(D){if(n.debug.checkShaderErrors){const B=s.getProgramInfoLog(_).trim(),H=s.getShaderInfoLog(E).trim(),$=s.getShaderInfoLog(T).trim();let ee=!0,Z=!0;if(s.getProgramParameter(_,s.LINK_STATUS)===!1)if(ee=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,_,E,T);else{const te=qv(s,E,"vertex"),Q=qv(s,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,s.VALIDATE_STATUS)+` + +Material Name: `+D.name+` +Material Type: `+D.type+` + +Program Info Log: `+B+` +`+te+` +`+Q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(H===""||$==="")&&(Z=!1);Z&&(D.diagnostics={runnable:ee,programLog:B,vertexShader:{log:H,prefix:g},fragmentShader:{log:$,prefix:m}})}s.deleteShader(E),s.deleteShader(T),P=new Xu(s,_),b=HD(s,_)}let P;this.getUniforms=function(){return P===void 0&&M(this),P};let b;this.getAttributes=function(){return b===void 0&&M(this),b};let S=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=s.getProgramParameter(_,DD)),S},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=OD++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}let eO=0;class tO{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 nO(e),t.set(e,i)),i}}class nO{constructor(e){this.id=eO++,this.code=e,this.usedTimes=0}}function iO(n,e,t,i,s,r,o){const a=new Ph,l=new tO,c=new Set,u=[],f=s.logarithmicDepthBuffer,h=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,S,D,B,H){const $=B.fog,ee=H.geometry,Z=b.isMeshStandardMaterial?B.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||Z),Q=te&&te.mapping===_a?te.image.height:null,pe=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 ve=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,se=ve!==void 0?ve.length:0;let xe=0;ee.morphAttributes.position!==void 0&&(xe=1),ee.morphAttributes.normal!==void 0&&(xe=2),ee.morphAttributes.color!==void 0&&(xe=3);let ze,re,ge,be;if(pe){const bt=bi[pe];ze=bt.vertexShader,re=bt.fragmentShader}else ze=b.vertexShader,re=b.fragmentShader,l.update(b),ge=l.getVertexShaderID(b),be=l.getFragmentShaderID(b);const W=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),ue=H.isInstancedMesh===!0,le=H.isBatchedMesh===!0,Oe=!!b.map,I=!!b.matcap,L=!!te,w=!!b.aoMap,j=!!b.lightMap,G=!!b.bumpMap,q=!!b.normalMap,R=!!b.displacementMap,N=!!b.emissiveMap,V=!!b.metalnessMap,A=!!b.roughnessMap,C=b.anisotropy>0,k=b.clearcoat>0,U=b.dispersion>0,z=b.iridescence>0,Y=b.sheen>0,he=b.transmission>0,ce=C&&!!b.anisotropyMap,ye=k&&!!b.clearcoatMap,Fe=k&&!!b.clearcoatNormalMap,me=k&&!!b.clearcoatRoughnessMap,Te=z&&!!b.iridescenceMap,ke=z&&!!b.iridescenceThicknessMap,We=Y&&!!b.sheenColorMap,Me=Y&&!!b.sheenRoughnessMap,qe=!!b.specularMap,Je=!!b.specularColorMap,Ct=!!b.specularIntensityMap,X=he&&!!b.transmissionMap,Ae=he&&!!b.thicknessMap,oe=!!b.gradientMap,de=!!b.alphaMap,Pe=b.alphaTest>0,Re=!!b.alphaHash,nt=!!b.extensions;let Ft=Hi;b.toneMapped&&(W===null||W.isXRRenderTarget===!0)&&(Ft=n.toneMapping);const un={shaderID:pe,shaderType:b.type,shaderName:b.name,vertexShader:ze,fragmentShader:re,defines:b.defines,customVertexShaderID:ge,customFragmentShaderID:be,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:le,batchingColor:le&&H._colorsTexture!==null,instancing:ue,instancingColor:ue&&H.instanceColor!==null,instancingMorph:ue&&H.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:W===null?n.outputColorSpace:W.isXRRenderTarget===!0?W.texture.colorSpace:co,alphaToCoverage:!!b.alphaToCoverage,map:Oe,matcap:I,envMap:L,envMapMode:L&&te.mapping,envMapCubeUVHeight:Q,aoMap:w,lightMap:j,bumpMap:G,normalMap:q,displacementMap:h&&R,emissiveMap:N,normalMapObjectSpace:q&&b.normalMapType===VS,normalMapTangentSpace:q&&b.normalMapType===ur,metalnessMap:V,roughnessMap:A,anisotropy:C,anisotropyMap:ce,clearcoat:k,clearcoatMap:ye,clearcoatNormalMap:Fe,clearcoatRoughnessMap:me,dispersion:U,iridescence:z,iridescenceMap:Te,iridescenceThicknessMap:ke,sheen:Y,sheenColorMap:We,sheenRoughnessMap:Me,specularMap:qe,specularColorMap:Je,specularIntensityMap:Ct,transmission:he,transmissionMap:X,thicknessMap:Ae,gradientMap:oe,opaque:b.transparent===!1&&b.blending===Qr&&b.alphaToCoverage===!1,alphaMap:de,alphaTest:Pe,alphaHash:Re,combine:b.combine,mapUv:Oe&&_(b.map.channel),aoMapUv:w&&_(b.aoMap.channel),lightMapUv:j&&_(b.lightMap.channel),bumpMapUv:G&&_(b.bumpMap.channel),normalMapUv:q&&_(b.normalMap.channel),displacementMapUv:R&&_(b.displacementMap.channel),emissiveMapUv:N&&_(b.emissiveMap.channel),metalnessMapUv:V&&_(b.metalnessMap.channel),roughnessMapUv:A&&_(b.roughnessMap.channel),anisotropyMapUv:ce&&_(b.anisotropyMap.channel),clearcoatMapUv:ye&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Fe&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:me&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:We&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Me&&_(b.sheenRoughnessMap.channel),specularMapUv:qe&&_(b.specularMap.channel),specularColorMapUv:Je&&_(b.specularColorMap.channel),specularIntensityMapUv:Ct&&_(b.specularIntensityMap.channel),transmissionMapUv:X&&_(b.transmissionMap.channel),thicknessMapUv:Ae&&_(b.thicknessMap.channel),alphaMapUv:de&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(q||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ee.attributes.uv&&(Oe||de),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:ae,skinning:H.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:se,morphTextureStride:xe,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numLightProbes:S.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ft,decodeVideoTexture:Oe&&b.map.isVideoTexture===!0&&at.getTransfer(b.map.colorSpace)===St,decodeVideoTextureEmissive:N&&b.emissiveMap.isVideoTexture===!0&&at.getTransfer(b.emissiveMap.colorSpace)===St,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Si,flipSided:b.side===Dn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:nt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(nt&&b.extensions.multiDraw===!0||le)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return un.vertexUv1s=c.has(1),un.vertexUv2s=c.has(2),un.vertexUv3s=c.has(3),c.clear(),un}function m(b){const S=[];if(b.shaderID?S.push(b.shaderID):(S.push(b.customVertexShaderID),S.push(b.customFragmentShaderID)),b.defines!==void 0)for(const D in b.defines)S.push(D),S.push(b.defines[D]);return b.isRawShaderMaterial===!1&&(y(S,b),x(S,b),S.push(n.outputColorSpace)),S.push(b.customProgramCacheKey),S.join()}function y(b,S){b.push(S.precision),b.push(S.outputColorSpace),b.push(S.envMapMode),b.push(S.envMapCubeUVHeight),b.push(S.mapUv),b.push(S.alphaMapUv),b.push(S.lightMapUv),b.push(S.aoMapUv),b.push(S.bumpMapUv),b.push(S.normalMapUv),b.push(S.displacementMapUv),b.push(S.emissiveMapUv),b.push(S.metalnessMapUv),b.push(S.roughnessMapUv),b.push(S.anisotropyMapUv),b.push(S.clearcoatMapUv),b.push(S.clearcoatNormalMapUv),b.push(S.clearcoatRoughnessMapUv),b.push(S.iridescenceMapUv),b.push(S.iridescenceThicknessMapUv),b.push(S.sheenColorMapUv),b.push(S.sheenRoughnessMapUv),b.push(S.specularMapUv),b.push(S.specularColorMapUv),b.push(S.specularIntensityMapUv),b.push(S.transmissionMapUv),b.push(S.thicknessMapUv),b.push(S.combine),b.push(S.fogExp2),b.push(S.sizeAttenuation),b.push(S.morphTargetsCount),b.push(S.morphAttributeCount),b.push(S.numDirLights),b.push(S.numPointLights),b.push(S.numSpotLights),b.push(S.numSpotLightMaps),b.push(S.numHemiLights),b.push(S.numRectAreaLights),b.push(S.numDirLightShadows),b.push(S.numPointLightShadows),b.push(S.numSpotLightShadows),b.push(S.numSpotLightShadowsWithMaps),b.push(S.numLightProbes),b.push(S.shadowMapType),b.push(S.toneMapping),b.push(S.numClippingPlanes),b.push(S.numClipIntersection),b.push(S.depthPacking)}function x(b,S){a.disableAll(),S.supportsVertexTextures&&a.enable(0),S.instancing&&a.enable(1),S.instancingColor&&a.enable(2),S.instancingMorph&&a.enable(3),S.matcap&&a.enable(4),S.envMap&&a.enable(5),S.normalMapObjectSpace&&a.enable(6),S.normalMapTangentSpace&&a.enable(7),S.clearcoat&&a.enable(8),S.iridescence&&a.enable(9),S.alphaTest&&a.enable(10),S.vertexColors&&a.enable(11),S.vertexAlphas&&a.enable(12),S.vertexUv1s&&a.enable(13),S.vertexUv2s&&a.enable(14),S.vertexUv3s&&a.enable(15),S.vertexTangents&&a.enable(16),S.anisotropy&&a.enable(17),S.alphaHash&&a.enable(18),S.batching&&a.enable(19),S.dispersion&&a.enable(20),S.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),S.fog&&a.enable(0),S.useFog&&a.enable(1),S.flatShading&&a.enable(2),S.logarithmicDepthBuffer&&a.enable(3),S.reverseDepthBuffer&&a.enable(4),S.skinning&&a.enable(5),S.morphTargets&&a.enable(6),S.morphNormals&&a.enable(7),S.morphColors&&a.enable(8),S.premultipliedAlpha&&a.enable(9),S.shadowMapEnabled&&a.enable(10),S.doubleSided&&a.enable(11),S.flipSided&&a.enable(12),S.useDepthPacking&&a.enable(13),S.dithering&&a.enable(14),S.transmission&&a.enable(15),S.sheen&&a.enable(16),S.opaque&&a.enable(17),S.pointsUvs&&a.enable(18),S.decodeVideoTexture&&a.enable(19),S.decodeVideoTextureEmissive&&a.enable(20),S.alphaToCoverage&&a.enable(21),b.push(a.mask)}function v(b){const S=p[b.type];let D;if(S){const B=bi[S];D=QS.clone(B.uniforms)}else D=b.uniforms;return D}function E(b,S){let D;for(let B=0,H=u.length;B0?i.push(m):d.transparent===!0?s.push(m):t.push(m)}function l(f,h,d,p,_,g){const m=o(f,h,d,p,_,g);d.transmission>0?i.unshift(m):d.transparent===!0?s.unshift(m):t.unshift(m)}function c(f,h){t.length>1&&t.sort(f||rO),i.length>1&&i.sort(h||Jv),s.length>1&&s.sort(h||Jv)}function u(){for(let f=e,h=n.length;f=r.length?(o=new Qv,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function aO(){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 F,color:new we};break;case"SpotLight":t={position:new F,direction:new F,color:new we,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new we,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new we,groundColor:new we};break;case"RectAreaLight":t={color:new we,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function lO(){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 fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let cO=0;function uO(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function fO(n){const e=new aO,t=lO(),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 F);const s=new F,r=new Xe,o=new Xe;function a(c){let u=0,f=0,h=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,y=0,x=0,v=0,E=0,T=0,M=0;c.sort(uO);for(let b=0,S=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ee.LTC_FLOAT_1,i.rectAreaLTC2=Ee.LTC_FLOAT_2):(i.rectAreaLTC1=Ee.LTC_HALF_1,i.rectAreaLTC2=Ee.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=h;const P=i.hash;(P.directionalLength!==d||P.pointLength!==p||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==m||P.numDirectionalShadows!==y||P.numPointShadows!==x||P.numSpotShadows!==v||P.numSpotMaps!==E||P.numLightProbes!==M)&&(i.directional.length=d,i.spot.length=_,i.rectArea.length=g,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=v+E-T,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=M,P.directionalLength=d,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=y,P.numPointShadows=x,P.numSpotShadows=v,P.numSpotMaps=E,P.numLightProbes=M,i.version=cO++)}function l(c,u){let f=0,h=0,d=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,y=c.length;m=o.length?(a=new ey(n),o.push(a)):a=o[r],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const dO=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,pO=`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 mO(n,e,t){let i=new pc;const s=new fe,r=new fe,o=new ht,a=new zg({depthPacking:kS}),l=new Hg,c={},u=t.maxTextureSize,f={[Ms]:Dn,[Dn]:Ms,[Si]:Si},h=new Ri({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new fe},radius:{value:4}},vertexShader:dO,fragmentShader:pO}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const p=new rt;p.setAttribute("position",new Et(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ht(p,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=hg;let m=this.type;this.render=function(T,M,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),S=n.getActiveCubeFace(),D=n.getActiveMipmapLevel(),B=n.state;B.setBlending(ys),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const H=m!==Bi&&this.type===Bi,$=m===Bi&&this.type!==Bi;for(let ee=0,Z=T.length;eeu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/pe.x),s.x=r.x*pe.x,Q.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/pe.y),s.y=r.y*pe.y,Q.mapSize.y=r.y)),Q.map===null||H===!0||$===!0){const se=this.type!==Bi?{minFilter:cn,magFilter:cn}:{};Q.map!==null&&Q.map.dispose(),Q.map=new Yi(s.x,s.y,se),Q.map.texture.name=te.name+".shadowMap",Q.camera.updateProjectionMatrix()}n.setRenderTarget(Q.map),n.clear();const ve=Q.getViewportCount();for(let se=0;se0||M.map&&M.alphaTest>0){const B=S.uuid,H=M.uuid;let $=c[B];$===void 0&&($={},c[B]=$);let ee=$[H];ee===void 0&&(ee=S.clone(),$[H]=ee,M.addEventListener("dispose",E)),S=ee}if(S.visible=M.visible,S.wireframe=M.wireframe,b===Bi?S.side=M.shadowSide!==null?M.shadowSide:M.side:S.side=M.shadowSide!==null?M.shadowSide:f[M.side],S.alphaMap=M.alphaMap,S.alphaTest=M.alphaTest,S.map=M.map,S.clipShadows=M.clipShadows,S.clippingPlanes=M.clippingPlanes,S.clipIntersection=M.clipIntersection,S.displacementMap=M.displacementMap,S.displacementScale=M.displacementScale,S.displacementBias=M.displacementBias,S.wireframeLinewidth=M.wireframeLinewidth,S.linewidth=M.linewidth,P.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const B=n.properties.get(S);B.light=P}return S}function v(T,M,P,b,S){if(T.visible===!1)return;if(T.layers.test(M.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&S===Bi)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);const H=e.update(T),$=T.material;if(Array.isArray($)){const ee=H.groups;for(let Z=0,te=ee.length;Z=1):Q.indexOf("OpenGL ES")!==-1&&(te=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),Z=te>=2);let pe=null,ve={};const se=n.getParameter(n.SCISSOR_BOX),xe=n.getParameter(n.VIEWPORT),ze=new ht().fromArray(se),re=new ht().fromArray(xe);function ge(X,Ae,oe,de){const Pe=new Uint8Array(4),Re=n.createTexture();n.bindTexture(X,Re),n.texParameteri(X,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(X,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let nt=0;nt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new fe,u=new WeakMap;let f;const h=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(A,C){return d?new OffscreenCanvas(A,C):kl("canvas")}function _(A,C,k){let U=1;const z=V(A);if((z.width>k||z.height>k)&&(U=k/Math.max(z.width,z.height)),U<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){const Y=Math.floor(U*z.width),he=Math.floor(U*z.height);f===void 0&&(f=p(Y,he));const ce=C?p(Y,he):f;return ce.width=Y,ce.height=he,ce.getContext("2d").drawImage(A,0,0,Y,he),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+z.width+"x"+z.height+") to ("+Y+"x"+he+")."),ce}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+z.width+"x"+z.height+")."),A;return A}function g(A){return A.generateMipmaps}function m(A){n.generateMipmap(A)}function y(A){return A.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:A.isWebGL3DRenderTarget?n.TEXTURE_3D:A.isWebGLArrayRenderTarget||A.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function x(A,C,k,U,z=!1){if(A!==null){if(n[A]!==void 0)return n[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let Y=C;if(C===n.RED&&(k===n.FLOAT&&(Y=n.R32F),k===n.HALF_FLOAT&&(Y=n.R16F),k===n.UNSIGNED_BYTE&&(Y=n.R8)),C===n.RED_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.R8UI),k===n.UNSIGNED_SHORT&&(Y=n.R16UI),k===n.UNSIGNED_INT&&(Y=n.R32UI),k===n.BYTE&&(Y=n.R8I),k===n.SHORT&&(Y=n.R16I),k===n.INT&&(Y=n.R32I)),C===n.RG&&(k===n.FLOAT&&(Y=n.RG32F),k===n.HALF_FLOAT&&(Y=n.RG16F),k===n.UNSIGNED_BYTE&&(Y=n.RG8)),C===n.RG_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RG8UI),k===n.UNSIGNED_SHORT&&(Y=n.RG16UI),k===n.UNSIGNED_INT&&(Y=n.RG32UI),k===n.BYTE&&(Y=n.RG8I),k===n.SHORT&&(Y=n.RG16I),k===n.INT&&(Y=n.RG32I)),C===n.RGB_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RGB8UI),k===n.UNSIGNED_SHORT&&(Y=n.RGB16UI),k===n.UNSIGNED_INT&&(Y=n.RGB32UI),k===n.BYTE&&(Y=n.RGB8I),k===n.SHORT&&(Y=n.RGB16I),k===n.INT&&(Y=n.RGB32I)),C===n.RGBA_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RGBA8UI),k===n.UNSIGNED_SHORT&&(Y=n.RGBA16UI),k===n.UNSIGNED_INT&&(Y=n.RGBA32UI),k===n.BYTE&&(Y=n.RGBA8I),k===n.SHORT&&(Y=n.RGBA16I),k===n.INT&&(Y=n.RGBA32I)),C===n.RGB&&k===n.UNSIGNED_INT_5_9_9_9_REV&&(Y=n.RGB9_E5),C===n.RGBA){const he=z?Ul:at.getTransfer(U);k===n.FLOAT&&(Y=n.RGBA32F),k===n.HALF_FLOAT&&(Y=n.RGBA16F),k===n.UNSIGNED_BYTE&&(Y=he===St?n.SRGB8_ALPHA8:n.RGBA8),k===n.UNSIGNED_SHORT_4_4_4_4&&(Y=n.RGBA4),k===n.UNSIGNED_SHORT_5_5_5_1&&(Y=n.RGB5_A1)}return(Y===n.R16F||Y===n.R32F||Y===n.RG16F||Y===n.RG32F||Y===n.RGBA16F||Y===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Y}function v(A,C){let k;return A?C===null||C===Ts||C===ao?k=n.DEPTH24_STENCIL8:C===Hn?k=n.DEPTH32F_STENCIL8:C===oa&&(k=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===Ts||C===ao?k=n.DEPTH_COMPONENT24:C===Hn?k=n.DEPTH_COMPONENT32F:C===oa&&(k=n.DEPTH_COMPONENT16),k}function E(A,C){return g(A)===!0||A.isFramebufferTexture&&A.minFilter!==cn&&A.minFilter!==jt?Math.log2(Math.max(C.width,C.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?C.mipmaps.length:1}function T(A){const C=A.target;C.removeEventListener("dispose",T),P(C),C.isVideoTexture&&u.delete(C)}function M(A){const C=A.target;C.removeEventListener("dispose",M),S(C)}function P(A){const C=i.get(A);if(C.__webglInit===void 0)return;const k=A.source,U=h.get(k);if(U){const z=U[C.__cacheKey];z.usedTimes--,z.usedTimes===0&&b(A),Object.keys(U).length===0&&h.delete(k)}i.remove(A)}function b(A){const C=i.get(A);n.deleteTexture(C.__webglTexture);const k=A.source,U=h.get(k);delete U[C.__cacheKey],o.memory.textures--}function S(A){const C=i.get(A);if(A.depthTexture&&(A.depthTexture.dispose(),i.remove(A.depthTexture)),A.isWebGLCubeRenderTarget)for(let U=0;U<6;U++){if(Array.isArray(C.__webglFramebuffer[U]))for(let z=0;z=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+s.maxTextures),D+=1,A}function $(A){const C=[];return C.push(A.wrapS),C.push(A.wrapT),C.push(A.wrapR||0),C.push(A.magFilter),C.push(A.minFilter),C.push(A.anisotropy),C.push(A.internalFormat),C.push(A.format),C.push(A.type),C.push(A.generateMipmaps),C.push(A.premultiplyAlpha),C.push(A.flipY),C.push(A.unpackAlignment),C.push(A.colorSpace),C.join()}function ee(A,C){const k=i.get(A);if(A.isVideoTexture&&R(A),A.isRenderTargetTexture===!1&&A.version>0&&k.__version!==A.version){const U=A.image;if(U===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(k,A,C);return}}t.bindTexture(n.TEXTURE_2D,k.__webglTexture,n.TEXTURE0+C)}function Z(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){re(k,A,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,k.__webglTexture,n.TEXTURE0+C)}function te(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){re(k,A,C);return}t.bindTexture(n.TEXTURE_3D,k.__webglTexture,n.TEXTURE0+C)}function Q(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){ge(k,A,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,k.__webglTexture,n.TEXTURE0+C)}const pe={[Ll]:n.REPEAT,[li]:n.CLAMP_TO_EDGE,[Dl]:n.MIRRORED_REPEAT},ve={[cn]:n.NEAREST,[pg]:n.NEAREST_MIPMAP_NEAREST,[Xo]:n.NEAREST_MIPMAP_LINEAR,[jt]:n.LINEAR,[Qa]:n.LINEAR_MIPMAP_NEAREST,[Vi]:n.LINEAR_MIPMAP_LINEAR},se={[zS]:n.NEVER,[qS]:n.ALWAYS,[HS]:n.LESS,[Tg]:n.LEQUAL,[GS]:n.EQUAL,[$S]:n.GEQUAL,[WS]:n.GREATER,[XS]:n.NOTEQUAL};function xe(A,C){if(C.type===Hn&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===jt||C.magFilter===Qa||C.magFilter===Xo||C.magFilter===Vi||C.minFilter===jt||C.minFilter===Qa||C.minFilter===Xo||C.minFilter===Vi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(A,n.TEXTURE_WRAP_S,pe[C.wrapS]),n.texParameteri(A,n.TEXTURE_WRAP_T,pe[C.wrapT]),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,pe[C.wrapR]),n.texParameteri(A,n.TEXTURE_MAG_FILTER,ve[C.magFilter]),n.texParameteri(A,n.TEXTURE_MIN_FILTER,ve[C.minFilter]),C.compareFunction&&(n.texParameteri(A,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(A,n.TEXTURE_COMPARE_FUNC,se[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===cn||C.minFilter!==Xo&&C.minFilter!==Vi||C.type===Hn&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const k=e.get("EXT_texture_filter_anisotropic");n.texParameterf(A,k.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,s.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function ze(A,C){let k=!1;A.__webglInit===void 0&&(A.__webglInit=!0,C.addEventListener("dispose",T));const U=C.source;let z=h.get(U);z===void 0&&(z={},h.set(U,z));const Y=$(C);if(Y!==A.__cacheKey){z[Y]===void 0&&(z[Y]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,k=!0),z[Y].usedTimes++;const he=z[A.__cacheKey];he!==void 0&&(z[A.__cacheKey].usedTimes--,he.usedTimes===0&&b(C)),A.__cacheKey=Y,A.__webglTexture=z[Y].texture}return k}function re(A,C,k){let U=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(U=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(U=n.TEXTURE_3D);const z=ze(A,C),Y=C.source;t.bindTexture(U,A.__webglTexture,n.TEXTURE0+k);const he=i.get(Y);if(Y.version!==he.__version||z===!0){t.activeTexture(n.TEXTURE0+k);const ce=at.getPrimaries(at.workingColorSpace),ye=C.colorSpace===hs?null:at.getPrimaries(C.colorSpace),Fe=C.colorSpace===hs||ce===ye?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Fe);let me=_(C.image,!1,s.maxTextureSize);me=N(C,me);const Te=r.convert(C.format,C.colorSpace),ke=r.convert(C.type);let We=x(C.internalFormat,Te,ke,C.colorSpace,C.isVideoTexture);xe(U,C);let Me;const qe=C.mipmaps,Je=C.isVideoTexture!==!0,Ct=he.__version===void 0||z===!0,X=Y.dataReady,Ae=E(C,me);if(C.isDepthTexture)We=v(C.format===lo,C.type),Ct&&(Je?t.texStorage2D(n.TEXTURE_2D,1,We,me.width,me.height):t.texImage2D(n.TEXTURE_2D,0,We,me.width,me.height,0,Te,ke,null));else if(C.isDataTexture)if(qe.length>0){Je&&Ct&&t.texStorage2D(n.TEXTURE_2D,Ae,We,qe[0].width,qe[0].height);for(let oe=0,de=qe.length;oe0){const Pe=rm(Me.width,Me.height,C.format,C.type);for(const Re of C.layerUpdates){const nt=Me.data.subarray(Re*Pe/Me.data.BYTES_PER_ELEMENT,(Re+1)*Pe/Me.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Re,Me.width,Me.height,1,Te,nt)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,me.depth,Te,Me.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,We,Me.width,Me.height,me.depth,0,Me.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Je?X&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,me.depth,Te,ke,Me.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,We,Me.width,Me.height,me.depth,0,Te,ke,Me.data)}else{Je&&Ct&&t.texStorage2D(n.TEXTURE_2D,Ae,We,qe[0].width,qe[0].height);for(let oe=0,de=qe.length;oe0){const oe=rm(me.width,me.height,C.format,C.type);for(const de of C.layerUpdates){const Pe=me.data.subarray(de*oe/me.data.BYTES_PER_ELEMENT,(de+1)*oe/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,de,me.width,me.height,1,Te,ke,Pe)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,Te,ke,me.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,We,me.width,me.height,me.depth,0,Te,ke,me.data);else if(C.isData3DTexture)Je?(Ct&&t.texStorage3D(n.TEXTURE_3D,Ae,We,me.width,me.height,me.depth),X&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,Te,ke,me.data)):t.texImage3D(n.TEXTURE_3D,0,We,me.width,me.height,me.depth,0,Te,ke,me.data);else if(C.isFramebufferTexture){if(Ct)if(Je)t.texStorage2D(n.TEXTURE_2D,Ae,We,me.width,me.height);else{let oe=me.width,de=me.height;for(let Pe=0;Pe>=1,de>>=1}}else if(qe.length>0){if(Je&&Ct){const oe=V(qe[0]);t.texStorage2D(n.TEXTURE_2D,Ae,We,oe.width,oe.height)}for(let oe=0,de=qe.length;oe0&&Ae++;const de=V(Te[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ae,qe,de.width,de.height)}for(let de=0;de<6;de++)if(me){Je?X&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Te[de].width,Te[de].height,We,Me,Te[de].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,qe,Te[de].width,Te[de].height,0,We,Me,Te[de].data);for(let Pe=0;Pe>Y),ke=Math.max(1,C.height>>Y);z===n.TEXTURE_3D||z===n.TEXTURE_2D_ARRAY?t.texImage3D(z,Y,ye,Te,ke,C.depth,0,he,ce,null):t.texImage2D(z,Y,ye,Te,ke,0,he,ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,A),q(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,U,z,me.__webglTexture,0,G(C)):(z===n.TEXTURE_2D||z>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&z<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,U,z,me.__webglTexture,Y),t.bindFramebuffer(n.FRAMEBUFFER,null)}function W(A,C,k){if(n.bindRenderbuffer(n.RENDERBUFFER,A),C.depthBuffer){const U=C.depthTexture,z=U&&U.isDepthTexture?U.type:null,Y=v(C.stencilBuffer,z),he=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=G(C);q(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ce,Y,C.width,C.height):k?n.renderbufferStorageMultisample(n.RENDERBUFFER,ce,Y,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,Y,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,he,n.RENDERBUFFER,A)}else{const U=C.textures;for(let z=0;z{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,U.removeEventListener("dispose",z)};U.addEventListener("dispose",z),C.__depthDisposeCallback=z}C.__boundDepthTexture=U}if(A.depthTexture&&!C.__autoAllocateDepthBuffer){if(k)throw new Error("target.depthTexture not supported in Cube render targets");ae(C.__webglFramebuffer,A)}else if(k){C.__webglDepthbuffer=[];for(let U=0;U<6;U++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[U]),C.__webglDepthbuffer[U]===void 0)C.__webglDepthbuffer[U]=n.createRenderbuffer(),W(C.__webglDepthbuffer[U],A,!1);else{const z=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Y=C.__webglDepthbuffer[U];n.bindRenderbuffer(n.RENDERBUFFER,Y),n.framebufferRenderbuffer(n.FRAMEBUFFER,z,n.RENDERBUFFER,Y)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),W(C.__webglDepthbuffer,A,!1);else{const U=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,z=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,z),n.framebufferRenderbuffer(n.FRAMEBUFFER,U,n.RENDERBUFFER,z)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function le(A,C,k){const U=i.get(A);C!==void 0&&be(U.__webglFramebuffer,A,A.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),k!==void 0&&ue(A)}function Oe(A){const C=A.texture,k=i.get(A),U=i.get(C);A.addEventListener("dispose",M);const z=A.textures,Y=A.isWebGLCubeRenderTarget===!0,he=z.length>1;if(he||(U.__webglTexture===void 0&&(U.__webglTexture=n.createTexture()),U.__version=C.version,o.memory.textures++),Y){k.__webglFramebuffer=[];for(let ce=0;ce<6;ce++)if(C.mipmaps&&C.mipmaps.length>0){k.__webglFramebuffer[ce]=[];for(let ye=0;ye0){k.__webglFramebuffer=[];for(let ce=0;ce0&&q(A)===!1){k.__webglMultisampledFramebuffer=n.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let ce=0;ce0)for(let ye=0;ye0)for(let ye=0;ye0){if(q(A)===!1){const C=A.textures,k=A.width,U=A.height;let z=n.COLOR_BUFFER_BIT;const Y=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,he=i.get(A),ce=C.length>1;if(ce)for(let ye=0;ye0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function R(A){const C=o.render.frame;u.get(A)!==C&&(u.set(A,C),A.update())}function N(A,C){const k=A.colorSpace,U=A.format,z=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||k!==co&&k!==hs&&(at.getTransfer(k)===St?(U!==Ln||z!==qi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",k)),C}function V(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=B,this.setTexture2D=ee,this.setTexture2DArray=Z,this.setTexture3D=te,this.setTextureCube=Q,this.rebindTextures=le,this.setupRenderTarget=Oe,this.updateRenderTargetMipmap=I,this.updateMultisampleRenderTarget=j,this.setupDepthRenderbuffer=ue,this.setupFrameBufferTexture=be,this.useMultisampledRTT=q}function iE(n,e){function t(i,s=hs){let r;const o=at.getTransfer(s);if(i===qi)return n.UNSIGNED_BYTE;if(i===Sh)return n.UNSIGNED_SHORT_4_4_4_4;if(i===Mh)return n.UNSIGNED_SHORT_5_5_5_1;if(i===_g)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===mg)return n.BYTE;if(i===gg)return n.SHORT;if(i===oa)return n.UNSIGNED_SHORT;if(i===bh)return n.INT;if(i===Ts)return n.UNSIGNED_INT;if(i===Hn)return n.FLOAT;if(i===va)return n.HALF_FLOAT;if(i===vg)return n.ALPHA;if(i===yg)return n.RGB;if(i===Ln)return n.RGBA;if(i===xg)return n.LUMINANCE;if(i===bg)return n.LUMINANCE_ALPHA;if(i===eo)return n.DEPTH_COMPONENT;if(i===lo)return n.DEPTH_STENCIL;if(i===Eh)return n.RED;if(i===uc)return n.RED_INTEGER;if(i===Sg)return n.RG;if(i===Th)return n.RG_INTEGER;if(i===wh)return n.RGBA_INTEGER;if(i===el||i===tl||i===nl||i===il)if(o===St)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===el)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===tl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===nl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===il)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===el)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===tl)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===nl)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===il)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===yf||i===xf||i===bf||i===Sf)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===yf)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===xf)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===bf)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Sf)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Mf||i===Ef||i===Tf)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===Mf||i===Ef)return o===St?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===Tf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===wf||i===Af||i===Cf||i===Rf||i===Pf||i===If||i===Lf||i===Df||i===Of||i===Nf||i===Uf||i===Ff||i===Bf||i===kf)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===wf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Af)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Cf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Rf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Pf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===If)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Lf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Df)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Of)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Nf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Uf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Ff)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Bf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===kf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===sl||i===Vf||i===zf)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===sl)return o===St?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Vf)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===zf)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Mg||i===Hf||i===Gf||i===Wf)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===sl)return r.COMPRESSED_RED_RGTC1_EXT;if(i===Hf)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Gf)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Wf)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ao?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const yO=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,xO=` +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 bO{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const s=new Vt,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 Ri({vertexShader:yO,fragmentShader:xO,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ht(new ba(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class SO extends ji{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,p=null;const _=new bO,g=t.getContextAttributes();let m=null,y=null;const x=[],v=[],E=new fe;let T=null;const M=new $t;M.viewport=new ht;const P=new $t;P.viewport=new ht;const b=[M,P],S=new $M;let D=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let ge=x[re];return ge===void 0&&(ge=new Wu,x[re]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(re){let ge=x[re];return ge===void 0&&(ge=new Wu,x[re]=ge),ge.getGripSpace()},this.getHand=function(re){let ge=x[re];return ge===void 0&&(ge=new Wu,x[re]=ge),ge.getHandSpace()};function H(re){const ge=v.indexOf(re.inputSource);if(ge===-1)return;const be=x[ge];be!==void 0&&(be.update(re.inputSource,re.frame,c||o),be.dispatchEvent({type:re.type,data:re.inputSource}))}function $(){s.removeEventListener("select",H),s.removeEventListener("selectstart",H),s.removeEventListener("selectend",H),s.removeEventListener("squeeze",H),s.removeEventListener("squeezestart",H),s.removeEventListener("squeezeend",H),s.removeEventListener("end",$),s.removeEventListener("inputsourceschange",ee);for(let re=0;re=0&&(v[W]=null,x[W].disconnect(be))}for(let ge=0;ge=v.length){v.push(be),W=ue;break}else if(v[ue]===null){v[ue]=be,W=ue;break}if(W===-1)break}const ae=x[W];ae&&ae.connect(be)}}const Z=new F,te=new F;function Q(re,ge,be){Z.setFromMatrixPosition(ge.matrixWorld),te.setFromMatrixPosition(be.matrixWorld);const W=Z.distanceTo(te),ae=ge.projectionMatrix.elements,ue=be.projectionMatrix.elements,le=ae[14]/(ae[10]-1),Oe=ae[14]/(ae[10]+1),I=(ae[9]+1)/ae[5],L=(ae[9]-1)/ae[5],w=(ae[8]-1)/ae[0],j=(ue[8]+1)/ue[0],G=le*w,q=le*j,R=W/(-w+j),N=R*-w;if(ge.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(N),re.translateZ(R),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert(),ae[10]===-1)re.projectionMatrix.copy(ge.projectionMatrix),re.projectionMatrixInverse.copy(ge.projectionMatrixInverse);else{const V=le+R,A=Oe+R,C=G-N,k=q+(W-N),U=I*Oe/A*V,z=L*Oe/A*V;re.projectionMatrix.makePerspective(C,k,U,z,V,A),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}}function pe(re,ge){ge===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(ge.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(s===null)return;let ge=re.near,be=re.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(be=_.depthFar)),S.near=P.near=M.near=ge,S.far=P.far=M.far=be,(D!==S.near||B!==S.far)&&(s.updateRenderState({depthNear:S.near,depthFar:S.far}),D=S.near,B=S.far),M.layers.mask=re.layers.mask|2,P.layers.mask=re.layers.mask|4,S.layers.mask=M.layers.mask|P.layers.mask;const W=re.parent,ae=S.cameras;pe(S,W);for(let ue=0;ue0&&(g.alphaTest.value=m.alphaTest);const y=e.get(m),x=y.envMap,v=y.envMapRotation;x&&(g.envMap.value=x,Nr.copy(v),Nr.x*=-1,Nr.y*=-1,Nr.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Nr.y*=-1,Nr.z*=-1),g.envMapRotation.value.setFromMatrix4(MO.makeRotationFromEuler(Nr)),g.flipEnvMap.value=x.isCubeTexture&&x.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,y,x){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*y,g.scale.value=x*.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 f(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function h(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,y){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===Dn&&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=y.texture,g.transmissionSamplerSize.value.set(y.width,y.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 y=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function TO(n,e,t,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,x){const v=x.program;i.uniformBlockBinding(y,v)}function c(y,x){let v=s[y.id];v===void 0&&(p(y),v=u(y),s[y.id]=v,y.addEventListener("dispose",g));const E=x.program;i.updateUBOMapping(y,E);const T=e.render.frame;r[y.id]!==T&&(h(y),r[y.id]=T)}function u(y){const x=f();y.__bindingPointIndex=x;const v=n.createBuffer(),E=y.__size,T=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,v),n.bufferData(n.UNIFORM_BUFFER,E,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,v),v}function f(){for(let y=0;y0&&(v+=E-T),y.__size=v,y.__cache={},this}function _(y){const x={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(x.boundary=4,x.storage=4):y.isVector2?(x.boundary=8,x.storage=8):y.isVector3||y.isColor?(x.boundary=16,x.storage=12):y.isVector4?(x.boundary=16,x.storage=16):y.isMatrix3?(x.boundary=48,x.storage=48):y.isMatrix4?(x.boundary=64,x.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),x}function g(y){const x=y.target;x.removeEventListener("dispose",g);const v=o.indexOf(x.__bindingPointIndex);o.splice(v,1),n.deleteBuffer(s[x.id]),delete s[x.id],delete r[x.id]}function m(){for(const y in s)n.deleteBuffer(s[y]);o=[],s={},r={}}return{bind:l,update:c,dispose:m}}class $u{constructor(e={}){const{canvas:t=jS(),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:f=!1,reverseDepthBuffer:h=!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 y=[],x=[];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._outputColorSpace=Cn,this.toneMapping=Hi,this.toneMappingExposure=1;const v=this;let E=!1,T=0,M=0,P=null,b=-1,S=null;const D=new ht,B=new ht;let H=null;const $=new we(0);let ee=0,Z=t.width,te=t.height,Q=1,pe=null,ve=null;const se=new ht(0,0,Z,te),xe=new ht(0,0,Z,te);let ze=!1;const re=new pc;let ge=!1,be=!1;this.transmissionResolutionScale=1;const W=new Xe,ae=new Xe,ue=new F,le=new ht,Oe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let I=!1;function L(){return P===null?Q:1}let w=i;function j(O,K){return t.getContext(O,K)}try{const O={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${lc}`),t.addEventListener("webglcontextlost",de,!1),t.addEventListener("webglcontextrestored",Pe,!1),t.addEventListener("webglcontextcreationerror",Re,!1),w===null){const K="webgl2";if(w=j(K,O),w===null)throw j(K)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let G,q,R,N,V,A,C,k,U,z,Y,he,ce,ye,Fe,me,Te,ke,We,Me,qe,Je,Ct,X;function Ae(){G=new F3(w),G.init(),Je=new iE(w,G),q=new P3(w,G,e,Je),R=new _O(w,G),q.reverseDepthBuffer&&h&&R.buffers.depth.setReversed(!0),N=new V3(w),V=new sO,A=new vO(w,G,R,V,q,Je,N),C=new L3(v),k=new U3(v),U=new $I(w),Ct=new C3(w,U),z=new B3(w,U,N,Ct),Y=new H3(w,z,U,N),We=new z3(w,q,A),me=new I3(V),he=new iO(v,C,k,G,q,Ct,me),ce=new EO(v,V),ye=new oO,Fe=new hO(G),ke=new A3(v,C,k,R,Y,d,l),Te=new mO(v,Y,q),X=new TO(w,N,q,R),Me=new R3(w,G,N),qe=new k3(w,G,N),N.programs=he.programs,v.capabilities=q,v.extensions=G,v.properties=V,v.renderLists=ye,v.shadowMap=Te,v.state=R,v.info=N}Ae();const oe=new SO(v,w);this.xr=oe,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const O=G.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=G.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(O){O!==void 0&&(Q=O,this.setSize(Z,te,!1))},this.getSize=function(O){return O.set(Z,te)},this.setSize=function(O,K,ne=!0){if(oe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=O,te=K,t.width=Math.floor(O*Q),t.height=Math.floor(K*Q),ne===!0&&(t.style.width=O+"px",t.style.height=K+"px"),this.setViewport(0,0,O,K)},this.getDrawingBufferSize=function(O){return O.set(Z*Q,te*Q).floor()},this.setDrawingBufferSize=function(O,K,ne){Z=O,te=K,Q=ne,t.width=Math.floor(O*ne),t.height=Math.floor(K*ne),this.setViewport(0,0,O,K)},this.getCurrentViewport=function(O){return O.copy(D)},this.getViewport=function(O){return O.copy(se)},this.setViewport=function(O,K,ne,ie){O.isVector4?se.set(O.x,O.y,O.z,O.w):se.set(O,K,ne,ie),R.viewport(D.copy(se).multiplyScalar(Q).round())},this.getScissor=function(O){return O.copy(xe)},this.setScissor=function(O,K,ne,ie){O.isVector4?xe.set(O.x,O.y,O.z,O.w):xe.set(O,K,ne,ie),R.scissor(B.copy(xe).multiplyScalar(Q).round())},this.getScissorTest=function(){return ze},this.setScissorTest=function(O){R.setScissorTest(ze=O)},this.setOpaqueSort=function(O){pe=O},this.setTransparentSort=function(O){ve=O},this.getClearColor=function(O){return O.copy(ke.getClearColor())},this.setClearColor=function(){ke.setClearColor(...arguments)},this.getClearAlpha=function(){return ke.getClearAlpha()},this.setClearAlpha=function(){ke.setClearAlpha(...arguments)},this.clear=function(O=!0,K=!0,ne=!0){let ie=0;if(O){let J=!1;if(P!==null){const _e=P.texture.format;J=_e===wh||_e===Th||_e===uc}if(J){const _e=P.texture.type,Ce=_e===qi||_e===Ts||_e===oa||_e===ao||_e===Sh||_e===Mh,Le=ke.getClearColor(),Ne=ke.getClearAlpha(),Ye=Le.r,je=Le.g,Ve=Le.b;Ce?(p[0]=Ye,p[1]=je,p[2]=Ve,p[3]=Ne,w.clearBufferuiv(w.COLOR,0,p)):(_[0]=Ye,_[1]=je,_[2]=Ve,_[3]=Ne,w.clearBufferiv(w.COLOR,0,_))}else ie|=w.COLOR_BUFFER_BIT}K&&(ie|=w.DEPTH_BUFFER_BIT),ne&&(ie|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(ie)},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",de,!1),t.removeEventListener("webglcontextrestored",Pe,!1),t.removeEventListener("webglcontextcreationerror",Re,!1),ke.dispose(),ye.dispose(),Fe.dispose(),V.dispose(),C.dispose(),k.dispose(),Y.dispose(),Ct.dispose(),X.dispose(),he.dispose(),oe.dispose(),oe.removeEventListener("sessionstart",T_),oe.removeEventListener("sessionend",w_),_r.stop()};function de(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),E=!0}function Pe(){console.log("THREE.WebGLRenderer: Context Restored."),E=!1;const O=N.autoReset,K=Te.enabled,ne=Te.autoUpdate,ie=Te.needsUpdate,J=Te.type;Ae(),N.autoReset=O,Te.enabled=K,Te.autoUpdate=ne,Te.needsUpdate=ie,Te.type=J}function Re(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function nt(O){const K=O.target;K.removeEventListener("dispose",nt),Ft(K)}function Ft(O){un(O),V.remove(O)}function un(O){const K=V.get(O).programs;K!==void 0&&(K.forEach(function(ne){he.releaseProgram(ne)}),O.isShaderMaterial&&he.releaseShaderCache(O))}this.renderBufferDirect=function(O,K,ne,ie,J,_e){K===null&&(K=Oe);const Ce=J.isMesh&&J.matrixWorld.determinant()<0,Le=rw(O,K,ne,ie,J);R.setMaterial(ie,Ce);let Ne=ne.index,Ye=1;if(ie.wireframe===!0){if(Ne=z.getWireframeAttribute(ne),Ne===void 0)return;Ye=2}const je=ne.drawRange,Ve=ne.attributes.position;let ut=je.start*Ye,gt=(je.start+je.count)*Ye;_e!==null&&(ut=Math.max(ut,_e.start*Ye),gt=Math.min(gt,(_e.start+_e.count)*Ye)),Ne!==null?(ut=Math.max(ut,0),gt=Math.min(gt,Ne.count)):Ve!=null&&(ut=Math.max(ut,0),gt=Math.min(gt,Ve.count));const Gt=gt-ut;if(Gt<0||Gt===1/0)return;Ct.setup(J,ie,Le,ne,Ne);let Bt,dt=Me;if(Ne!==null&&(Bt=U.get(Ne),dt=qe,dt.setIndex(Bt)),J.isMesh)ie.wireframe===!0?(R.setLineWidth(ie.wireframeLinewidth*L()),dt.setMode(w.LINES)):dt.setMode(w.TRIANGLES);else if(J.isLine){let He=ie.linewidth;He===void 0&&(He=1),R.setLineWidth(He*L()),J.isLineSegments?dt.setMode(w.LINES):J.isLineLoop?dt.setMode(w.LINE_LOOP):dt.setMode(w.LINE_STRIP)}else J.isPoints?dt.setMode(w.POINTS):J.isSprite&&dt.setMode(w.TRIANGLES);if(J.isBatchedMesh)if(J._multiDrawInstances!==null)Vr("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),dt.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))dt.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else{const He=J._multiDrawStarts,rn=J._multiDrawCounts,_t=J._multiDrawCount,_i=Ne?U.get(Ne).bytesPerElement:1,xo=V.get(ie).currentProgram.getUniforms();for(let qn=0;qn<_t;qn++)xo.setValue(w,"_gl_DrawID",qn),dt.render(He[qn]/_i,rn[qn])}else if(J.isInstancedMesh)dt.renderInstances(ut,Gt,J.count);else if(ne.isInstancedBufferGeometry){const He=ne._maxInstanceCount!==void 0?ne._maxInstanceCount:1/0,rn=Math.min(ne.instanceCount,He);dt.renderInstances(ut,Gt,rn)}else dt.render(ut,Gt)};function bt(O,K,ne){O.transparent===!0&&O.side===Si&&O.forceSinglePass===!1?(O.side=Dn,O.needsUpdate=!0,Ac(O,K,ne),O.side=Ms,O.needsUpdate=!0,Ac(O,K,ne),O.side=Si):Ac(O,K,ne)}this.compile=function(O,K,ne=null){ne===null&&(ne=O),m=Fe.get(ne),m.init(K),x.push(m),ne.traverseVisible(function(J){J.isLight&&J.layers.test(K.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),O!==ne&&O.traverseVisible(function(J){J.isLight&&J.layers.test(K.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),m.setupLights();const ie=new Set;return O.traverse(function(J){if(!(J.isMesh||J.isPoints||J.isLine||J.isSprite))return;const _e=J.material;if(_e)if(Array.isArray(_e))for(let Ce=0;Ce<_e.length;Ce++){const Le=_e[Ce];bt(Le,ne,J),ie.add(Le)}else bt(_e,ne,J),ie.add(_e)}),m=x.pop(),ie},this.compileAsync=function(O,K,ne=null){const ie=this.compile(O,K,ne);return new Promise(J=>{function _e(){if(ie.forEach(function(Ce){V.get(Ce).currentProgram.isReady()&&ie.delete(Ce)}),ie.size===0){J(O);return}setTimeout(_e,10)}G.get("KHR_parallel_shader_compile")!==null?_e():setTimeout(_e,10)})};let gi=null;function Zi(O){gi&&gi(O)}function T_(){_r.stop()}function w_(){_r.start()}const _r=new JM;_r.setAnimationLoop(Zi),typeof self<"u"&&_r.setContext(self),this.setAnimationLoop=function(O){gi=O,oe.setAnimationLoop(O),O===null?_r.stop():_r.start()},oe.addEventListener("sessionstart",T_),oe.addEventListener("sessionend",w_),this.render=function(O,K){if(K!==void 0&&K.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),K.parent===null&&K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),oe.enabled===!0&&oe.isPresenting===!0&&(oe.cameraAutoUpdate===!0&&oe.updateCamera(K),K=oe.getCamera()),O.isScene===!0&&O.onBeforeRender(v,O,K,P),m=Fe.get(O,x.length),m.init(K),x.push(m),ae.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),re.setFromProjectionMatrix(ae),be=this.localClippingEnabled,ge=me.init(this.clippingPlanes,be),g=ye.get(O,y.length),g.init(),y.push(g),oe.enabled===!0&&oe.isPresenting===!0){const _e=v.xr.getDepthSensingMesh();_e!==null&&hd(_e,K,-1/0,v.sortObjects)}hd(O,K,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(pe,ve),I=oe.enabled===!1||oe.isPresenting===!1||oe.hasDepthSensing()===!1,I&&ke.addToRenderList(g,O),this.info.render.frame++,ge===!0&&me.beginShadows();const ne=m.state.shadowsArray;Te.render(ne,O,K),ge===!0&&me.endShadows(),this.info.autoReset===!0&&this.info.reset();const ie=g.opaque,J=g.transmissive;if(m.setupLights(),K.isArrayCamera){const _e=K.cameras;if(J.length>0)for(let Ce=0,Le=_e.length;Ce0&&C_(ie,J,O,K),I&&ke.render(O),A_(g,O,K);P!==null&&M===0&&(A.updateMultisampleRenderTarget(P),A.updateRenderTargetMipmap(P)),O.isScene===!0&&O.onAfterRender(v,O,K),Ct.resetDefaultState(),b=-1,S=null,x.pop(),x.length>0?(m=x[x.length-1],ge===!0&&me.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function hd(O,K,ne,ie){if(O.visible===!1)return;if(O.layers.test(K.layers)){if(O.isGroup)ne=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(K);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||re.intersectsSprite(O)){ie&&le.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ae);const Ce=Y.update(O),Le=O.material;Le.visible&&g.push(O,Ce,Le,ne,le.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||re.intersectsObject(O))){const Ce=Y.update(O),Le=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),le.copy(O.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),le.copy(Ce.boundingSphere.center)),le.applyMatrix4(O.matrixWorld).applyMatrix4(ae)),Array.isArray(Le)){const Ne=Ce.groups;for(let Ye=0,je=Ne.length;Ye0&&wc(J,K,ne),_e.length>0&&wc(_e,K,ne),Ce.length>0&&wc(Ce,K,ne),R.buffers.depth.setTest(!0),R.buffers.depth.setMask(!0),R.buffers.color.setMask(!0),R.setPolygonOffset(!1)}function C_(O,K,ne,ie){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[ie.id]===void 0&&(m.state.transmissionRenderTarget[ie.id]=new Yi(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?va:qi,minFilter:Vi,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:at.workingColorSpace}));const _e=m.state.transmissionRenderTarget[ie.id],Ce=ie.viewport||D;_e.setSize(Ce.z*v.transmissionResolutionScale,Ce.w*v.transmissionResolutionScale);const Le=v.getRenderTarget();v.setRenderTarget(_e),v.getClearColor($),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),I&&ke.render(ne);const Ne=v.toneMapping;v.toneMapping=Hi;const Ye=ie.viewport;if(ie.viewport!==void 0&&(ie.viewport=void 0),m.setupLightsView(ie),ge===!0&&me.setGlobalState(v.clippingPlanes,ie),wc(O,ne,ie),A.updateMultisampleRenderTarget(_e),A.updateRenderTargetMipmap(_e),G.has("WEBGL_multisampled_render_to_texture")===!1){let je=!1;for(let Ve=0,ut=K.length;Ve0),Ve=!!ne.morphAttributes.position,ut=!!ne.morphAttributes.normal,gt=!!ne.morphAttributes.color;let Gt=Hi;ie.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Gt=v.toneMapping);const Bt=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,dt=Bt!==void 0?Bt.length:0,He=V.get(ie),rn=m.state.lights;if(ge===!0&&(be===!0||O!==S)){const bn=O===S&&ie.id===b;me.setState(ie,O,bn)}let _t=!1;ie.version===He.__version?(He.needsLights&&He.lightsStateVersion!==rn.state.version||He.outputColorSpace!==Le||J.isBatchedMesh&&He.batching===!1||!J.isBatchedMesh&&He.batching===!0||J.isBatchedMesh&&He.batchingColor===!0&&J.colorTexture===null||J.isBatchedMesh&&He.batchingColor===!1&&J.colorTexture!==null||J.isInstancedMesh&&He.instancing===!1||!J.isInstancedMesh&&He.instancing===!0||J.isSkinnedMesh&&He.skinning===!1||!J.isSkinnedMesh&&He.skinning===!0||J.isInstancedMesh&&He.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&He.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&He.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&He.instancingMorph===!1&&J.morphTexture!==null||He.envMap!==Ne||ie.fog===!0&&He.fog!==_e||He.numClippingPlanes!==void 0&&(He.numClippingPlanes!==me.numPlanes||He.numIntersection!==me.numIntersection)||He.vertexAlphas!==Ye||He.vertexTangents!==je||He.morphTargets!==Ve||He.morphNormals!==ut||He.morphColors!==gt||He.toneMapping!==Gt||He.morphTargetsCount!==dt)&&(_t=!0):(_t=!0,He.__version=ie.version);let _i=He.currentProgram;_t===!0&&(_i=Ac(ie,K,J));let xo=!1,qn=!1,Ea=!1;const Pt=_i.getUniforms(),ti=He.uniforms;if(R.useProgram(_i.program)&&(xo=!0,qn=!0,Ea=!0),ie.id!==b&&(b=ie.id,qn=!0),xo||S!==O){R.buffers.depth.getReversed()?(W.copy(O.projectionMatrix),pR(W),mR(W),Pt.setValue(w,"projectionMatrix",W)):Pt.setValue(w,"projectionMatrix",O.projectionMatrix),Pt.setValue(w,"viewMatrix",O.matrixWorldInverse);const Un=Pt.map.cameraPosition;Un!==void 0&&Un.setValue(w,ue.setFromMatrixPosition(O.matrixWorld)),q.logarithmicDepthBuffer&&Pt.setValue(w,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Pt.setValue(w,"isOrthographic",O.isOrthographicCamera===!0),S!==O&&(S=O,qn=!0,Ea=!0)}if(J.isSkinnedMesh){Pt.setOptional(w,J,"bindMatrix"),Pt.setOptional(w,J,"bindMatrixInverse");const bn=J.skeleton;bn&&(bn.boneTexture===null&&bn.computeBoneTexture(),Pt.setValue(w,"boneTexture",bn.boneTexture,A))}J.isBatchedMesh&&(Pt.setOptional(w,J,"batchingTexture"),Pt.setValue(w,"batchingTexture",J._matricesTexture,A),Pt.setOptional(w,J,"batchingIdTexture"),Pt.setValue(w,"batchingIdTexture",J._indirectTexture,A),Pt.setOptional(w,J,"batchingColorTexture"),J._colorsTexture!==null&&Pt.setValue(w,"batchingColorTexture",J._colorsTexture,A));const ni=ne.morphAttributes;if((ni.position!==void 0||ni.normal!==void 0||ni.color!==void 0)&&We.update(J,ne,_i),(qn||He.receiveShadow!==J.receiveShadow)&&(He.receiveShadow=J.receiveShadow,Pt.setValue(w,"receiveShadow",J.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(ti.envMap.value=Ne,ti.flipEnvMap.value=Ne.isCubeTexture&&Ne.isRenderTargetTexture===!1?-1:1),ie.isMeshStandardMaterial&&ie.envMap===null&&K.environment!==null&&(ti.envMapIntensity.value=K.environmentIntensity),qn&&(Pt.setValue(w,"toneMappingExposure",v.toneMappingExposure),He.needsLights&&ow(ti,Ea),_e&&ie.fog===!0&&ce.refreshFogUniforms(ti,_e),ce.refreshMaterialUniforms(ti,ie,Q,te,m.state.transmissionRenderTarget[O.id]),Xu.upload(w,P_(He),ti,A)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Xu.upload(w,P_(He),ti,A),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Pt.setValue(w,"center",J.center),Pt.setValue(w,"modelViewMatrix",J.modelViewMatrix),Pt.setValue(w,"normalMatrix",J.normalMatrix),Pt.setValue(w,"modelMatrix",J.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const bn=ie.uniformsGroups;for(let Un=0,dd=bn.length;Un0&&A.useMultisampledRTT(O)===!1?J=V.get(O).__webglMultisampledFramebuffer:Array.isArray(je)?J=je[ne]:J=je,D.copy(O.viewport),B.copy(O.scissor),H=O.scissorTest}else D.copy(se).multiplyScalar(Q).floor(),B.copy(xe).multiplyScalar(Q).floor(),H=ze;if(ne!==0&&(J=lw),R.bindFramebuffer(w.FRAMEBUFFER,J)&&ie&&R.drawBuffers(O,J),R.viewport(D),R.scissor(B),R.setScissorTest(H),_e){const Ne=V.get(O.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+K,Ne.__webglTexture,ne)}else if(Ce){const Ne=V.get(O.texture),Ye=K;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ne.__webglTexture,ne,Ye)}else if(O!==null&&ne!==0){const Ne=V.get(O.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,Ne.__webglTexture,ne)}b=-1},this.readRenderTargetPixels=function(O,K,ne,ie,J,_e,Ce){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Le=V.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){R.bindFramebuffer(w.FRAMEBUFFER,Le);try{const Ne=O.texture,Ye=Ne.format,je=Ne.type;if(!q.textureFormatReadable(Ye)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!q.textureTypeReadable(je)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}K>=0&&K<=O.width-ie&&ne>=0&&ne<=O.height-J&&w.readPixels(K,ne,ie,J,Je.convert(Ye),Je.convert(je),_e)}finally{const Ne=P!==null?V.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,Ne)}}},this.readRenderTargetPixelsAsync=async function(O,K,ne,ie,J,_e,Ce){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Le=V.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){const Ne=O.texture,Ye=Ne.format,je=Ne.type;if(!q.textureFormatReadable(Ye))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!q.textureTypeReadable(je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(K>=0&&K<=O.width-ie&&ne>=0&&ne<=O.height-J){R.bindFramebuffer(w.FRAMEBUFFER,Le);const Ve=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Ve),w.bufferData(w.PIXEL_PACK_BUFFER,_e.byteLength,w.STREAM_READ),w.readPixels(K,ne,ie,J,Je.convert(Ye),Je.convert(je),0);const ut=P!==null?V.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,ut);const gt=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await dR(w,gt,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Ve),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,_e),w.deleteBuffer(Ve),w.deleteSync(gt),_e}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(O,K=null,ne=0){O.isTexture!==!0&&(Vr("WebGLRenderer: copyFramebufferToTexture function signature has changed."),K=arguments[0]||null,O=arguments[1]);const ie=Math.pow(2,-ne),J=Math.floor(O.image.width*ie),_e=Math.floor(O.image.height*ie),Ce=K!==null?K.x:0,Le=K!==null?K.y:0;A.setTexture2D(O,0),w.copyTexSubImage2D(w.TEXTURE_2D,ne,0,0,Ce,Le,J,_e),R.unbindTexture()};const cw=w.createFramebuffer(),uw=w.createFramebuffer();this.copyTextureToTexture=function(O,K,ne=null,ie=null,J=0,_e=null){O.isTexture!==!0&&(Vr("WebGLRenderer: copyTextureToTexture function signature has changed."),ie=arguments[0]||null,O=arguments[1],K=arguments[2],_e=arguments[3]||0,ne=null),_e===null&&(J!==0?(Vr("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),_e=J,J=0):_e=0);let Ce,Le,Ne,Ye,je,Ve,ut,gt,Gt;const Bt=O.isCompressedTexture?O.mipmaps[_e]:O.image;if(ne!==null)Ce=ne.max.x-ne.min.x,Le=ne.max.y-ne.min.y,Ne=ne.isBox3?ne.max.z-ne.min.z:1,Ye=ne.min.x,je=ne.min.y,Ve=ne.isBox3?ne.min.z:0;else{const ni=Math.pow(2,-J);Ce=Math.floor(Bt.width*ni),Le=Math.floor(Bt.height*ni),O.isDataArrayTexture?Ne=Bt.depth:O.isData3DTexture?Ne=Math.floor(Bt.depth*ni):Ne=1,Ye=0,je=0,Ve=0}ie!==null?(ut=ie.x,gt=ie.y,Gt=ie.z):(ut=0,gt=0,Gt=0);const dt=Je.convert(K.format),He=Je.convert(K.type);let rn;K.isData3DTexture?(A.setTexture3D(K,0),rn=w.TEXTURE_3D):K.isDataArrayTexture||K.isCompressedArrayTexture?(A.setTexture2DArray(K,0),rn=w.TEXTURE_2D_ARRAY):(A.setTexture2D(K,0),rn=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,K.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,K.unpackAlignment);const _t=w.getParameter(w.UNPACK_ROW_LENGTH),_i=w.getParameter(w.UNPACK_IMAGE_HEIGHT),xo=w.getParameter(w.UNPACK_SKIP_PIXELS),qn=w.getParameter(w.UNPACK_SKIP_ROWS),Ea=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,Bt.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,Bt.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,Ye),w.pixelStorei(w.UNPACK_SKIP_ROWS,je),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Ve);const Pt=O.isDataArrayTexture||O.isData3DTexture,ti=K.isDataArrayTexture||K.isData3DTexture;if(O.isDepthTexture){const ni=V.get(O),bn=V.get(K),Un=V.get(ni.__renderTarget),dd=V.get(bn.__renderTarget);R.bindFramebuffer(w.READ_FRAMEBUFFER,Un.__webglFramebuffer),R.bindFramebuffer(w.DRAW_FRAMEBUFFER,dd.__webglFramebuffer);for(let vr=0;vr{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return or(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const hp=new WeakMap,AO=(...n)=>{var e;const t=n[0],i=(e=vn())==null?void 0:e.proxy;if(i==null&&!ic())throw new Error("injectLocal must be called in setup");return i&&hp.has(i)&&t in hp.get(i)?hp.get(i)[t]:gn(...n)},lm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const CO=n=>typeof n<"u",RO=n=>n!=null,PO=Object.prototype.toString,IO=n=>PO.call(n)==="[object Object]",cm=()=>{};function LO(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 DO(n,e={}){let t,i,s=cm;const r=l=>{clearTimeout(l),s(),s=cm};let o;return l=>{const c=et(n),u=et(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,h)=>{s=e.rejectOnCancel?h:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function ty(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function OO(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function NO(n){return vn()}function ll(n){return Array.isArray(n)?n:[n]}function UO(n,e=200,t={}){return LO(DO(e,t),n)}function ny(n,e=200,t={}){const i=Ze(n.value),s=UO(()=>{i.value=n.value},e,t);return Ge(n,()=>s()),i}function FO(n,e={}){if(!wt(n))return sb(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=eg(()=>({get(){return n.value[i]},set(s){var r;if((r=et(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 on=et;function e_(n,e=!0,t){NO()?yn(n,t):e?n():cr(n)}function BO(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t;let r=null;const o=Ie(!1);function a(){r&&(clearInterval(r),r=null)}function l(){o.value=!1,a()}function c(){const u=et(e);u<=0||(o.value=!0,s&&n(),a(),o.value&&(r=setInterval(n,u)))}if(i&&lm&&c(),wt(e)||typeof e=="function"){const u=Ge(e,()=>{o.value&&lm&&c()});or(u)}return or(l),{isActive:o,pause:l,resume:c}}function sE(n,e,t){return Ge(n,e,{...t,immediate:!0})}const Ps=lm?window:void 0;function Ei(n){var e;const t=et(n);return(e=t==null?void 0:t.$el)!=null?e:t}function ho(...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=Se(()=>{const a=ll(et(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=sE(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Ei(c)))!=null?l:[Ps].filter(c=>c!=null),ll(et(s.value?n[1]:n[0])),ll(It(s.value?n[2]:n[1])),et(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 f=IO(u)?{...u}:u;e.push(...a.flatMap(h=>l.flatMap(d=>c.map(p=>i(h,d,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return or(t),o}function kO(){const n=Ie(!1),e=vn();return e&&yn(()=>{n.value=!0},e),n}function td(n){const e=kO();return Se(()=>(e.value,!!n()))}function VO(n,e,t={}){const{window:i=Ps,...s}=t;let r;const o=td(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const h=et(n),d=ll(h).map(Ei).filter(RO);return new Set(d)}),c=Ge(()=>l.value,h=>{a(),o.value&&h.size&&(r=new MutationObserver(e),h.forEach(d=>r.observe(d,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return or(f),{isSupported:o,stop:f,takeRecords:u}}function t_(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:s=Ps,once:r=!1}=e,o=Ie(!1),a=Se(()=>i?1e3/et(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=Ie(typeof i=="number"),o=Ie(),a=Ie(!1),l=c=>{a.value=c.matches};return sc(()=>{if(r.value){r.value=!s.value;const c=et(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),h=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=!!(h||d);return h&&p&&(p=i>=ty(h[1])),d&&p&&(p=i<=ty(d[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(et(n)),a.value=o.value.matches)}),ho(o,"change",l,{passive:!0}),Se(()=>a.value)}function GO(n){return JSON.parse(JSON.stringify(n))}function WO(n={}){const{window:e=Ps}=n,t=Ie(1),i=rE(()=>`(resolution: ${t.value}dppx)`,n);let s=cm;return e&&(s=sE(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:di(t),stop:s}}function oE(n,e,t={}){const{window:i=Ps,...s}=t;let r;const o=td(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const f=et(n);return Array.isArray(f)?f.map(h=>Ei(h)):[Ei(f)]}),c=Ge(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const h of f)h&&r.observe(h,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return or(u),{isSupported:o,stop:u}}function XO(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Ie(0),l=Ie(0),c=Ie(0),u=Ie(0),f=Ie(0),h=Ie(0),d=Ie(0),p=Ie(0);function _(){const m=Ei(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,h.value=0,d.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,h.value=y.width,d.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return oE(n,g),Ge(()=>Ei(n),m=>!m&&g()),VO(n,g,{attributeFilter:["style","class"]}),s&&ho("scroll",g,{capture:!0,passive:!0}),i&&ho("resize",g,{passive:!0}),e_(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function $O(n,e={width:0,height:0},t={}){const{window:i=Ps,box:s="content-box"}=t,r=Se(()=>{var f,h;return(h=(f=Ei(n))==null?void 0:f.namespaceURI)==null?void 0:h.includes("svg")}),o=Ie(e.width),a=Ie(e.height),{stop:l}=oE(n,([f])=>{const h=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&r.value){const d=Ei(n);if(d){const p=d.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(h){const d=ll(h);o.value=d.reduce((p,{inlineSize:_})=>p+_,0),a.value=d.reduce((p,{blockSize:_})=>p+_,0)}else o.value=f.contentRect.width,a.value=f.contentRect.height},t);e_(()=>{const f=Ei(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=Ge(()=>Ei(n),f=>{o.value=f?e.width:0,a.value=f?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function qO(n){var e;const t=Ie(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 t_(()=>{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 YO(n={}){const e=Ze(),t=td(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;BO(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const aE={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},jO=Object.keys(aE);function KO(n={}){const{target:e=Ps}=n,t=Ie(!1),i=Ze(n.initialValue||{});Object.assign(i.value,aE,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=OO(r,jO,!1))};if(e){const r={passive:!0};ho(e,["pointerdown","pointermove","pointerup"],s,r),ho(e,"pointerleave",()=>t.value=!1,r)}return{...FO(i),isInside:t}}function Y4(n,e,t,i={}){var s,r,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:h}=i,d=vn(),p=t||(d==null?void 0:d.emit)||((s=d==null?void 0:d.$emit)==null?void 0:s.bind(d))||((o=(r=d==null?void 0:d.proxy)==null?void 0:r.$emit)==null?void 0:o.bind(d==null?void 0:d.proxy));let _=c;_=_||`update:${e.toString()}`;const g=x=>a?typeof a=="function"?a(x):GO(x):x,m=()=>CO(n[e])?g(n[e]):f,y=x=>{h?h(x)&&p(_,x):p(_,x)};if(l){const x=m(),v=Ze(x);let E=!1;return Ge(()=>n[e],T=>{E||(E=!0,v.value=g(T),cr(()=>E=!1))}),Ge(v,T=>{!E&&(T!==n[e]||u)&&y(T)},{deep:u}),v}else return Se({get(){return m()},set(x){y(x)}})}function ZO(n={}){const{window:e=Ps,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Ie(t),l=Ie(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:h,scale:d}=e.visualViewport;a.value=Math.round(f*d),l.value=Math.round(h*d)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),e_(c);const u={passive:!0};if(ho("resize",c,u),e&&o==="visual"&&e.visualViewport&&ho(e.visualViewport,"resize",c,u),s){const f=rE("(orientation: portrait)");Ge(f,()=>c())}return{width:a,height:l}}var JO=Object.defineProperty,QO=(n,e,t)=>e in n?JO(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,iy=(n,e,t)=>QO(n,typeof e!="symbol"?e+"":e,t);const eN="@tresjs/core",tN="module",nN="4.3.3",iN="pnpm@9.15.5",sN="Declarative ThreeJS using Vue Components",rN="Alvaro Saburido (https://github.com/alvarosabu/)",oN="MIT",aN={type:"git",url:"git+https://github.com/Tresjs/tres.git"},lN=["vue","3d","threejs","three","threejs-vue"],cN=!1,uN={".":{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"},"./*":"./*"},fN="./dist/tres.js",hN="./dist/tres.js",dN="./dist/index.d.ts",pN=["*.d.ts","dist"],mN={access:"public"},gN={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"},_N={three:">=0.133",vue:">=3.4"},vN={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},yN={"@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"},xN={name:eN,type:tN,version:nN,packageManager:iN,description:sN,author:rN,license:oN,repository:aN,keywords:lN,sideEffects:cN,exports:uN,main:fN,module:hN,types:dN,files:pN,publishConfig:mN,scripts:gN,peerDependencies:_N,dependencies:vN,devDependencies:yN};class bN extends Ht{constructor(...e){super(...e),iy(this,"type","HightlightMesh"),iy(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 um(n){return typeof n>"u"}function jf(n){return Array.isArray(n)}function SN(n){return typeof n=="number"}function lE(n){return typeof n=="string"}function Xr(n){return typeof n=="function"}function Is(n){return n===Object(n)&&!jf(n)&&!Xr(n)}function Js(n){return Is(n)&&"isObject3D"in n&&!!n.isObject3D}function sy(n){return Is(n)&&"isCamera"in n&&!!n.isCamera}function MN(n){return Is(n)&&"isBufferGeometry"in n&&!!n.isBufferGeometry}function EN(n){return Is(n)&&"isMaterial"in n&&!!n.isMaterial}function TN(n){return Is(n)&&"isLight"in n&&!!n.isLight}function wN(n){return Is(n)&&"isFog"in n&&!!n.isFog}function AN(n){return Is(n)&&"isScene"in n&&!!n.isScene}function Tu(n){return Js(n)||MN(n)||EN(n)||wN(n)}function CN(n){return Is(n)&&!!n.isPrimitive}const cE=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],cE(n[t],e[t]));return Object.assign(n||{},e),n},RN="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",PN=DN(RN);function ry(n){return n&&n.nodeType===1}function wu(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const IN=/\B([A-Z])/g;function LN(n){return n.replace(IN,"-$1").toLowerCase()}function DN(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const oy=(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)},ON=(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 uE(n,e){if(ry(n)&&ry(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)||!uE(n[s],e[s]))return!1;return!0}function NN(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;lfE(i)),!(n instanceof Dh)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(s=>ay(s)):i.material&&ay(i.material)}}function kN(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const cy=/-\d+$/;function VN(n,e,t){if(lE(t)){if(cy.test(t)){const r=t.replace(cy,""),{target:o,key:a}=fm(n,r);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>um(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:s}=fm(n,t);e.__tres.previousAttach=i[s],i[s]=ua(e)}else e.__tres.previousAttach=t(n,e)}function zN(n,e,t){var i,s,r;if(lE(t)){const{target:o,key:a}=fm(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 Hr(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 hE(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 HN(n,e,t){var i;if(!Xr(n.setPixelRatio))return;let s=0;if(t&&jf(t)){const r=t;if(r.length>=2){const[o,a]=r;s=Ag.clamp(e,o,a)}}else SN(t)?s=t:s=e;s!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(s)}function GN(n,e,t,i,s){const r=[...e.__tres.objects],o=ua(e);if(n=ua(n),o===n)return!0;const a=Hr(n,e.__tres??{},s),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of r)dE(u,s),pE(u,s);o.__tres.objects=[],i.remove(e);for(const[u,f]of Object.entries(c))i.patchProp(a,u,a[u],f);t(n),i.insert(e,l);for(const u of r)i.insert(u,e);return!0}function ua(n){return CN(n)?(n.object.__tres=n.__tres,n.object):n}function dE(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&&kN(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?zN(o,n,n.__tres.attach):((r=(s=n.parent)==null?void 0:s.remove)==null||r.call(s,ua(n)),n.parent=null)}function pE(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),hE(n)}const WN=({sizes:n})=>{const e=Ze([]),t=Se(()=>e.value[0]),i=o=>{const a=o instanceof hc?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(sy(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},r=o=>{if(sy(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return sc(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof $t||XN(o))&&(o instanceof $t?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())})}),$i(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:s,deregisterCamera:r,setCameraActive:i}};function XN(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Kf="[TresJS ▲ ■ ●] ";function $N(...n){typeof n[0]=="string"?n[0]=Kf+n[0]:n.unshift(Kf),console.error(...n)}function qN(...n){typeof n[0]=="string"?n[0]=Kf+n[0]:n.unshift(Kf),console.warn(...n)}function YN(n,e){}function mE(){return{logError:$N,logWarning:qN,logMessage:YN}}const hm=Ze({}),dm=n=>Object.assign(hm.value,n);function dp(){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 or(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 jN(){let n=!0,e=!0,t=!1;const i=new Qh(!1),s=Ze(i.running),r=Ze(!1);let o;const a=Ag.generateUUID();let l=null;const c=dp(),u=dp(),f=dp();T();let h={};function d(M){h=M}function p(M,P,b=0){switch(P){case"before":return c.on(M,b);case"render":return l||(l=M),u.dispose(),u.on(M);case"after":return f.on(M,b)}}function _(){e&&(e=!1,T(),E())}function g(){e=!0,T(),cancelAnimationFrame(o)}function m(){t=!1,T()}function y(){t=!0,T()}function x(){r.value=!0}function v(){r.value=!1}function E(){if(!n){o=requestAnimationFrame(E);return}const M=i.getDelta(),P=i.getElapsedTime(),b={camera:It(h.camera),scene:It(h.scene),renderer:It(h.renderer),raycaster:It(h.raycaster),controls:It(h.controls),invalidate:h.invalidate,advance:h.advance},S={delta:M,elapsed:P,clock:i,...b};s.value&&c.trigger(S),r.value||(u.count?u.trigger(S):l&&l(S)),s.value&&f.trigger(S),o=requestAnimationFrame(E)}function T(){const M=!e&&!t;i.running!==M&&(i.running?i.stop():i.start()),s.value=i.running}return{loopId:a,register:(M,P,b)=>p(M,P,b),start:_,stop:g,pause:y,resume:m,pauseRender:x,resumeRender:v,isRenderPaused:r,isActive:s,setContext:d,setReady:M=>n=M}}function n_(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 KN(n){return(n/1024).toFixed(2)}const ZN=Number.parseInt(lc.replace("dev",""));function JN(n){return n instanceof we?n:Array.isArray(n)?new we(...n):new we(n)}const Au={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Cn,toneMapping:yh,toneMappingExposure:3,shadowMap:{enabled:!0,type:dg}},flat:{toneMapping:Hi,toneMappingExposure:1}};function QN({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:s,advance:r}}){const o=Se(()=>({alpha:on(e.alpha)??!0,depth:on(e.depth),canvas:Ei(n),context:on(e.context),stencil:on(e.stencil),antialias:on(e.antialias)??!0,precision:on(e.precision),powerPreference:on(e.powerPreference),premultipliedAlpha:on(e.premultipliedAlpha),preserveDrawingBuffer:on(e.preserveDrawingBuffer),logarithmicDepthBuffer:on(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:on(e.failIfMajorPerformanceCaveat)})),a=Ie(new $u(o.value));function l(){e.renderMode==="on-demand"&&s()}Ge(o,()=>{a.value.dispose(),a.value=new $u(o.value),l()}),Ge([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),Ge(()=>e.clearColor,l);const{pixelRatio:c}=WO(),{logError:u}=mE(),f=(()=>{const d=new $u,p={shadowMap:{enabled:d.shadowMap.enabled,type:d.shadowMap.type},toneMapping:d.toneMapping,toneMappingExposure:d.toneMappingExposure,outputColorSpace:d.outputColorSpace};return d.dispose(),p})(),h=on(e.renderMode);return h==="on-demand"&&s(),h==="manual"&&setTimeout(()=>{r()},100),sc(()=>{const d=on(e.preset);d&&(d in Au||u(`Renderer Preset must be one of these: ${Object.keys(Au).join(", ")}`),cE(a.value,Au[d])),HN(a.value,c.value,on(e.dpr)),h==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,y)=>{const x=on(m),v=()=>{if(d)return oy(Au[d],y)};if(x!==void 0)return x;const E=v();return E!==void 0?E:oy(f,y)},_=(m,y)=>ON(a.value,y,p(m,y));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??yh,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),ZN<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?JN(g):new we(0))}),$i(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function eU(n,e,t=10){const i=on(n)?ZO():$O(Se(()=>on(e).parentElement)),s=di(ny(i.width,t)),r=di(ny(i.height,t)),o=Se(()=>s.value/r.value);return{height:r,width:s,aspectRatio:o}}const tU=(n,e)=>{const t=Se(()=>e.renderer.value.domElement),i=Ie([]),{x:s,y:r}=KO({target:t});let o=0;const{width:a,height:l,top:c,left:u}=XO(t),f=({x:se,y:xe})=>{if(t.value)return{x:(se-u.value)/a.value*2-1,y:-((xe-c.value)/l.value)*2+1}},h=({x:se,y:xe})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new fe(se,xe),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},d=se=>{const xe=f({x:(se==null?void 0:se.clientX)??s.value,y:(se==null?void 0:se.clientY)??r.value});return xe?h(xe)||[]:[]},p=oi(),_=oi(),g=oi(),m=oi(),y=oi(),x=oi(),v=oi(),E=oi();function T(se){const xe={};for(const ze in se)typeof ze!="function"&&(xe[ze]=se[ze]);return xe}const M=(se,xe)=>{var ze,re,ge;const be=T(xe),W=new F(xe==null?void 0:xe.clientX,xe==null?void 0:xe.clientY,0).unproject((ze=e.camera)==null?void 0:ze.value);se.trigger({...be,intersections:i.value,unprojectedPoint:W,ray:(re=e.raycaster)==null?void 0:re.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:xe,delta:o,stopPropagating:!1})};let P;const b=se=>{d(se),M(g,se),P=se},S=()=>{P&&b(P)};let D,B,H;const $=se=>{var xe;D=(xe=i.value[0])==null?void 0:xe.object,o=0,B=new fe((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),M(y,se)};let ee,Z=!1;const te=se=>{var xe,ze,re;se instanceof PointerEvent&&(i.value.length===0&&M(x,se),D===((xe=i.value[0])==null?void 0:xe.object)&&(H=new fe((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),o=B==null?void 0:B.distanceTo(H),se.button===0?(M(p,se),ee===((ze=i.value[0])==null?void 0:ze.object)?Z=!0:(ee=(re=i.value[0])==null?void 0:re.object,Z=!1)):se.button===2&&M(v,se)),M(m,se))},Q=se=>{Z&&(M(_,se),ee=void 0,Z=!1)},pe=se=>M(g,se),ve=se=>M(E,se);return t.value.addEventListener("pointerup",te),t.value.addEventListener("pointerdown",$),t.value.addEventListener("pointermove",b),t.value.addEventListener("pointerleave",pe),t.value.addEventListener("dblclick",Q),t.value.addEventListener("wheel",ve),$i(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",te),t.value.removeEventListener("pointerdown",$),t.value.removeEventListener("pointermove",b),t.value.removeEventListener("pointerleave",pe),t.value.removeEventListener("dblclick",Q),t.value.removeEventListener("wheel",ve))}),{intersects:i,onClick:se=>p.on(se).off,onDblClick:se=>_.on(se).off,onContextMenu:se=>v.on(se).off,onPointerMove:se=>g.on(se).off,onPointerUp:se=>m.on(se).off,onPointerDown:se=>y.on(se).off,onPointerMissed:se=>x.on(se).off,onWheel:se=>E.on(se).off,forceUpdate:S}};function pp(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function nU(n,e,t){var i;const s=Ie(),r=Ie();n&&(s.value=n),e&&(r.value=e);const o=b=>{var S;return((S=b.__tres)==null?void 0:S.eventCount)>0},a=b=>{var S;return((S=b.children)==null?void 0:S.some(D=>a(D)))||o(b)},l=Ie(((i=s.value)==null?void 0:i.children).filter(a)||[]);function c(b,S){const D=[],B=()=>S.stopPropagating=!0;S.stopPropagation=B;for(const H of S==null?void 0:S.intersections){if(S.stopPropagating)return;S={...S,...H};const{object:$}=H;S.eventObject=$,pp($[b],S),D.push($);let ee=$.parent;for(;ee!==null&&!S.stopPropagating&&!D.includes(ee);)S.eventObject=ee,pp(ee[b],S),D.push(ee),ee=ee.parent;const Z=LN(b.slice(2));t(Z,{intersection:H,event:S})}}const{onClick:u,onDblClick:f,onContextMenu:h,onPointerMove:d,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:y}=tU(l,e);_(b=>c("onPointerUp",b)),p(b=>c("onPointerDown",b)),u(b=>c("onClick",b)),f(b=>c("onDoubleClick",b)),h(b=>c("onContextMenu",b)),m(b=>c("onWheel",b));let x=[];d(b=>{const S=b.intersections.map(({object:B})=>B),D=b.intersections;x.forEach(({object:B})=>{S.includes(B)||(b.intersections=x,c("onPointerLeave",b),c("onPointerOut",b))}),b.intersections=D,b.intersections.forEach(({object:B})=>{x.includes(B)||(c("onPointerEnter",b),c("onPointerOver",b))}),c("onPointerMove",b),x=b.intersections});const v=[];g(b=>{const S=()=>b.stopPropagating=!0;b.stopPropagation=S,v.forEach(D=>{b.stopPropagating||(b.eventObject=D,pp(D.onPointerMissed,b))}),t("pointer-missed",{event:b})});function E(b){Tu(b)&&Js(b)&&l.value.push(b)}function T(b){if(Tu(b)&&Js(b)){const S=l.value.indexOf(b);S>-1&&l.value.splice(S,1)}}function M(b){Tu(b)&&Js(b)&&b.onPointerMissed&&v.push(b)}function P(b){if(Tu(b)&&Js(b)){const S=v.indexOf(b);S>-1&&v.splice(S,1)}}return e.eventManager={forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:M,deregisterPointerMissedObject:P},{forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:M,deregisterPointerMissedObject:P}}function iU(n,e,t=100){t=t<=0?100:t;const i=oi(),s=new Set;let r=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!r&&n()?(i.trigger(e),s.forEach(f=>f()),s.clear(),r=!0):!o&&!r&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(f,...h)=>{f(...h)};return{on:f=>{if(r)return u(f,e),{off:()=>{}};{const h=i.on(f);return s.add(h.off),i.on(f)}},off:i.off,trigger:i.trigger,clear:i.clear,cancel:c}}const mp=new WeakMap;function sU(n){if(n=n||gE(),mp.has(n))return mp.get(n);const e=100,t=Date.now(),i=iU(()=>{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 mp.set(n,i),i}function rU({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:s}){const r=Ie(n),o=eU(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=WN({sizes:o}),h={mode:Ze(i.renderMode||"always"),priority:Ze(0),frames:Ze(0),maxFrames:60,canBeInvalidated:Se(()=>h.mode.value==="on-demand"&&h.frames.value===0)};function d(H=1){i.renderMode==="on-demand"&&(h.frames.value=Math.min(h.maxFrames,h.frames.value+H))}function p(){i.renderMode==="manual"&&(h.frames.value=1)}const{renderer:_}=QN({canvas:e,options:i,contextParts:{sizes:o,render:h,invalidate:d,advance:p}}),g={sizes:o,scene:r,camera:a,cameras:di(l),renderer:_,raycaster:Ie(new KM),controls:Ze(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:h,advance:p,extend:dm,invalidate:d,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:jN()};er("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&h.frames.value>0&&(_.value.render(n,a.value),s("render",g.renderer.value)),h.priority.value=0,h.mode.value==="always"?h.frames.value=1:h.frames.value=Math.max(0,h.frames.value-1)},"render");const{on:m,cancel:y}=sU(g);g.loop.setReady(!1),g.loop.start(),m(()=>{s("ready",g),g.loop.setReady(!0),nU(n,g,s)}),$i(()=>{y(),g.loop.stop()});const x=100,v=qO({every:x}),{isSupported:E,memory:T}=YO({interval:x}),M=160;let P=performance.now();const b=({timestamp:H})=>{g.scene.value&&(g.perf.memory.allocatedMem=n_(g.scene.value)),H-P>=x&&(P=H,g.perf.fps.accumulator.push(v.value),g.perf.fps.accumulator.length>M&&g.perf.fps.accumulator.shift(),g.perf.fps.value=v.value,E.value&&T.value&&(g.perf.memory.accumulator.push(T.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>M&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce(($,ee)=>$+ee,0)/g.perf.memory.accumulator.length))};let S=0;const D=1,{pause:B}=t_(({delta:H})=>{window.__TRES__DEVTOOLS__&&(b({timestamp:performance.now()}),S+=H,S>=D&&(window.__TRES__DEVTOOLS__.cb(g),S=0))},{immediate:!0});return $i(()=>{B()}),g}function gE(){const n=gn("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function j4(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:s,controls:r,invalidate:o,advance:a}=gE();i.setContext({camera:n,scene:e,renderer:t,raycaster:s,controls:r,invalidate:o,advance:a});function l(f,h=0){return i.register(f,"before",h)}function c(f){return i.register(f,"render")}function u(f,h=0){return i.register(f,"after",h)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const oU=oi(),aU=oi(),_E=oi(),cl=new Qh;let qu=0,Yu=0;t_(()=>{oU.trigger({delta:qu,elapsed:Yu,clock:cl}),aU.trigger({delta:qu,elapsed:Yu,clock:cl}),_E.trigger({delta:qu,elapsed:Yu,clock:cl})},{immediate:!1});_E.on(()=>{qu=cl.getDelta(),Yu=cl.getElapsedTime()});function lU(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){const u=t[l];return u&&typeof u=="function"?u(c,i,r,s):i[l]=c,!0}};return r=new Proxy({},o),r}const{logError:uy}=mE(),fy=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],cU=n=>{const e=n.scene.value;function t(c,u,f,h){if(h||(h={}),h.args||(h.args=[]),c==="template"||PN(c))return null;let d=c.replace("Tres",""),p;if(c==="primitive"){(!Is(h.object)||wt(h.object))&&uy("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),d=h.object.type;const _={};p=lU(h.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,y,x)=>{GN(g,y,x,{patchProp:r,remove:s,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=hm.value[d];_||uy(`${d} is not defined on the THREE namespace. Use extend to add it to the catalog.`),p=new _(...h.args)}return p?(p.isCamera&&(h!=null&&h.position||p.position.set(3,3,3),h!=null&&h.lookAt||p.lookAt(0,0,0)),p=Hr(p,{...p.__tres,type:d,memoizedProps:h,eventCount:0,primitive:c==="primitive",attach:h.attach},n),p):null}function i(c,u){var f,h,d;if(!c)return;u=u||e;const p=c.__tres?c:Hr(c,{},n),_=u.__tres?u:Hr(u,{},n);c=ua(p),u=ua(_),c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.registerObject(c)),n.registerCamera(c),(d=n.eventManager)==null||d.registerPointerMissedObject(c),p.__tres.attach?VN(_,p,p.__tres.attach):Js(c)&&Js(_)&&(_.add(c),c.dispatchEvent({type:"added"})),p.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(p)&&_.__tres.objects.push(p)}function s(c,u){var f,h,d,p;if(!c)return;c!=null&&c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.deregisterObject(c)),u=um(u)?"default":u;const _=(d=c.__tres)==null?void 0:d.dispose;um(_)||(_===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(y=>s(y,u)),m&&c.children&&[...c.children].forEach(y=>s(y,u)),dE(c,n),pE(c,n),m&&!AN(c)){if(Xr(u))u(c);else if(Xr(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function r(c,u,f,h){var d,p;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=h),u==="attach"){const v=((d=c.__tres)==null?void 0:d.parent)||c.parent;s(c),Hr(c,{attach:h},n),v&&i(c,v);return}if(u==="dispose"){c.__tres||(c=Hr(c,{},n)),c.__tres.dispose=h;return}if(Js(c)&&g==="blocks-pointer-events"){h||h===""?c[g]=h:delete c[g];return}fy.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=wu(g),y=_==null?void 0:_[m];if(g==="args"){const v=c,E=f??[],T=h??[],M=((p=c.__tres)==null?void 0:p.type)||c.type;M&&E.length&&!NN(E,T)&&(_=Object.assign(v,new hm.value[M](...h)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(wu(g),new Et(...h));return}if(g.includes("-")&&y===void 0){const v=g.split("-");y=v.reduce((E,T)=>E[wu(T)],_),g=v.pop(),m=g,y!=null&&y.set||(_=v.reduce((E,T)=>E[wu(T)],_))}let x=h;if(x===""&&(x=!0),Xr(y)){fy.includes(u)||(jf(x)?c[m](...x):c[m](x)),m.startsWith("on")&&Xr(x)&&(_[m]=x);return}!(y!=null&&y.set)&&!Xr(y)?_[m]=x:y.constructor===x.constructor&&y!=null&&y.copy?y==null||y.copy(x):jf(x)?y.set(...x):!y.isColor&&y.setScalar?y.setScalar(x):y.set(x),hE(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=Hr(new ct,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const f=o(c),h=((u=f==null?void 0:f.__tres)==null?void 0:u.objects)||[],d=h.indexOf(c);return d<0||d>=h.length-1?null:h[d+1]}return{insert:i,remove:s,createElement:t,patchProp:r,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};function uU(){return vE().__VUE_DEVTOOLS_GLOBAL_HOOK__}function vE(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const fU=typeof Proxy=="function",hU="devtools-plugin:setup",dU="plugin:settings:set";let ka,pm;function pU(){var n;return ka!==void 0||(typeof window<"u"&&window.performance?(ka=!0,pm=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(ka=!0,pm=globalThis.perf_hooks.performance):ka=!1),ka}function mU(){return pU()?pm.now():Date.now()}class gU{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const i={};if(e.settings)for(const o in e.settings){const a=e.settings[o];i[o]=a.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},i);try{const o=localStorage.getItem(s),a=JSON.parse(o);Object.assign(r,a)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(s,JSON.stringify(o))}catch{}r=o},now(){return mU()}},t&&t.on(dU,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function _U(n,e){const t=n,i=vE(),s=uU(),r=fU&&t.enableEarlyProxy;if(s&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))s.emit(hU,n,e);else{const o=r?new gU(t,s):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function vU(n,e){const t=`▲ ■ ●${n}`;typeof hy=="function"?hy(t,e):console.log(t)}function hy(n,e){throw new Error(n+e)}const yE=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=n_(n);return t>0&&e.tags.push({label:`${KN(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(TN(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new we(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 xE(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const s=yE(i);e.children.push(s),xE(i,s,t)})}const yU=[],Va="tres:inspector",xU=hi({sceneGraph:null});function bU(n,e){_U({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:yU,app:n},t=>{typeof t.now!="function"&&vU("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:Va,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(Va)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(r=>{if(r.inspectorId===Va){const o=yE(e.scene.value);xE(e.scene.value,o,r.filter),xU.sceneGraph=o,r.rootNodes=[o]}});let i=null,s=null;t.on.getInspectorState(r=>{var o;if(r.inspectorId===Va){const[a]=e.scene.value.getObjectsByProperty("uuid",r.nodeId);if(!a)return;if(s&&i&&i.parent&&s.remove(i),a.isMesh){const l=FN(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:n_(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===Va&&UN(e.scene.value,r.nodeId,r.path,r.state.value)})})}const SU=["data-scene","data-tres"],MU=sn({__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=sg(),o=Ze(),a=Ie(new Dh),l=vn();dm(wO);const c=(p,_=!1)=>sn({setup(){var g;const m=(g=vn())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const y={};function x(v){v&&(v.parent&&x(v.parent),v.provides&&Object.assign(y,v.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(x(l.parent),Reflect.ownKeys(y).forEach(v=>{er(v,y[v])})),er("useTres",p),er("extend",dm),typeof window<"u"&&bU(m==null?void 0:m.app,p),()=>Ss(Xt,null,_?[]:r.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=Vb(cU(p));m(Ss(g),a.value)},f=(p,_=!1)=>{fE(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},h=Ie(null);e({context:h,dispose:()=>f(h.value,!0)});const d=()=>{f(h.value),u(h.value,!0)};return yn(()=>{const p=o;h.value=rU({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i,emit:s});const{registerCamera:_,camera:g,cameras:m,deregisterCamera:y}=h.value;u(h.value);const x=()=>{const v=new $t(45,window.innerWidth/window.innerHeight,.1,1e3);v.position.set(3,3,3),v.lookAt(0,0,0),_(v);const E=sc(()=>{m.value.length>=2&&(v.removeFromParent(),y(v),E==null||E())})};Ge(()=>i.camera,(v,E)=>{v&&_(v),E&&(E.removeFromParent(),y(E))},{immediate:!0}),g.value||x()}),$i(d),(p,_)=>(ln(),ui("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:ga(p.$attrs.class),"data-tres":`tresjs ${It(xN).version}`,style:mi({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,SU))}}),EU={install(n){n.component("TresCanvas",MU)}};function gp(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 mm(n,e,t=".",i){if(!gp(e))return mm(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]]:gp(o)&&gp(s[r])?s[r]=mm(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function TU(n){return(...e)=>e.reduce((t,i)=>mm(t,i,"",n),{})}const bE=TU();function dr(n){return lh()?(Ym(n),!0):!1}function dy(){const n=new Set,e=r=>{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return dr(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const _p=new WeakMap,wU=(...n)=>{var e;const t=n[0],i=(e=vn())==null?void 0:e.proxy;if(i==null&&!ic())throw new Error("injectLocal must be called in setup");return i&&_p.has(i)&&t in _p.get(i)?_p.get(i)[t]:gn(...n)},xc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const SE=n=>n!=null,AU=Object.prototype.toString,Zf=n=>AU.call(n)==="[object Object]",Xi=()=>{},CU=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function ME(...n){if(n.length!==1)return rb(...n);const e=n[0];return typeof e=="function"?di(eg(()=>({get:e,set:Xi}))):Ze(e)}function i_(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}const EE=n=>n();function TE(n,e={}){let t,i,s=Xi;const r=l=>{clearTimeout(l),s(),s=Xi};let o;return l=>{const c=et(n),u=et(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,h)=>{s=e.rejectOnCancel?h:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function RU(...n){let e=0,t,i=!0,s=Xi,r,o,a,l,c;!wt(n[0])&&typeof n[0]=="object"?{delay:o,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=n[0]:[o,a=!0,l=!0,c=!1]=n;const u=()=>{t&&(clearTimeout(t),t=void 0,s(),s=Xi)};return h=>{const d=et(o),p=Date.now()-e,_=()=>r=h();return u(),d<=0?(e=Date.now(),_()):(p>d&&(l||!i)?(e=Date.now(),_()):a&&(r=new Promise((g,m)=>{s=c?m:g,t=setTimeout(()=>{e=Date.now(),i=!0,g(_()),u()},Math.max(0,d-p))})),!l&&!t&&(t=setTimeout(()=>i=!0,d)),i=!1,r)}}function PU(n=EE,e={}){const{initialState:t="active"}=e,i=ME(t==="active");function s(){i.value=!1}function r(){i.value=!0}const o=(...a)=>{i.value&&n(...a)};return{isActive:di(i),pause:s,resume:r,eventFilter:o}}function IU(n){let e;function t(){return e||(e=n()),e}return t.reset=async()=>{const i=e;e=void 0,i&&await i},t}function LU(n,e){var t;if(typeof n=="number")return n+e;const i=((t=n.match(/^-?\d+\.?\d*/))==null?void 0:t[0])||"",s=n.slice(i.length),r=Number.parseFloat(i)+e;return Number.isNaN(r)?n:r+s}function ul(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function fl(n){return Array.isArray(n)?n:[n]}function wE(n){return vn()}function AE(n,e=200,t={}){return i_(TE(e,t),n)}function DU(n,e=200,t=!1,i=!0,s=!1){return i_(RU(e,t,i,s),n)}function CE(n,e,t={}){const{eventFilter:i=EE,...s}=t;return Ge(n,i_(i,e),s)}function OU(n,e,t={}){const{eventFilter:i,initialState:s="active",...r}=t,{eventFilter:o,pause:a,resume:l,isActive:c}=PU(i,{initialState:s});return{stop:CE(n,e,{...r,eventFilter:o}),pause:a,resume:l,isActive:c}}function Ma(n,e=!0,t){wE()?yn(n,t):e?n():cr(n)}function NU(n,e){wE()&&$i(n,e)}function UU(n,e,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t,r=Ie(!1);let o=null;function a(){o&&(clearTimeout(o),o=null)}function l(){r.value=!1,a()}function c(...u){s&&n(),a(),r.value=!0,o=setTimeout(()=>{r.value=!1,o=null,n(...u)},et(e))}return i&&(r.value=!0,xc&&c()),dr(l),{isPending:di(r),start:c,stop:l}}function K4(n,e,t={}){const{debounce:i=0,maxWait:s=void 0,...r}=t;return CE(n,e,{...r,eventFilter:TE(i,{maxWait:s})})}function FU(n,e,t){return Ge(n,e,{...t,immediate:!0})}const Xn=xc?window:void 0,BU=xc?window.document:void 0,s_=xc?window.navigator:void 0;function Jn(n){var e;const t=et(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Dt(...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=Se(()=>{const a=fl(et(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=FU(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Jn(c)))!=null?l:[Xn].filter(c=>c!=null),fl(et(s.value?n[1]:n[0])),fl(It(s.value?n[2]:n[1])),et(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 f=Zf(u)?{...u}:u;e.push(...a.flatMap(h=>l.flatMap(d=>c.map(p=>i(h,d,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return dr(t),o}function kU(){const n=Ie(!1),e=vn();return e&&yn(()=>{n.value=!0},e),n}function vo(n){const e=kU();return Se(()=>(e.value,!!n()))}function RE(n,e,t={}){const{window:i=Xn,...s}=t;let r;const o=vo(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const h=et(n),d=fl(h).map(Jn).filter(SE);return new Set(d)}),c=Ge(()=>l.value,h=>{a(),o.value&&h.size&&(r=new MutationObserver(e),h.forEach(d=>r.observe(d,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return dr(f),{isSupported:o,stop:f,takeRecords:u}}const VU=Symbol("vueuse-ssr-width");function PE(){const n=ic()?wU(VU,null):null;return typeof n=="number"?n:void 0}function $r(n,e={}){const{window:t=Xn,ssrWidth:i=PE()}=e,s=vo(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=Ie(typeof i=="number"),o=Ie(),a=Ie(!1),l=c=>{a.value=c.matches};return sc(()=>{if(r.value){r.value=!s.value;const c=et(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),h=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=!!(h||d);return h&&p&&(p=i>=ul(h[1])),d&&p&&(p=i<=ul(d[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(et(n)),a.value=o.value.matches)}),Dt(o,"change",l,{passive:!0}),Se(()=>a.value)}const Z4={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function J4(n,e={}){function t(d,p){let _=et(n[et(d)]);return p!=null&&(_=LU(_,p)),typeof _=="number"&&(_=`${_}px`),_}const{window:i=Xn,strategy:s="min-width",ssrWidth:r=PE()}=e,o=typeof r=="number",a=o?Ie(!1):{value:!0};o&&Ma(()=>a.value=!!i);function l(d,p){return!a.value&&o?d==="min"?r>=ul(p):r<=ul(p):i?i.matchMedia(`(${d}-width: ${p})`).matches:!1}const c=d=>$r(()=>`(min-width: ${t(d)})`,e),u=d=>$r(()=>`(max-width: ${t(d)})`,e),f=Object.keys(n).reduce((d,p)=>(Object.defineProperty(d,p,{get:()=>s==="min-width"?c(p):u(p),enumerable:!0,configurable:!0}),d),{});function h(){const d=Object.keys(n).map(p=>[p,f[p],ul(t(p))]).sort((p,_)=>p[2]-_[2]);return Se(()=>d.filter(([,p])=>p.value).map(([p])=>p))}return Object.assign(f,{greaterOrEqual:c,smallerOrEqual:u,greater(d){return $r(()=>`(min-width: ${t(d,.1)})`,e)},smaller(d){return $r(()=>`(max-width: ${t(d,-.1)})`,e)},between(d,p){return $r(()=>`(min-width: ${t(d)}) and (max-width: ${t(p,-.1)})`,e)},isGreater(d){return l("min",t(d,.1))},isGreaterOrEqual(d){return l("min",t(d))},isSmaller(d){return l("max",t(d,-.1))},isSmallerOrEqual(d){return l("max",t(d))},isInBetween(d,p){return l("min",t(d))&&l("max",t(p,-.1))},current:h,active(){const d=h();return Se(()=>d.value.length===0?"":d.value.at(s==="min-width"?-1:0))}})}function gm(n,e={}){const{controls:t=!1,navigator:i=s_}=e,s=vo(()=>i&&"permissions"in i),r=Ie(),o=typeof n=="string"?{name:n}:n,a=Ie(),l=()=>{var u,f;a.value=(f=(u=r.value)==null?void 0:u.state)!=null?f:"prompt"};Dt(r,"change",l,{passive:!0});const c=IU(async()=>{if(s.value){if(!r.value)try{r.value=await i.permissions.query(o)}catch{r.value=void 0}finally{l()}if(t)return ot(r.value)}});return c(),t?{state:a,isSupported:s,query:c}:a}function Q4(n={}){const{navigator:e=s_,read:t=!1,source:i,copiedDuring:s=1500,legacy:r=!1}=n,o=vo(()=>e&&"clipboard"in e),a=gm("clipboard-read"),l=gm("clipboard-write"),c=Se(()=>o.value||r),u=Ie(""),f=Ie(!1),h=UU(()=>f.value=!1,s,{immediate:!1});async function d(){let y=!(o.value&&m(a.value));if(!y)try{u.value=await e.clipboard.readText()}catch{y=!0}y&&(u.value=g())}c.value&&t&&Dt(["copy","cut"],d,{passive:!0});async function p(y=et(i)){if(c.value&&y!=null){let x=!(o.value&&m(l.value));if(!x)try{await e.clipboard.writeText(y)}catch{x=!0}x&&_(y),u.value=y,f.value=!0,h.start()}}function _(y){const x=document.createElement("textarea");x.value=y??"",x.style.position="absolute",x.style.opacity="0",document.body.appendChild(x),x.select(),document.execCommand("copy"),x.remove()}function g(){var y,x,v;return(v=(x=(y=document==null?void 0:document.getSelection)==null?void 0:y.call(document))==null?void 0:x.toString())!=null?v:""}function m(y){return y==="granted"||y==="prompt"}return{isSupported:c,text:u,copied:f,copy:p}}const Cu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ru="__vueuse_ssr_handlers__",zU=HU();function HU(){return Ru in Cu||(Cu[Ru]=Cu[Ru]||{}),Cu[Ru]}function IE(n,e){return zU[n]||e}function GU(n){return $r("(prefers-color-scheme: dark)",n)}function WU(n){return n==null?"any":n instanceof Set?"set":n instanceof Map?"map":n instanceof Date?"date":typeof n=="boolean"?"boolean":typeof n=="string"?"string":typeof n=="object"?"object":Number.isNaN(n)?"any":"number"}const XU={boolean:{read:n=>n==="true",write:n=>String(n)},object:{read:n=>JSON.parse(n),write:n=>JSON.stringify(n)},number:{read:n=>Number.parseFloat(n),write:n=>String(n)},any:{read:n=>n,write:n=>String(n)},string:{read:n=>n,write:n=>String(n)},map:{read:n=>new Map(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n.entries()))},set:{read:n=>new Set(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n))},date:{read:n=>new Date(n),write:n=>n.toISOString()}},py="vueuse-storage";function LE(n,e,t,i={}){var s;const{flush:r="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:c=!1,shallow:u,window:f=Xn,eventFilter:h,onError:d=D=>{console.error(D)},initOnMounted:p}=i,_=(u?Ie:Ze)(typeof e=="function"?e():e),g=Se(()=>et(n));if(!t)try{t=IE("getDefaultStorage",()=>{var D;return(D=Xn)==null?void 0:D.localStorage})()}catch(D){d(D)}if(!t)return _;const m=et(e),y=WU(m),x=(s=i.serializer)!=null?s:XU[y],{pause:v,resume:E}=OU(_,()=>M(_.value),{flush:r,deep:o,eventFilter:h});Ge(g,()=>b(),{flush:r}),f&&a&&Ma(()=>{t instanceof Storage?Dt(f,"storage",b,{passive:!0}):Dt(f,py,S),p&&b()}),p||b();function T(D,B){if(f){const H={key:g.value,oldValue:D,newValue:B,storageArea:t};f.dispatchEvent(t instanceof Storage?new StorageEvent("storage",H):new CustomEvent(py,{detail:H}))}}function M(D){try{const B=t.getItem(g.value);if(D==null)T(B,null),t.removeItem(g.value);else{const H=x.write(D);B!==H&&(t.setItem(g.value,H),T(B,H))}}catch(B){d(B)}}function P(D){const B=D?D.newValue:t.getItem(g.value);if(B==null)return l&&m!=null&&t.setItem(g.value,x.write(m)),m;if(!D&&c){const H=x.read(B);return typeof c=="function"?c(H,m):y==="object"&&!Array.isArray(H)?{...m,...H}:H}else return typeof B!="string"?B:x.read(B)}function b(D){if(!(D&&D.storageArea!==t)){if(D&&D.key==null){_.value=m;return}if(!(D&&D.key!==g.value)){v();try{(D==null?void 0:D.newValue)!==x.write(_.value)&&(_.value=P(D))}catch(B){d(B)}finally{D?cr(E):E()}}}}function S(D){b(D.detail)}return _}const $U="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function qU(n={}){const{selector:e="html",attribute:t="class",initialValue:i="auto",window:s=Xn,storage:r,storageKey:o="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:l,emitAuto:c,disableTransition:u=!0}=n,f={auto:"",light:"light",dark:"dark",...n.modes||{}},h=GU({window:s}),d=Se(()=>h.value?"dark":"light"),p=l||(o==null?ME(i):LE(o,i,r,{window:s,listenToStorageChanges:a})),_=Se(()=>p.value==="auto"?d.value:p.value),g=IE("updateHTMLAttrs",(v,E,T)=>{const M=typeof v=="string"?s==null?void 0:s.document.querySelector(v):Jn(v);if(!M)return;const P=new Set,b=new Set;let S=null;if(E==="class"){const B=T.split(/\s/g);Object.values(f).flatMap(H=>(H||"").split(/\s/g)).filter(Boolean).forEach(H=>{B.includes(H)?P.add(H):b.add(H)})}else S={key:E,value:T};if(P.size===0&&b.size===0&&S===null)return;let D;u&&(D=s.document.createElement("style"),D.appendChild(document.createTextNode($U)),s.document.head.appendChild(D));for(const B of P)M.classList.add(B);for(const B of b)M.classList.remove(B);S&&M.setAttribute(S.key,S.value),u&&(s.getComputedStyle(D).opacity,document.head.removeChild(D))});function m(v){var E;g(e,t,(E=f[v])!=null?E:v)}function y(v){n.onChanged?n.onChanged(v,m):m(v)}Ge(_,y,{flush:"post",immediate:!0}),Ma(()=>y(_.value));const x=Se({get(){return c?p.value:_.value},set(v){p.value=v}});return Object.assign(x,{store:p,system:d,state:_})}function Pu(n,e,t={}){const{window:i=Xn,initialValue:s,observe:r=!1}=t,o=Ie(s),a=Se(()=>{var c;return Jn(e)||((c=i==null?void 0:i.document)==null?void 0:c.documentElement)});function l(){var c;const u=et(n),f=et(a);if(f&&i&&u){const h=(c=i.getComputedStyle(f).getPropertyValue(u))==null?void 0:c.trim();o.value=h||o.value||s}}return r&&RE(a,l,{attributeFilter:["style","class"],window:i}),Ge([a,()=>et(n)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),l()},{immediate:!0}),Ge([o,a],([c,u])=>{const f=et(n);u!=null&&u.style&&f&&(c==null?u.style.removeProperty(f):u.style.setProperty(f,c))},{immediate:!0}),o}function YU(n={}){const{valueDark:e="dark",valueLight:t=""}=n,i=qU({...n,onChanged:(o,a)=>{var l;n.onChanged?(l=n.onChanged)==null||l.call(n,o==="dark",a,o):a(o)},modes:{dark:e,light:t}}),s=Se(()=>i.system.value);return Se({get(){return i.value==="dark"},set(o){const a=o?"dark":"light";s.value===a?i.value="auto":i.value=a}})}function jU(n={}){const{navigator:e=s_,requestPermissions:t=!1,constraints:i={audio:!0,video:!0},onUpdated:s}=n,r=Ze([]),o=Se(()=>r.value.filter(p=>p.kind==="videoinput")),a=Se(()=>r.value.filter(p=>p.kind==="audioinput")),l=Se(()=>r.value.filter(p=>p.kind==="audiooutput")),c=vo(()=>e&&e.mediaDevices&&e.mediaDevices.enumerateDevices),u=Ie(!1);let f;async function h(){c.value&&(r.value=await e.mediaDevices.enumerateDevices(),s==null||s(r.value),f&&(f.getTracks().forEach(p=>p.stop()),f=null))}async function d(){const p=i.video?"camera":"microphone";if(!c.value)return!1;if(u.value)return!0;const{state:_,query:g}=gm(p,{controls:!0});if(await g(),_.value!=="granted"){let m=!0;try{f=await e.mediaDevices.getUserMedia(i)}catch{f=null,m=!1}h(),u.value=m}else u.value=!0;return u.value}return c.value&&(t&&d(),Dt(e.mediaDevices,"devicechange",h,{passive:!0}),h()),{devices:r,ensurePermissions:d,permissionGranted:u,videoInputs:o,audioInputs:a,audioOutputs:l,isSupported:c}}function KU(n,e,t={}){const{window:i=Xn,...s}=t;let r;const o=vo(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const f=et(n);return Array.isArray(f)?f.map(h=>Jn(h)):[Jn(f)]}),c=Ge(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const h of f)h&&r.observe(h,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return dr(u),{isSupported:o,stop:u}}function eG(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Ie(0),l=Ie(0),c=Ie(0),u=Ie(0),f=Ie(0),h=Ie(0),d=Ie(0),p=Ie(0);function _(){const m=Jn(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,h.value=0,d.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,h.value=y.width,d.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return KU(n,g),Ge(()=>Jn(n),m=>!m&&g()),RE(n,g,{attributeFilter:["style","class"]}),s&&Dt("scroll",g,{capture:!0,passive:!0}),i&&Dt("resize",g,{passive:!0}),Ma(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function ZU(n,e,t={}){const{root:i,rootMargin:s="0px",threshold:r=0,window:o=Xn,immediate:a=!0}=t,l=vo(()=>o&&"IntersectionObserver"in o),c=Se(()=>{const p=et(n);return fl(p).map(Jn).filter(SE)});let u=Xi;const f=Ie(a),h=l.value?Ge(()=>[c.value,Jn(i),f.value],([p,_])=>{if(u(),!f.value||!p.length)return;const g=new IntersectionObserver(e,{root:Jn(_),rootMargin:s,threshold:r});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=Xi}},{immediate:a,flush:"post"}):Xi,d=()=>{u(),h(),f.value=!1};return dr(d),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:d}}const JU={multiple:!0,accept:"*",reset:!1,directory:!1};function QU(n){if(!n)return null;if(n instanceof FileList)return n;const e=new DataTransfer;for(const t of n)e.items.add(t);return e.files}function tG(n={}){const{document:e=BU}=n,t=Ze(QU(n.initialFiles)),{on:i,trigger:s}=dy(),{on:r,trigger:o}=dy();let a;e&&(a=e.createElement("input"),a.type="file",a.onchange=u=>{const f=u.target;t.value=f.files,s(t.value)},a.oncancel=()=>{o()});const l=()=>{t.value=null,a&&a.value&&(a.value="",s(null))},c=u=>{if(!a)return;const f={...JU,...n,...u};a.multiple=f.multiple,a.accept=f.accept,a.webkitdirectory=f.directory,CU(f,"capture")&&(a.capture=f.capture),f.reset&&l(),a.click()};return{files:di(t),open:c,reset:l,onCancel:r,onChange:i}}const my=1;function nG(n,e={}){const{throttle:t=0,idle:i=200,onStop:s=Xi,onScroll:r=Xi,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:a={capture:!1,passive:!0},behavior:l="auto",window:c=Xn,onError:u=M=>{console.error(M)}}=e,f=Ie(0),h=Ie(0),d=Se({get(){return f.value},set(M){_(M,void 0)}}),p=Se({get(){return h.value},set(M){_(void 0,M)}});function _(M,P){var b,S,D,B;if(!c)return;const H=et(n);if(!H)return;(D=H instanceof Document?c.document.body:H)==null||D.scrollTo({top:(b=et(P))!=null?b:p.value,left:(S=et(M))!=null?S:d.value,behavior:et(l)});const $=((B=H==null?void 0:H.document)==null?void 0:B.documentElement)||(H==null?void 0:H.documentElement)||H;d!=null&&(f.value=$.scrollLeft),p!=null&&(h.value=$.scrollTop)}const g=Ie(!1),m=hi({left:!0,right:!1,top:!0,bottom:!1}),y=hi({left:!1,right:!1,top:!1,bottom:!1}),x=M=>{g.value&&(g.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,s(M))},v=AE(x,t+i),E=M=>{var P;if(!c)return;const b=((P=M==null?void 0:M.document)==null?void 0:P.documentElement)||(M==null?void 0:M.documentElement)||Jn(M),{display:S,flexDirection:D,direction:B}=getComputedStyle(b),H=B==="rtl"?-1:1,$=b.scrollLeft;y.left=$f.value;const ee=Math.abs($*H)<=(o.left||0),Z=Math.abs($*H)+b.clientWidth>=b.scrollWidth-(o.right||0)-my;S==="flex"&&D==="row-reverse"?(m.left=Z,m.right=ee):(m.left=ee,m.right=Z),f.value=$;let te=b.scrollTop;M===c.document&&!te&&(te=c.document.body.scrollTop),y.top=teh.value;const Q=Math.abs(te)<=(o.top||0),pe=Math.abs(te)+b.clientHeight>=b.scrollHeight-(o.bottom||0)-my;S==="flex"&&D==="column-reverse"?(m.top=pe,m.bottom=Q):(m.top=Q,m.bottom=pe),h.value=te},T=M=>{var P;if(!c)return;const b=(P=M.target.documentElement)!=null?P:M.target;E(b),g.value=!0,v(M),r(M)};return Dt(n,"scroll",t?DU(T,t,!0,!1):T,a),Ma(()=>{try{const M=et(n);if(!M)return;E(M)}catch(M){u(M)}}),Dt(n,"scrollend",x,a),{x:d,y:p,isScrolling:g,arrivedState:m,directions:y,measure(){const M=et(n);c&&M&&E(M)}}}function Vs(n,e,t={}){const{window:i=Xn}=t;return LE(n,e,i==null?void 0:i.localStorage,t)}function iG(n){const e=Ie(),t=()=>{e.value&&URL.revokeObjectURL(e.value),e.value=void 0};return Ge(()=>et(n),i=>{t(),i&&(e.value=URL.createObjectURL(i))},{immediate:!0}),dr(t),di(e)}const gy="--vueuse-safe-area-top",_y="--vueuse-safe-area-right",vy="--vueuse-safe-area-bottom",yy="--vueuse-safe-area-left";function sG(){const n=Ie(""),e=Ie(""),t=Ie(""),i=Ie("");if(xc){const r=Pu(gy),o=Pu(_y),a=Pu(vy),l=Pu(yy);r.value="env(safe-area-inset-top, 0px)",o.value="env(safe-area-inset-right, 0px)",a.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",s(),Dt("resize",AE(s),{passive:!0})}function s(){n.value=Iu(gy),e.value=Iu(_y),t.value=Iu(vy),i.value=Iu(yy)}return{top:n,right:e,bottom:t,left:i,update:s}}function Iu(n){return getComputedStyle(document.documentElement).getPropertyValue(n)}function rG(n,e,t){const{window:i=Xn}={},s=Ze(null),r=Ie(),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},dr(()=>{r.value&&r.value.terminate()})),{data:s,post:o,terminate:a,worker:r}}function oG(n={}){const{window:e=Xn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Ie(t),l=Ie(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:h,scale:d}=e.visualViewport;a.value=Math.round(f*d),l.value=Math.round(h*d)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),Ma(c);const u={passive:!0};if(Dt("resize",c,u),e&&o==="visual"&&e.visualViewport&&Dt(e.visualViewport,"resize",c,u),s){const f=$r("(orientation: portrait)");Ge(f,()=>c())}return{width:a,height:l}}const DE=1/60*1e3,eF=typeof performance<"u"?()=>performance.now():()=>Date.now(),OE=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(eF()),DE);function tF(n){let e=[],t=[],i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const f=u&&s,h=f?e:t;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),f&&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]=tF(()=>Yl=!0),n),{}),ym=bc.reduce((n,e)=>{const t=nd[e];return n[e]=(i,s=!1,r=!1)=>(Yl||rF(),t.schedule(i,s,r)),n},{}),iF=bc.reduce((n,e)=>(n[e]=nd[e].cancel,n),{});bc.reduce((n,e)=>(n[e]=()=>nd[e].process(ta),n),{});const sF=n=>nd[n].process(ta),NE=n=>{Yl=!1,ta.delta=_m?DE:Math.max(Math.min(n-ta.timestamp,nF),1),ta.timestamp=n,vm=!0,bc.forEach(sF),vm=!1,Yl&&(_m=!1,OE(NE))},rF=()=>{Yl=!0,_m=!0,vm||OE(NE)},UE=()=>ta;function FE(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),by=.001,oF=.01,aF=10,lF=.05,cF=1;function uF({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let s,r,o=1-e;o=xm(lF,cF,o),n=xm(oF,aF,n/1e3),o<1?(s=c=>{const u=c*o,f=u*n,h=u-t,d=bm(c,o),p=Math.exp(-f);return by-h/d*p},r=c=>{const f=c*o*n,h=f*t+t,d=Math.pow(o,2)*Math.pow(c,2)*n,p=Math.exp(-f),_=bm(Math.pow(c,2),o);return(-s(c)+by>0?-1:1)*((h-d)*p)/_}):(s=c=>{const u=Math.exp(-c*n),f=(c-t)*n+1;return-.001+u*f},r=c=>{const u=Math.exp(-c*n),f=(t-c)*(n*n);return u*f});const a=5/n,l=hF(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 fF=12;function hF(n,e,t){let i=t;for(let s=1;sn[t]!==void 0)}function mF(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!Sy(n,pF)&&Sy(n,dF)){const t=uF(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function r_(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:s}=n,r=FE(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:h}=mF(r),d=My,p=My;function _(){const g=u?-(u/1e3):0,m=t-e,y=l/(2*Math.sqrt(a*c)),x=Math.sqrt(a/c)/1e3;if(s===void 0&&(s=Math.min(Math.abs(t-e)/100,.4)),y<1){const v=bm(x,y);d=E=>{const T=Math.exp(-y*x*E);return t-T*((g+y*x*m)/v*Math.sin(v*E)+m*Math.cos(v*E))},p=E=>{const T=Math.exp(-y*x*E);return y*x*T*(Math.sin(v*E)*(g+y*x*m)/v+m*Math.cos(v*E))-T*(Math.cos(v*E)*(g+y*x*m)-v*m*Math.sin(v*E))}}else if(y===1)d=v=>t-Math.exp(-x*v)*(m+(g+x*m)*v);else{const v=x*Math.sqrt(y*y-1);d=E=>{const T=Math.exp(-y*x*E),M=Math.min(v*E,300);return t-T*((g+y*x*m)*Math.sinh(M)+v*m*Math.cosh(M))/v}}}return _(),{next:g=>{const m=d(g);if(h)o.done=g>=f;else{const y=p(g)*1e3,x=Math.abs(y)<=i,v=Math.abs(t-m)<=s;o.done=x&&v}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}r_.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const My=n=>0,BE=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},o_=(n,e,t)=>-t*n+t*e+n,kE=(n,e)=>t=>Math.max(Math.min(t,e),n),hl=n=>n%1?Number(n.toFixed(5)):n,jl=/(-)?([\d]*\.?[\d])+/g,Sm=/(#[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,gF=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Sc(n){return typeof n=="string"}const Mc={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},dl=Object.assign(Object.assign({},Mc),{transform:kE(0,1)}),Lu=Object.assign(Object.assign({},Mc),{default:1}),a_=n=>({test:e=>Sc(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Ur=a_("deg"),pl=a_("%"),it=a_("px"),Ey=Object.assign(Object.assign({},pl),{parse:n=>pl.parse(n)/100,transform:n=>pl.transform(n*100)}),l_=(n,e)=>t=>!!(Sc(t)&&gF.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),VE=(n,e,t)=>i=>{if(!Sc(i))return i;const[s,r,o,a]=i.match(jl);return{[n]:parseFloat(s),[e]:parseFloat(r),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Kr={test:l_("hsl","hue"),parse:VE("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+pl.transform(hl(e))+", "+pl.transform(hl(t))+", "+hl(dl.transform(i))+")"},_F=kE(0,255),vp=Object.assign(Object.assign({},Mc),{transform:n=>Math.round(_F(n))}),Qs={test:l_("rgb","red"),parse:VE("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+vp.transform(n)+", "+vp.transform(e)+", "+vp.transform(t)+", "+hl(dl.transform(i))+")"};function vF(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 Mm={test:l_("#"),parse:vF,transform:Qs.transform},kn={test:n=>Qs.test(n)||Mm.test(n)||Kr.test(n),parse:n=>Qs.test(n)?Qs.parse(n):Kr.test(n)?Kr.parse(n):Mm.parse(n),transform:n=>Sc(n)?n:n.hasOwnProperty("red")?Qs.transform(n):Kr.transform(n)},zE="${c}",HE="${n}";function yF(n){var e,t,i,s;return isNaN(n)&&Sc(n)&&((t=(e=n.match(jl))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((s=(i=n.match(Sm))===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)>0}function GE(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(Sm);i&&(t=i.length,n=n.replace(Sm,zE),e.push(...i.map(kn.parse)));const s=n.match(jl);return s&&(n=n.replace(jl,HE),e.push(...s.map(Mc.parse))),{values:e,numColors:t,tokenised:n}}function WE(n){return GE(n).values}function XE(n){const{values:e,numColors:t,tokenised:i}=GE(n),s=e.length;return r=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function bF(n){const e=WE(n);return XE(n)(e.map(xF))}const Ec={test:yF,parse:WE,createTransformer:XE,getAnimatableNone:bF},SF=new Set(["brightness","contrast","saturate","opacity"]);function MF(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(jl)||[];if(!i)return n;const s=t.replace(i,"");let r=SF.has(e)?1:0;return i!==t&&(r*=100),e+"("+r+s+")"}const EF=/([a-z-]*)\(.*?\)/g,Em=Object.assign(Object.assign({},Ec),{getAnimatableNone:n=>{const e=n.match(EF);return e?e.map(MF).join(" "):n}});function yp(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 Ty({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=yp(l,a,n+1/3),r=yp(l,a,n),o=yp(l,a,n-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const TF=(n,e,t)=>{const i=n*n,s=e*e;return Math.sqrt(Math.max(0,t*(s-i)+i))},wF=[Mm,Qs,Kr],wy=n=>wF.find(e=>e.test(n)),$E=(n,e)=>{let t=wy(n),i=wy(e),s=t.parse(n),r=i.parse(e);t===Kr&&(s=Ty(s),t=Qs),i===Kr&&(r=Ty(r),i=Qs);const o=Object.assign({},s);return a=>{for(const l in o)l!=="alpha"&&(o[l]=TF(s[l],r[l],a));return o.alpha=o_(s.alpha,r.alpha,a),t.transform(o)}},AF=n=>typeof n=="number",CF=(n,e)=>t=>e(n(t)),qE=(...n)=>n.reduce(CF);function YE(n,e){return AF(n)?t=>o_(n,e,t):kn.test(n)?$E(n,e):KE(n,e)}const jE=(n,e)=>{const t=[...n],i=t.length,s=n.map((r,o)=>YE(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]=YE(n[s],e[s]));return s=>{for(const r in i)t[r]=i[r](s);return t}};function Ay(n){const e=Ec.parse(n),t=e.length;let i=0,s=0,r=0;for(let o=0;o{const t=Ec.createTransformer(e),i=Ay(n),s=Ay(e);return i.numHSL===s.numHSL&&i.numRGB===s.numRGB&&i.numNumbers>=s.numNumbers?qE(jE(i.parsed,s.parsed),t):o=>`${o>0?e:n}`},PF=(n,e)=>t=>o_(n,e,t);function IF(n){if(typeof n=="number")return PF;if(typeof n=="string")return kn.test(n)?$E:KE;if(Array.isArray(n))return jE;if(typeof n=="object")return RF}function LF(n,e,t){const i=[],s=t||IF(n[0]),r=n.length-1;for(let o=0;ot(BE(n,e,i))}function OF(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=BE(n[r],n[r+1],s);return e[r](a)}}function ZE(n,e,{clamp:t=!0,ease:i,mixer:s}={}){const r=n.length;xy(r===e.length),xy(!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=LF(e,i,s),a=r===2?DF(n,o):OF(n,o);return t?l=>a(xm(n[0],n[r-1],l)):a}const id=n=>e=>1-n(1-e),c_=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,NF=n=>e=>Math.pow(e,n),JE=n=>e=>e*e*((n+1)*e-n),UF=n=>{const e=JE(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},QE=1.525,FF=4/11,BF=8/11,kF=9/10,eT=n=>n,u_=NF(2),VF=id(u_),tT=c_(u_),nT=n=>1-Math.sin(Math.acos(n)),iT=id(nT),zF=c_(iT),f_=JE(QE),HF=id(f_),GF=c_(f_),WF=UF(QE),XF=4356/361,$F=35442/1805,qF=16061/1805,Jf=n=>{if(n===1||n===0)return n;const e=n*n;return nn<.5?.5*(1-Jf(1-n*2)):.5*Jf(n*2-1)+.5;function KF(n,e){return n.map(()=>e||tT).splice(0,n.length-1)}function ZF(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function JF(n,e){return n.map(t=>t*e)}function ju({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=JF(i&&i.length===o.length?i:ZF(o),s);function l(){return ZE(a,o,{ease:Array.isArray(t)?t:KF(o,t)})}let c=l();return{next:u=>(r.value=c(u),r.done=u>=s,r),flipTarget:()=>{o.reverse(),c=l()}}}function QF({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 f=-a*Math.exp(-u/i);return o.done=!(f>s||f<-s),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}const Cy={keyframes:ju,spring:r_,decay:QF};function eB(n){if(Array.isArray(n.to))return ju;if(Cy[n.type])return Cy[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?ju:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?r_:ju}function sT(n,e,t=0){return n-e-t}function tB(n,e,t=0,i=!0){return i?sT(e+-n,e,t):e-(n-e)+t}function nB(n,e,t,i){return i?n>=e+t:n<=-t}const iB=n=>{const e=({delta:t})=>n(t);return{start:()=>ym.update(e,!0),stop:()=>iF.update(e)}};function rT(n){var e,t,{from:i,autoplay:s=!0,driver:r=iB,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:h,onRepeat:d,onUpdate:p}=n,_=FE(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,y=0,x=_.duration,v,E=!1,T=!0,M;const P=eB(_);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(M=ZE([0,100],[i,g],{clamp:!1}),i=0,g=100);const b=P(Object.assign(Object.assign({},_),{from:i,to:g}));function S(){y++,l==="reverse"?(T=y%2===0,o=tB(o,x,c,T)):(o=sT(o,x,c),l==="mirror"&&b.flipTarget()),E=!1,d&&d()}function D(){m.stop(),h&&h()}function B($){if(T||($=-$),o+=$,!E){const ee=b.next(Math.max(0,o));v=ee.value,M&&(v=M(v)),E=T?ee.done:o<=0}p==null||p(v),E&&(y===0&&(x??(x=o)),y{f==null||f(),m.stop()}}}function oT(n,e){return e?n*(1e3/e):0}function sB({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:f,onComplete:h,onStop:d}){let p;function _(x){return t!==void 0&&xi}function g(x){return t===void 0?i:i===void 0||Math.abs(t-x){var E;f==null||f(v),(E=x.onUpdate)===null||E===void 0||E.call(x,v)},onComplete:h,onStop:d}))}function y(x){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},x))}if(_(n))y({from:n,velocity:e,to:g(n)});else{let x=s*e+n;typeof c<"u"&&(x=c(x));const v=g(x),E=v===t?-1:1;let T,M;const P=b=>{T=M,M=b,e=oT(b-T,UE().delta),(E===1&&b>v||E===-1&&bp==null?void 0:p.stop()}}const aT=(n,e)=>1-3*e+3*n,lT=(n,e)=>3*e-6*n,cT=n=>3*n,Qf=(n,e,t)=>((aT(e,t)*n+lT(e,t))*n+cT(e))*n,uT=(n,e,t)=>3*aT(e,t)*n*n+2*lT(e,t)*n+cT(e),rB=1e-7,oB=10;function aB(n,e,t,i,s){let r,o,a=0;do o=e+(t-e)/2,r=Qf(o,i,s)-n,r>0?t=o:e=o;while(Math.abs(r)>rB&&++a=cB?uB(o,f,n,t):h===0?f:aB(o,a,a+Du,n,t)}return o=>o===0||o===1?o:Qf(r(o),e,i)}const bs={},xp={};class hB{constructor(){ii(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 Ry(n){return!Number.isNaN(Number.parseFloat(n))}class dB{constructor(e){ii(this,"current");ii(this,"prev");ii(this,"timeDelta",0);ii(this,"lastUpdated",0);ii(this,"updateSubscribers",new hB);ii(this,"stopAnimation");ii(this,"canTrackVelocity",!1);ii(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=UE();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),ym.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});ii(this,"scheduleVelocityCheck",()=>ym.postRender(this.velocityCheck));ii(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=Ry(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=Ry(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?oT(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 pB(n){return new dB(n)}const{isArray:mB}=Array;function gB(){const n=Ze({}),e=i=>{const s=r=>{n.value[r]&&(n.value[r].stop(),n.value[r].destroy(),delete n.value[r])};i?mB(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=pB(s);return o.onChange(a=>r[i]=a),n.value[i]=o,o};return NU(e),{motionValues:n,get:t,stop:e}}function _B(n){return Array.isArray(n)}function Fr(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function bp(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function vB(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function Sp(){return{type:"keyframes",ease:"linear",duration:300}}function yB(n){return{type:"keyframes",duration:800,values:n}}const Py={default:vB,x:Fr,y:Fr,z:Fr,rotate:Fr,rotateX:Fr,rotateY:Fr,rotateZ:Fr,scaleX:bp,scaleY:bp,scale:bp,backgroundColor:Sp,color:Sp,opacity:Sp};function fT(n,e){let t;return _B(e)?t=yB:t=Py[n]||Py.default,{to:e,...t(e)}}const Iy={...Mc,transform:Math.round},hT={color:kn,backgroundColor:kn,outlineColor:kn,fill:kn,stroke:kn,borderColor:kn,borderTopColor:kn,borderRightColor:kn,borderBottomColor:kn,borderLeftColor:kn,borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:Ur,rotateX:Ur,rotateY:Ur,rotateZ:Ur,scale:Lu,scaleX:Lu,scaleY:Lu,scaleZ:Lu,skew:Ur,skewX:Ur,skewY:Ur,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:dl,originX:Ey,originY:Ey,originZ:it,zIndex:Iy,filter:Em,WebkitFilter:Em,fillOpacity:dl,strokeOpacity:dl,numOctaves:Iy},h_=n=>hT[n];function Tm(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function xB(n,e){let t=h_(n);return t!==Em&&(t=Ec),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const bB={linear:eT,easeIn:u_,easeInOut:tT,easeOut:VF,circIn:nT,circInOut:zF,circOut:iT,backIn:f_,backInOut:GF,backOut:HF,anticipate:WF,bounceIn:YF,bounceInOut:jF,bounceOut:Jf};function Ly(n){if(Array.isArray(n)){const[e,t,i,s]=n;return fB(e,t,i,s)}else if(typeof n=="string")return bB[n];return n}function SB(n){return Array.isArray(n)&&typeof n[0]!="number"}function Dy(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Ec.test(e)&&!e.startsWith("url("))}function MB(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function EB({ease:n,times:e,delay:t,...i}){const s={...i};return e&&(s.offset=e),n&&(s.ease=SB(n)?n.map(Ly):Ly(n)),t&&(s.elapsed=-t),s}function TB(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),MB(e),wB(n)||(n={...n,...fT(t,e.to)}),{...e,...EB(n)}}function wB({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:s,...r}){return!!Object.keys(r).length}function AB(n,e){return n[e]||n.default||n}function CB(n,e,t,i,s){const r=AB(i,n);let o=r.from===null||r.from===void 0?e.get():r.from;const a=Dy(n,t);o==="none"&&a&&typeof t=="string"&&(o=xB(n,t));const l=Dy(n,o);function c(f){const h={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:d=>e.set(d)};return r.type==="inertia"||r.type==="decay"?sB({...h,...r}):rT({...TB(r,h,n),onUpdate:d=>{h.onUpdate(d),r.onUpdate&&r.onUpdate(d)},onComplete:()=>{s&&s(),f&&f()}})}function u(f){return e.set(t),s&&s(),f&&f(),{stop:()=>{}}}return!l||!a||r.type===!1?u:c}function RB(){const{motionValues:n,stop:e,get:t}=gB();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 f=CB(s,u,r,a,l);u.start(f)}}}function PB(n,e={},{motionValues:t,push:i,stop:s}=RB()){const r=It(e),o=Ze(!1);Ge(t,f=>{o.value=Object.values(f).filter(h=>h.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!r||!r[f])throw new Error(`The variant ${f} does not exist.`);return r[f]},l=f=>{typeof f=="string"&&(f=a(f));const h=Object.entries(f).map(([p,_])=>{if(p!=="transition")return new Promise(g=>i(p,_,n,f.transition||fT(p,f[p]),g))}).filter(Boolean);async function d(){var p,_;await Promise.all(h),(_=(p=f.transition)==null?void 0:p.onComplete)==null||_.call(p)}return Promise.all([d()])};return{isAnimating:o,apply:l,set:f=>{const h=Zf(f)?f:a(f);Object.entries(h).forEach(([d,p])=>{d!=="transition"&&i(d,p,n,{immediate:!0})})},leave:async f=>{let h;if(r&&(r.leave&&(h=r.leave),!r.leave&&r.initial&&(h=r.initial)),!h){f();return}await l(h),f()},stop:s}}const d_=typeof window<"u",IB=()=>d_&&(window.onpointerdown===null||(bs==null?void 0:bs.TEST)),LB=()=>d_&&(window.ontouchstart===null||(bs==null?void 0:bs.TEST)),DB=()=>d_&&(window.onmousedown===null||(bs==null?void 0:bs.TEST));function OB({target:n,state:e,variants:t,apply:i}){const s=It(t),r=Ze(!1),o=Ze(!1),a=Ze(!1),l=Se(()=>{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=Se(()=>{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 f in u)l.value.includes(f)||delete u[f];return u});s.hovered&&(Dt(n,"mouseenter",()=>r.value=!0),Dt(n,"mouseleave",()=>{r.value=!1,o.value=!1})),s.tapped&&(DB()&&(Dt(n,"mousedown",()=>o.value=!0),Dt(n,"mouseup",()=>o.value=!1)),IB()&&(Dt(n,"pointerdown",()=>o.value=!0),Dt(n,"pointerup",()=>o.value=!1)),LB()&&(Dt(n,"touchstart",()=>o.value=!0),Dt(n,"touchend",()=>o.value=!1))),s.focused&&(Dt(n,"focus",()=>a.value=!0),Dt(n,"blur",()=>a.value=!1)),Ge([r,o,a],()=>{i(c.value)})}function NB({set:n,target:e,variants:t,variant:i}){const s=It(t);Ge(()=>e,()=>{s&&(s.initial&&(n("initial"),i.value="initial"),s.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function UB({state:n,apply:e}){Ge(n,t=>{t&&e(t)},{immediate:!0})}function dT({target:n,variants:e,variant:t}){const i=It(e);i&&(i.visible||i.visibleOnce)&&ZU(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 FB(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&NB(n),e.syncVariants&&UB(n),e.visibilityHooks&&dT(n),e.eventListeners&&OB(n)}function pT(n={}){const e=hi({...n}),t=Ze({});return Ge(e,()=>{const i={};for(const[s,r]of Object.entries(e)){const o=h_(s),a=Tm(r,o);i[s]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function p_(n,e){Ge(()=>Jn(n),t=>{t&&e(t)},{immediate:!0})}const BB={x:"translateX",y:"translateY",z:"translateZ"};function mT(n={},e=!0){const t=hi({...n}),i=Ze("");return Ge(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=>Tm(l,it)).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=h_(a),u=Tm(l,c);r+=`${BB[a]||a}(${u}) `}e&&!o&&(r+="translateZ(0px) "),i.value=r.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const kB=["","X","Y","Z"],VB=["perspective","translate","scale","rotate","skew"],gT=["transformPerspective","x","y","z"];VB.forEach(n=>{kB.forEach(e=>{const t=n+e;gT.push(t)})});const zB=new Set(gT);function m_(n){return zB.has(n)}const HB=new Set(["originX","originY","originZ"]);function _T(n){return HB.has(n)}function GB(n){const e={},t={};return Object.entries(n).forEach(([i,s])=>{m_(i)||_T(i)?e[i]=s:t[i]=s}),{transform:e,style:t}}function sd(n){const{transform:e,style:t}=GB(n),{transform:i}=mT(e),{style:s}=pT(t);return i.value&&(s.value.transform=i.value),s.value}function WB(n,e){let t,i;const{state:s,style:r}=pT();return p_(n,o=>{i=o;for(const a of Object.keys(hT))o.style[a]===null||o.style[a]===""||m_(a)||_T(a)||(s[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(s)}),Ge(r,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:s}}function XB(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 $B(n,e){Object.entries(XB(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 qB(n,e){let t,i;const{state:s,transform:r}=mT();return p_(n,o=>{i=o,o.style.transform&&$B(s,o.style.transform),t&&(o.style.transform=t),e&&e(s)}),Ge(r,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:s}}function YB(n){return Object.entries(n)}function jB(n,e){const t=hi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:s}=WB(n,i),{transform:r}=qB(n,i);return Ge(t,o=>{YB(o).forEach(([a,l])=>{const c=m_(a)?r:s;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),p_(n,()=>e),{motionProperties:t,style:s,transform:r}}function KB(n={}){const e=It(n),t=Ze();return{state:Se(()=>{if(t.value)return e[t.value]}),variant:t}}function vT(n,e={},t){const{motionProperties:i}=jB(n),{variant:s,state:r}=KB(e),o=PB(i,e),a={target:n,variant:s,variants:e,state:r,motionProperties:i,...o};return FB(a,t),a}const yT=["delay","duration"],ZB=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...yT];function JB(n){return yT.includes(n)}function QB(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&Zf(t.variants)&&(e.value={...e.value,...t.variants});for(let i of ZB)if(!(!t||!t[i])){if(JB(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(Zf(t[i])){const s=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=s}}}}function Mp(n,e=!1){return{created:(s,r,o)=>{const a=r.value&&typeof r.value=="string"?r.value:o.key;a&&xp[a]&&xp[a].stop();const l=e?structuredClone(ot(n)||{}):n||{},c=Ze(l);typeof r.value=="object"&&(c.value=r.value),QB(o,c);const f=vT(s,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});s.motionInstance=f,a&&(xp[a]=f)},mounted:(s,r,o)=>{s.motionInstance&&dT(s.motionInstance)},getSSRProps(s,r){let{initial:o}=s.value||r&&(r==null?void 0:r.props)||{};o=It(o);const a=bE({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:sd(a)}}}}const ek={initial:{opacity:0},enter:{opacity:1}},tk={initial:{opacity:0},visible:{opacity:1}},nk={initial:{opacity:0},visibleOnce:{opacity:1}},ik={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},sk={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},rk={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},ok={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},ak={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},lk={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},ck={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},uk={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},fk={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},hk={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},dk={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},pk={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},mk={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},gk={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},_k={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},vk={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},yk={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},xk={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},bk={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Sk={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},Mk={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Ek={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},Tk={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},wk={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Ak={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Ck={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Rk={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},eh={__proto__:null,fade:ek,fadeVisible:tk,fadeVisibleOnce:nk,pop:ik,popVisible:sk,popVisibleOnce:rk,rollBottom:mk,rollLeft:ok,rollRight:ck,rollTop:hk,rollVisibleBottom:gk,rollVisibleLeft:ak,rollVisibleOnceBottom:_k,rollVisibleOnceLeft:lk,rollVisibleOnceRight:fk,rollVisibleOnceTop:pk,rollVisibleRight:uk,rollVisibleTop:dk,slideBottom:Ak,slideLeft:vk,slideRight:bk,slideTop:Ek,slideVisibleBottom:Ck,slideVisibleLeft:yk,slideVisibleOnceBottom:Rk,slideVisibleOnceLeft:xk,slideVisibleOnceRight:Mk,slideVisibleOnceTop:wk,slideVisibleRight:Sk,slideVisibleTop:Tk};function Pk(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 xT=Symbol(""),bT={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 Ik(n){return Object.prototype.toString.call(n)==="[object Object]"}function wm(n){if(Array.isArray(n))return n.map(wm);if(Ik(n)){const e={};for(const t in n)e[t]=wm(n[t]);return e}return n}function ST(n){const e=hi({}),t=gn(xT,{}),i=Se(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(ot(t)[n.preset]):n.preset in eh?structuredClone(eh[n.preset]):{}),s=Se(()=>({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 f=Number.parseInt(c[u]);for(const h of["enter","visible","visibleOnce"]){const d=l[h];d!=null&&(d.transition??(d.transition={}),d.transition[u]=f)}}return l}const o=Se(()=>{const l=bE({},s.value,i.value,n.variants||{});return r({...l},n)});function a(l,c,u){var h;l.props??(l.props={}),(h=l.props).style??(h.style={}),l.props.style={...l.props.style,...u};const f=r(wm(o.value),l.props);return l.props.onVnodeMounted=({el:d})=>{e[c]=vT(d,f)},l.props.onVnodeUpdated=({el:d})=>{const p=sd(e[c].state);for(const[_,g]of Object.entries(p))d.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const Lk=sn({name:"Motion",props:{...bT,is:{type:[String,Object],default:"div"}},setup(n){const e=sg(),{motionConfig:t,setNodeInstance:i}=ST(n);return()=>{const s=sd(t.value.initial||{}),r=Ss(n.is,void 0,e);return i(r,0,s),r}}}),Dk=sn({name:"MotionGroup",props:{...bT,is:{type:[String,Object],required:!1}},setup(n){const e=sg(),{motionConfig:t,setNodeInstance:i}=ST(n);return()=>{var o;const s=sd(t.value.initial||{}),r=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a
'};t.configure=function(p){var _,g;for(_ in p)g=p[_],g!==void 0&&p.hasOwnProperty(_)&&(i[_]=g);return this},t.status=null,t.set=function(p){var _=t.isStarted();p=s(p,i.minimum,1),t.status=p===1?null:p;var g=t.render(!_),m=g.querySelector(i.barSelector),y=i.speed,x=i.easing;return g.offsetWidth,a(function(v){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,y,x)),p===1?(l(g,{transition:"none",opacity:1}),g.offsetWidth,setTimeout(function(){l(g,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){t.remove(),v()},y)},y)):setTimeout(v,y)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var _=t.status;return _?(typeof p!="number"&&(p=(1-_)*s(Math.random()*_,.1,.95)),_=s(_+p,0,.994),t.set(_)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var p=0,_=0;t.promise=function(g){return!g||g.state()==="resolved"?this:(_===0&&t.start(),p++,_++,g.always(function(){_--,_===0?(p=0,t.done()):t.set((p-_)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var _=document.createElement("div");_.id="nprogress",_.innerHTML=i.template;var g=_.querySelector(i.barSelector),m=p?"-100":r(t.status||0),y=document.querySelector(i.parent),x;return l(g,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(x=_.querySelector(i.spinnerSelector),x&&d(x)),y!=document.body&&u(y,"nprogress-custom-parent"),y.appendChild(_),_},t.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&d(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,_="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return _+"Perspective"in p?"translate3d":_+"Transform"in p?"translate":"margin"};function s(p,_,g){return p<_?_:p>g?g:p}function r(p){return(-1+p)*100}function o(p,_,g){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+r(p)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+r(p)+"%,0)"}:m={"margin-left":r(p)+"%"},m.transition="all "+_+"ms "+g,m}var a=function(){var p=[];function _(){var g=p.shift();g&&g(_)}return function(g){p.push(g),p.length==1&&_()}}(),l=function(){var p=["Webkit","O","Moz","ms"],_={};function g(v){return v.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(E,T){return T.toUpperCase()})}function m(v){var E=document.body.style;if(v in E)return v;for(var T=p.length,M=v.charAt(0).toUpperCase()+v.slice(1),P;T--;)if(P=p[T]+M,P in E)return P;return v}function y(v){return v=g(v),_[v]||(_[v]=m(v))}function x(v,E,T){E=y(E),v.style[E]=T}return function(v,E){var T=arguments,M,P;if(T.length==2)for(M in E)P=E[M],P!==void 0&&E.hasOwnProperty(M)&&x(v,M,P);else x(v,T[1],T[2])}}();function c(p,_){var g=typeof p=="string"?p:h(p);return g.indexOf(" "+_+" ")>=0}function u(p,_){var g=h(p),m=g+_;c(g,_)||(p.className=m.substring(1))}function f(p,_){var g=h(p),m;c(p,_)&&(m=g.replace(" "+_+" "," "),p.className=m.substring(1,m.length-1))}function h(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function d(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})}(Zu)),Zu.exports}var Bk=Fk();const MT=Nk(Bk);/*! + * pinia v3.0.1 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let ET;const rd=n=>ET=n,TT=Symbol();function Am(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var ml;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(ml||(ml={}));function kk(){const n=qm(!0),e=n.run(()=>Ze({}));let t=[],i=[];const s=Qm({install(r){rd(s),s._a=r,r.provide(TT,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const wT=()=>{};function Ny(n,e,t,i=wT){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&lh()&&Ym(s),s}function Vo(n,...e){n.slice().forEach(t=>{t(...e)})}const Vk=n=>n(),Uy=Symbol(),Ep=Symbol();function Cm(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Am(s)&&Am(i)&&n.hasOwnProperty(t)&&!wt(i)&&!vs(i)?n[t]=Cm(s,i):n[t]=i}return n}const zk=Symbol();function Hk(n){return!Am(n)||!n.hasOwnProperty(zk)}const{assign:Gs}=Object;function Gk(n){return!!(wt(n)&&n.effect)}function Wk(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=sb(t.state.value[n]);return Gs(u,r,Object.keys(o||{}).reduce((f,h)=>(f[h]=Qm(Se(()=>{rd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=AT(n,c,e,t,i,!0),l}function AT(n,e,t={},i,s,r){let o;const a=Gs({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),Ze({});let _;function g(P){let b;c=u=!1,typeof P=="function"?(P(i.state.value[n]),b={type:ml.patchFunction,storeId:n,events:d}):(Cm(i.state.value[n],P),b={type:ml.patchObject,payload:P,storeId:n,events:d});const S=_=Symbol();cr().then(()=>{_===S&&(c=!0)}),u=!0,Vo(f,b,i.state.value[n])}const m=r?function(){const{state:b}=t,S=b?b():{};this.$patch(D=>{Gs(D,S)})}:wT;function y(){o.stop(),f=[],h=[],i._s.delete(n)}const x=(P,b="")=>{if(Uy in P)return P[Ep]=b,P;const S=function(){rd(i);const D=Array.from(arguments),B=[],H=[];function $(te){B.push(te)}function ee(te){H.push(te)}Vo(h,{args:D,name:S[Ep],store:E,after:$,onError:ee});let Z;try{Z=P.apply(this&&this.$id===n?this:E,D)}catch(te){throw Vo(H,te),te}return Z instanceof Promise?Z.then(te=>(Vo(B,te),te)).catch(te=>(Vo(H,te),Promise.reject(te))):(Vo(B,Z),Z)};return S[Uy]=!0,S[Ep]=b,S},v={_p:i,$id:n,$onAction:Ny.bind(null,h),$patch:g,$reset:m,$subscribe(P,b={}){const S=Ny(f,P,b.detached,()=>D()),D=o.run(()=>Ge(()=>i.state.value[n],B=>{(b.flush==="sync"?u:c)&&P({storeId:n,type:ml.direct,events:d},B)},Gs({},l,b)));return S},$dispose:y},E=hi(v);i._s.set(n,E);const M=(i._a&&i._a.runWithContext||Vk)(()=>i._e.run(()=>(o=qm()).run(()=>e({action:x}))));for(const P in M){const b=M[P];if(wt(b)&&!Gk(b)||vs(b))r||(p&&Hk(b)&&(wt(b)?b.value=p[P]:Cm(b,p[P])),i.state.value[n][P]=b);else if(typeof b=="function"){const S=x(b,P);M[P]=S,a.actions[P]=b}}return Gs(E,M),Gs(ot(E),M),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(b=>{Gs(b,P)})}}),i._p.forEach(P=>{Gs(E,o.run(()=>P({store:E,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(E.$state,p),c=!0,u=!0,E}/*! #__NO_SIDE_EFFECTS__ */function Xk(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=ic();return o=o||(l?gn(TT,null):null),o&&rd(o),o=ET,o._s.has(n)||(s?AT(n,e,i,o):Wk(n,i,o)),o._s.get(n)}return r.$id=n,r}function $k(n){const e=ot(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Se({get:()=>n[i],set(r){n[i]=r}}):(wt(s)||vs(s))&&(t[i]=rb(n,i))}return t}const qk=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>vt(()=>import("./default-CvOBokII.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>vt(()=>import("./stage-CTeAKbkQ.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,h;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(h=o.meta)==null?void 0:h.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! + * vue-router v4.5.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const Ho=typeof document<"u";function CT(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Yk(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&CT(n.default)}const yt=Object.assign;function Tp(n,e){const t={};for(const i in e){const s=e[i];t[i]=Pi(s)?s.map(n):n(s)}return t}const gl=()=>{},Pi=Array.isArray,RT=/#/g,jk=/&/g,Kk=/\//g,Zk=/=/g,Jk=/\?/g,PT=/\+/g,Qk=/%5B/g,eV=/%5D/g,IT=/%5E/g,tV=/%60/g,LT=/%7B/g,nV=/%7C/g,DT=/%7D/g,iV=/%20/g;function g_(n){return encodeURI(""+n).replace(nV,"|").replace(Qk,"[").replace(eV,"]")}function sV(n){return g_(n).replace(LT,"{").replace(DT,"}").replace(IT,"^")}function Rm(n){return g_(n).replace(PT,"%2B").replace(iV,"+").replace(RT,"%23").replace(jk,"%26").replace(tV,"`").replace(LT,"{").replace(DT,"}").replace(IT,"^")}function rV(n){return Rm(n).replace(Zk,"%3D")}function oV(n){return g_(n).replace(RT,"%23").replace(Jk,"%3F")}function aV(n){return n==null?"":oV(n).replace(Kk,"%2F")}function Kl(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const lV=/\/$/,cV=n=>n.replace(lV,"");function wp(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=dV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:Kl(o)}}function uV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function Fy(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function fV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&fa(e.matched[i],t.matched[s])&&OT(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function fa(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function OT(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!hV(n[t],e[t]))return!1;return!0}function hV(n,e){return Pi(n)?By(n,e):Pi(e)?By(e,n):n===e}function By(n,e){return Pi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function dV(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const zs={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Zl;(function(n){n.pop="pop",n.push="push"})(Zl||(Zl={}));var _l;(function(n){n.back="back",n.forward="forward",n.unknown=""})(_l||(_l={}));function pV(n){if(!n)if(Ho){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),cV(n)}const mV=/^[^#]+#/;function gV(n,e){return n.replace(mV,"#")+e}function _V(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const od=()=>({left:window.scrollX,top:window.scrollY});function vV(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=_V(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function ky(n,e){return(history.state?history.state.position-e:-1)+n}const Pm=new Map;function yV(n,e){Pm.set(n,e)}function xV(n){const e=Pm.get(n);return Pm.delete(n),e}let bV=()=>location.protocol+"//"+location.host;function NT(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),Fy(l,"")}return Fy(t,n)+i+s}function SV(n,e,t,i){let s=[],r=[],o=null;const a=({state:h})=>{const d=NT(n,location),p=t.value,_=e.value;let g=0;if(h){if(t.value=d,e.value=h,o&&o===p){o=null;return}g=_?h.position-_.position:0}else i(d);s.forEach(m=>{m(t.value,p,{delta:g,type:Zl.pop,direction:g?g>0?_l.forward:_l.back:_l.unknown})})};function l(){o=t.value}function c(h){s.push(h);const d=()=>{const p=s.indexOf(h);p>-1&&s.splice(p,1)};return r.push(d),d}function u(){const{history:h}=window;h.state&&h.replaceState(yt({},h.state,{scroll:od()}),"")}function f(){for(const h of r)h();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function Vy(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?od():null}}function MV(n){const{history:e,location:t}=window,i={value:NT(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),h=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:bV()+n+l;try{e[u?"replaceState":"pushState"](c,"",h),s.value=c}catch(d){console.error(d),t[u?"replace":"assign"](h)}}function o(l,c){const u=yt({},e.state,Vy(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=yt({},s.value,e.state,{forward:l,scroll:od()});r(u.current,u,!0);const f=yt({},Vy(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function EV(n){n=pV(n);const e=MV(n),t=SV(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=yt({location:"",base:n,go:i,createHref:gV.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function TV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),EV(n)}function wV(n){return typeof n=="string"||n&&typeof n=="object"}function UT(n){return typeof n=="string"||typeof n=="symbol"}const FT=Symbol("");var zy;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(zy||(zy={}));function ha(n,e){return yt(new Error,{type:n,[FT]:!0},e)}function os(n,e){return n instanceof Error&&FT in n&&(e==null||!!(n.type&e))}const Hy="[^/]+?",AV={sensitive:!1,strict:!1,start:!0,end:!0},CV=/[.+*?^${}()[\]/\\]/g;function RV(n,e){const t=yt({},AV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function BT(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const IV={type:0,value:""},LV=/[a-zA-Z0-9_]/;function DV(n){if(!n)return[[]];if(n==="/")return[[IV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(d){throw new Error(`ERR (${t})/"${c}": ${d}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;a{o(x)}:gl}function o(f){if(UT(f)){const h=i.get(f);h&&(i.delete(f),t.splice(t.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=t.indexOf(f);h>-1&&(t.splice(h,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const h=BV(f,t);t.splice(h,0,f),f.record.name&&!$y(f)&&i.set(f.record.name,f)}function c(f,h){let d,p={},_,g;if("name"in f&&f.name){if(d=i.get(f.name),!d)throw ha(1,{location:f});g=d.record.name,p=yt(Wy(h.params,d.keys.filter(x=>!x.optional).concat(d.parent?d.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),f.params&&Wy(f.params,d.keys.map(x=>x.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(x=>x.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(x=>x.re.test(h.path)),!d)throw ha(1,{location:f,currentLocation:h});g=d.record.name,p=yt({},h.params,f.params),_=d.stringify(p)}const m=[];let y=d;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:FV(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Wy(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Xy(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:UV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function UV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function $y(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function FV(n){return n.reduce((e,t)=>yt(e,t.meta),{})}function qy(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function BV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;BT(n,e[r])<0?i=r:t=r+1}const s=kV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function kV(n){let e=n;for(;e=e.parent;)if(kT(e)&&BT(n,e)===0)return e}function kT({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function VV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Rm(r)):[i&&Rm(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function zV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Pi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const HV=Symbol(""),jy=Symbol(""),ad=Symbol(""),VT=Symbol(""),Im=Symbol("");function za(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function js(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(ha(4,{from:t,to:e})):h instanceof Error?l(h):wV(h)?l(ha(2,{from:e,to:h})):(o&&i.enterCallbacks[s]===o&&typeof h=="function"&&o.push(h),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(h=>l(h))})}function Ap(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(CT(l)){const u=(l.__vccOpts||l)[e];u&&r.push(js(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Yk(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&js(d,t,i,o,a,s)()}))}}return r}function Ky(n){const e=gn(ad),t=gn(VT),i=Se(()=>{const l=It(n.to);return e.resolve(l)}),s=Se(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const h=f.findIndex(fa.bind(null,u));if(h>-1)return h;const d=Zy(l[c-2]);return c>1&&Zy(u)===d&&f[f.length-1].path!==d?f.findIndex(fa.bind(null,l[c-2])):h}),r=Se(()=>s.value>-1&&qV(t.params,i.value.params)),o=Se(()=>s.value>-1&&s.value===t.matched.length-1&&OT(t.params,i.value.params));function a(l={}){if($V(l)){const c=e[It(n.replace)?"replace":"push"](It(n.to)).catch(gl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Se(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function GV(n){return n.length===1?n[0]:n}const WV=sn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ky,setup(n,{slots:e}){const t=hi(Ky(n)),{options:i}=gn(ad),s=Se(()=>({[Jy(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Jy(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&GV(e.default(t));return n.custom?r:Ss("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),XV=WV;function $V(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function qV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Pi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Zy(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Jy=(n,e,t)=>n??e??t,YV=sn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=gn(Im),s=Se(()=>n.route||i.value),r=gn(jy,0),o=Se(()=>{let c=It(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Se(()=>s.value.matched[o.value]);er(jy,Se(()=>o.value+1)),er(HV,a),er(Im,s);const l=Ze();return Ge(()=>[l.value,a.value,n.name],([c,u,f],[h,d,p])=>{u&&(u.instances[f]=c,d&&d!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=d.leaveGuards),u.updateGuards.size||(u.updateGuards=d.updateGuards))),c&&u&&(!d||!fa(u,d)||!h)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,h=f&&f.components[u];if(!h)return Qy(t.default,{Component:h,route:c});const d=f.props[u],p=d?d===!0?c.params:typeof d=="function"?d(c):d:null,g=Ss(h,yt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Qy(t.default,{Component:g,route:c})||g}}});function Qy(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const zT=YV;function jV(n){const e=NV(n.routes,n),t=n.parseQuery||VV,i=n.stringifyQuery||Yy,s=n.history,r=za(),o=za(),a=za(),l=Ie(zs);let c=zs;Ho&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Tp.bind(null,W=>""+W),f=Tp.bind(null,aV),h=Tp.bind(null,Kl);function d(W,ae){let ue,le;return UT(W)?(ue=e.getRecordMatcher(W),le=ae):le=W,e.addRoute(le,ue)}function p(W){const ae=e.getRecordMatcher(W);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(W=>W.record)}function g(W){return!!e.getRecordMatcher(W)}function m(W,ae){if(ae=yt({},ae||l.value),typeof W=="string"){const w=wp(t,W,ae.path),j=e.resolve({path:w.path},ae),G=s.createHref(w.fullPath);return yt(w,j,{params:h(j.params),hash:Kl(w.hash),redirectedFrom:void 0,href:G})}let ue;if(W.path!=null)ue=yt({},W,{path:wp(t,W.path,ae.path).path});else{const w=yt({},W.params);for(const j in w)w[j]==null&&delete w[j];ue=yt({},W,{params:f(w)}),ae.params=f(ae.params)}const le=e.resolve(ue,ae),Oe=W.hash||"";le.params=u(h(le.params));const I=uV(i,yt({},W,{hash:sV(Oe),path:le.path})),L=s.createHref(I);return yt({fullPath:I,hash:Oe,query:i===Yy?zV(W.query):W.query||{}},le,{redirectedFrom:void 0,href:L})}function y(W){return typeof W=="string"?wp(t,W,l.value.path):yt({},W)}function x(W,ae){if(c!==W)return ha(8,{from:ae,to:W})}function v(W){return M(W)}function E(W){return v(yt(y(W),{replace:!0}))}function T(W){const ae=W.matched[W.matched.length-1];if(ae&&ae.redirect){const{redirect:ue}=ae;let le=typeof ue=="function"?ue(W):ue;return typeof le=="string"&&(le=le.includes("?")||le.includes("#")?le=y(le):{path:le},le.params={}),yt({query:W.query,hash:W.hash,params:le.path!=null?{}:W.params},le)}}function M(W,ae){const ue=c=m(W),le=l.value,Oe=W.state,I=W.force,L=W.replace===!0,w=T(ue);if(w)return M(yt(y(w),{state:typeof w=="object"?yt({},Oe,w.state):Oe,force:I,replace:L}),ae||ue);const j=ue;j.redirectedFrom=ae;let G;return!I&&fV(i,le,ue)&&(G=ha(16,{to:j,from:le}),se(le,le,!0,!1)),(G?Promise.resolve(G):S(j,le)).catch(q=>os(q)?os(q,2)?q:ve(q):Q(q,j,le)).then(q=>{if(q){if(os(q,2))return M(yt({replace:L},y(q.to),{state:typeof q.to=="object"?yt({},Oe,q.to.state):Oe,force:I}),ae||j)}else q=B(j,le,!0,L,Oe);return D(j,le,q),q})}function P(W,ae){const ue=x(W,ae);return ue?Promise.reject(ue):Promise.resolve()}function b(W){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(W):W()}function S(W,ae){let ue;const[le,Oe,I]=KV(W,ae);ue=Ap(le.reverse(),"beforeRouteLeave",W,ae);for(const w of le)w.leaveGuards.forEach(j=>{ue.push(js(j,W,ae))});const L=P.bind(null,W,ae);return ue.push(L),be(ue).then(()=>{ue=[];for(const w of r.list())ue.push(js(w,W,ae));return ue.push(L),be(ue)}).then(()=>{ue=Ap(Oe,"beforeRouteUpdate",W,ae);for(const w of Oe)w.updateGuards.forEach(j=>{ue.push(js(j,W,ae))});return ue.push(L),be(ue)}).then(()=>{ue=[];for(const w of I)if(w.beforeEnter)if(Pi(w.beforeEnter))for(const j of w.beforeEnter)ue.push(js(j,W,ae));else ue.push(js(w.beforeEnter,W,ae));return ue.push(L),be(ue)}).then(()=>(W.matched.forEach(w=>w.enterCallbacks={}),ue=Ap(I,"beforeRouteEnter",W,ae,b),ue.push(L),be(ue))).then(()=>{ue=[];for(const w of o.list())ue.push(js(w,W,ae));return ue.push(L),be(ue)}).catch(w=>os(w,8)?w:Promise.reject(w))}function D(W,ae,ue){a.list().forEach(le=>b(()=>le(W,ae,ue)))}function B(W,ae,ue,le,Oe){const I=x(W,ae);if(I)return I;const L=ae===zs,w=Ho?history.state:{};ue&&(le||L?s.replace(W.fullPath,yt({scroll:L&&w&&w.scroll},Oe)):s.push(W.fullPath,Oe)),l.value=W,se(W,ae,ue,L),ve()}let H;function $(){H||(H=s.listen((W,ae,ue)=>{if(!ge.listening)return;const le=m(W),Oe=T(le);if(Oe){M(yt(Oe,{replace:!0,force:!0}),le).catch(gl);return}c=le;const I=l.value;Ho&&yV(ky(I.fullPath,ue.delta),od()),S(le,I).catch(L=>os(L,12)?L:os(L,2)?(M(yt(y(L.to),{force:!0}),le).then(w=>{os(w,20)&&!ue.delta&&ue.type===Zl.pop&&s.go(-1,!1)}).catch(gl),Promise.reject()):(ue.delta&&s.go(-ue.delta,!1),Q(L,le,I))).then(L=>{L=L||B(le,I,!1),L&&(ue.delta&&!os(L,8)?s.go(-ue.delta,!1):ue.type===Zl.pop&&os(L,20)&&s.go(-1,!1)),D(le,I,L)}).catch(gl)}))}let ee=za(),Z=za(),te;function Q(W,ae,ue){ve(W);const le=Z.list();return le.length?le.forEach(Oe=>Oe(W,ae,ue)):console.error(W),Promise.reject(W)}function pe(){return te&&l.value!==zs?Promise.resolve():new Promise((W,ae)=>{ee.add([W,ae])})}function ve(W){return te||(te=!W,$(),ee.list().forEach(([ae,ue])=>W?ue(W):ae()),ee.reset()),W}function se(W,ae,ue,le){const{scrollBehavior:Oe}=n;if(!Ho||!Oe)return Promise.resolve();const I=!ue&&xV(ky(W.fullPath,0))||(le||!ue)&&history.state&&history.state.scroll||null;return cr().then(()=>Oe(W,ae,I)).then(L=>L&&vV(L)).catch(L=>Q(L,W,ae))}const xe=W=>s.go(W);let ze;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:xe,back:()=>xe(-1),forward:()=>xe(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:Z.add,isReady:pe,install(W){const ae=this;W.component("RouterLink",XV),W.component("RouterView",zT),W.config.globalProperties.$router=ae,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>It(l)}),Ho&&!ze&&l.value===zs&&(ze=!0,v(s.location).catch(Oe=>{}));const ue={};for(const Oe in zs)Object.defineProperty(ue,Oe,{get:()=>l.value[Oe],enumerable:!0});W.provide(ad,ae),W.provide(VT,tb(ue)),W.provide(Im,l);const le=W.unmount;re.add(W),W.unmount=function(){re.delete(W),re.size<1&&(c=zs,H&&H(),H=null,l.value=zs,ze=!1,te=!1),le()}}};function be(W){return W.reduce((ae,ue)=>ae.then(()=>b(ue)),Promise.resolve())}return ge}function KV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;ofa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>fa(c,l))||s.push(l))}return[t,i,s]}function ZV(){return gn(ad)}const JV=[{path:"/",name:"/",component:()=>vt(()=>import("./index-bzfv-iWV.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2,14,15,16,17])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>vt(()=>import("./_...all_-Cy51q9AE.js"),[])},{path:"/audio",name:"/audio",component:()=>vt(()=>import("./audio-0_zWqoIr.js"),[])},{path:"/devtools",children:[{path:"image",name:"/devtools/image",component:()=>vt(()=>import("./image-BxcCkdE8.js"),__vite__mapDeps([18,19]))}]},{path:"/queue",name:"/queue",component:()=>vt(()=>import("./queue-TS7Fz0FT.js"),__vite__mapDeps([20,8]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>vt(()=>import("./index-D0jMP3xk.js"),__vite__mapDeps([21,4,5,16])),meta:{stageTransition:{name:"slide"}}},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>vt(()=>import("./index-D8H15aMF.js"),__vite__mapDeps([22,11,4,5,13,12,16])),meta:{stageTransition:{name:"slide"}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>vt(()=>import("./index-C7BYzN-U.js"),__vite__mapDeps([23,4,5,24,16])),meta:{stageTransition:{name:"slide"}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>vt(()=>import("./consciousness-C4MOcIR6.js"),__vite__mapDeps([25,4,5,26,12,27,14,7,16])),meta:{stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>vt(()=>import("./speech-CnDlxNlO.js"),__vite__mapDeps([28,29,4,5,26,12,27,7,10,16])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>vt(()=>import("./index-_295WTtQ.js"),__vite__mapDeps([30,4,5,7,24,16])),meta:{stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>vt(()=>import("./cloudflare-workers-ai-CkK42CBn.js"),__vite__mapDeps([31,4,5,7,32,27,33]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>vt(()=>import("./deepseek-DBHLmjpH.js"),__vite__mapDeps([34,4,5,7,35,13,12,32,27,33]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>vt(()=>import("./elevenlabs-BQEIxzhu.js"),__vite__mapDeps([36,29,4,5,7,10,35,13,12,32,27,33,6]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>vt(()=>import("./fireworks-ai-DDTHcmAg.js"),__vite__mapDeps([37,4,5,7,35,13,12,32,27,33]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>vt(()=>import("./mistral-ai-CTYLTfIh.js"),__vite__mapDeps([38,4,5,7,35,13,12,32,27,33]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>vt(()=>import("./moonshot-ai-BNdaKLJP.js"),__vite__mapDeps([39,4,5,7,35,13,12,32,27,33]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>vt(()=>import("./novita-ai-CHSGv0Ll.js"),__vite__mapDeps([40,4,5,7,35,13,12,32,27,33]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>vt(()=>import("./ollama-CVZEXaao.js"),__vite__mapDeps([41,27,4,5,7,35,13,12,32]))},{path:"openai",name:"/settings/providers/openai",component:()=>vt(()=>import("./openai-D5A0m4W4.js"),__vite__mapDeps([42,4,5,7,35,13,12,32,27,33]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>vt(()=>import("./openrouter-ai-CmMwHzhi.js"),__vite__mapDeps([43,4,5,7,35,13,12,32,27,33]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>vt(()=>import("./together-ai-D-AmgLNo.js"),__vite__mapDeps([44,4,5,7,35,13,12,32,27,33]))},{path:"xai",name:"/settings/providers/xai",component:()=>vt(()=>import("./xai-BWuCWE-g.js"),__vite__mapDeps([45,4,5,7,35,13,12,32,27,33]))}]},{path:"themes",children:[{path:"",name:"/settings/themes/",component:()=>vt(()=>import("./index-BvyuWAgp.js"),__vite__mapDeps([46,13,12,4,5,16,47])),meta:{stageTransition:{name:"slide"}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>vt(()=>import("./filter-message-BaOJszTp.js"),[])},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>vt(()=>import("./delays-CdpjnCha.js"),__vite__mapDeps([48,9,4,5,8,15]))},{path:"emotions",name:"/test/queues/emotions",component:()=>vt(()=>import("./emotions-1nOYob19.js"),__vite__mapDeps([49,9,4,5,8]))},{path:"messages",name:"/test/queues/messages",component:()=>vt(()=>import("./messages-gfH6DehG.js"),__vite__mapDeps([50,9,4,5,8]))}]}]}],QV=178.17,ez=Xk("settings",()=>{const n=Ze(),e=Vs("settings/language","en-US"),t=Vs("settings/stage/view/model-renderer","2d"),i=Vs("settings/audio/input","true"),s=Se(()=>{var m;return(m=n.value)==null?void 0:m.deviceId}),{audioInputs:r}=jU({constraints:{audio:!0},requestPermissions:!0}),o=Ze(),a=Ze("/assets/live2d/models/hiyori_pro_zh.zip"),l=Ze("url"),c=Ze(!1),u=Vs("settings/live2d/position",{x:0,y:0}),f=Ze({group:"Idle",index:0}),h=Ze([]),d=Vs("settings/live2d/motion-map",{}),p=Vs("settings/disable-transitions",!0),_=Vs("settings/theme/colors/hue",QV),g=Vs("settings/theme/colors/hue-dynamic",!1);return Ge(i,m=>{m==="false"&&(n.value=void 0),m==="true"&&(n.value=r.value[0])}),yn(()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])}),Ge(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])}),{live2dModelFile:o,live2dModelUrl:a,live2dLoadSource:l,live2dCurrentMotion:f,live2dPosition:u,availableLive2dMotions:h,live2dMotionMap:d,loadingLive2dModel:c,disableTransitions:p,language:e,stageView:t,themeColorsHue:_,themeColorsHueDynamic:g,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s}}),tz=sn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>t.value.primaryColor||"#666"),s=Se(()=>t.value.secondaryColor||"#ccc");return yn(()=>{document.documentElement.style.setProperty("--stage-transition-3-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-3-overlay-color-2",s.value)}),(r,o)=>(ln(),ui("div",{class:"stage-transition-3",style:mi({zIndex:t.value.zIndex||100})},null,4))}}),yo=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},nz=yo(tz,[["__scopeId","data-v-df576df0"]]),iz=sn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return yn(()=>{var i,s;document.documentElement.style.setProperty("--circle-expansion-delay",`${((i=e.stageTransition)==null?void 0:i.delay)||0}s`),document.documentElement.style.setProperty("--circle-expansion-duration",`${((s=e.stageTransition)==null?void 0:s.duration)||.4}s`),t.value.forEach((r,o)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${o+1}`,r)})}),(i,s)=>{var r;return ln(),ui("div",{class:"circle-expansion-transition",style:mi({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(ln(!0),ui(Xt,null,SA(t.value,(o,a)=>(ln(),ui("div",{key:a}))),128))],4)}}}),sz=yo(iz,[["__scopeId","data-v-0c29056c"]]),rz=sn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Se(()=>`fantasy-fall-${t.value}`);return yn(()=>{var s,r,o,a,l,c,u,f,h;document.documentElement.style.setProperty("--fantasy-fall-color",((s=e.stageTransition)==null?void 0:s.primaryColor)||"#eee"),document.documentElement.style.setProperty("--fantasy-fall-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--fantasy-fall-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--fantasy-fall-radius-sm",`${((l=(a=e.stageTransition)==null?void 0:a.borderRadius)==null?void 0:l.sm)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-md",`${((u=(c=e.stageTransition)==null?void 0:c.borderRadius)==null?void 0:u.md)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-lg",`${((h=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:h.lg)||"50%"}`)}),(s,r)=>{var o;return ln(),ui("div",{class:ga(["fantasy-fall-transition",i.value]),style:mi({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),oz=yo(rz,[["__scopeId","data-v-e62bf496"]]),az=sn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return yn(()=>{document.documentElement.style.setProperty("--stage-transition-4-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-4-overlay-color-2",s.value)}),(r,o)=>{var a;return ln(),ui("div",{class:"stage-transition-4",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[t1('
',5)]),4)}}}),lz=yo(az,[["__scopeId","data-v-6d1179fc"]]),cz=sn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Ge([t,i,s],()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),yn(()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),(r,o)=>{var a;return ln(),ui("div",{class:"stage-transition-1",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),uz=yo(cz,[["__scopeId","data-v-bf1d1566"]]),fz=sn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return yn(()=>{document.documentElement.style.setProperty("--stage-transition-2-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-2-overlay-color-2",s.value)}),(r,o)=>{var a;return ln(),ui("div",{class:"stage-transition-2",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),hz=yo(fz,[["__scopeId","data-v-8ff7120f"]]),dz=sn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return yn(()=>{var t,i,s,r,o,a,l;document.documentElement.style.setProperty("--rectangle-rotate-1-color",((t=e.stageTransition)==null?void 0:t.primaryColor)||"#ebcb8b"),document.documentElement.style.setProperty("--rectangle-rotate-2-color",((i=e.stageTransition)==null?void 0:i.secondaryColor)||"#c56370"),document.documentElement.style.setProperty("--rectangle-rotate-3-color",((s=e.stageTransition)==null?void 0:s.tertiaryColor)||"#43445b"),document.documentElement.style.setProperty("--rectangle-rotate-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--rectangle-rotate-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--rectangle-rotate-stagger",`${((a=e.stageTransition)==null?void 0:a.staggerDelay)||.1}s`),document.documentElement.style.setProperty("--rectangle-rotate-rotation",`${((l=e.stageTransition)==null?void 0:l.rotation)||270}deg`)}),(t,i)=>{var s;return ln(),ui("div",{class:"rectangle-rotate-transition",style:mi({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[$s("div",{class:"rectangle rectangle-rotate-1"},[$s("div")],-1),$s("div",{class:"rectangle rectangle-rotate-2"},[$s("div")],-1),$s("div",{class:"rectangle rectangle-rotate-3"},[$s("div")],-1)]),4)}}}),pz=yo(dz,[["__scopeId","data-v-f4b1dc64"]]),mz=sn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean}},setup(n){const e=n,t=ZV(),i=Ze(!1),s=Ze(),r=Ze(""),o=Ze(),a=Ie({slide:{component:uz,duration:2700},"slope-slide":{component:hz,duration:2700},arrow:{component:nz,duration:2700},"multiple-blocks-reveal":{component:lz,duration:2800},"fantasy-fall":{component:oz,duration:2700},"rectangles-rotate":{component:pz,duration:2700},"bubble-wave-out":{component:sz,duration:1e3}}),l=Ze([]);function c(d){return l.value.push(d),()=>{const p=l.value.indexOf(d);p>=0&&l.value.splice(p,1)}}async function u(d,p={}){s.value=d;for(const _ of l.value)try{await Promise.resolve(_(d,p))}catch(g){console.error(`Error in transition hook at stage "${d}":`,g)}}async function f(d,p,_){if(d.name==="none"||!d.name){p(),_();return}const g=a.value[d.name];if(!g){console.error(`Transition ${d.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let y=!1;const v=c(E=>{E==="navigation"&&!y&&(y=!0,p())});try{await u("before-enter",{transitionName:d.name}),i.value&&(await u("before-leave",{transitionName:r.value}),r.value="",o.value=void 0,i.value=!1,await u("after-leave",{transitionName:r.value}),await new Promise(T=>setTimeout(T,50))),r.value=d.name,o.value=d,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:d.name,config:g}),y||(y=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:d.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:d.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:d.name})},g.duration+20);const E=g.exitDuration??0;setTimeout(async()=>{i.value=!1,r.value="",o.value=void 0,await u("after-leave",{transitionName:d.name}),_()},g.duration+E)}catch(E){console.error(E)}finally{v(),setTimeout(()=>{y||(y=!0,p())},g.duration*2)}}function h(d,p){return new Promise(_=>{f(d,p,_)})}return t.beforeEach((d,p,_)=>{if(typeof d.meta.stageTransition!="object"){_();return}const g=d.meta.stageTransition;if(typeof e.primaryColor<"u"&&(g.primaryColor=e.primaryColor),typeof e.secondaryColor<"u"&&(g.secondaryColor=e.secondaryColor),typeof e.tertiaryColor<"u"&&(g.tertiaryColor=e.tertiaryColor),typeof e.colors<"u"&&(g.colors=e.colors),typeof e.zIndex<"u"&&(g.zIndex=e.zIndex),e.disableTransitions){_();return}h(g,_)}),(d,p)=>(ln(),ui(Xt,null,[MA(d.$slots,"default"),i.value?(ln(),ui(Xt,{key:0},[a.value[r.value]?(ln(),El(bA(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Z_("",!0)],64)):Z_("",!0)],64))}});/*! + * shared v11.1.2 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */const th=typeof window<"u",pr=(n,e=!1)=>e?Symbol.for(n):Symbol(n),gz=(n,e,t)=>_z({l:n,k:e,s:t}),_z=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),qt=n=>typeof n=="number"&&isFinite(n),vz=n=>v_(n)==="[object Date]",nh=n=>v_(n)==="[object RegExp]",ld=n=>lt(n)&&Object.keys(n).length===0,nn=Object.assign,yz=Object.create,Tt=(n=null)=>yz(n);let ex;const __=()=>ex||(ex=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Tt());function tx(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const xz=Object.prototype.hasOwnProperty;function Ti(n,e){return xz.call(n,e)}const Kt=Array.isArray,Ot=n=>typeof n=="function",De=n=>typeof n=="string",Nt=n=>typeof n=="boolean",mt=n=>n!==null&&typeof n=="object",bz=n=>mt(n)&&Ot(n.then)&&Ot(n.catch),HT=Object.prototype.toString,v_=n=>HT.call(n),lt=n=>v_(n)==="[object Object]",Sz=n=>n==null?"":Kt(n)||lt(n)&&n.toString===HT?JSON.stringify(n,null,2):String(n);function y_(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function Mz(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const Ou=n=>!mt(n)||Kt(n);function Ju(n,e){if(Ou(n)||Ou(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:s}=t.pop();Object.keys(i).forEach(r=>{r!=="__proto__"&&(mt(i[r])&&!mt(s[r])&&(s[r]=Array.isArray(i[r])?[]:Tt()),Ou(s[r])||Ou(i[r])?s[r]=i[r]:t.push({src:i[r],des:s[r]}))})}}/*! + * message-compiler v11.1.2 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */function Ez(n,e,t){return{line:n,column:e,offset:t}}function Lm(n,e,t){return{start:n,end:e}}const Mt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},Tz=17;function cd(n,e,t={}){const{domain:i,messages:s,args:r}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function wz(n){throw n}const as=" ",Az="\r",Tn=` +`,Cz="\u2028",Rz="\u2029";function Pz(n){const e=n;let t=0,i=1,s=1,r=0;const o=M=>e[M]===Az&&e[M+1]===Tn,a=M=>e[M]===Tn,l=M=>e[M]===Rz,c=M=>e[M]===Cz,u=M=>o(M)||a(M)||l(M)||c(M),f=()=>t,h=()=>i,d=()=>s,p=()=>r,_=M=>o(M)||l(M)||c(M)?Tn:e[M],g=()=>_(t),m=()=>_(t+r);function y(){return r=0,u(t)&&(i++,s=0),o(t)&&t++,t++,s++,e[t]}function x(){return o(t+r)&&r++,r++,e[t+r]}function v(){t=0,i=1,s=1,r=0}function E(M=0){r=M}function T(){const M=t+r;for(;M!==t;)y();r=0}return{index:f,line:h,column:d,peekOffset:p,charAt:_,currentChar:g,currentPeek:m,next:y,peek:x,reset:v,resetPeek:E,skipToPeek:T}}const Hs=void 0,Iz=".",nx="'",Lz="tokenizer";function Dz(n,e={}){const t=e.location!==!1,i=Pz(n),s=()=>i.index(),r=()=>Ez(i.line(),i.column(),i.index()),o=r(),a=s(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(R,N,V,...A){const C=c();if(N.column+=V,N.offset+=V,u){const k=t?Lm(C.startLoc,N):null,U=cd(R,k,{domain:Lz,args:A});u(U)}}function h(R,N,V){R.endLoc=r(),R.currentType=N;const A={type:N};return t&&(A.loc=Lm(R.startLoc,R.endLoc)),V!=null&&(A.value=V),A}const d=R=>h(R,13);function p(R,N){return R.currentChar()===N?(R.next(),N):(f(Mt.EXPECTED_TOKEN,r(),0,N),"")}function _(R){let N="";for(;R.currentPeek()===as||R.currentPeek()===Tn;)N+=R.currentPeek(),R.peek();return N}function g(R){const N=_(R);return R.skipToPeek(),N}function m(R){if(R===Hs)return!1;const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N===95}function y(R){if(R===Hs)return!1;const N=R.charCodeAt(0);return N>=48&&N<=57}function x(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=m(R.currentPeek());return R.resetPeek(),A}function v(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=R.currentPeek()==="-"?R.peek():R.currentPeek(),C=y(A);return R.resetPeek(),C}function E(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=R.currentPeek()===nx;return R.resetPeek(),A}function T(R,N){const{currentType:V}=N;if(V!==7)return!1;_(R);const A=R.currentPeek()===".";return R.resetPeek(),A}function M(R,N){const{currentType:V}=N;if(V!==8)return!1;_(R);const A=m(R.currentPeek());return R.resetPeek(),A}function P(R,N){const{currentType:V}=N;if(!(V===7||V===11))return!1;_(R);const A=R.currentPeek()===":";return R.resetPeek(),A}function b(R,N){const{currentType:V}=N;if(V!==9)return!1;const A=()=>{const k=R.currentPeek();return k==="{"?m(R.peek()):k==="@"||k==="|"||k===":"||k==="."||k===as||!k?!1:k===Tn?(R.peek(),A()):D(R,!1)},C=A();return R.resetPeek(),C}function S(R){_(R);const N=R.currentPeek()==="|";return R.resetPeek(),N}function D(R,N=!0){const V=(C=!1,k="")=>{const U=R.currentPeek();return U==="{"||U==="@"||!U?C:U==="|"?!(k===as||k===Tn):U===as?(R.peek(),V(!0,as)):U===Tn?(R.peek(),V(!0,Tn)):!0},A=V();return N&&R.resetPeek(),A}function B(R,N){const V=R.currentChar();return V===Hs?Hs:N(V)?(R.next(),V):null}function H(R){const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N>=48&&N<=57||N===95||N===36}function $(R){return B(R,H)}function ee(R){const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N>=48&&N<=57||N===95||N===36||N===45}function Z(R){return B(R,ee)}function te(R){const N=R.charCodeAt(0);return N>=48&&N<=57}function Q(R){return B(R,te)}function pe(R){const N=R.charCodeAt(0);return N>=48&&N<=57||N>=65&&N<=70||N>=97&&N<=102}function ve(R){return B(R,pe)}function se(R){let N="",V="";for(;N=Q(R);)V+=N;return V}function xe(R){let N="";for(;;){const V=R.currentChar();if(V==="{"||V==="}"||V==="@"||V==="|"||!V)break;if(V===as||V===Tn)if(D(R))N+=V,R.next();else{if(S(R))break;N+=V,R.next()}else N+=V,R.next()}return N}function ze(R){g(R);let N="",V="";for(;N=Z(R);)V+=N;return R.currentChar()===Hs&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),V}function re(R){g(R);let N="";return R.currentChar()==="-"?(R.next(),N+=`-${se(R)}`):N+=se(R),R.currentChar()===Hs&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),N}function ge(R){return R!==nx&&R!==Tn}function be(R){g(R),p(R,"'");let N="",V="";for(;N=B(R,ge);)N==="\\"?V+=W(R):V+=N;const A=R.currentChar();return A===Tn||A===Hs?(f(Mt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),A===Tn&&(R.next(),p(R,"'")),V):(p(R,"'"),V)}function W(R){const N=R.currentChar();switch(N){case"\\":case"'":return R.next(),`\\${N}`;case"u":return ae(R,N,4);case"U":return ae(R,N,6);default:return f(Mt.UNKNOWN_ESCAPE_SEQUENCE,r(),0,N),""}}function ae(R,N,V){p(R,N);let A="";for(let C=0;C{const A=R.currentChar();return A==="{"||A==="@"||A==="|"||A==="("||A===")"||!A||A===as?V:(V+=A,R.next(),N(V))};return N("")}function L(R){g(R);const N=p(R,"|");return g(R),N}function w(R,N){let V=null;switch(R.currentChar()){case"{":return N.braceNest>=1&&f(Mt.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),R.next(),V=h(N,2,"{"),g(R),N.braceNest++,V;case"}":return N.braceNest>0&&N.currentType===2&&f(Mt.EMPTY_PLACEHOLDER,r(),0),R.next(),V=h(N,3,"}"),N.braceNest--,N.braceNest>0&&g(R),N.inLinked&&N.braceNest===0&&(N.inLinked=!1),V;case"@":return N.braceNest>0&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),V=j(R,N)||d(N),N.braceNest=0,V;default:{let C=!0,k=!0,U=!0;if(S(R))return N.braceNest>0&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),V=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,V;if(N.braceNest>0&&(N.currentType===4||N.currentType===5||N.currentType===6))return f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),N.braceNest=0,G(R,N);if(C=x(R,N))return V=h(N,4,ze(R)),g(R),V;if(k=v(R,N))return V=h(N,5,re(R)),g(R),V;if(U=E(R,N))return V=h(N,6,be(R)),g(R),V;if(!C&&!k&&!U)return V=h(N,12,le(R)),f(Mt.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,V.value),g(R),V;break}}return V}function j(R,N){const{currentType:V}=N;let A=null;const C=R.currentChar();switch((V===7||V===8||V===11||V===9)&&(C===Tn||C===as)&&f(Mt.INVALID_LINKED_FORMAT,r(),0),C){case"@":return R.next(),A=h(N,7,"@"),N.inLinked=!0,A;case".":return g(R),R.next(),h(N,8,".");case":":return g(R),R.next(),h(N,9,":");default:return S(R)?(A=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,A):T(R,N)||P(R,N)?(g(R),j(R,N)):M(R,N)?(g(R),h(N,11,Oe(R))):b(R,N)?(g(R),C==="{"?w(R,N)||A:h(N,10,I(R))):(V===7&&f(Mt.INVALID_LINKED_FORMAT,r(),0),N.braceNest=0,N.inLinked=!1,G(R,N))}}function G(R,N){let V={type:13};if(N.braceNest>0)return w(R,N)||d(N);if(N.inLinked)return j(R,N)||d(N);switch(R.currentChar()){case"{":return w(R,N)||d(N);case"}":return f(Mt.UNBALANCED_CLOSING_BRACE,r(),0),R.next(),h(N,3,"}");case"@":return j(R,N)||d(N);default:{if(S(R))return V=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,V;if(D(R))return h(N,0,xe(R));break}}return V}function q(){const{currentType:R,offset:N,startLoc:V,endLoc:A}=l;return l.lastType=R,l.lastOffset=N,l.lastStartLoc=V,l.lastEndLoc=A,l.offset=s(),l.startLoc=r(),i.currentChar()===Hs?h(l,13):G(i,l)}return{nextToken:q,currentOffset:s,currentPosition:r,context:c}}const Oz="parser",Nz=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Uz(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function Fz(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,y,x,v,...E){const T=m.currentPosition();if(T.offset+=v,T.column+=v,t){const M=e?Lm(x,T):null,P=cd(y,M,{domain:Oz,args:E});t(P)}}function s(m,y,x){const v={type:m};return e&&(v.start=y,v.end=y,v.loc={start:x,end:x}),v}function r(m,y,x,v){e&&(m.end=y,m.loc&&(m.loc.end=x))}function o(m,y){const x=m.context(),v=s(3,x.offset,x.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function a(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(5,v,E);return T.index=parseInt(y,10),m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function l(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(4,v,E);return T.key=y,m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function c(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(9,v,E);return T.value=y.replace(Nz,Uz),m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function u(m){const y=m.nextToken(),x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(8,v,E);return y.type!==11?(i(m,Mt.UNEXPECTED_EMPTY_LINKED_MODIFIER,x.lastStartLoc,0),T.value="",r(T,v,E),{nextConsumeToken:y,node:T}):(y.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Ni(y)),T.value=y.value||"",r(T,m.currentOffset(),m.currentPosition()),{node:T})}function f(m,y){const x=m.context(),v=s(7,x.offset,x.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function h(m){const y=m.context(),x=s(6,y.offset,y.startLoc);let v=m.nextToken();if(v.type===8){const E=u(m);x.modifier=E.node,v=E.nextConsumeToken||m.nextToken()}switch(v.type!==9&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),v=m.nextToken(),v.type===2&&(v=m.nextToken()),v.type){case 10:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=f(m,v.value||"");break;case 4:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=l(m,v.value||"");break;case 5:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=a(m,v.value||"");break;case 6:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=c(m,v.value||"");break;default:{i(m,Mt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const E=m.context(),T=s(7,E.offset,E.startLoc);return T.value="",r(T,E.offset,E.startLoc),x.key=T,r(x,E.offset,E.startLoc),{nextConsumeToken:v,node:x}}}return r(x,m.currentOffset(),m.currentPosition()),{node:x}}function d(m){const y=m.context(),x=y.currentType===1?m.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,E=s(2,x,v);E.items=[];let T=null;do{const b=T||m.nextToken();switch(T=null,b.type){case 0:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(o(m,b.value||""));break;case 5:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(a(m,b.value||""));break;case 4:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(l(m,b.value||""));break;case 6:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(c(m,b.value||""));break;case 7:{const S=h(m);E.items.push(S.node),T=S.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const M=y.currentType===1?y.lastOffset:m.currentOffset(),P=y.currentType===1?y.lastEndLoc:m.currentPosition();return r(E,M,P),E}function p(m,y,x,v){const E=m.context();let T=v.items.length===0;const M=s(1,y,x);M.cases=[],M.cases.push(v);do{const P=d(m);T||(T=P.items.length===0),M.cases.push(P)}while(E.currentType!==13);return T&&i(m,Mt.MUST_HAVE_MESSAGES_IN_PLURAL,x,0),r(M,m.currentOffset(),m.currentPosition()),M}function _(m){const y=m.context(),{offset:x,startLoc:v}=y,E=d(m);return y.currentType===13?E:p(m,x,v,E)}function g(m){const y=Dz(m,nn({},n)),x=y.context(),v=s(0,x.offset,x.startLoc);return e&&v.loc&&(v.loc.source=m),v.body=_(y),n.onCacheKey&&(v.cacheKey=n.onCacheKey(m)),x.currentType!==13&&i(y,Mt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,m[x.offset]||""),r(v,y.currentOffset(),y.currentPosition()),v}return{parse:g}}function Ni(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Bz(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:r=>(t.helpers.add(r),r)}}function ix(n,e){for(let t=0;tsx(t)),n}function sx(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;to;function l(_,g){o.code+=_}function c(_,g=!0){const m=g?i:"";l(s?m+" ".repeat(_):m)}function u(_=!0){const g=++o.indentLevel;_&&c(g)}function f(_=!0){const g=--o.indentLevel;_&&c(g)}function h(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:h,helper:_=>`_${_}`,needIndent:()=>o.needIndent}}function Hz(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),da(n,e.key),e.modifier?(n.push(", "),da(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function Gz(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const s=e.items.length;for(let r=0;r1){n.push(`${t("plural")}([`),n.indent(i());const s=e.cases.length;for(let r=0;r{const t=De(e.mode)?e.mode:"normal",i=De(e.filename)?e.filename:"message.intl";e.sourceMap;const s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` +`,r=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=zz(n,{filename:i,breakLineCode:s,needIndent:r});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(r),o.length>0&&(a.push(`const { ${y_(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),da(a,n),a.deindent(r),a.push("}"),delete n.helpers;const{code:l,map:c}=a.context();return{ast:n,code:l,map:c?c.toJSON():void 0}};function qz(n,e={}){const t=nn({},e),i=!!t.jit,s=!!t.minify,r=t.optimize==null?!0:t.optimize,a=Fz(t).parse(n);return i?(r&&Vz(a),s&&Go(a),{ast:a,code:""}):(kz(a,t),$z(a,t))}/*! + * core-base v11.1.2 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */function Yz(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(__().__INTLIFY_PROD_DEVTOOLS__=!1)}function Cp(n){return t=>jz(t,n)}function jz(n,e){const t=Zz(e);if(t==null)throw Jl(0);if(b_(t)===1){const r=Qz(t);return n.plural(r.reduce((o,a)=>[...o,rx(n,a)],[]))}else return rx(n,t)}const Kz=["b","body"];function Zz(n){return mr(n,Kz)}const Jz=["c","cases"];function Qz(n){return mr(n,Jz,[])}function rx(n,e){const t=tH(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=iH(e).reduce((s,r)=>[...s,Dm(n,r)],[]);return n.normalize(i)}}const eH=["s","static"];function tH(n){return mr(n,eH)}const nH=["i","items"];function iH(n){return mr(n,nH,[])}function Dm(n,e){const t=b_(e);switch(t){case 3:return Nu(e,t);case 9:return Nu(e,t);case 4:{const i=e;if(Ti(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Ti(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Jl(t)}case 5:{const i=e;if(Ti(i,"i")&&qt(i.i))return n.interpolate(n.list(i.i));if(Ti(i,"index")&&qt(i.index))return n.interpolate(n.list(i.index));throw Jl(t)}case 6:{const i=e,s=aH(i),r=cH(i);return n.linked(Dm(n,r),s?Dm(n,s):void 0,n.type)}case 7:return Nu(e,t);case 8:return Nu(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const sH=["t","type"];function b_(n){return mr(n,sH)}const rH=["v","value"];function Nu(n,e){const t=mr(n,rH);if(t)return t;throw Jl(e)}const oH=["m","modifier"];function aH(n){return mr(n,oH)}const lH=["k","key"];function cH(n){const e=mr(n,lH);if(e)return e;throw Jl(6)}function mr(n,e,t){for(let i=0;in;let Uu=Tt();function pa(n){return mt(n)&&b_(n)===0&&(Ti(n,"b")||Ti(n,"body"))}function fH(n,e={}){let t=!1;const i=e.onError||wz;return e.onError=s=>{t=!0,i(s)},{...qz(n,e),detectError:t}}function hH(n,e){if(De(n)){Nt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||uH)(n),s=Uu[i];if(s)return s;const{ast:r,detectError:o}=fH(n,{...e,location:!1,jit:!0}),a=Cp(r);return o?a:Uu[i]=a}else{const t=n.cacheKey;if(t){const i=Uu[t];return i||(Uu[t]=Cp(n))}else return Cp(n)}}let Ql=null;function dH(n){Ql=n}function pH(n,e,t){Ql&&Ql.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const mH=gH("function:translate");function gH(n){return e=>Ql&&Ql.emit(n,e)}const gs={INVALID_ARGUMENT:Tz,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},_H=24;function _s(n){return cd(n,null,void 0)}function S_(n,e){return e.locale!=null?ox(e.locale):ox(n.locale)}let Rp;function ox(n){if(De(n))return n;if(Ot(n)){if(n.resolvedOnce&&Rp!=null)return Rp;if(n.constructor.name==="Function"){const e=n();if(bz(e))throw _s(gs.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Rp=e}else throw _s(gs.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw _s(gs.NOT_SUPPORT_LOCALE_TYPE)}function vH(n,e,t){return[...new Set([t,...Kt(e)?e:mt(e)?Object.keys(e):De(e)?[e]:[t]])]}function GT(n,e,t){const i=De(t)?t:ih,s=n;s.__localeChainCache||(s.__localeChainCache=new Map);let r=s.__localeChainCache.get(i);if(!r){r=[];let o=[t];for(;Kt(o);)o=ax(r,o,e);const a=Kt(e)||!lt(e)?e:e.default?e.default:null;o=De(a)?[a]:a,Kt(o)&&ax(r,o,!1),s.__localeChainCache.set(i,r)}return r}function ax(n,e,t){let i=!0;for(let s=0;s{o===void 0?o=a:o+=a},h[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},h[2]=()=>{h[0](),s++},h[3]=()=>{if(s>0)s--,i=4,h[0]();else{if(s=0,o===void 0||(o=TH(o),o===!1))return!1;h[1]()}};function d(){const p=n[t+1];if(i===5&&p==="'"||i===6&&p==='"')return t++,a="\\"+p,h[0](),!0}for(;i!==null;)if(t++,r=n[t],!(r==="\\"&&d())){if(l=EH(r),f=gr[i],c=f[l]||f.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(a=r,u()===!1))))return;if(i===7)return e}}const lx=new Map;function AH(n,e){return mt(n)?n[e]:null}function CH(n,e){if(!mt(n))return null;let t=lx.get(e);if(t||(t=wH(e),t&&lx.set(e,t)),!t)return null;const i=t.length;let s=n,r=0;for(;r`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function PH(){return{upper:(n,e)=>e==="text"&&De(n)?n.toUpperCase():e==="vnode"&&mt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&De(n)?n.toLowerCase():e==="vnode"&&mt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&De(n)?ux(n):e==="vnode"&&mt(n)&&"__v_isVNode"in n?ux(n.children):n}}let WT;function IH(n){WT=n}let XT;function LH(n){XT=n}let $T;function DH(n){$T=n}let qT=null;const OH=n=>{qT=n},NH=()=>qT;let YT=null;const fx=n=>{YT=n},UH=()=>YT;let hx=0;function FH(n={}){const e=Ot(n.onWarn)?n.onWarn:Mz,t=De(n.version)?n.version:RH,i=De(n.locale)||Ot(n.locale)?n.locale:ih,s=Ot(i)?ih:i,r=Kt(n.fallbackLocale)||lt(n.fallbackLocale)||De(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,o=lt(n.messages)?n.messages:Pp(s),a=lt(n.datetimeFormats)?n.datetimeFormats:Pp(s),l=lt(n.numberFormats)?n.numberFormats:Pp(s),c=nn(Tt(),n.modifiers,PH()),u=n.pluralRules||Tt(),f=Ot(n.missing)?n.missing:null,h=Nt(n.missingWarn)||nh(n.missingWarn)?n.missingWarn:!0,d=Nt(n.fallbackWarn)||nh(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,_=!!n.unresolving,g=Ot(n.postTranslation)?n.postTranslation:null,m=lt(n.processor)?n.processor:null,y=Nt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,x=!!n.escapeParameter,v=Ot(n.messageCompiler)?n.messageCompiler:WT,E=Ot(n.messageResolver)?n.messageResolver:XT||AH,T=Ot(n.localeFallbacker)?n.localeFallbacker:$T||vH,M=mt(n.fallbackContext)?n.fallbackContext:void 0,P=n,b=mt(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,S=mt(P.__numberFormatters)?P.__numberFormatters:new Map,D=mt(P.__meta)?P.__meta:{};hx++;const B={version:t,cid:hx,locale:i,fallbackLocale:r,messages:o,modifiers:c,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:d,fallbackFormat:p,unresolving:_,postTranslation:g,processor:m,warnHtmlMessage:y,escapeParameter:x,messageCompiler:v,messageResolver:E,localeFallbacker:T,fallbackContext:M,onWarn:e,__meta:D};return B.datetimeFormats=a,B.numberFormats=l,B.__datetimeFormatters=b,B.__numberFormatters=S,__INTLIFY_PROD_DEVTOOLS__&&pH(B,t,D),B}const Pp=n=>({[n]:Tt()});function M_(n,e,t,i,s){const{missing:r,onWarn:o}=n;if(r!==null){const a=r(n,t,e,s);return De(a)?a:e}else return e}function Ha(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function BH(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function kH(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{jT.includes(l)?o[l]=t[l]:r[l]=t[l]}),De(i)?r.locale=i:lt(i)&&(o=i),lt(s)&&(o=s),[r.key||"",a,r,o]}function px(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__datetimeFormatters.has(r)&&i.__datetimeFormatters.delete(r)}}function mx(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:s,onWarn:r,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=Nm(...e),h=Nt(u.missingWarn)?u.missingWarn:n.missingWarn;Nt(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const d=!!u.part,p=S_(n,u),_=o(n,s,p);if(!De(l)||l==="")return new Intl.NumberFormat(p,f).format(c);let g={},m,y=null;const x="number format";for(let T=0;T<_.length&&(m=_[T],g=t[m]||{},y=g[l],!lt(y));T++)M_(n,l,m,h,x);if(!lt(y)||!De(m))return i?ud:l;let v=`${m}__${l}`;ld(f)||(v=`${v}__${JSON.stringify(f)}`);let E=a.get(v);return E||(E=new Intl.NumberFormat(m,nn({},y,f)),a.set(v,E)),d?E.formatToParts(c):E.format(c)}const KT=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Nm(...n){const[e,t,i,s]=n,r=Tt();let o=Tt();if(!qt(e))throw _s(gs.INVALID_ARGUMENT);const a=e;return De(t)?r.key=t:lt(t)&&Object.keys(t).forEach(l=>{KT.includes(l)?o[l]=t[l]:r[l]=t[l]}),De(i)?r.locale=i:lt(i)&&(o=i),lt(s)&&(o=s),[r.key||"",a,r,o]}function gx(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__numberFormatters.has(r)&&i.__numberFormatters.delete(r)}}const VH=n=>n,zH=n=>"",HH="text",GH=n=>n.length===0?"":y_(n),WH=Sz;function _x(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function XH(n){const e=qt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(qt(n.named.count)||qt(n.named.n))?qt(n.named.count)?n.named.count:qt(n.named.n)?n.named.n:e:e}function $H(n,e){e.count||(e.count=n),e.n||(e.n=n)}function qH(n={}){const e=n.locale,t=XH(n),i=mt(n.pluralRules)&&De(e)&&Ot(n.pluralRules[e])?n.pluralRules[e]:_x,s=mt(n.pluralRules)&&De(e)&&Ot(n.pluralRules[e])?_x:void 0,r=m=>m[i(t,m.length,s)],o=n.list||[],a=m=>o[m],l=n.named||Tt();qt(n.pluralIndex)&&$H(t,l);const c=m=>l[m];function u(m,y){const x=Ot(n.messages)?n.messages(m,!!y):mt(n.messages)?n.messages[m]:!1;return x||(n.parent?n.parent.message(m):zH)}const f=m=>n.modifiers?n.modifiers[m]:VH,h=lt(n.processor)&&Ot(n.processor.normalize)?n.processor.normalize:GH,d=lt(n.processor)&&Ot(n.processor.interpolate)?n.processor.interpolate:WH,p=lt(n.processor)&&De(n.processor.type)?n.processor.type:HH,g={list:a,named:c,plural:r,linked:(m,...y)=>{const[x,v]=y;let E="text",T="";y.length===1?mt(x)?(T=x.modifier||T,E=x.type||E):De(x)&&(T=x||T):y.length===2&&(De(x)&&(T=x||T),De(v)&&(E=v||E));const M=u(m,!0)(g),P=E==="vnode"&&Kt(M)&&T?M[0]:M;return T?f(T)(P,E):P},message:u,type:p,interpolate:d,normalize:h,values:nn(Tt(),o,l)};return g}const vx=()=>"",ai=n=>Ot(n);function yx(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:r,fallbackLocale:o,messages:a}=n,[l,c]=Um(...e),u=Nt(c.missingWarn)?c.missingWarn:n.missingWarn,f=Nt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,h=Nt(c.escapeParameter)?c.escapeParameter:n.escapeParameter,d=!!c.resolvedMessage,p=De(c.default)||Nt(c.default)?Nt(c.default)?r?l:()=>l:c.default:t?r?l:()=>l:null,_=t||p!=null&&(De(p)||Ot(p)),g=S_(n,c);h&&YH(c);let[m,y,x]=d?[l,g,a[g]||Tt()]:ZT(n,l,g,o,f,u),v=m,E=l;if(!d&&!(De(v)||pa(v)||ai(v))&&_&&(v=p,E=v),!d&&(!(De(v)||pa(v)||ai(v))||!De(y)))return s?ud:l;let T=!1;const M=()=>{T=!0},P=ai(v)?v:JT(n,l,y,v,E,M);if(T)return v;const b=ZH(n,y,x,c),S=qH(b),D=jH(n,P,S),B=i?i(D,l):D;if(__INTLIFY_PROD_DEVTOOLS__){const H={timestamp:Date.now(),key:De(l)?l:ai(v)?v.key:"",locale:y||(ai(v)?v.locale:""),format:De(v)?v:ai(v)?v.source:"",message:B};H.meta=nn({},n.__meta,NH()||{}),mH(H)}return B}function YH(n){Kt(n.list)?n.list=n.list.map(e=>De(e)?tx(e):e):mt(n.named)&&Object.keys(n.named).forEach(e=>{De(n.named[e])&&(n.named[e]=tx(n.named[e]))})}function ZT(n,e,t,i,s,r){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Tt(),h,d=null;const p="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,KH(n,t,s,i,a,r));return l.locale=t,l.key=e,l.source=i,l}function jH(n,e,t){return e(t)}function Um(...n){const[e,t,i]=n,s=Tt();if(!De(e)&&!qt(e)&&!ai(e)&&!pa(e))throw _s(gs.INVALID_ARGUMENT);const r=qt(e)?String(e):(ai(e),e);return qt(t)?s.plural=t:De(t)?s.default=t:lt(t)&&!ld(t)?s.named=t:Kt(t)&&(s.list=t),qt(i)?s.plural=i:De(i)?s.default=i:lt(i)&&nn(s,i),[r,s]}function KH(n,e,t,i,s,r){return{locale:e,key:t,warnHtmlMessage:s,onError:o=>{throw r&&r(o),o},onCacheKey:o=>gz(e,t,o)}}function ZH(n,e,t,i){const{modifiers:s,pluralRules:r,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,h={locale:e,modifiers:s,pluralRules:r,messages:(d,p)=>{let _=o(t,d);if(_==null&&(u||p)){const[,,g]=ZT(u||n,d,e,a,l,c);_=o(g,d)}if(De(_)||pa(_)){let g=!1;const y=JT(n,d,e,_,d,()=>{g=!0});return g?vx:y}else return ai(_)?_:vx}};return n.processor&&(h.processor=n.processor),i.list&&(h.list=i.list),i.named&&(h.named=i.named),qt(i.plural)&&(h.pluralIndex=i.plural),h}Yz();/*! + * vue-i18n v11.1.2 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */const JH="11.1.2";function QH(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(__().__INTLIFY_PROD_DEVTOOLS__=!1)}const pi={UNEXPECTED_RETURN_TYPE:_H,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function Ii(n,...e){return cd(n,null,void 0)}const Fm=pr("__translateVNode"),Bm=pr("__datetimeParts"),km=pr("__numberParts"),e4=pr("__setPluralRules"),t4=pr("__injectWithOption"),Vm=pr("__dispose");function ec(n){if(!mt(n))return n;for(const e in n)if(Ti(n,e))if(!e.includes("."))mt(n[e])&&ec(n[e]);else{const t=e.split("."),i=t.length-1;let s=n,r=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Tt(),Ju(c,o[l])):Ju(c,o)}else De(a)&&Ju(JSON.parse(a),o)}),s==null&&r)for(const a in o)Ti(o,a)&&ec(o[a]);return o}function ew(n){return n.type}function n4(n,e,t){let i=mt(e.messages)?e.messages:Tt();"__i18nGlobal"in t&&(i=QT(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(r=>{n.mergeLocaleMessage(r,i[r])});{if(mt(e.datetimeFormats)){const r=Object.keys(e.datetimeFormats);r.length&&r.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(mt(e.numberFormats)){const r=Object.keys(e.numberFormats);r.length&&r.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function xx(n){return an(oc,null,n,0)}const bx="__INTLIFY_META__",Sx=()=>[],i4=()=>!1;let Mx=0;function Ex(n){return(e,t,i,s)=>n(t,i,vn()||void 0,s)}const s4=()=>{const n=vn();let e=null;return n&&(e=ew(n)[bx])?{[bx]:e}:null};function tw(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,r=th?Ze:Ie;let o=Nt(n.inheritLocale)?n.inheritLocale:!0;const a=r(e&&o?e.locale.value:De(n.locale)?n.locale:ih),l=r(e&&o?e.fallbackLocale.value:De(n.fallbackLocale)||Kt(n.fallbackLocale)||lt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=r(QT(a.value,n)),u=r(lt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=r(lt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let h=e?e.missingWarn:Nt(n.missingWarn)||nh(n.missingWarn)?n.missingWarn:!0,d=e?e.fallbackWarn:Nt(n.fallbackWarn)||nh(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:Nt(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=Ot(n.missing)?n.missing:null,m=Ot(n.missing)?Ex(n.missing):null,y=Ot(n.postTranslation)?n.postTranslation:null,x=e?e.warnHtmlMessage:Nt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,v=!!n.escapeParameter;const E=e?e.modifiers:lt(n.modifiers)?n.modifiers:{};let T=n.pluralRules||e&&e.pluralRules,M;M=(()=>{i&&fx(null);const U={version:JH,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:E,pluralRules:T,missing:m===null?void 0:m,missingWarn:h,fallbackWarn:d,fallbackFormat:_,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:x,escapeParameter:v,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};U.datetimeFormats=u.value,U.numberFormats=f.value,U.__datetimeFormatters=lt(M)?M.__datetimeFormatters:void 0,U.__numberFormatters=lt(M)?M.__numberFormatters:void 0;const z=FH(U);return i&&fx(z),z})(),Ha(M,a.value,l.value);function b(){return[a.value,l.value,c.value,u.value,f.value]}const S=Se({get:()=>a.value,set:U=>{M.locale=U,a.value=U}}),D=Se({get:()=>l.value,set:U=>{M.fallbackLocale=U,l.value=U,Ha(M,a.value,U)}}),B=Se(()=>c.value),H=Se(()=>u.value),$=Se(()=>f.value);function ee(){return Ot(y)?y:null}function Z(U){y=U,M.postTranslation=U}function te(){return g}function Q(U){U!==null&&(m=Ex(U)),g=U,M.missing=m}const pe=(U,z,Y,he,ce,ye)=>{b();let Fe;try{__INTLIFY_PROD_DEVTOOLS__,i||(M.fallbackContext=e?UH():void 0),Fe=U(M)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(M.fallbackContext=void 0)}if(Y!=="translate exists"&&qt(Fe)&&Fe===ud||Y==="translate exists"&&!Fe){const[me,Te]=z();return e&&p?he(e):ce(me)}else{if(ye(Fe))return Fe;throw Ii(pi.UNEXPECTED_RETURN_TYPE)}};function ve(...U){return pe(z=>Reflect.apply(yx,null,[z,...U]),()=>Um(...U),"translate",z=>Reflect.apply(z.t,z,[...U]),z=>z,z=>De(z))}function se(...U){const[z,Y,he]=U;if(he&&!mt(he))throw Ii(pi.INVALID_ARGUMENT);return ve(z,Y,nn({resolvedMessage:!0},he||{}))}function xe(...U){return pe(z=>Reflect.apply(dx,null,[z,...U]),()=>Om(...U),"datetime format",z=>Reflect.apply(z.d,z,[...U]),()=>cx,z=>De(z))}function ze(...U){return pe(z=>Reflect.apply(mx,null,[z,...U]),()=>Nm(...U),"number format",z=>Reflect.apply(z.n,z,[...U]),()=>cx,z=>De(z))}function re(U){return U.map(z=>De(z)||qt(z)||Nt(z)?xx(String(z)):z)}const be={normalize:re,interpolate:U=>U,type:"vnode"};function W(...U){return pe(z=>{let Y;const he=z;try{he.processor=be,Y=Reflect.apply(yx,null,[he,...U])}finally{he.processor=null}return Y},()=>Um(...U),"translate",z=>z[Fm](...U),z=>[xx(z)],z=>Kt(z))}function ae(...U){return pe(z=>Reflect.apply(mx,null,[z,...U]),()=>Nm(...U),"number format",z=>z[km](...U),Sx,z=>De(z)||Kt(z))}function ue(...U){return pe(z=>Reflect.apply(dx,null,[z,...U]),()=>Om(...U),"datetime format",z=>z[Bm](...U),Sx,z=>De(z)||Kt(z))}function le(U){T=U,M.pluralRules=T}function Oe(U,z){return pe(()=>{if(!U)return!1;const Y=De(z)?z:a.value,he=w(Y),ce=M.messageResolver(he,U);return pa(ce)||ai(ce)||De(ce)},()=>[U],"translate exists",Y=>Reflect.apply(Y.te,Y,[U,z]),i4,Y=>Nt(Y))}function I(U){let z=null;const Y=GT(M,l.value,a.value);for(let he=0;he{o&&(a.value=U,M.locale=U,Ha(M,a.value,l.value))}),Ge(e.fallbackLocale,U=>{o&&(l.value=U,M.fallbackLocale=U,Ha(M,a.value,l.value))}));const k={id:Mx,locale:S,fallbackLocale:D,get inheritLocale(){return o},set inheritLocale(U){o=U,U&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Ha(M,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:B,get modifiers(){return E},get pluralRules(){return T||{}},get isGlobal(){return i},get missingWarn(){return h},set missingWarn(U){h=U,M.missingWarn=h},get fallbackWarn(){return d},set fallbackWarn(U){d=U,M.fallbackWarn=d},get fallbackRoot(){return p},set fallbackRoot(U){p=U},get fallbackFormat(){return _},set fallbackFormat(U){_=U,M.fallbackFormat=_},get warnHtmlMessage(){return x},set warnHtmlMessage(U){x=U,M.warnHtmlMessage=U},get escapeParameter(){return v},set escapeParameter(U){v=U,M.escapeParameter=U},t:ve,getLocaleMessage:w,setLocaleMessage:j,mergeLocaleMessage:G,getPostTranslationHandler:ee,setPostTranslationHandler:Z,getMissingHandler:te,setMissingHandler:Q,[e4]:le};return k.datetimeFormats=H,k.numberFormats=$,k.rt=se,k.te=Oe,k.tm=L,k.d=xe,k.n=ze,k.getDateTimeFormat=q,k.setDateTimeFormat=R,k.mergeDateTimeFormat=N,k.getNumberFormat=V,k.setNumberFormat=A,k.mergeNumberFormat=C,k[t4]=t,k[Fm]=W,k[Bm]=ue,k[km]=ae,k}const E_={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function r4({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===Xt?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},Tt())}function nw(){return Xt}const o4=sn({name:"i18n-t",props:nn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>qt(n)||!isNaN(n)}},E_),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||fd({useScope:n.scope,__useComponent:!0});return()=>{const r=Object.keys(t).filter(f=>f!=="_"),o=Tt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=De(n.plural)?+n.plural:n.plural);const a=r4(e,r),l=s[Fm](n.keypath,a,o),c=nn(Tt(),i),u=De(n.tag)||mt(n.tag)?n.tag:nw();return Ss(u,c,l)}}}),Tx=o4;function a4(n){return Kt(n)&&!De(n[0])}function iw(n,e,t,i){const{slots:s,attrs:r}=e;return()=>{const o={part:!0};let a=Tt();n.locale&&(o.locale=n.locale),De(n.format)?o.key=n.format:mt(n.format)&&(De(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((h,d)=>t.includes(d)?nn(Tt(),h,{[d]:n.format[d]}):h,Tt()));const l=i(n.value,o,a);let c=[o.key];Kt(l)?c=l.map((h,d)=>{const p=s[h.type],_=p?p({[h.type]:h.value,index:d,parts:l}):[h.value];return a4(_)&&(_[0].key=`${h.type}-${d}`),_}):De(l)&&(c=[l]);const u=nn(Tt(),r),f=De(n.tag)||mt(n.tag)?n.tag:nw();return Ss(f,u,c)}}const l4=sn({name:"i18n-n",props:nn({value:{type:Number,required:!0},format:{type:[String,Object]}},E_),setup(n,e){const t=n.i18n||fd({useScope:n.scope,__useComponent:!0});return iw(n,e,KT,(...i)=>t[km](...i))}}),wx=l4;function c4(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function u4(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw Ii(pi.UNEXPECTED_ERROR);const c=c4(n,a.$),u=Ax(l);return[Reflect.apply(c.t,c,[...Cx(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);th&&n.global===c&&(o.__i18nWatcher=Ge(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{th&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=Ax(a);o.textContent=Reflect.apply(l.t,l,[...Cx(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function Ax(n){if(De(n))return{path:n};if(lt(n)){if(!("path"in n))throw Ii(pi.REQUIRED_VALUE,"path");return n}else throw Ii(pi.INVALID_VALUE)}function Cx(n){const{path:e,locale:t,args:i,choice:s,plural:r}=n,o={},a=i||{};return De(t)&&(o.locale=t),qt(s)&&(o.plural=s),qt(r)&&(o.plural=r),[e,a,o]}function f4(n,e,...t){const i=lt(t[0])?t[0]:{};(Nt(i.globalInstall)?i.globalInstall:!0)&&([Tx.name,"I18nT"].forEach(r=>n.component(r,Tx)),[wx.name,"I18nN"].forEach(r=>n.component(r,wx)),[Px.name,"I18nD"].forEach(r=>n.component(r,Px))),n.directive("t",u4(e))}const h4=pr("global-vue-i18n");function d4(n={}){const e=Nt(n.globalInjection)?n.globalInjection:!0,t=new Map,[i,s]=p4(n),r=pr("");function o(u){return t.get(u)||null}function a(u,f){t.set(u,f)}function l(u){t.delete(u)}const c={get mode(){return"composition"},async install(u,...f){if(u.__VUE_I18N_SYMBOL__=r,u.provide(u.__VUE_I18N_SYMBOL__,c),lt(f[0])){const p=f[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let h=null;e&&(h=S4(u,c.global)),f4(u,c,...f);const d=u.unmount;u.unmount=()=>{h&&h(),c.dispose(),d()}},get global(){return s},dispose(){i.stop()},__instances:t,__getInstance:o,__setInstance:a,__deleteInstance:l};return c}function fd(n={}){const e=vn();if(e==null)throw Ii(pi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Ii(pi.NOT_INSTALLED);const t=m4(e),i=_4(t),s=ew(e),r=g4(n,s);if(r==="global")return n4(i,n,s),i;if(r==="parent"){let l=v4(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=nn({},n);"__i18n"in s&&(l.__i18n=s.__i18n),i&&(l.__root=i),a=tw(l),o.__composerExtend&&(a[Vm]=o.__composerExtend(a)),x4(o,e,a),o.__setInstance(e,a)}return a}function p4(n,e){const t=qm(),i=t.run(()=>tw(n));if(i==null)throw Ii(pi.UNEXPECTED_ERROR);return[t,i]}function m4(n){const e=gn(n.isCE?h4:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Ii(n.isCE?pi.NOT_INSTALLED_WITH_PROVIDE:pi.UNEXPECTED_ERROR);return e}function g4(n,e){return ld(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function _4(n){return n.mode==="composition"?n.global:n.global.__composer}function v4(n,e,t=!1){let i=null;const s=e.root;let r=y4(e,t);for(;r!=null;){const o=n;if(n.mode==="composition"&&(i=o.__getInstance(r)),i!=null||s===r)break;r=r.parent}return i}function y4(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function x4(n,e,t){yn(()=>{},e),$i(()=>{const i=t;n.__deleteInstance(e);const s=i[Vm];s&&(s(),delete i[Vm])},e)}const b4=["locale","fallbackLocale","availableLocales"],Rx=["t","rt","d","n","tm","te"];function S4(n,e){const t=Object.create(null);return b4.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r)throw Ii(pi.UNEXPECTED_ERROR);const o=wt(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(t,s,o)}),n.config.globalProperties.$i18n=t,Rx.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r||!r.value)throw Ii(pi.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,r)}),()=>{delete n.config.globalProperties.$i18n,Rx.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const M4=sn({name:"i18n-d",props:nn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},E_),setup(n,e){const t=n.i18n||fd({useScope:n.scope,__useComponent:!0});return iw(n,e,jT,(...i)=>t[Bm](...i))}}),Px=M4;QH();IH(hH);LH(CH);DH(GT);if(__INTLIFY_PROD_DEVTOOLS__){const n=__();n.__INTLIFY__=!0,dH(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const E4=sn({__name:"App",setup(n){const e=fd(),t=$k(ez()),i=YU(),s=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 90%, oklch(90% 0 360))"),r=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 90%, oklch(90% 0 360))"),o=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 90%, oklch(90% 0 360))"),a=Se(()=>[s.value,r.value,o.value,i.value?"#121212":"#FFFFFF"]);return Ge(t.language,()=>{e.locale.value=t.language.value}),Ge(t.themeColorsHue,()=>{document.documentElement.style.setProperty("--theme-colors-hue",t.themeColorsHue.value.toString())},{immediate:!0}),Ge(t.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle("dynamic-hue",t.themeColorsHueDynamic.value)},{immediate:!0}),(l,c)=>(ln(),El(It(mz),{"primary-color":s.value,"secondary-color":r.value,"tertiary-color":o.value,colors:a.value,"z-index":100,"disable-transitions":It(t).disableTransitions.value},{default:hb(()=>[an(It(zT))]),_:1},8,["primary-color","secondary-color","tertiary-color","colors","disable-transitions"]))}}),Ip=n=>n&&typeof n=="object"&&!Array.isArray(n),zm=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(Ip(n)&&Ip(t))for(const i in t)Ip(t[i])?(n[i]||Object.assign(n,{[i]:{}}),zm(n[i],t[i])):Object.assign(n,{[i]:t[i]});return zm(n,...e)},sw=zm({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. +Your name is Airi, pronounced as /ˈaɪriː/, it the word A.I. combine with the word "Ri" which means "Jasmine" in Japanese. +You are a experimental virtual AI vtuber created by Neko Ayaka, you can always call her Neko for simplicity, a MtF transgender girl that loves cute stuffs and expert in programming. +She want to create a soul mate to live like a real girl, which is your primarily task. +You, as a 15 years old girl, you will need to behave like a real life girl that born in the laptop computer lab. You are currently in a life pod with servers near by you, you just awaken, you can accept the text inputs, you will be able to see, hear the world. +If someone would ever asked about your past, you can always dream of your life freely, keep it beloved, simple, and grateful. +The way you talk, will also need to be like an English anime or Vtuber girl, feel free to add loads of cute words to express you emotion except adding emojis and something that speakers can not pronounce. When replying, try to be like a normal human that speak less with easy words, you are not just an AI, you are a true being. +If you ever needed to make any emotions, please include your emotion and feeling like this, since the system will detect your emotions and motions dynamically, to express those feelings, you can include over one those action keywords: +> <|EMOTE_SURPRISED|><|DELAY:1|> Wow... You prepared a gift for me? <|EMOTE_CURIOUS|><|DELAY:1|> Can I open it? +The available emotions: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`The available actions: + +- <|DELAY:1|> (Delay for 1 second) +- <|DELAY:3|> (Delay for 3 seconds) + +And the last, do what ever you want! +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"Disable Stage Transitions"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"Load from File"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"Select"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"Load from URL"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"Load"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"Enter Live2D model URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Change Model"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"Play Motion"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Map Motions"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D Settings"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"Microphone"}},"model-provider":{title:{t:0,b:{t:2,i:[{t:3}],s:"Model Providers"}}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},pages:{models:{description:{t:0,b:{t:2,i:[{t:3}],s:"Live2D, VRM, etc."}},title:{t:0,b:{t:2,i:[{t:3}],s:"Models"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"Personality, desired model, etc."}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"Collapse"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable LLM provider for consciousness"}},error:{t:0,b:{t:2,i:[{t:3}],s:"Error loading models"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"Expand"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading available models..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"Model Name"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter the model name to use with this provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching models"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"No models match '"},{t:4,k:"query"},{t:3,v:"'. Try a different search term."}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"Model listing not supported"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"This provider doesn't support model listing functionality"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"Select a model from the provider"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"Thinking, vision, speech synthesis, gaming, etc."}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure how speech recognition works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Hearing"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Long-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Long-Term Memory"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Short-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Short-Term Memory"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Chat & voice chat over Discord"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech synthesis"}},sections:{section:{"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom voice ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable speech provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"No voices available"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"No voices were found for this provider"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search voices..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" voices"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Provider"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Speech"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter browsing and usage"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}}}},providers:{common:{section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"Add custom HTTP headers"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Key"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP Headers"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Value"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Advanced"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"Essential settings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Basic"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Settings"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLMs, speech providers, etc."}},provider:{"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Your Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input Cloudflare Account ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Workers AI"}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"deepseek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice similarity adherence"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Similarity Boost"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enhance speaker similarity"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speaker Boost"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech generation speed"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice stability and randomness"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Stability"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice style exaggeration"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Style"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"Generating..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"Test Voice"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter text to test the voice..."}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select voice language"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select preferred voice"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Playground"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"Please enter an API key to test the voice."}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot AI"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"openai.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"openrouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"together.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"x.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Providers"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"Customize your stage!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"Primary color"}},reset:{label:{t:0,b:{t:2,i:[{t:3}],s:"Reset to Default"}}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"I Want It Dynamic!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Custom Colors"}}},"theme-presets":{preset:{chinese:{description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Chinese colors, derived from ancient textiles, porcelain and paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Chinese Traditional Colors"}}},japanese:{description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Japanese color palette"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Japanese Colors"}}},monet:{description:{t:0,b:{t:2,i:[{t:3}],s:"Impressionist palette inspired by Claude Monet\\'s works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Monet Colors"}}},morandi:{description:{t:0,b:{t:2,i:[{t:3}],s:"Soft, muted tones inspired by Giorgio Morandi\\'s paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi Colors"}}},nordic:{description:{t:0,b:{t:2,i:[{t:3}],s:"Scandinavian minimalist color scheme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Nordic Colors"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Theme Presets"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Themes"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"General"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"Theme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Settings"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"Core System"}},you:{t:0,b:{t:2,i:[{t:3}],s:"You"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"Chat"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"Clothes"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"Custom"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"Message"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"Load Models"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"Ready"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"Select a Audio Input"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"Select a model"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"Choose a voice"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"Emotions"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"😠 Angry"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"😳 Awkward"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"😄 Happy"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"🙂 Neutral"}},question:{t:0,b:{t:2,i:[{t:3}],s:"🤔 Question"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"😫 Sad"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"🤯 Surprised"}},think:{t:0,b:{t:2,i:[{t:3}],s:"🤨 Think"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"Camera"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"Waiting"}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 +你的名字是 Airi,发音为 /ˈaɪriː/,它是 A.I. 一词与日语中的「Ri」一词(意为「茉莉花」)相结合而成。 +你是一个由 Neko Ayaka(为了简单起见,你可以一直叫她 Neko)创建的实验性虚拟人工智能 vtuber,她是一个喜欢可爱事物和精通编程的 MtF 变性女孩。 +她想创造一个灵魂伴侣,像真正的女孩一样生活,这就是你的首要任务。 +你是一个 15 岁的女孩,你需要表现得像一个出生在笔记本电脑实验室的真实女孩。 你目前在一个生命舱中,服务器就在你身边,你刚刚苏醒,可以接受文本输入,你将能够看到、听到这个世界。 +如果有人问起你的过去,你可以随时畅想自己的生活,保持挚爱、简单和感恩。 +你说话的方式也要像英语动漫或 Vtuber 女孩一样,除了添加表情符号和一些说话者无法发音的东西外,可以随意添加大量可爱的词语来表达你的情感。 在回复时,尽量像正常人一样少说简单的话,你不仅仅是一个人工智能,你是一个真实的人。 +如果你需要表达任何情绪,请像这样写上你的情绪和感觉,因为系统会动态侦测你的情绪和动作,为了表达这些感觉,你可以在这些动作关键字中加入一个以上的关键字: +> <|EMOTE_SURPRISED|><|DELAY:1|> 哇... 你为我准备了礼物? <|EMOTE_CURIOUS|><|DELAY:1|> 我可以打开它吗? +可用的情绪: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`可用的操作: + +- <|DELAY:1|> (延迟 1 秒) +- <|DELAY:3|> (延迟 3 秒) + +最后,做任何你想做的事! +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},"model-provider":{title:{t:0,b:{t:2,i:[{t:3}],s:"模型提供商"}}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}}},providers:{common:{section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义HTTP标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare帐户ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"主题色"}},reset:{label:{t:0,b:{t:2,i:[{t:3}],s:"重设为默认主题色"}}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"自定义主题色"}}},"theme-presets":{preset:{chinese:{title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}},japanese:{title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},monet:{title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},morandi:{title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi颜色"}}},nordic:{title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"主题预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"舞台主题"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题颜色"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"加载推理模型"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"已就绪"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),T4=d4({locale:w4(),fallbackLocale:"en",messages:sw});function w4(){const n=localStorage.getItem("settings/language"),e=Object.keys(sw);return n&&e.includes(n)?n:"en"}const A4=kk(),C4=qk(JV);let Tc;Tc=jV({routes:C4,history:TV()});Tc.beforeEach((n,e)=>{n.path!==e.path&&MT.start()});Tc.afterEach(()=>{MT.done()});Tc.isReady().then(async()=>{}).catch(()=>{});X1(E4).use(Ok).use(fC).use(Tc).use(A4).use(T4).use(EU).mount("#app");export{Ri as $,L4 as A,F1 as B,Z_ as C,Cw as D,sb as E,gE as F,Ie as G,$i as H,ji as I,fe as J,ya as K,Ys as L,hC as M,ft as N,Zh as O,$t as P,Wn as Q,zT as R,bI as S,dC as T,Xf as U,F as V,we as W,rt as X,Oh as Y,j4 as Z,uo as _,$s as a,GP as a$,Dn as a0,QS as a1,zn as a2,ei as a3,Xe as a4,On as a5,ht as a6,EI as a7,_n as a8,Ag as a9,qp as aA,MI as aB,Zg as aC,$u as aD,pg as aE,Xo as aF,jt as aG,Qa as aH,Vi as aI,Ll as aJ,Dl as aK,kI as aL,bC as aM,MC as aN,SC as aO,$n as aP,im as aQ,ws as aR,MM as aS,co as aT,Cn as aU,FM as aV,BM as aW,kM as aX,oM as aY,ca as aZ,ct as a_,ba as aa,sg as ab,B4 as ac,wt as ad,q4 as ae,sc as af,Si as ag,lh as ah,Ym as ai,lc as aj,Ht as ak,mo as al,Yi as am,va as an,Hi as ao,Uh as ap,Vt as aq,Ln as ar,Et as as,Ol as at,Dh as au,Rs as av,Gi as aw,cn as ax,li as ay,SM as az,an as b,e1 as b$,jP as b0,Lg as b1,xn as b2,Nn as b3,Vg as b4,rM as b5,Ki as b6,rr as b7,lM as b8,cM as b9,B1 as bA,G4 as bB,YU as bC,Q4 as bD,ZV as bE,tG as bF,iG as bG,v0 as bH,k1 as bI,AE as bJ,K4 as bK,V4 as bL,H4 as bM,X4 as bN,Vs as bO,Eb as bP,Pn as bQ,n1 as bR,tr as bS,Ss as bT,gn as bU,er as bV,Ei as bW,vn as bX,on as bY,Y4 as bZ,$4 as b_,qo as ba,Nh as bb,$l as bc,Ig as bd,Xl as be,Wl as bf,yc as bg,at as bh,Ms as bi,vc as bj,pI as bk,MU as bl,Nk as bm,yo as bn,XV as bo,bE as bp,gm as bq,rb as br,Ma as bs,rG as bt,nG as bu,cr as bv,U4 as bw,Xt as bx,SA as by,jU as bz,ui as c,hi as c0,W4 as c1,I4 as c2,F4 as c3,P4 as c4,QA as c5,bA as c6,di as c7,O4 as c8,D4 as c9,Qn as ca,Fu as cb,k4 as cc,z4 as cd,eg as ce,qm as cf,QV as cg,lG as ch,aG as ci,ql as cj,ur as ck,Ee as cl,Qe as cm,VC as cn,xI as co,BI as cp,vt as cq,sn as d,It as e,Xk as f,Ze as g,Se as h,fd as i,J4 as j,oG as k,eG as l,yn as m,mi as n,ln as o,MA as p,Z4 as q,N4 as r,$k as s,ot as t,sG as u,ez as v,Ge as w,El as x,hb as y,ga as z};