diff --git "a/assets/index-dsqm1seh.js" "b/assets/index-dsqm1seh.js" new file mode 100644--- /dev/null +++ "b/assets/index-dsqm1seh.js" @@ -0,0 +1,3906 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-Bh41rP52.js","assets/HeaderLink-CABggCDX.js","assets/HeaderLink-DsxHr3rn.css","assets/index-DCgZ1otg.js","assets/live2d-zip-loader-DeezV3PO.js","assets/emotions-CAex_2dA.js","assets/speech-BSIm5OPL.js","assets/providers-BGfrFZxg.js","assets/queue-CIplBYRf.js","assets/queues-D6xQxfVu.js","assets/airi-card-DrJIxUwa.js","assets/consciousness-DLMFxRlW.js","assets/Model.vue_vue_type_script_setup_true_lang-Da28R0fS.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-CGEUyg1_.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-BxyedCwo.js","assets/index-B0Y1_A_O.js","assets/route-block-B_A1xBdJ.js","assets/index-B6DQ8quC.css","assets/image-sQ7wa3Pp.js","assets/image-BhuwcwI9.css","assets/queue-2N0dKXI3.js","assets/index-BdXRtjBk.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-Dar8M7y6.js","assets/index-wBUQ6CAe.css","assets/index-DiIZdg1G.js","assets/Button.vue_vue_type_script_setup_true_lang-3lEEjsJb.js","assets/RadioCardDetailManySelect-CdMZMp9d.js","assets/Input.vue_vue_type_script_setup_true_lang-CXS2lf1C.js","assets/RadioCardDetailManySelect-DNocHbhX.css","assets/_id_-DD5Yu2WU.js","assets/index-C1GxC_3w.js","assets/index-D2jND_zI.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-B4oXPXfP.js","assets/useIconAnimation-74XB0XL4.js","assets/index-Cm5GgQiK.css","assets/index-B7xgUlCR.js","assets/index-DzMFUKkB.css","assets/index-E_an0jlT.js","assets/IconStatusItem-DpIL-Lps.js","assets/IconStatusItem-Bkq6rmpG.css","assets/consciousness-BAeO6vIi.js","assets/RadioCardSimple-DlRE8Qxz.js","assets/RadioCardSimple-bMVb3Rwi.css","assets/speech-Cin2zufB.js","assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-RoJ9dkfJ.js","assets/TestDummyMarker-CuAjjIfV.css","assets/FieldInput.vue_vue_type_script_setup_true_lang-DyKskHbm.js","assets/speech-Hr-CnTW2.css","assets/index-m5xEO3nx.js","assets/anthropic-e6mHsga1.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CPxNS0lQ.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DraUzycu.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DEQVVF8u.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BsLsQwB3.js","assets/cloudflare-workers-ai-CQRVl7Sv.js","assets/deepseek-gWAOZ6Io.js","assets/elevenlabs-CbE-A_Z6.js","assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-BlYiVoQk.js","assets/fireworks-ai-D9hKrVV7.js","assets/microsoft-speech-DxHKvU9d.js","assets/mistral-ai-fThv8auK.js","assets/moonshot-ai-nB1DlMEd.js","assets/novita-ai-DlllHYS3.js","assets/ollama-CoKkn-rf.js","assets/openai-DOQ7jvcz.js","assets/openrouter-ai-C74OiWQd.js","assets/together-ai-Bsm7LTTc.js","assets/xai-DhNcKb7x.js","assets/delays-CeBiNvEk.js","assets/emotions-DyG_d_3u.js","assets/messages-RPEwvPZ2.js"])))=>i.map(i=>d[i]); +var WA=Object.defineProperty;var XA=(n,e,t)=>e in n?WA(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>XA(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 $A="modulepreload",qA=function(n){return"/"+n},uv={},ct=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=qA(l),l in uv)return;uv[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":$A,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 f0(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const vt={},la=[],Ki=()=>{},YA=()=>!1,Vh=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),h0=n=>n.startsWith("onUpdate:"),nn=Object.assign,d0=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},jA=Object.prototype.hasOwnProperty,St=(n,e)=>jA.call(n,e),ze=Array.isArray,ca=n=>wc(n)==="[object Map]",Da=n=>wc(n)==="[object Set]",fv=n=>wc(n)==="[object Date]",je=n=>typeof n=="function",Ut=n=>typeof n=="string",Ui=n=>typeof n=="symbol",It=n=>n!==null&&typeof n=="object",OM=n=>(It(n)||je(n))&&je(n.then)&&je(n.catch),NM=Object.prototype.toString,wc=n=>NM.call(n),KA=n=>wc(n).slice(8,-1),UM=n=>wc(n)==="[object Object]",p0=n=>Ut(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,gl=f0(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Hh=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},ZA=/-(\w)/g,ai=Hh(n=>n.replace(ZA,(e,t)=>t?t.toUpperCase():"")),JA=/\B([A-Z])/g,Fs=Hh(n=>n.replace(JA,"-$1").toLowerCase()),Gh=Hh(n=>n.charAt(0).toUpperCase()+n.slice(1)),pf=Hh(n=>n?`on${Gh(n)}`:""),Yn=(n,e)=>!Object.is(n,e),mf=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},If=n=>{const e=parseFloat(n);return isNaN(e)?n:e},QA=n=>{const e=Ut(n)?Number(n):NaN;return isNaN(e)?n:e};let hv;const Wh=()=>hv||(hv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Si(n){if(ze(n)){const e={};for(let t=0;t{if(t){const i=t.split(tC);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Oa(n){let e="";if(Ut(n))e=n;else if(ze(n))for(let t=0;t_o(t,e))}const BM=n=>!!(n&&n.__v_isRef===!0),aC=n=>Ut(n)?n:n==null?"":ze(n)||It(n)&&(n.toString===NM||!je(n.toString))?BM(n)?aC(n.value):JSON.stringify(n,zM,2):String(n),zM=(n,e)=>BM(e)?zM(n,e.value):ca(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[ap(i,r)+" =>"]=s,t),{})}:Da(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>ap(t))}:Ui(e)?ap(e):It(e)&&!ze(e)&&!UM(e)?String(e):e,ap=(n,e="")=>{var t;return Ui(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 On;class VM{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=On,!e&&On&&(this.index=(On.scopes||(On.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(vl){let e=vl;for(vl=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;_l;){let e=_l;for(_l=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 XM(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function $M(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),b0(i),lC(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function qm(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(qM(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function qM(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Hl))return;n.globalVersion=Hl;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!qm(n)){n.flags&=-3;return}const t=Dt,i=Ni;Dt=n,Ni=!0;try{XM(n);const s=n.fn(n._value);(e.version===0||Yn(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{Dt=t,Ni=i,$M(n),n.flags&=-3}}function b0(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)b0(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function lC(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Ni=!0;const YM=[];function xr(){YM.push(Ni),Ni=!1}function Mr(){const n=YM.pop();Ni=n===void 0?!0:n}function dv(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Dt;Dt=void 0;try{e()}finally{Dt=t}}}let Hl=0;class cC{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 $h{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(!Dt||!Ni||Dt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Dt)t=this.activeLink=new cC(Dt,this),Dt.deps?(t.prevDep=Dt.depsTail,Dt.depsTail.nextDep=t,Dt.depsTail=t):Dt.deps=Dt.depsTail=t,jM(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=Dt.depsTail,t.nextDep=void 0,Dt.depsTail.nextDep=t,Dt.depsTail=t,Dt.deps===t&&(Dt.deps=i)}return t}trigger(e){this.version++,Hl++,this.notify(e)}notify(e){v0();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{y0()}}}function jM(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)jM(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Lf=new WeakMap,uo=Symbol(""),Ym=Symbol(""),Gl=Symbol("");function Sn(n,e,t){if(Ni&&Dt){let i=Lf.get(n);i||Lf.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new $h),s.map=i,s.key=t),s.track()}}function ys(n,e,t,i,s,r){const o=Lf.get(n);if(!o){Hl++;return}const a=l=>{l&&l.trigger()};if(v0(),e==="clear")o.forEach(a);else{const l=ze(n),c=l&&p0(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,h)=>{(h==="length"||h===Gl||!Ui(h)&&h>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Gl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(uo)),ca(n)&&a(o.get(Ym)));break;case"delete":l||(a(o.get(uo)),ca(n)&&a(o.get(Ym)));break;case"set":ca(n)&&a(o.get(uo));break}}y0()}function uC(n,e){const t=Lf.get(n);return t&&t.get(e)}function Oo(n){const e=ut(n);return e===n?e:(Sn(e,"iterate",Gl),_i(n)?e:e.map(En))}function qh(n){return Sn(n=ut(n),"iterate",Gl),n}const fC={__proto__:null,[Symbol.iterator](){return cp(this,Symbol.iterator,En)},concat(...n){return Oo(this).concat(...n.map(e=>ze(e)?Oo(e):e))},entries(){return cp(this,"entries",n=>(n[1]=En(n[1]),n))},every(n,e){return as(this,"every",n,e,void 0,arguments)},filter(n,e){return as(this,"filter",n,e,t=>t.map(En),arguments)},find(n,e){return as(this,"find",n,e,En,arguments)},findIndex(n,e){return as(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return as(this,"findLast",n,e,En,arguments)},findLastIndex(n,e){return as(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return as(this,"forEach",n,e,void 0,arguments)},includes(...n){return up(this,"includes",n)},indexOf(...n){return up(this,"indexOf",n)},join(n){return Oo(this).join(n)},lastIndexOf(...n){return up(this,"lastIndexOf",n)},map(n,e){return as(this,"map",n,e,void 0,arguments)},pop(){return $a(this,"pop")},push(...n){return $a(this,"push",n)},reduce(n,...e){return pv(this,"reduce",n,e)},reduceRight(n,...e){return pv(this,"reduceRight",n,e)},shift(){return $a(this,"shift")},some(n,e){return as(this,"some",n,e,void 0,arguments)},splice(...n){return $a(this,"splice",n)},toReversed(){return Oo(this).toReversed()},toSorted(n){return Oo(this).toSorted(n)},toSpliced(...n){return Oo(this).toSpliced(...n)},unshift(...n){return $a(this,"unshift",n)},values(){return cp(this,"values",En)}};function cp(n,e,t){const i=qh(n),s=i[e]();return i!==n&&!_i(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const hC=Array.prototype;function as(n,e,t,i,s,r){const o=qh(n),a=o!==n&&!_i(n),l=o[e];if(l!==hC[e]){const f=l.apply(n,r);return a?En(f):f}let c=t;o!==n&&(a?c=function(f,h){return t.call(this,En(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 pv(n,e,t,i){const s=qh(n);let r=t;return s!==n&&(_i(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,En(a),l,n)}),s[e](r,...i)}function up(n,e,t){const i=ut(n);Sn(i,"iterate",Gl);const s=i[e](...t);return(s===-1||s===!1)&&x0(t[0])?(t[0]=ut(t[0]),i[e](...t)):s}function $a(n,e,t=[]){xr(),v0();const i=ut(n)[e].apply(n,t);return y0(),Mr(),i}const dC=f0("__proto__,__v_isRef,__isVue"),KM=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ui));function pC(n){Ui(n)||(n=String(n));const e=ut(this);return Sn(e,"has",n),e.hasOwnProperty(n)}class ZM{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?iS:nS:r?tS:eS).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=ze(e);if(!s){let l;if(o&&(l=fC[t]))return l;if(t==="hasOwnProperty")return pC}const a=Reflect.get(e,t,Pt(e)?e:i);return(Ui(t)?KM.has(t):dC(t))||(s||Sn(e,"get",t),r)?a:Pt(a)?o&&p0(t)?a:a.value:It(a)?s?xi(a):bi(a):a}}class JM extends ZM{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=vo(r);if(!_i(i)&&!vo(i)&&(r=ut(r),i=ut(i)),!ze(e)&&Pt(r)&&!Pt(i))return l?!1:(r.value=i,!0)}const o=ze(e)&&p0(t)?Number(t)n,nu=n=>Reflect.getPrototypeOf(n);function yC(n,e,t){return function(...i){const s=this.__v_raw,r=ut(s),o=ca(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=t?jm:e?Km:En;return!e&&Sn(r,"iterate",l?Ym:uo),{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 iu(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function bC(n,e){const t={get(s){const r=this.__v_raw,o=ut(r),a=ut(s);n||(Yn(s,a)&&Sn(o,"get",s),Sn(o,"get",a));const{has:l}=nu(o),c=e?jm:n?Km:En;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&Sn(ut(s),"iterate",uo),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=ut(r),a=ut(s);return n||(Yn(s,a)&&Sn(o,"has",s),Sn(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=ut(a),c=e?jm:n?Km:En;return!n&&Sn(l,"iterate",uo),a.forEach((u,f)=>s.call(r,c(u),c(f),o))}};return nn(t,n?{add:iu("add"),set:iu("set"),delete:iu("delete"),clear:iu("clear")}:{add(s){!e&&!_i(s)&&!vo(s)&&(s=ut(s));const r=ut(this);return nu(r).has.call(r,s)||(r.add(s),ys(r,"add",s,s)),this},set(s,r){!e&&!_i(r)&&!vo(r)&&(r=ut(r));const o=ut(this),{has:a,get:l}=nu(o);let c=a.call(o,s);c||(s=ut(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?Yn(r,u)&&ys(o,"set",s,r):ys(o,"add",s,r),this},delete(s){const r=ut(this),{has:o,get:a}=nu(r);let l=o.call(r,s);l||(s=ut(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&ys(r,"delete",s,void 0),c},clear(){const s=ut(this),r=s.size!==0,o=s.clear();return r&&ys(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=yC(s,n,e)}),t}function Yh(n,e){const t=bC(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(St(t,s)&&s in i?t:i,s,r)}const xC={get:Yh(!1,!1)},MC={get:Yh(!1,!0)},SC={get:Yh(!0,!1)},EC={get:Yh(!0,!0)},eS=new WeakMap,tS=new WeakMap,nS=new WeakMap,iS=new WeakMap;function TC(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function wC(n){return n.__v_skip||!Object.isExtensible(n)?0:TC(KA(n))}function bi(n){return vo(n)?n:jh(n,!1,mC,xC,eS)}function sS(n){return jh(n,!1,_C,MC,tS)}function xi(n){return jh(n,!0,gC,SC,nS)}function j9(n){return jh(n,!0,vC,EC,iS)}function jh(n,e,t,i,s){if(!It(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=wC(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function Cs(n){return vo(n)?Cs(n.__v_raw):!!(n&&n.__v_isReactive)}function vo(n){return!!(n&&n.__v_isReadonly)}function _i(n){return!!(n&&n.__v_isShallow)}function x0(n){return n?!!n.__v_raw:!1}function ut(n){const e=n&&n.__v_raw;return e?ut(e):n}function M0(n){return!St(n,"__v_skip")&&Object.isExtensible(n)&&FM(n,"__v_skip",!0),n}const En=n=>It(n)?bi(n):n,Km=n=>It(n)?xi(n):n;function Pt(n){return n?n.__v_isRef===!0:!1}function et(n){return rS(n,!1)}function De(n){return rS(n,!0)}function rS(n,e){return Pt(n)?n:new AC(n,e)}class AC{constructor(e,t){this.dep=new $h,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ut(e),this._value=t?e:En(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||_i(e)||vo(e);e=i?e:ut(e),Yn(e,t)&&(this._rawValue=e,this._value=i?e:En(e),this.dep.trigger())}}function Ot(n){return Pt(n)?n.value:n}function it(n){return je(n)?n():Ot(n)}const CC={get:(n,e,t)=>e==="__v_raw"?n:Ot(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return Pt(s)&&!Pt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function oS(n){return Cs(n)?n:new Proxy(n,CC)}class RC{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new $h,{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 S0(n){return new RC(n)}function aS(n){const e=ze(n)?new Array(n.length):{};for(const t in n)e[t]=cS(n,t);return e}class PC{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 uC(ut(this._object),this._key)}}class IC{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 lS(n,e,t){return Pt(n)?n:je(n)?new IC(n):It(n)&&arguments.length>1?cS(n,e,t):et(n)}function cS(n,e,t){const i=n[e];return Pt(i)?i:new PC(n,e,t)}class LC{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new $h(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return WM(this,!0),!0}get value(){const e=this.dep.track();return qM(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function DC(n,e,t=!1){let i,s;return je(n)?i=n:(i=n.get,s=n.set),new LC(i,s,t)}const su={},Df=new WeakMap;let Jr;function OC(n,e=!1,t=Jr){if(t){let i=Df.get(t);i||Df.set(t,i=[]),i.push(n)}}function NC(n,e,t=vt){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=v=>s?v:_i(v)||s===!1||s===0?bs(v,1):bs(v);let u,f,h,d,p=!1,_=!1;if(Pt(n)?(f=()=>n.value,p=_i(n)):Cs(n)?(f=()=>c(n),p=!0):ze(n)?(_=!0,p=n.some(v=>Cs(v)||_i(v)),f=()=>n.map(v=>{if(Pt(v))return v.value;if(Cs(v))return c(v);if(je(v))return l?l(v,2):v()})):je(n)?e?f=l?()=>l(n,2):n:f=()=>{if(h){xr();try{h()}finally{Mr()}}const v=Jr;Jr=u;try{return l?l(n,3,[d]):n(d)}finally{Jr=v}}:f=Ki,e&&s){const v=f,E=s===!0?1/0:s;f=()=>bs(v(),E)}const g=Xh(),m=()=>{u.stop(),g&&g.active&&d0(g.effects,u)};if(r&&e){const v=e;e=(...E)=>{v(...E),m()}}let y=_?new Array(n.length).fill(su):su;const b=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const E=u.run();if(s||p||(_?E.some((T,S)=>Yn(T,y[S])):Yn(E,y))){h&&h();const T=Jr;Jr=u;try{const S=[E,y===su?void 0:_&&y[0]===su?[]:y,d];l?l(e,3,S):e(...S),y=E}finally{Jr=T}}}else u.run()};return a&&a(b),u=new HM(f),u.scheduler=o?()=>o(b,!1):b,d=v=>OC(v,!1,u),h=u.onStop=()=>{const v=Df.get(u);if(v){if(l)l(v,4);else for(const E of v)E();Df.delete(u)}},e?i?b(!0):y=u.run():o?o(b.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function bs(n,e=1/0,t){if(e<=0||!It(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Pt(n))bs(n.value,e,t);else if(ze(n))for(let i=0;i{bs(i,e,t)});else if(UM(n)){for(const i in n)bs(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&bs(n[i],e,t)}return n}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Ac(n,e,t,i){try{return i?n(...i):n()}catch(s){Kh(s,e,t)}}function Fi(n,e,t,i){if(je(n)){const s=Ac(n,e,t,i);return s&&OM(s)&&s.catch(r=>{Kh(r,e,t)}),s}if(ze(n)){const s=[];for(let r=0;r>>1,s=Un[i],r=Wl(s);r=Wl(t)?Un.push(n):Un.splice(FC(e),0,n),n.flags|=1,fS()}}function fS(){Of||(Of=uS.then(dS))}function kC(n){ze(n)?ua.push(...n):tr&&n.id===-1?tr.splice(ea+1,0,n):n.flags&1||(ua.push(n),n.flags|=1),fS()}function mv(n,e,t=Wi+1){for(;tWl(t)-Wl(i));if(ua.length=0,tr){tr.push(...e);return}for(tr=e,ea=0;ean.id==null?n.flags&2?-1:1/0:n.id;function dS(n){try{for(Wi=0;Wi{i._d&&Cv(-1);const r=Nf(e);let o;try{o=n(...s)}finally{Nf(r),i._d&&Cv(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function K9(n,e){if(Qt===null)return n;const t=ed(Qt),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,yl=n=>n&&(n.disabled||n.disabled===""),gv=n=>n&&(n.defer||n.defer===""),_v=n=>typeof SVGElement<"u"&&n instanceof SVGElement,vv=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Zm=(n,e)=>{const t=n&&n.to;return Ut(t)?e?e(t):null:t},vS={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=yl(e.props);let{shapeFlag:y,children:b,dynamicChildren:v}=e;if(n==null){const E=e.el=_(""),T=e.anchor=_("");d(E,t,i),d(T,t,i);const S=(x,M)=>{y&16&&(s&&s.isCE&&(s.ce._teleportTarget=x),u(b,x,M,s,r,o,a,l))},P=()=>{const x=e.target=Zm(e.props,p),M=yS(x,e,_,d);x&&(o!=="svg"&&_v(x)?o="svg":o!=="mathml"&&vv(x)&&(o="mathml"),m||(S(x,M),gf(e,!1)))};m&&(S(t,T),gf(e,!0)),gv(e.props)?Dn(()=>{P(),e.el.__isMounted=!0},r):P()}else{if(gv(e.props)&&!n.el.__isMounted){Dn(()=>{vS.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,S=e.targetAnchor=n.targetAnchor,P=yl(n.props),x=P?t:T,M=P?E:S;if(o==="svg"||_v(T)?o="svg":(o==="mathml"||vv(T))&&(o="mathml"),v?(h(n.dynamicChildren,v,x,s,r,o,a),R0(n,e,!0)):l||f(n,e,x,M,s,r,o,a,!1),m)P?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):ru(e,t,E,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const L=e.target=Zm(e.props,p);L&&ru(e,L,null,c,0)}else P&&ru(e,T,S,c,1);gf(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||!yl(h);for(let p=0;p{n.isMounted=!0}),AS(()=>{n.isUnmounting=!0}),n}const hi=[Function,Array],bS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:hi,onEnter:hi,onAfterEnter:hi,onEnterCancelled:hi,onBeforeLeave:hi,onLeave:hi,onAfterLeave:hi,onLeaveCancelled:hi,onBeforeAppear:hi,onAppear:hi,onAfterAppear:hi,onAppearCancelled:hi},xS=n=>{const e=n.subTree;return e.component?xS(e.component):e},VC={name:"BaseTransition",props:bS,setup(n,{slots:e}){const t=wn(),i=zC();return()=>{const s=e.default&&ES(e.default(),!0);if(!s||!s.length)return;const r=MS(s),o=ut(n),{mode:a}=o;if(i.isLeaving)return fp(r);const l=yv(r);if(!l)return fp(r);let c=Jm(l,o,i,t,f=>c=f);l.type!==Fn&&Xl(l,c);let u=t.subTree&&yv(t.subTree);if(u&&u.type!==Fn&&!no(l,u)&&xS(t).type!==Fn){let f=Jm(u,o,i,t);if(Xl(u,f),a==="out-in"&&l.type!==Fn)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},fp(r);a==="in-out"&&l.type!==Fn?f.delayLeave=(h,d,p)=>{const _=SS(i,u);_[String(u.key)]=u,h[nr]=()=>{d(),h[nr]=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 MS(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==Fn){e=t;break}}return e}const HC=VC;function SS(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 Jm(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:b}=e,v=String(n.key),E=SS(t,n),T=(x,M)=>{x&&Fi(x,i,9,M)},S=(x,M)=>{const L=M[1];T(x,M),ze(x)?x.every(F=>F.length<=1)&&L():x.length<=1&&L()},P={mode:o,persisted:a,beforeEnter(x){let M=l;if(!t.isMounted)if(r)M=g||l;else return;x[nr]&&x[nr](!0);const L=E[v];L&&no(n,L)&&L.el[nr]&&L.el[nr](),T(M,[x])},enter(x){let M=c,L=u,F=f;if(!t.isMounted)if(r)M=m||c,L=y||u,F=b||f;else return;let H=!1;const Y=x[ou]=ee=>{H||(H=!0,ee?T(F,[x]):T(L,[x]),P.delayedLeave&&P.delayedLeave(),x[ou]=void 0)};M?S(M,[x,Y]):Y()},leave(x,M){const L=String(n.key);if(x[ou]&&x[ou](!0),t.isUnmounting)return M();T(h,[x]);let F=!1;const H=x[nr]=Y=>{F||(F=!0,M(),Y?T(_,[x]):T(p,[x]),x[nr]=void 0,E[L]===n&&delete E[L])};E[L]=n,d?S(d,[x,H]):H()},clone(x){const M=Jm(x,e,t,i,s);return s&&s(M),M}};return P}function fp(n){if(Zh(n))return n=dr(n),n.children=null,n}function yv(n){if(!Zh(n))return _S(n.type)&&n.children?MS(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&je(t.default))return t.default()}}function Xl(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Xl(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 ES(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rUf(p,e&&(ze(e)?e[_]:e),t,i,s));return}if(fa(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Uf(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?ed(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,u=a.refs===vt?a.refs={}:a.refs,f=a.setupState,h=ut(f),d=f===vt?()=>!1:p=>St(h,p);if(c!=null&&c!==l&&(Ut(c)?(u[c]=null,d(c)&&(f[c]=null)):Pt(c)&&(c.value=null)),je(l))Ac(l,a,12,[o,u]);else{const p=Ut(l),_=Pt(l);if(p||_){const g=()=>{if(n.f){const m=p?d(l)?f[l]:u[l]:l.value;s?ze(m)&&d0(m,r):ze(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,Dn(g,t)):g()}}}Wh().requestIdleCallback;Wh().cancelIdleCallback;const fa=n=>!!n.type.__asyncLoader,Zh=n=>n.type.__isKeepAlive;function GC(n,e){wS(n,"a",e)}function WC(n,e){wS(n,"da",e)}function wS(n,e,t=cn){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(Jh(e,i,t),t){let s=t.parent;for(;s&&s.parent;)Zh(s.parent.vnode)&&XC(i,e,t,s),s=s.parent}}function XC(n,e,t,i){const s=Jh(e,n,i,!0);ts(()=>{d0(i[e],s)},t)}function Jh(n,e,t=cn,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{xr();const a=Lc(t),l=Fi(e,t,n,o);return a(),Mr(),l});return i?s.unshift(r):s.push(r),r}}const ks=n=>(e,t=cn)=>{(!Kl||n==="sp")&&Jh(n,(...i)=>e(...i),t)},$C=ks("bm"),Hn=ks("m"),qC=ks("bu"),YC=ks("u"),AS=ks("bum"),ts=ks("um"),jC=ks("sp"),KC=ks("rtg"),ZC=ks("rtc");function JC(n,e=cn){Jh("ec",n,e)}const T0="components",QC="directives";function Q9(n,e){return w0(T0,n,!0,e)||n}const CS=Symbol.for("v-ndc");function e2(n){return Ut(n)?w0(T0,n,!1)||n:n||CS}function eG(n){return w0(QC,n)}function w0(n,e,t=!0,i=!1){const s=Qt||cn;if(s){const r=s.type;if(n===T0){const a=H2(r,!1);if(a&&(a===e||a===ai(e)||a===Gh(ai(e))))return r}const o=bv(s[n]||r[n],e)||bv(s.appContext[n],e);return!o&&i?r:o}}function bv(n,e){return n&&(n[e]||n[ai(e)]||n[Gh(ai(e))])}function t2(n,e,t,i){let s;const r=t,o=ze(n);if(o||Ut(n)){const a=o&&Cs(n);let l=!1;a&&(l=!_i(n),n=qh(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;ljl(e)?!(e.type===Fn||e.type===jt&&!RS(e.children)):!0)?n:null}function tG(n,e){const t={};for(const i in n)t[pf(i)]=n[i];return t}const Qm=n=>n?ZS(n)?ed(n):Qm(n.parent):null,bl=nn(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=>Qm(n.parent),$root:n=>Qm(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>LS(n),$forceUpdate:n=>n.f||(n.f=()=>{E0(n.update)}),$nextTick:n=>n.n||(n.n=Sr.bind(n.proxy)),$watch:n=>S2.bind(n)}),hp=(n,e)=>n!==vt&&!n.__isScriptSetup&&St(n,e),i2={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(hp(i,e))return o[e]=1,i[e];if(s!==vt&&St(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&St(c,e))return o[e]=3,r[e];if(t!==vt&&St(t,e))return o[e]=4,t[e];eg&&(o[e]=0)}}const u=bl[e];let f,h;if(u)return e==="$attrs"&&Sn(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==vt&&St(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,St(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return hp(s,e)?(s[e]=t,!0):i!==vt&&St(i,e)?(i[e]=t,!0):St(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!==vt&&St(n,o)||hp(e,o)||(a=r[0])&&St(a,o)||St(i,o)||St(bl,o)||St(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:St(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function A0(){return PS().slots}function nG(){return PS().attrs}function PS(){const n=wn();return n.setupContext||(n.setupContext=QS(n))}function $l(n){return ze(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function iG(n,e){const t=$l(n);for(const i in e){if(i.startsWith("__skip"))continue;let s=t[i];s?ze(s)||je(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 sG(n,e){return!n||!e?n||e:ze(n)&&ze(e)?n.concat(e):nn({},$l(n),$l(e))}let eg=!0;function s2(n){const e=LS(n),t=n.proxy,i=n.ctx;eg=!1,e.beforeCreate&&xv(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:b,unmounted:v,render:E,renderTracked:T,renderTriggered:S,errorCaptured:P,serverPrefetch:x,expose:M,inheritAttrs:L,components:F,directives:H,filters:Y}=e;if(c&&r2(c,i,null),o)for(const Q in o){const Z=o[Q];je(Z)&&(i[Q]=Z.bind(t))}if(s){const Q=s.call(t,t);It(Q)&&(n.data=bi(Q))}if(eg=!0,r)for(const Q in r){const Z=r[Q],de=je(Z)?Z.bind(t,t):je(Z.get)?Z.get.bind(t,t):Ki,be=!je(Z)&&je(Z.set)?Z.set.bind(t):Ki,se=Ee({get:de,set:be});Object.defineProperty(i,Q,{enumerable:!0,configurable:!0,get:()=>se.value,set:ye=>se.value=ye})}if(a)for(const Q in a)IS(a[Q],i,t,Q);if(l){const Q=je(l)?l.call(t):l;Reflect.ownKeys(Q).forEach(Z=>{fr(Z,Q[Z])})}u&&xv(u,n,"c");function K(Q,Z){ze(Z)?Z.forEach(de=>Q(de.bind(t))):Z&&Q(Z.bind(t))}if(K($C,f),K(Hn,h),K(qC,d),K(YC,p),K(GC,_),K(WC,g),K(JC,P),K(ZC,T),K(KC,S),K(AS,y),K(ts,v),K(jC,x),ze(M))if(M.length){const Q=n.exposed||(n.exposed={});M.forEach(Z=>{Object.defineProperty(Q,Z,{get:()=>t[Z],set:de=>t[Z]=de})})}else n.exposed||(n.exposed={});E&&n.render===Ki&&(n.render=E),L!=null&&(n.inheritAttrs=L),F&&(n.components=F),H&&(n.directives=H),x&&TS(n)}function r2(n,e,t=Ki){ze(n)&&(n=tg(n));for(const i in n){const s=n[i];let r;It(s)?"default"in s?r=mn(s.from||i,s.default,!0):r=mn(s.from||i):r=mn(s),Pt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function xv(n,e,t){Fi(ze(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function IS(n,e,t,i){let s=i.includes(".")?XS(t,i):()=>t[i];if(Ut(n)){const r=e[n];je(r)&&$e(s,r)}else if(je(n))$e(s,n.bind(t));else if(It(n))if(ze(n))n.forEach(r=>IS(r,e,t,i));else{const r=je(n.handler)?n.handler.bind(t):e[n.handler];je(r)&&$e(s,r,n)}}function LS(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=>Ff(l,c,o,!0)),Ff(l,e,o)),It(e)&&r.set(e,l),l}function Ff(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&Ff(n,r,t,!0),s&&s.forEach(o=>Ff(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=o2[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const o2={data:Mv,props:Sv,emits:Sv,methods:fl,computed:fl,beforeCreate:Pn,created:Pn,beforeMount:Pn,mounted:Pn,beforeUpdate:Pn,updated:Pn,beforeDestroy:Pn,beforeUnmount:Pn,destroyed:Pn,unmounted:Pn,activated:Pn,deactivated:Pn,errorCaptured:Pn,serverPrefetch:Pn,components:fl,directives:fl,watch:l2,provide:Mv,inject:a2};function Mv(n,e){return e?n?function(){return nn(je(n)?n.call(this,this):n,je(e)?e.call(this,this):e)}:e:n}function a2(n,e){return fl(tg(n),tg(e))}function tg(n){if(ze(n)){const e={};for(let t=0;t1)return t&&je(e)?e.call(i&&i.proxy):e}}function Cc(){return!!(cn||Qt||fo)}const OS={},NS=()=>Object.create(OS),US=n=>Object.getPrototypeOf(n)===OS;function f2(n,e,t,i=!1){const s={},r=NS();n.propsDefaults=Object.create(null),FS(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:sS(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function h2(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=ut(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]=kS(f,e,!0);nn(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 It(n)&&i.set(n,la),la;if(ze(r))for(let u=0;un[0]==="_"||n==="$stable",C0=n=>ze(n)?n.map(qi):[qi(n)],p2=(n,e,t)=>{if(e._n)return e;const i=mS((...s)=>C0(e(...s)),t);return i._c=!1,i},zS=(n,e,t)=>{const i=n._ctx;for(const s in n){if(BS(s))continue;const r=n[s];if(je(r))e[s]=p2(s,r,i);else if(r!=null){const o=C0(r);e[s]=()=>o}}},VS=(n,e)=>{const t=C0(e);n.slots.default=()=>t},HS=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},m2=(n,e,t)=>{const i=n.slots=NS();if(n.vnode.shapeFlag&32){const s=e._;s?(HS(i,e,t),t&&FM(i,"_",s,!0)):zS(e,i)}else e&&VS(n,e)},g2=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=vt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:HS(s,e,t):(r=!e.$stable,zS(e,s)),o=e}else e&&(VS(n,e),o={default:1});if(r)for(const a in s)!BS(a)&&o[a]==null&&delete s[a]},Dn=R2;function GS(n){return _2(n)}function _2(n,e){const t=Wh();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=Ki,insertStaticContent:p}=n,_=(k,z,R,te=null,G=null,W=null,C=void 0,I=null,N=!!z.dynamicChildren)=>{if(k===z)return;k&&!no(k,z)&&(te=X(k),ye(k,G,W,!0),k=null),z.patchFlag===-2&&(N=!1,z.dynamicChildren=null);const{type:A,ref:w,shapeFlag:U}=z;switch(A){case Ic:g(k,z,R,te);break;case Fn:m(k,z,R,te);break;case _f:k==null&&y(z,R,te,C);break;case jt:F(k,z,R,te,G,W,C,I,N);break;default:U&1?E(k,z,R,te,G,W,C,I,N):U&6?H(k,z,R,te,G,W,C,I,N):(U&64||U&128)&&A.process(k,z,R,te,G,W,C,I,N,ce)}w!=null&&G&&Uf(w,k&&k.ref,W,z||k,!z)},g=(k,z,R,te)=>{if(k==null)i(z.el=a(z.children),R,te);else{const G=z.el=k.el;z.children!==k.children&&c(G,z.children)}},m=(k,z,R,te)=>{k==null?i(z.el=l(z.children||""),R,te):z.el=k.el},y=(k,z,R,te)=>{[k.el,k.anchor]=p(k.children,z,R,te,k.el,k.anchor)},b=({el:k,anchor:z},R,te)=>{let G;for(;k&&k!==z;)G=h(k),i(k,R,te),k=G;i(z,R,te)},v=({el:k,anchor:z})=>{let R;for(;k&&k!==z;)R=h(k),s(k),k=R;s(z)},E=(k,z,R,te,G,W,C,I,N)=>{z.type==="svg"?C="svg":z.type==="math"&&(C="mathml"),k==null?T(z,R,te,G,W,C,I,N):x(k,z,G,W,C,I,N)},T=(k,z,R,te,G,W,C,I)=>{let N,A;const{props:w,shapeFlag:U,transition:O,dirs:V}=k;if(N=k.el=o(k.type,W,w&&w.is,w),U&8?u(N,k.children):U&16&&P(k.children,N,null,te,G,dp(k,W),C,I),V&&Dr(k,null,te,"created"),S(N,k,k.scopeId,C,te),w){for(const ue in w)ue!=="value"&&!gl(ue)&&r(N,ue,null,w[ue],W,te);"value"in w&&r(N,"value",null,w.value,W),(A=w.onVnodeBeforeMount)&&Hi(A,te,k)}V&&Dr(k,null,te,"beforeMount");const $=v2(G,O);$&&O.beforeEnter(N),i(N,z,R),((A=w&&w.onVnodeMounted)||$||V)&&Dn(()=>{A&&Hi(A,te,k),$&&O.enter(N),V&&Dr(k,null,te,"mounted")},G)},S=(k,z,R,te,G)=>{if(R&&d(k,R),te)for(let W=0;W{for(let A=N;A{const I=z.el=k.el;let{patchFlag:N,dynamicChildren:A,dirs:w}=z;N|=k.patchFlag&16;const U=k.props||vt,O=z.props||vt;let V;if(R&&Or(R,!1),(V=O.onVnodeBeforeUpdate)&&Hi(V,R,z,k),w&&Dr(z,k,R,"beforeUpdate"),R&&Or(R,!0),(U.innerHTML&&O.innerHTML==null||U.textContent&&O.textContent==null)&&u(I,""),A?M(k.dynamicChildren,A,I,R,te,dp(z,G),W):C||Z(k,z,I,null,R,te,dp(z,G),W,!1),N>0){if(N&16)L(I,U,O,R,G);else if(N&2&&U.class!==O.class&&r(I,"class",null,O.class,G),N&4&&r(I,"style",U.style,O.style,G),N&8){const $=z.dynamicProps;for(let ue=0;ue<$.length;ue++){const le=$[ue],Me=U[le],Be=O[le];(Be!==Me||le==="value")&&r(I,le,Me,Be,G,R)}}N&1&&k.children!==z.children&&u(I,z.children)}else!C&&A==null&&L(I,U,O,R,G);((V=O.onVnodeUpdated)||w)&&Dn(()=>{V&&Hi(V,R,z,k),w&&Dr(z,k,R,"updated")},te)},M=(k,z,R,te,G,W,C)=>{for(let I=0;I{if(z!==R){if(z!==vt)for(const W in z)!gl(W)&&!(W in R)&&r(k,W,z[W],null,G,te);for(const W in R){if(gl(W))continue;const C=R[W],I=z[W];C!==I&&W!=="value"&&r(k,W,I,C,G,te)}"value"in R&&r(k,"value",z.value,R.value,G)}},F=(k,z,R,te,G,W,C,I,N)=>{const A=z.el=k?k.el:a(""),w=z.anchor=k?k.anchor:a("");let{patchFlag:U,dynamicChildren:O,slotScopeIds:V}=z;V&&(I=I?I.concat(V):V),k==null?(i(A,R,te),i(w,R,te),P(z.children||[],R,w,G,W,C,I,N)):U>0&&U&64&&O&&k.dynamicChildren?(M(k.dynamicChildren,O,R,G,W,C,I),(z.key!=null||G&&z===G.subTree)&&R0(k,z,!0)):Z(k,z,R,w,G,W,C,I,N)},H=(k,z,R,te,G,W,C,I,N)=>{z.slotScopeIds=I,k==null?z.shapeFlag&512?G.ctx.activate(z,R,te,C,N):Y(z,R,te,G,W,C,N):ee(k,z,N)},Y=(k,z,R,te,G,W,C)=>{const I=k.component=k2(k,te,G);if(Zh(k)&&(I.ctx.renderer=ce),B2(I,!1,C),I.asyncDep){if(G&&G.registerDep(I,K,C),!k.el){const N=I.subTree=pn(Fn);m(null,N,z,R)}}else K(I,k,z,R,G,W,C)},ee=(k,z,R)=>{const te=z.component=k.component;if(A2(k,z,R))if(te.asyncDep&&!te.asyncResolved){Q(te,z,R);return}else te.next=z,te.update();else z.el=k.el,te.vnode=z},K=(k,z,R,te,G,W,C)=>{const I=()=>{if(k.isMounted){let{next:U,bu:O,u:V,parent:$,vnode:ue}=k;{const Te=WS(k);if(Te){U&&(U.el=ue.el,Q(k,U,C)),Te.asyncDep.then(()=>{k.isUnmounted||I()});return}}let le=U,Me;Or(k,!1),U?(U.el=ue.el,Q(k,U,C)):U=ue,O&&mf(O),(Me=U.props&&U.props.onVnodeBeforeUpdate)&&Hi(Me,$,U,ue),Or(k,!0);const Be=wv(k),me=k.subTree;k.subTree=Be,_(me,Be,f(me.el),X(me),k,G,W),U.el=Be.el,le===null&&C2(k,Be.el),V&&Dn(V,G),(Me=U.props&&U.props.onVnodeUpdated)&&Dn(()=>Hi(Me,$,U,ue),G)}else{let U;const{el:O,props:V}=z,{bm:$,m:ue,parent:le,root:Me,type:Be}=k,me=fa(z);Or(k,!1),$&&mf($),!me&&(U=V&&V.onVnodeBeforeMount)&&Hi(U,le,z),Or(k,!0);{Me.ce&&Me.ce._injectChildStyle(Be);const Te=k.subTree=wv(k);_(null,Te,R,te,k,G,W),z.el=Te.el}if(ue&&Dn(ue,G),!me&&(U=V&&V.onVnodeMounted)){const Te=z;Dn(()=>Hi(U,le,Te),G)}(z.shapeFlag&256||le&&fa(le.vnode)&&le.vnode.shapeFlag&256)&&k.a&&Dn(k.a,G),k.isMounted=!0,z=R=te=null}};k.scope.on();const N=k.effect=new HM(I);k.scope.off();const A=k.update=N.run.bind(N),w=k.job=N.runIfDirty.bind(N);w.i=k,w.id=k.uid,N.scheduler=()=>E0(w),Or(k,!0),A()},Q=(k,z,R)=>{z.component=k;const te=k.vnode.props;k.vnode=z,k.next=null,h2(k,z.props,te,R),g2(k,z.children,R),xr(),mv(k),Mr()},Z=(k,z,R,te,G,W,C,I,N=!1)=>{const A=k&&k.children,w=k?k.shapeFlag:0,U=z.children,{patchFlag:O,shapeFlag:V}=z;if(O>0){if(O&128){be(A,U,R,te,G,W,C,I,N);return}else if(O&256){de(A,U,R,te,G,W,C,I,N);return}}V&8?(w&16&&xe(A,G,W),U!==A&&u(R,U)):w&16?V&16?be(A,U,R,te,G,W,C,I,N):xe(A,G,W,!0):(w&8&&u(R,""),V&16&&P(U,R,te,G,W,C,I,N))},de=(k,z,R,te,G,W,C,I,N)=>{k=k||la,z=z||la;const A=k.length,w=z.length,U=Math.min(A,w);let O;for(O=0;Ow?xe(k,G,W,!0,!1,U):P(z,R,te,G,W,C,I,N,U)},be=(k,z,R,te,G,W,C,I,N)=>{let A=0;const w=z.length;let U=k.length-1,O=w-1;for(;A<=U&&A<=O;){const V=k[A],$=z[A]=N?sr(z[A]):qi(z[A]);if(no(V,$))_(V,$,R,null,G,W,C,I,N);else break;A++}for(;A<=U&&A<=O;){const V=k[U],$=z[O]=N?sr(z[O]):qi(z[O]);if(no(V,$))_(V,$,R,null,G,W,C,I,N);else break;U--,O--}if(A>U){if(A<=O){const V=O+1,$=VO)for(;A<=U;)ye(k[A],G,W,!0),A++;else{const V=A,$=A,ue=new Map;for(A=$;A<=O;A++){const Se=z[A]=N?sr(z[A]):qi(z[A]);Se.key!=null&&ue.set(Se.key,A)}let le,Me=0;const Be=O-$+1;let me=!1,Te=0;const Ve=new Array(Be);for(A=0;A=Be){ye(Se,G,W,!0);continue}let Ze;if(Se.key!=null)Ze=ue.get(Se.key);else for(le=$;le<=O;le++)if(Ve[le-$]===0&&no(Se,z[le])){Ze=le;break}Ze===void 0?ye(Se,G,W,!0):(Ve[Ze-$]=A+1,Ze>=Te?Te=Ze:me=!0,_(Se,z[Ze],R,null,G,W,C,I,N),Me++)}const We=me?y2(Ve):la;for(le=We.length-1,A=Be-1;A>=0;A--){const Se=$+A,Ze=z[Se],tt=Se+1{const{el:W,type:C,transition:I,children:N,shapeFlag:A}=k;if(A&6){se(k.component.subTree,z,R,te);return}if(A&128){k.suspense.move(z,R,te);return}if(A&64){C.move(k,z,R,ce);return}if(C===jt){i(W,z,R);for(let U=0;UI.enter(W),G);else{const{leave:U,delayLeave:O,afterLeave:V}=I,$=()=>i(W,z,R),ue=()=>{U(W,()=>{$(),V&&V()})};O?O(W,$,ue):ue()}else i(W,z,R)},ye=(k,z,R,te=!1,G=!1)=>{const{type:W,props:C,ref:I,children:N,dynamicChildren:A,shapeFlag:w,patchFlag:U,dirs:O,cacheIndex:V}=k;if(U===-2&&(G=!1),I!=null&&Uf(I,null,R,k,!0),V!=null&&(z.renderCache[V]=void 0),w&256){z.ctx.deactivate(k);return}const $=w&1&&O,ue=!fa(k);let le;if(ue&&(le=C&&C.onVnodeBeforeUnmount)&&Hi(le,z,k),w&6)ge(k.component,R,te);else{if(w&128){k.suspense.unmount(R,te);return}$&&Dr(k,null,z,"beforeUnmount"),w&64?k.type.remove(k,z,R,ce,te):A&&!A.hasOnce&&(W!==jt||U>0&&U&64)?xe(A,z,R,!1,!0):(W===jt&&U&384||!G&&w&16)&&xe(N,z,R),te&&He(k)}(ue&&(le=C&&C.onVnodeUnmounted)||$)&&Dn(()=>{le&&Hi(le,z,k),$&&Dr(k,null,z,"unmounted")},R)},He=k=>{const{type:z,el:R,anchor:te,transition:G}=k;if(z===jt){re(R,te);return}if(z===_f){v(k);return}const W=()=>{s(R),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(k.shapeFlag&1&&G&&!G.persisted){const{leave:C,delayLeave:I}=G,N=()=>C(R,W);I?I(k.el,W,N):N()}else W()},re=(k,z)=>{let R;for(;k!==z;)R=h(k),s(k),k=R;s(z)},ge=(k,z,R)=>{const{bum:te,scope:G,job:W,subTree:C,um:I,m:N,a:A}=k;Tv(N),Tv(A),te&&mf(te),G.stop(),W&&(W.flags|=8,ye(C,k,z,R)),I&&Dn(I,z),Dn(()=>{k.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&k.asyncDep&&!k.asyncResolved&&k.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},xe=(k,z,R,te=!1,G=!1,W=0)=>{for(let C=W;C{if(k.shapeFlag&6)return X(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const z=h(k.anchor||k.el),R=z&&z[gS];return R?h(R):z};let ae=!1;const fe=(k,z,R)=>{k==null?z._vnode&&ye(z._vnode,null,null,!0):_(z._vnode||null,k,z,null,null,null,R),z._vnode=k,ae||(ae=!0,mv(),hS(),ae=!1)},ce={p:_,um:ye,m:se,r:He,mt:Y,mc:P,pc:Z,pbc:M,n:X,o:n};return{render:fe,hydrate:void 0,createApp:u2(fe)}}function dp({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 Or({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function v2(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function R0(n,e,t=!1){const i=n.children,s=e.children;if(ze(i)&&ze(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 WS(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:WS(e)}function Tv(n){if(n)for(let e=0;emn(b2);function Rc(n,e){return Pc(n,null,e)}function rG(n,e){return Pc(n,null,{flush:"post"})}function M2(n,e){return Pc(n,null,{flush:"sync"})}function $e(n,e,t){return Pc(n,e,t)}function Pc(n,e,t=vt){const{immediate:i,deep:s,flush:r,once:o}=t,a=nn({},t),l=e&&i||!e&&r!=="post";let c;if(Kl){if(r==="sync"){const d=x2();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=Ki,d.resume=Ki,d.pause=Ki,d}}const u=cn;a.call=(d,p,_)=>Fi(d,u,p,_);let f=!1;r==="post"?a.scheduler=d=>{Dn(d,u&&u.suspense)}:r!=="sync"&&(f=!0,a.scheduler=(d,p)=>{p?d():E0(d)}),a.augmentJob=d=>{e&&(d.flags|=4),f&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const h=NC(n,e,a);return Kl&&(c?c.push(h):l&&h()),h}function S2(n,e,t){const i=this.proxy,s=Ut(n)?n.includes(".")?XS(i,n):()=>i[n]:n.bind(i,i);let r;je(e)?r=e:(r=e.handler,t=e);const o=Lc(this),a=Pc(s,r.bind(i),t);return o(),a}function XS(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{let u,f=vt,h;return M2(()=>{const d=n[s];Yn(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(!Yn(p,u)&&!(f!==vt&&Yn(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),Yn(d,p)&&Yn(d,f)&&!Yn(p,h)&&c(),f=d,h=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||vt:a,done:!1}:{done:!0}}}},a}const $S=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${ai(e)}Modifiers`]||n[`${Fs(e)}Modifiers`];function E2(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||vt;let s=t;const r=e.startsWith("update:"),o=r&&$S(i,e.slice(7));o&&(o.trim&&(s=t.map(u=>Ut(u)?u.trim():u)),o.number&&(s=t.map(If)));let a,l=i[a=pf(e)]||i[a=pf(ai(e))];!l&&r&&(l=i[a=pf(Fs(e))]),l&&Fi(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,Fi(c,n,6,s)}}function qS(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(!je(n)){const l=c=>{const u=qS(c,e,!0);u&&(a=!0,nn(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(It(n)&&i.set(n,null),null):(ze(r)?r.forEach(l=>o[l]=null):nn(o,r),It(n)&&i.set(n,o),o)}function Qh(n,e){return!n||!Vh(e)?!1:(e=e.slice(2).replace(/Once$/,""),St(n,e[0].toLowerCase()+e.slice(1))||St(n,Fs(e))||St(n,e))}function wv(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=Nf(n);let m,y;try{if(t.shapeFlag&4){const v=s||i,E=v;m=qi(c.call(E,v,u,f,d,h,p)),y=a}else{const v=e;m=qi(v.length>1?v(f,{attrs:a,slots:o,emit:l}):v(f,null)),y=e.props?a:T2(a)}}catch(v){xl.length=0,Kh(v,n,1),m=pn(Fn)}let b=m;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:E}=b;v.length&&E&7&&(r&&v.some(h0)&&(y=w2(y,r)),b=dr(b,y,!1,!0))}return t.dirs&&(b=dr(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(t.dirs):t.dirs),t.transition&&Xl(b,t.transition),m=b,Nf(g),m}const T2=n=>{let e;for(const t in n)(t==="class"||t==="style"||Vh(t))&&((e||(e={}))[t]=n[t]);return e},w2=(n,e)=>{const t={};for(const i in n)(!h0(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function A2(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?Av(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function R2(n,e){e&&e.pendingBranch?ze(n)?e.effects.push(...n):e.effects.push(n):kC(n)}const jt=Symbol.for("v-fgt"),Ic=Symbol.for("v-txt"),Fn=Symbol.for("v-cmt"),_f=Symbol.for("v-stc"),xl=[];let si=null;function gn(n=!1){xl.push(si=n?null:[])}function P2(){xl.pop(),si=xl[xl.length-1]||null}let ql=1;function Cv(n,e=!1){ql+=n,n<0&&si&&e&&(si.hasOnce=!0)}function jS(n){return n.dynamicChildren=ql>0?si||la:null,P2(),ql>0&&si&&si.push(n),n}function vi(n,e,t,i,s,r){return jS(ir(n,e,t,i,s,r,!0))}function Yl(n,e,t,i,s){return jS(pn(n,e,t,i,s,!0))}function jl(n){return n?n.__v_isVNode===!0:!1}function no(n,e){return n.type===e.type&&n.key===e.key}const KS=({key:n})=>n??null,vf=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ut(n)||Pt(n)||je(n)?{i:Qt,r:n,k:e,f:!!t}:n:null);function ir(n,e=null,t=null,i=0,s=null,r=n===jt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&KS(e),ref:e&&vf(e),scopeId:pS,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:Qt};return a?(P0(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=Ut(t)?8:16),ql>0&&!o&&si&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&si.push(l),l}const pn=I2;function I2(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===CS)&&(n=Fn),jl(n)){const a=dr(n,e,!0);return t&&P0(a,t),ql>0&&!r&&si&&(a.shapeFlag&6?si[si.indexOf(n)]=a:si.push(a)),a.patchFlag=-2,a}if(G2(n)&&(n=n.__vccOpts),e){e=L2(e);let{class:a,style:l}=e;a&&!Ut(a)&&(e.class=Oa(a)),It(l)&&(x0(l)&&!ze(l)&&(l=nn({},l)),e.style=Si(l))}const o=Ut(n)?1:YS(n)?128:_S(n)?64:It(n)?4:je(n)?2:0;return ir(n,e,t,i,s,o,r,!0)}function L2(n){return n?x0(n)||US(n)?nn({},n):n:null}function dr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?N2(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&KS(c),ref:e&&e.ref?t&&r?ze(r)?r.concat(vf(e)):[r,vf(e)]:vf(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!==jt?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&&dr(n.ssContent),ssFallback:n.ssFallback&&dr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&Xl(u,l.clone(u)),u}function D2(n=" ",e=0){return pn(Ic,null,n,e)}function O2(n,e){const t=pn(_f,null,n);return t.staticCount=e,t}function Rv(n="",e=!1){return e?(gn(),Yl(Fn,null,n)):pn(Fn,null,n)}function qi(n){return n==null||typeof n=="boolean"?pn(Fn):ze(n)?pn(jt,null,n.slice()):jl(n)?sr(n):pn(Ic,null,String(n))}function sr(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:dr(n)}function P0(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(ze(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),P0(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!US(e)?e._ctx=Qt:s===3&&Qt&&(Qt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else je(e)?(e={default:e,_ctx:Qt},t=32):(e=String(e),i&64?(t=16,e=[D2(e)]):t=8);n.children=e,n.shapeFlag|=t}function N2(...n){const e={};for(let t=0;tcn||Qt;let kf,ig;{const n=Wh(),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)}};kf=e("__VUE_INSTANCE_SETTERS__",t=>cn=t),ig=e("__VUE_SSR_SETTERS__",t=>Kl=t)}const Lc=n=>{const e=cn;return kf(n),n.scope.on(),()=>{n.scope.off(),kf(e)}},Pv=()=>{cn&&cn.scope.off(),kf(null)};function ZS(n){return n.vnode.shapeFlag&4}let Kl=!1;function B2(n,e=!1,t=!1){e&&ig(e);const{props:i,children:s}=n.vnode,r=ZS(n);f2(n,i,r,e),m2(n,s,t);const o=r?z2(n,e):void 0;return e&&ig(!1),o}function z2(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,i2);const{setup:i}=t;if(i){xr();const s=n.setupContext=i.length>1?QS(n):null,r=Lc(n),o=Ac(i,n,0,[n.props,s]),a=OM(o);if(Mr(),r(),(a||n.sp)&&!fa(n)&&TS(n),a){if(o.then(Pv,Pv),e)return o.then(l=>{Iv(n,l)}).catch(l=>{Kh(l,n,0)});n.asyncDep=o}else Iv(n,o)}else JS(n)}function Iv(n,e,t){je(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:It(e)&&(n.setupState=oS(e)),JS(n)}function JS(n,e,t){const i=n.type;n.render||(n.render=i.render||Ki);{const s=Lc(n);xr();try{s2(n)}finally{Mr(),s()}}}const V2={get(n,e){return Sn(n,"get",""),n[e]}};function QS(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,V2),slots:n.slots,emit:n.emit,expose:e}}function ed(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(oS(M0(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in bl)return bl[t](n)},has(e,t){return t in e||t in bl}})):n.proxy}function H2(n,e=!0){return je(n)?n.displayName||n.name:n.name||e&&n.__name}function G2(n){return je(n)&&"__vccOpts"in n}const Ee=(n,e)=>DC(n,e,Kl);function Ls(n,e,t){const i=arguments.length;return i===2?It(e)&&!ze(e)?jl(e)?pn(n,null,[e]):pn(n,e):pn(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&jl(t)&&(t=[t]),pn(n,e,t))}const W2="3.5.13";/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let sg;const Lv=typeof window<"u"&&window.trustedTypes;if(Lv)try{sg=Lv.createPolicy("vue",{createHTML:n=>n})}catch{}const e1=sg?n=>sg.createHTML(n):n=>n,X2="http://www.w3.org/2000/svg",$2="http://www.w3.org/1998/Math/MathML",vs=typeof document<"u"?document:null,Dv=vs&&vs.createElement("template"),q2={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"?vs.createElementNS(X2,n):e==="mathml"?vs.createElementNS($2,n):t?vs.createElement(n,{is:t}):vs.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>vs.createTextNode(n),createComment:n=>vs.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>vs.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{Dv.innerHTML=e1(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=Dv.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]}},Ws="transition",qa="animation",Zl=Symbol("_vtc"),t1={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},Y2=nn({},bS,t1),j2=n=>(n.displayName="Transition",n.props=Y2,n),aG=j2((n,{slots:e})=>Ls(HC,K2(n),e)),Nr=(n,e=[])=>{ze(n)?n.forEach(t=>t(...e)):n&&n(...e)},Ov=n=>n?ze(n)?n.some(e=>e.length>1):n.length>1:!1;function K2(n){const e={};for(const F in n)F in t1||(e[F]=n[F]);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=Z2(s),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:y,onEnterCancelled:b,onLeave:v,onLeaveCancelled:E,onBeforeAppear:T=m,onAppear:S=y,onAppearCancelled:P=b}=e,x=(F,H,Y,ee)=>{F._enterCancelled=ee,Ur(F,H?u:a),Ur(F,H?c:o),Y&&Y()},M=(F,H)=>{F._isLeaving=!1,Ur(F,f),Ur(F,d),Ur(F,h),H&&H()},L=F=>(H,Y)=>{const ee=F?S:y,K=()=>x(H,F,Y);Nr(ee,[H,K]),Nv(()=>{Ur(H,F?l:r),ls(H,F?u:a),Ov(ee)||Uv(H,i,_,K)})};return nn(e,{onBeforeEnter(F){Nr(m,[F]),ls(F,r),ls(F,o)},onBeforeAppear(F){Nr(T,[F]),ls(F,l),ls(F,c)},onEnter:L(!1),onAppear:L(!0),onLeave(F,H){F._isLeaving=!0;const Y=()=>M(F,H);ls(F,f),F._enterCancelled?(ls(F,h),Bv()):(Bv(),ls(F,h)),Nv(()=>{F._isLeaving&&(Ur(F,f),ls(F,d),Ov(v)||Uv(F,i,g,Y))}),Nr(v,[F,Y])},onEnterCancelled(F){x(F,!1,void 0,!0),Nr(b,[F])},onAppearCancelled(F){x(F,!0,void 0,!0),Nr(P,[F])},onLeaveCancelled(F){M(F),Nr(E,[F])}})}function Z2(n){if(n==null)return null;if(It(n))return[pp(n.enter),pp(n.leave)];{const e=pp(n);return[e,e]}}function pp(n){return QA(n)}function ls(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Zl]||(n[Zl]=new Set)).add(e)}function Ur(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Zl];t&&(t.delete(e),t.size||(n[Zl]=void 0))}function Nv(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let J2=0;function Uv(n,e,t,i){const s=n._endId=++J2,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=Q2(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(`${Ws}Delay`),r=i(`${Ws}Duration`),o=Fv(s,r),a=i(`${qa}Delay`),l=i(`${qa}Duration`),c=Fv(a,l);let u=null,f=0,h=0;e===Ws?o>0&&(u=Ws,f=o,h=r.length):e===qa?c>0&&(u=qa,f=c,h=l.length):(f=Math.max(o,c),u=f>0?o>c?Ws:qa:null,h=u?u===Ws?r.length:l.length:0);const d=u===Ws&&/\b(transform|all)(,|$)/.test(i(`${Ws}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:d}}function Fv(n,e){for(;n.lengthkv(t)+kv(n[i])))}function kv(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function Bv(){return document.body.offsetHeight}function eR(n,e,t){const i=n[Zl];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const zv=Symbol("_vod"),tR=Symbol("_vsh"),nR=Symbol(""),iR=/(^|;)\s*display\s*:/;function sR(n,e,t){const i=n.style,s=Ut(t);let r=!1;if(t&&!s){if(e)if(Ut(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&yf(i,a,"")}else for(const o in e)t[o]==null&&yf(i,o,"");for(const o in t)o==="display"&&(r=!0),yf(i,o,t[o])}else if(s){if(e!==t){const o=i[nR];o&&(t+=";"+o),i.cssText=t,r=iR.test(t)}}else e&&n.removeAttribute("style");zv in n&&(n[zv]=r?i.display:"",n[tR]&&(i.display="none"))}const Vv=/\s*!important$/;function yf(n,e,t){if(ze(t))t.forEach(i=>yf(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=rR(n,e);Vv.test(t)?n.setProperty(Fs(i),t.replace(Vv,""),"important"):n[i]=t}}const Hv=["Webkit","Moz","ms"],mp={};function rR(n,e){const t=mp[e];if(t)return t;let i=ai(e);if(i!=="filter"&&i in n)return mp[e]=i;i=Gh(i);for(let s=0;sgp||(cR.then(()=>gp=0),gp=Date.now());function fR(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Fi(hR(i,t.value),e,5,[i])};return t.value=n,t.attached=uR(),t}function hR(n,e){if(ze(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 Yv=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,dR=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?eR(n,i,o):e==="style"?sR(n,t,i):Vh(e)?h0(e)||aR(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):pR(n,e,i,o))?(Xv(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Wv(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Ut(i))?Xv(n,ai(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),Wv(n,e,i,o))};function pR(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&Yv(e)&&je(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 Yv(e)&&Ut(t)?!1:e in n}const pr=n=>{const e=n.props["onUpdate:modelValue"]||!1;return ze(e)?t=>mf(e,t):e};function mR(n){n.target.composing=!0}function jv(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const yi=Symbol("_assign"),Kv={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[yi]=pr(s);const r=i||s.props&&s.props.type==="number";xs(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=If(a)),n[yi](a)}),t&&xs(n,"change",()=>{n.value=n.value.trim()}),e||(xs(n,"compositionstart",mR),xs(n,"compositionend",jv),xs(n,"change",jv))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[yi]=pr(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?If(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))}},gR={deep:!0,created(n,e,t){n[yi]=pr(t),xs(n,"change",()=>{const i=n._modelValue,s=ma(n),r=n.checked,o=n[yi];if(ze(i)){const a=m0(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(Da(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(n1(n,r))})},mounted:Zv,beforeUpdate(n,e,t){n[yi]=pr(t),Zv(n,e,t)}};function Zv(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(ze(e))s=m0(e,i.props.value)>-1;else if(Da(e))s=e.has(i.props.value);else{if(e===t)return;s=_o(e,n1(n,!0))}n.checked!==s&&(n.checked=s)}const _R={created(n,{value:e},t){n.checked=_o(e,t.props.value),n[yi]=pr(t),xs(n,"change",()=>{n[yi](ma(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[yi]=pr(i),e!==t&&(n.checked=_o(e,i.props.value))}},vR={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const s=Da(e);xs(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?If(ma(o)):ma(o));n[yi](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,Sr(()=>{n._assigning=!1})}),n[yi]=pr(i)},mounted(n,{value:e}){Jv(n,e)},beforeUpdate(n,e,t){n[yi]=pr(t)},updated(n,{value:e}){n._assigning||Jv(n,e)}};function Jv(n,e){const t=n.multiple,i=ze(e);if(!(t&&!i&&!Da(e))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=m0(e,a)>-1}else o.selected=e.has(a);else if(_o(ma(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function ma(n){return"_value"in n?n._value:n.value}function n1(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const lG={created(n,e,t){au(n,e,t,null,"created")},mounted(n,e,t){au(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){au(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){au(n,e,t,i,"updated")}};function yR(n,e){switch(n){case"SELECT":return vR;case"TEXTAREA":return Kv;default:switch(e){case"checkbox":return gR;case"radio":return _R;default:return Kv}}}function au(n,e,t,i,s){const o=yR(n.tagName,t.props&&t.props.type)[s];o&&o(n,e,t,i)}const bR=["ctrl","shift","alt","meta"],xR={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)=>bR.some(t=>n[`${t}Key`]&&!e.includes(t))},cG=(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=Fs(s.key);if(e.some(o=>o===r||MR[o]===r))return n(s)})},SR=nn({patchProp:dR},q2);let Qv;function i1(){return Qv||(Qv=GS(SR))}const fG=(...n)=>{i1().render(...n)},ER=(...n)=>{const e=i1().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=wR(i);if(!s)return;const r=e._component;!je(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,TR(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function TR(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function wR(n){return Ut(n)?document.querySelector(n):n}const s1=new Set,Zn=new WeakMap,ga=new WeakMap,yo=new WeakMap,rg=new WeakMap,AR=new WeakMap,_a=new WeakMap,Bf=new WeakMap,hl=new WeakSet;let mr,I0=0,L0=0;const Es="__aa_tgt",Jl="__aa_del",zf="__aa_new",CR=n=>{const e=OR(n);e&&e.forEach(t=>NR(t))},RR=n=>{n.forEach(e=>{e.target===mr&&IR(),Zn.has(e.target)&&To(e.target)})};function PR(n){const e=rg.get(n);e==null||e.disconnect();let t=Zn.get(n),i=0;const s=5;t||(t=va(n),Zn.set(n,t));const{offsetWidth:r,offsetHeight:o}=mr,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&&To(n)},{root:mr,threshold:1,rootMargin:l});c.observe(n),rg.set(n,c)}function To(n){clearTimeout(Bf.get(n));const e=td(n),t=Ql(e)?500:e.duration;Bf.set(n,setTimeout(async()=>{const i=yo.get(n);try{await(i==null?void 0:i.finished),Zn.set(n,va(n)),PR(n)}catch{}},t))}function IR(){clearTimeout(Bf.get(mr)),Bf.set(mr,setTimeout(()=>{s1.forEach(n=>l1(n,e=>r1(()=>To(e))))},100))}function LR(n){setTimeout(()=>{AR.set(n,setInterval(()=>r1(To.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function r1(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let og,ia;const DR=typeof window<"u"&&"ResizeObserver"in window;DR&&(mr=document.documentElement,og=new MutationObserver(CR),ia=new ResizeObserver(RR),window.addEventListener("scroll",()=>{L0=window.scrollY,I0=window.scrollX}),ia.observe(mr));function OR(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(_p(s.target),!i.has(s.target)){i.add(s.target);for(let r=0;rt(n,_a.has(n)));for(let t=0;ts(i,_a.has(i)))}}function O0(n){return Array.isArray(n)?n:[n]}function Ql(n){return typeof n=="function"}function FR(n){const e=Zn.get(n),t=va(n);if(!D0(n))return Zn.set(n,t);let i;if(!e)return;const s=td(n);if(typeof s!="function"){const r=e.left-t.left,o=e.top-t.top,[a,l,c,u]=o1(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]=O0(s(n,"remain",e,t));i=new Animation(r),i.play()}yo.set(n,i),Zn.set(n,t),i.addEventListener("finish",To.bind(null,n))}function ey(n){zf in n&&delete n[zf];const e=va(n);Zn.set(n,e);const t=td(n);if(!D0(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]=O0(t(n,"add",e));i=new Animation(s),i.play()}yo.set(n,i),i.addEventListener("finish",To.bind(null,n))}function ty(n,e){var t;n.remove(),Zn.delete(n),ga.delete(n),yo.delete(n),(t=rg.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(Jl in n&&delete n[Jl],Object.defineProperty(n,zf,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function kR(n){var e;if(!ga.has(n)||!Zn.has(n))return;const[t,i]=ga.get(n);Object.defineProperty(n,Jl,{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=a1(n))===null||e===void 0||e.appendChild(n),!D0(n))return ty(n);const[o,a,l,c]=zR(n),u=td(n),f=Zn.get(n);(s!==I0||r!==L0)&&BR(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(!Ql(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,_]=O0(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()}yo.set(n,h),h.addEventListener("finish",ty.bind(null,n,d))}function BR(n,e,t,i){const s=I0-e,r=L0-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(mr).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(!Ql(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 zR(n){const e=Zn.get(n),[t,,i]=o1(n,e,va(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=Zn.get(s)||va(s),a=Math.round(e.top-o.top)-Xi(r.borderTopWidth),l=Math.round(e.left-o.left)-Xi(r.borderLeftWidth);return[a,l,t,i]}function VR(n,e={}){return og&&ia&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Ql(e)&&!e.disrespectUserMotionPreference||(hl.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),l1(n,To,LR,s=>ia==null?void 0:ia.observe(s)),Ql(e)?_a.set(n,e):_a.set(n,{duration:250,easing:"ease-in-out",...e}),og.observe(n,{childList:!0}),s1.add(n))),Object.freeze({parent:n,enable:()=>{hl.add(n)},disable:()=>{hl.delete(n)},isEnabled:()=>hl.has(n)})}const HR={mounted:(n,e)=>{VR(n,e.value||{})},getSSRProps:()=>({})},GR=HR,WR={install(n){n.directive("auto-animate",GR)}};/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */const Dc="175",XR={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},$R={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},c1=0,ag=1,u1=2,qR=3,YR=0,N0=1,U0=2,$i=3,Ds=0,zn=1,Ii=2,Rs=0,ho=1,lg=2,cg=3,ug=4,f1=5,ar=100,h1=101,d1=102,p1=103,m1=104,g1=200,_1=201,v1=202,y1=203,Vf=204,Hf=205,b1=206,x1=207,M1=208,S1=209,E1=210,T1=211,w1=212,A1=213,C1=214,Gf=0,Wf=1,Xf=2,bo=3,$f=4,qf=5,Yf=6,jf=7,Oc=0,R1=1,P1=2,Zi=0,I1=1,L1=2,D1=3,nd=4,O1=5,N1=6,U1=7,fg="attached",F1="detached",id=300,Os=301,gr=302,ec=303,tc=304,Na=306,nc=1e3,gi=1001,ic=1002,_n=1003,F0=1004,jR=1004,sa=1005,KR=1005,en=1006,Ml=1007,ZR=1007,ji=1008,JR=1008,ns=1009,k0=1010,B0=1011,ya=1012,sd=1013,Ns=1014,Kn=1015,Ua=1016,rd=1017,od=1018,ba=1020,z0=35902,V0=1021,H0=1022,Bn=1023,G0=1024,W0=1025,xa=1026,Ma=1027,ad=1028,Nc=1029,X0=1030,ld=1031,QR=1032,cd=1033,Sl=33776,El=33777,Tl=33778,wl=33779,Kf=35840,Zf=35841,Jf=35842,Qf=35843,eh=36196,th=37492,nh=37496,ih=37808,sh=37809,rh=37810,oh=37811,ah=37812,lh=37813,ch=37814,uh=37815,fh=37816,hh=37817,dh=37818,ph=37819,mh=37820,gh=37821,Al=36492,_h=36494,vh=36495,$0=36283,yh=36284,bh=36285,xh=36286,k1=2200,B1=2201,z1=2202,sc=2300,Mh=2301,bf=2302,oo=2400,ao=2401,rc=2402,ud=2500,q0=2501,e3=0,t3=1,n3=2,V1=3200,H1=3201,i3=3202,s3=3203,Er=0,G1=1,Ms="",Nn="srgb",xo="srgb-linear",oc="linear",wt="srgb",r3=0,Qr=7680,o3=7681,a3=7682,l3=7683,c3=34055,u3=34056,f3=5386,h3=512,d3=513,p3=514,m3=515,g3=516,_3=517,v3=518,hg=519,W1=512,X1=513,$1=514,Y0=515,q1=516,Y1=517,j1=518,K1=519,ac=35044,y3=35048,b3=35040,x3=35045,M3=35049,S3=35041,E3=35046,T3=35050,w3=35042,A3="100",dg="300 es",Li=2e3,lc=2001,C3={COMPUTE:"compute",RENDER:"render"};class ss{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]+bn[n>>16&255]+bn[n>>24&255]+"-"+bn[e&255]+bn[e>>8&255]+"-"+bn[e>>16&15|64]+bn[e>>24&255]+"-"+bn[t&63|128]+bn[t>>8&255]+"-"+bn[t>>16&255]+bn[t>>24&255]+bn[i&255]+bn[i>>8&255]+bn[i>>16&255]+bn[i>>24&255]).toLowerCase()}function Qe(n,e,t){return Math.max(e,Math.min(t,n))}function j0(n,e){return(n%e+e)%e}function R3(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function P3(n,e,t){return n!==e?(t-n)/(e-n):0}function Cl(n,e,t){return(1-t)*n+t*e}function I3(n,e,t,i){return Cl(n,e,1-Math.exp(-t*i))}function L3(n,e=1){return e-Math.abs(j0(n,e*2)-e)}function D3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function O3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function N3(n,e){return n+Math.floor(Math.random()*(e-n+1))}function U3(n,e){return n+Math.random()*(e-n)}function F3(n){return n*(.5-Math.random())}function k3(n){n!==void 0&&(ny=n);let e=ny+=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 B3(n){return n*po}function z3(n){return n*Sa}function V3(n){return(n&n-1)===0&&n!==0}function H3(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function G3(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function W3(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 kn(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 st(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 K0={DEG2RAD:po,RAD2DEG:Sa,generateUUID:ri,clamp:Qe,euclideanModulo:j0,mapLinear:R3,inverseLerp:P3,lerp:Cl,damp:I3,pingpong:L3,smoothstep:D3,smootherstep:O3,randInt:N3,randFloat:U3,randFloatSpread:F3,seededRandom:k3,degToRad:B3,radToDeg:z3,isPowerOfTwo:V3,ceilPowerOfTwo:H3,floorPowerOfTwo:G3,setQuaternionFromProperEuler:W3,normalize:st,denormalize:kn};class he{constructor(e=0,t=0){he.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Qe(this.x,e.x,t.x),this.y=Qe(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Qe(this.x,e,t),this.y=Qe(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Qe(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Qe(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class nt{constructor(e,t,i,s,r,o,a,l,c){nt.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],b=s[4],v=s[7],E=s[2],T=s[5],S=s[8];return r[0]=o*_+a*y+l*E,r[3]=o*g+a*b+l*T,r[6]=o*m+a*v+l*S,r[1]=c*_+u*y+f*E,r[4]=c*g+u*b+f*T,r[7]=c*m+u*v+f*S,r[2]=h*_+d*y+p*E,r[5]=h*g+d*b+p*T,r[8]=h*m+d*v+p*S,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(vp.makeScale(e,t)),this}rotate(e){return this.premultiply(vp.makeRotation(-e)),this}translate(e,t){return this.premultiply(vp.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 vp=new nt;function Z1(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const X3={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ra(n,e){return new X3[n](e)}function cc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function J1(){const n=cc("canvas");return n.style.display="block",n}const iy={};function xf(n){n in iy||(iy[n]=!0,console.warn(n))}function $3(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 q3(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 Y3(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 sy=new nt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ry=new nt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function j3(){const n={enabled:!0,workingColorSpace:xo,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===wt&&(s.r=Ps(s.r),s.g=Ps(s.g),s.b=Ps(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===wt&&(s.r=ha(s.r),s.g=ha(s.g),s.b=ha(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===Ms?oc: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({[xo]:{primaries:e,whitePoint:i,transfer:oc,toXYZ:sy,fromXYZ:ry,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Nn},outputColorSpaceConfig:{drawingBufferColorSpace:Nn}},[Nn]:{primaries:e,whitePoint:i,transfer:wt,toXYZ:sy,fromXYZ:ry,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Nn}}}),n}const ft=j3();function Ps(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ha(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let No;class Q1{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{No===void 0&&(No=cc("canvas")),No.width=e.width,No.height=e.height;const s=No.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),i=No}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=cc("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!==id)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case nc:e.x=e.x-Math.floor(e.x);break;case gi:e.x=e.x<0?0:1;break;case ic: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 nc:e.y=e.y-Math.floor(e.y);break;case gi:e.y=e.y<0?0:1;break;case ic: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++}}Wt.DEFAULT_IMAGE=null;Wt.DEFAULT_MAPPING=id;Wt.DEFAULT_ANISOTROPY=1;class gt{constructor(e=0,t=0,i=0,s=1){gt.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 b=(c+1)/2,v=(d+1)/2,E=(m+1)/2,T=(u+h)/4,S=(f+_)/4,P=(p+g)/4;return b>v&&b>E?b<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(b),s=T/i,r=S/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=S/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=Qe(this.x,e.x,t.x),this.y=Qe(this.y,e.y,t.y),this.z=Qe(this.z,e.z,t.z),this.w=Qe(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Qe(this.x,e,t),this.y=Qe(this.y,e,t),this.z=Qe(this.z,e,t),this.w=Qe(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Qe(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class fd extends ss{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new gt(0,0,e,t),this.scissorTest=!1,this.viewport=new gt(0,0,e,t);const s={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:en,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new Wt(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const E=Math.sqrt(b),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(Qe(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const d=1-t;return this._w=d*o+t*this._w,this._x=d*i+t*this._x,this._y=d*s+t*this._y,this._z=d*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),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 B{constructor(e=0,t=0,i=0){B.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(oy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(oy.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=Qe(this.x,e.x,t.x),this.y=Qe(this.y,e.y,t.y),this.z=Qe(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Qe(this.x,e,t),this.y=Qe(this.y,e,t),this.z=Qe(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Qe(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return bp.copy(this).projectOnVector(e),this.sub(bp)}reflect(e){return this.sub(bp.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Qe(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bp=new B,oy=new Jn;class Vn{constructor(e=new B(1/0,1/0,1/0),t=new B(-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,Ai),Ai.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(Ya),cu.subVectors(this.max,Ya),Uo.subVectors(e.a,Ya),Fo.subVectors(e.b,Ya),ko.subVectors(e.c,Ya),Xs.subVectors(Fo,Uo),$s.subVectors(ko,Fo),Fr.subVectors(Uo,ko);let t=[0,-Xs.z,Xs.y,0,-$s.z,$s.y,0,-Fr.z,Fr.y,Xs.z,0,-Xs.x,$s.z,0,-$s.x,Fr.z,0,-Fr.x,-Xs.y,Xs.x,0,-$s.y,$s.x,0,-Fr.y,Fr.x,0];return!xp(t,Uo,Fo,ko,cu)||(t=[1,0,0,0,1,0,0,0,1],!xp(t,Uo,Fo,ko,cu))?!1:(uu.crossVectors(Xs,$s),t=[uu.x,uu.y,uu.z],xp(t,Uo,Fo,ko,cu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ai).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ai).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:(cs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),cs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),cs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),cs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),cs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),cs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),cs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),cs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(cs),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 cs=[new B,new B,new B,new B,new B,new B,new B,new B],Ai=new B,lu=new Vn,Uo=new B,Fo=new B,ko=new B,Xs=new B,$s=new B,Fr=new B,Ya=new B,cu=new B,uu=new B,kr=new B;function xp(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){kr.fromArray(n,r);const a=s.x*Math.abs(kr.x)+s.y*Math.abs(kr.y)+s.z*Math.abs(kr.z),l=e.dot(kr),c=t.dot(kr),u=i.dot(kr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const eP=new Vn,ja=new B,Mp=new B;class Tn{constructor(e=new B,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):eP.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;ja.subVectors(e,this.center);const t=ja.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(ja,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):(Mp.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ja.copy(e.center).add(Mp)),this.expandByPoint(ja.copy(e.center).sub(Mp))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const us=new B,Sp=new B,fu=new B,qs=new B,Ep=new B,hu=new B,Tp=new B;class Fa{constructor(e=new B,t=new B(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,us)),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=us.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(us.copy(this.origin).addScaledVector(this.direction,t),us.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Sp.copy(e).add(t).multiplyScalar(.5),fu.copy(t).sub(e).normalize(),qs.copy(this.origin).sub(Sp);const r=e.distanceTo(t)*.5,o=-this.direction.dot(fu),a=qs.dot(this.direction),l=-qs.dot(fu),c=qs.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(Sp).addScaledVector(fu,h),d}intersectSphere(e,t){us.subVectors(e.center,this.origin);const i=us.dot(this.direction),s=us.dot(us)-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,us)!==null}intersectTriangle(e,t,i,s,r){Ep.subVectors(t,e),hu.subVectors(i,e),Tp.crossVectors(Ep,hu);let o=this.direction.dot(Tp),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;qs.subVectors(this.origin,e);const l=a*this.direction.dot(hu.crossVectors(qs,hu));if(l<0)return null;const c=a*this.direction.dot(Ep.cross(qs));if(c<0||l+c>o)return null;const u=-a*qs.dot(Tp);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 Ye{constructor(e,t,i,s,r,o,a,l,c,u,f,h,d,p,_,g){Ye.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 Ye().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/Bo.setFromMatrixColumn(e,0).length(),r=1/Bo.setFromMatrixColumn(e,1).length(),o=1/Bo.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(tP,e,nP)}lookAt(e,t,i){const s=this.elements;return ni.subVectors(e,t),ni.lengthSq()===0&&(ni.z=1),ni.normalize(),Ys.crossVectors(i,ni),Ys.lengthSq()===0&&(Math.abs(i.z)===1?ni.x+=1e-4:ni.z+=1e-4,ni.normalize(),Ys.crossVectors(i,ni)),Ys.normalize(),du.crossVectors(ni,Ys),s[0]=Ys.x,s[4]=du.x,s[8]=ni.x,s[1]=Ys.y,s[5]=du.y,s[9]=ni.y,s[2]=Ys.z,s[6]=du.z,s[10]=ni.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],b=i[7],v=i[11],E=i[15],T=s[0],S=s[4],P=s[8],x=s[12],M=s[1],L=s[5],F=s[9],H=s[13],Y=s[2],ee=s[6],K=s[10],Q=s[14],Z=s[3],de=s[7],be=s[11],se=s[15];return r[0]=o*T+a*M+l*Y+c*Z,r[4]=o*S+a*L+l*ee+c*de,r[8]=o*P+a*F+l*K+c*be,r[12]=o*x+a*H+l*Q+c*se,r[1]=u*T+f*M+h*Y+d*Z,r[5]=u*S+f*L+h*ee+d*de,r[9]=u*P+f*F+h*K+d*be,r[13]=u*x+f*H+h*Q+d*se,r[2]=p*T+_*M+g*Y+m*Z,r[6]=p*S+_*L+g*ee+m*de,r[10]=p*P+_*F+g*K+m*be,r[14]=p*x+_*H+g*Q+m*se,r[3]=y*T+b*M+v*Y+E*Z,r[7]=y*S+b*L+v*ee+E*de,r[11]=y*P+b*F+v*K+E*be,r[15]=y*x+b*H+v*Q+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,b=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*b+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 S=1/T;return e[0]=y*S,e[1]=(_*h*r-f*g*r-_*s*d+i*g*d+f*s*m-i*h*m)*S,e[2]=(a*g*r-_*l*r+_*s*c-i*g*c-a*s*m+i*l*m)*S,e[3]=(f*l*r-a*h*r-f*s*c+i*h*c+a*s*d-i*l*d)*S,e[4]=b*S,e[5]=(u*g*r-p*h*r+p*s*d-t*g*d-u*s*m+t*h*m)*S,e[6]=(p*l*r-o*g*r-p*s*c+t*g*c+o*s*m-t*l*m)*S,e[7]=(o*h*r-u*l*r+u*s*c-t*h*c-o*s*d+t*l*d)*S,e[8]=v*S,e[9]=(p*f*r-u*_*r-p*i*d+t*_*d+u*i*m-t*f*m)*S,e[10]=(o*_*r-p*a*r+p*i*c-t*_*c-o*i*m+t*a*m)*S,e[11]=(u*a*r-o*f*r-u*i*c+t*f*c+o*i*d-t*a*d)*S,e[12]=E*S,e[13]=(u*_*s-p*f*s+p*i*h-t*_*h-u*i*g+t*f*g)*S,e[14]=(p*a*s-o*_*s-p*i*l+t*_*l+o*i*g-t*a*g)*S,e[15]=(o*f*s-u*a*s+u*i*l-t*f*l-o*i*h+t*a*h)*S,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,b=l*u,v=l*f,E=i.x,T=i.y,S=i.z;return s[0]=(1-(_+m))*E,s[1]=(d+v)*E,s[2]=(p-b)*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+b)*S,s[9]=(g-y)*S,s[10]=(1-(h+_))*S,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=Bo.set(s[0],s[1],s[2]).length();const o=Bo.set(s[4],s[5],s[6]).length(),a=Bo.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],Ci.copy(this);const c=1/r,u=1/o,f=1/a;return Ci.elements[0]*=c,Ci.elements[1]*=c,Ci.elements[2]*=c,Ci.elements[4]*=u,Ci.elements[5]*=u,Ci.elements[6]*=u,Ci.elements[8]*=f,Ci.elements[9]*=f,Ci.elements[10]*=f,t.setFromRotationMatrix(Ci),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=Li){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===Li)d=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===lc)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=Li){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===Li)p=(o+r)*f,_=-2*f;else if(a===lc)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 Bo=new B,Ci=new Ye,tP=new B(0,0,0),nP=new B(1,1,1),Ys=new B,du=new B,ni=new B,ay=new Ye,ly=new Jn;class li{constructor(e=0,t=0,i=0,s=li.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(Qe(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(-Qe(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(Qe(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(-Qe(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(Qe(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(-Qe(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 ay.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ay,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ly.setFromEuler(this),this.setFromQuaternion(ly,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}}li.DEFAULT_ORDER="XYZ";class dd{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){Ri.subVectors(s,t),hs.subVectors(i,t),Ap.subVectors(e,t);const o=Ri.dot(Ri),a=Ri.dot(hs),l=Ri.dot(Ap),c=hs.dot(hs),u=hs.dot(Ap),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,ds)===null?!1:ds.x>=0&&ds.y>=0&&ds.x+ds.y<=1}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ds)===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,ds.x),l.addScaledVector(o,ds.y),l.addScaledVector(a,ds.z),l)}static getInterpolatedAttribute(e,t,i,s,r,o){return Ip.setScalar(0),Lp.setScalar(0),Dp.setScalar(0),Ip.fromBufferAttribute(e,t),Lp.fromBufferAttribute(e,i),Dp.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(Ip,r.x),o.addScaledVector(Lp,r.y),o.addScaledVector(Dp,r.z),o}static isFrontFacing(e,t,i,s){return Ri.subVectors(i,t),hs.subVectors(e,t),Ri.cross(hs).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 Ri.subVectors(this.c,this.b),hs.subVectors(this.a,this.b),Ri.cross(hs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return jn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return jn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,s,r){return jn.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return jn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return jn.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;Ho.subVectors(s,i),Go.subVectors(r,i),Cp.subVectors(e,i);const l=Ho.dot(Cp),c=Go.dot(Cp);if(l<=0&&c<=0)return t.copy(i);Rp.subVectors(e,s);const u=Ho.dot(Rp),f=Go.dot(Rp);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(Ho,o);Pp.subVectors(e,r);const d=Ho.dot(Pp),p=Go.dot(Pp);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(Go,a);const g=u*p-d*f;if(g<=0&&f-u>=0&&d-p>=0)return py.subVectors(r,s),a=(f-u)/(f-u+(d-p)),t.copy(s).addScaledVector(py,a);const m=1/(g+_+h);return o=_*m,a=h*m,t.copy(i).addScaledVector(Ho,o).addScaledVector(Go,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const eE={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},js={h:0,s:0,l:0},mu={h:0,s:0,l:0};function Op(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 Ce{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Nn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ft.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=ft.workingColorSpace){return this.r=e,this.g=t,this.b=i,ft.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=ft.workingColorSpace){if(e=j0(e,1),t=Qe(t,0,1),i=Qe(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=Op(o,r,e+1/3),this.g=Op(o,r,e),this.b=Op(o,r,e-1/3)}return ft.toWorkingColorSpace(this,s),this}setStyle(e,t=Nn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Nn){const i=eE[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=Ps(e.r),this.g=Ps(e.g),this.b=Ps(e.b),this}copyLinearToSRGB(e){return this.r=ha(e.r),this.g=ha(e.g),this.b=ha(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Nn){return ft.fromWorkingColorSpace(xn.copy(this),e),Math.round(Qe(xn.r*255,0,255))*65536+Math.round(Qe(xn.g*255,0,255))*256+Math.round(Qe(xn.b*255,0,255))}getHexString(e=Nn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ft.workingColorSpace){ft.fromWorkingColorSpace(xn.copy(this),t);const i=xn.r,s=xn.g,r=xn.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!==ho&&(i.blending=this.blending),this.side!==Ds&&(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!==Vf&&(i.blendSrc=this.blendSrc),this.blendDst!==Hf&&(i.blendDst=this.blendDst),this.blendEquation!==ar&&(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!==bo&&(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!==hg&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Qr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Qr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Qr&&(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 Bs extends An{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ce(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 li,this.combine=Oc,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 Ss=lP();function lP(){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 $n(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Qe(n,-65504,65504),Ss.floatView[0]=n;const e=Ss.uint32View[0],t=e>>23&511;return Ss.baseTable[t]+((e&8388607)>>Ss.shiftTable[t])}function dl(n){const e=n>>10;return Ss.uint32View[0]=Ss.mantissaTable[Ss.offsetTable[e]+(n&1023)]+Ss.exponentTable[e],Ss.floatView[0]}class cP{static toHalfFloat(e){return $n(e)}static fromHalfFloat(e){return dl(e)}}const Yt=new B,gu=new he;let uP=0;class Ct{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:uP++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=ac,this.updateRanges=[],this.gpuType=Kn,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 Vn);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 B(-1/0,-1/0,-1/0),new B(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());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))&&(my.copy(r).invert(),Br.copy(e.ray).applyMatrix4(my),!(i.boundingBox!==null&&Br.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Br)))}_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),b=Math.min(a.count,Math.min(g.start+g.count,d.start+d.count));for(let v=y,E=b;vt.far?null:{distance:c,point:Mu.clone(),object:n}}function Su(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,vu),n.getVertexPosition(l,yu),n.getVertexPosition(c,bu);const u=vP(n,e,t,i,vu,yu,bu,_y);if(u){const f=new B;jn.getBarycoord(_y,vu,yu,bu,f),s&&(u.uv=jn.getInterpolatedAttribute(s,a,l,c,f,new he)),r&&(u.uv1=jn.getInterpolatedAttribute(r,a,l,c,f,new he)),o&&(u.normal=jn.getInterpolatedAttribute(o,a,l,c,f,new B),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new B,materialIndex:0};jn.getNormal(vu,yu,bu,h.normal),u.face=h,u.barycoord=f}return u}class wo extends lt{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 ke(c,3)),this.setAttribute("normal",new ke(u,3)),this.setAttribute("uv",new ke(f,2));function p(_,g,m,y,b,v,E,T,S,P,x){const M=v/S,L=E/P,F=v/2,H=E/2,Y=T/2,ee=S+1,K=P+1;let Q=0,Z=0;const de=new B;for(let be=0;be0?1:-1,u.push(de.x,de.y,de.z),f.push(ye/S),f.push(1-be/P),Q+=1}}for(let be=0;be0&&(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 Fc extends dt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ye,this.projectionMatrix=new Ye,this.projectionMatrixInverse=new Ye,this.coordinateSystem=Li}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 Ks=new B,vy=new he,yy=new he;class Kt extends Fc{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=Sa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(po*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Sa*2*Math.atan(Math.tan(po*.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){Ks.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ks.x,Ks.y).multiplyScalar(-e/Ks.z),Ks.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ks.x,Ks.y).multiplyScalar(-e/Ks.z)}getViewSize(e,t){return this.getViewBounds(e,vy,yy),t.subVectors(yy,vy)}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(po*.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 Xo=-90,$o=1;class iE extends dt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Kt(Xo,$o,e,t);s.layers=this.layers,this.add(s);const r=new Kt(Xo,$o,e,t);r.layers=this.layers,this.add(r);const o=new Kt(Xo,$o,e,t);o.layers=this.layers,this.add(o);const a=new Kt(Xo,$o,e,t);a.layers=this.layers,this.add(a);const l=new Kt(Xo,$o,e,t);l.layers=this.layers,this.add(l);const c=new Kt(Xo,$o,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===Li)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===lc)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 kc extends Wt{constructor(e=[],t=Os,i,s,r,o,a,l,c,u){super(e,t,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class sE extends is{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 kc(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:en}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 wo(5,5,5),r=new ki({name:"CubemapFromEquirect",uniforms:Ea(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:zn,blending:Rs});r.uniforms.tEquirect.value=t;const o=new $t(s,r),a=t.minFilter;return t.minFilter===ji&&(t.minFilter=en),new iE(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,i=!0,s=!0){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}class oa extends dt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const MP={type:"move"};class Mf{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new oa,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 oa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new B,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new B),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new oa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new B,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new B),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(MP)))}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 oa;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class pd{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ce(e),this.density=t}clone(){return new pd(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class md{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ce(e),this.near=t,this.far=i}clone(){return new md(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class gd extends dt{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 li,this.environmentIntensity=1,this.environmentRotation=new li,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 _d{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ac,this.updateRanges=[],this.version=0,this.uuid=ri()}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:Ja.clone(),uv:jn.getInterpolation(Ja,Eu,el,Tu,by,Fp,xy,new he),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 wu(n,e,t,i,s,r){Ko.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(Qa.x=r*Ko.x-s*Ko.y,Qa.y=s*Ko.x+r*Ko.y):Qa.copy(Ko),n.copy(e),n.x+=Qa.x,n.y+=Qa.y,n.applyMatrix4(rE)}const Au=new B,My=new B;class aE extends dt{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){Au.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Au);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Au.setFromMatrixPosition(e.matrixWorld),My.setFromMatrixPosition(this.matrixWorld);const i=Au.distanceTo(My)/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||AP.getNormalMatrix(e),s=this.coplanarPoint(zp).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 zr=new Tn,Pu=new B;class Bc{constructor(e=new rr,t=new rr,i=new rr,s=new rr,r=new rr,o=new rr){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=Li){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],b=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-b).normalize(),t===Li)i[5].setComponents(l+a,h+f,g+_,v+b).normalize();else if(t===lc)i[5].setComponents(a,f,_,b).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(),zr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),zr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zr)}intersectsSprite(e){return zr.center.set(0,0,0),zr.radius=.7071067811865476,zr.applyMatrix4(e.matrixWorld),this.intersectsSphere(zr)}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,Pu.y=s.normal.y>0?e.max.y:e.min.y,Pu.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Pu)<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 Vp(n,e){return n-e}function CP(n,e){return n.z-e.z}function RP(n,e){return e.z-n.z}class PP{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 Xn=new Ye,IP=new Ce(1,1,1),Hp=new Bc,Iu=new Vn,Vr=new Tn,il=new B,Iy=new B,LP=new B,Gp=new PP,Mn=new $t,Lu=[];function DP(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 Ct(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 Vn);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(Vp),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Xn.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const o=this._colorsTexture;return o&&(IP.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(Vp),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);DP(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 Vn,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 Tn;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 lt,this._initializeGeometry(r));const o=this.geometry;r.index&&Hr(r.index.array,o.index.array);for(const a in r.attributes)Hr(r.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,o=this.geometry;Mn.material=this.material,Mn.geometry.index=o.index,Mn.geometry.attributes=o.attributes,Mn.geometry.boundingBox===null&&(Mn.geometry.boundingBox=new Vn),Mn.geometry.boundingSphere===null&&(Mn.geometry.boundingSphere=new Tn);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&&(Xn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Hp.setFromProjectionMatrix(Xn,e.coordinateSystem));let _=0;if(this.sortObjects){Xn.copy(this.matrixWorld).invert(),il.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Xn),Iy.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Xn);for(let y=0,b=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;Wp.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Wp);if(!(ce.far))return{distance:c,point:Dy.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const Oy=new B,Ny=new B;class rs extends _r{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 dE extends Wt{constructor(e,t,i,s,r=en,o=en,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isVideoTexture=!0,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 OP extends dE{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 Wt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=_n,this.minFilter=_n,this.generateMipmaps=!1,this.needsUpdate=!0}}class yd extends Wt{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 UP extends yd{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=gi,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class FP extends yd{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Os),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class kP extends Wt{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 n_ extends Wt{constructor(e,t,i=Ns,s,r,o,a=_n,l=_n,c,u=xa){if(u!==xa&&u!==Ma)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,s,r,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new lr(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 Vi{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 he:new B);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 B,s=[],r=[],o=[],a=new B,l=new Ye;for(let d=0;d<=e;d++){const p=d/e;s[d]=this.getTangentAt(p,new B)}r[0]=new B,o[0]=new B;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(Qe(s[d-1].dot(s[d]),-1,1));r[d].applyMatrix4(l.makeRotationAxis(a,p))}o[d].crossVectors(s[d],r[d])}if(t===!0){let d=Math.acos(Qe(r[0].dot(r[e]),-1,1));d/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(d=-d);for(let p=1;p<=e;p++)r[p].applyMatrix4(l.makeRotationAxis(s[p],d*p)),o[p].crossVectors(s[p],r[p])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class bd extends Vi{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 he){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]:(Fu.subVectors(s[0],s[1]).add(s[0]),c=Fu);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(ky(a,l.x,c.x,u.x,f.x),ky(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 zc extends lt{constructor(e=[new he(0,-.5),new he(.5,0),new he(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=Qe(s,0,Math.PI*2);const r=[],o=[],a=[],l=[],c=[],u=1/t,f=new B,h=new he,d=new B,p=new B,_=new B;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 b=i+y*u*s,v=Math.sin(b),E=Math.cos(b);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 S=l[3*T+0]*v,P=l[3*T+1],x=l[3*T+0]*E;c.push(S,P,x)}}for(let y=0;y0&&b(!0),t>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new ke(f,3)),this.setAttribute("normal",new ke(h,3)),this.setAttribute("uv",new ke(d,2));function y(){const v=new B,E=new B;let T=0;const S=(t-e)/i;for(let P=0;P<=r;P++){const x=[],M=P/r,L=M*(t-e)+e;for(let F=0;F<=s;F++){const H=F/s,Y=H*l+a,ee=Math.sin(Y),K=Math.cos(Y);E.x=L*ee,E.y=-M*i+g,E.z=L*K,f.push(E.x,E.y,E.z),v.set(ee,S,K).normalize(),h.push(v.x,v.y,v.z),d.push(H,1-M),x.push(p++)}_.push(x)}for(let P=0;P0||x!==0)&&(u.push(M,L,H),T+=3),(t>0||x!==r-1)&&(u.push(L,F,H),T+=3)}c.addGroup(m,T,0),m+=T}function b(v){const E=p,T=new he,S=new B;let P=0;const x=v===!0?e:t,M=v===!0?1:-1;for(let F=1;F<=s;F++)f.push(0,g*M,0),h.push(0,M,0),d.push(.5,.5),p++;const L=p;for(let F=0;F<=s;F++){const Y=F/s*l+a,ee=Math.cos(Y),K=Math.sin(Y);S.x=x*K,S.y=g*M,S.z=x*ee,f.push(S.x,S.y,S.z),h.push(0,M,0),T.x=ee*.5+.5,T.y=K*.5*M+.5,d.push(T.x,T.y),p++}for(let F=0;F.9&&S<.1&&(b<.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,b){const v=y*3;b.x=e[v+0],b.y=e[v+1],b.z=e[v+2]}function p(){const y=new B,b=new B,v=new B,E=new B,T=new he,S=new he,P=new he;for(let x=0,M=0;x80*t){a=1/0,l=1/0;let u=-1/0,f=-1/0;for(let h=t;hu&&(u=d),p>f&&(f=p)}c=Math.max(u-a,f-l),c=c!==0?32767/c:0}return fc(r,o,t,a,l,c,0),o}function bE(n,e,t,i,s){let r;if(s===lI(n,e,t,i)>0)for(let o=e;o=e;o-=i)r=By(o/i|0,n[o],n[o+1],r);return r&&wa(r,r.next)&&(dc(r),r=r.next),r}function So(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(wa(t,t.next)||zt(t.prev,t,t.next)===0)){if(dc(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function fc(n,e,t,i,s,r,o){if(!n)return;!o&&r&&nI(n,i,s,r);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(r?YP(n,i,s,r):qP(n)){e.push(l.i,n.i,c.i),dc(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=jP(So(n),e),fc(n,e,t,i,s,r,2)):o===2&&KP(n,e,t,i,s,r):fc(So(n),e,t,i,s,r,1);break}}}function qP(n){const e=n.prev,t=n,i=n.next;if(zt(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=Math.min(s,r,o),f=Math.min(a,l,c),h=Math.max(s,r,o),d=Math.max(a,l,c);let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=h&&p.y>=f&&p.y<=d&&pl(s,a,r,l,o,c,p.x,p.y)&&zt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function YP(n,e,t,i){const s=n.prev,r=n,o=n.next;if(zt(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=Math.min(a,l,c),p=Math.min(u,f,h),_=Math.max(a,l,c),g=Math.max(u,f,h),m=mg(d,p,e,t,i),y=mg(_,g,e,t,i);let b=n.prevZ,v=n.nextZ;for(;b&&b.z>=m&&v&&v.z<=y;){if(b.x>=d&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&pl(a,u,l,f,c,h,b.x,b.y)&&zt(b.prev,b,b.next)>=0||(b=b.prevZ,v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&pl(a,u,l,f,c,h,v.x,v.y)&&zt(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;b&&b.z>=m;){if(b.x>=d&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&pl(a,u,l,f,c,h,b.x,b.y)&&zt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&pl(a,u,l,f,c,h,v.x,v.y)&&zt(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function jP(n,e){let t=n;do{const i=t.prev,s=t.next.next;!wa(i,s)&&ME(i,t,t.next,s)&&hc(i,s)&&hc(s,i)&&(e.push(i.i,t.i,s.i),dc(t),dc(t.next),t=n=s),t=t.next}while(t!==n);return So(t)}function KP(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&rI(o,a)){let l=SE(o,a);o=So(o,o.next),l=So(l,l.next),fc(o,e,t,i,s,r,0),fc(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function ZP(n,e,t,i){const s=[];for(let r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=i&&f>r&&(r=f,o=t.x=t.x&&t.x>=l&&i!==t.x&&xE(so.x||t.x===o.x&&tI(o,t)))&&(o=t,u=f)}t=t.next}while(t!==a);return o}function tI(n,e){return zt(n.prev,n,e.prev)<0&&zt(e.next,n,n.next)<0}function nI(n,e,t,i){let s=n;do s.z===0&&(s.z=mg(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,iI(s)}function iI(n){let e,t=1;do{let i=n,s;n=null;let r=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;i=o}r.nextZ=null,t*=2}while(e>1);return n}function mg(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 sI(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 pl(n,e,t,i,s,r,o,a){return!(n===o&&e===a)&&xE(n,e,t,i,s,r,o,a)}function rI(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!oI(n,e)&&(hc(n,e)&&hc(e,n)&&aI(n,e)&&(zt(n.prev,n,e.prev)||zt(n,e.prev,e))||wa(n,e)&&zt(n.prev,n,n.next)>0&&zt(e.prev,e,e.next)>0)}function zt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function wa(n,e){return n.x===e.x&&n.y===e.y}function ME(n,e,t,i){const s=Hu(zt(n,e,t)),r=Hu(zt(n,e,i)),o=Hu(zt(t,i,n)),a=Hu(zt(t,i,e));return!!(s!==r&&o!==a||s===0&&Vu(n,t,e)||r===0&&Vu(n,i,e)||o===0&&Vu(t,n,i)||a===0&&Vu(t,e,i))}function Vu(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 Hu(n){return n>0?1:n<0?-1:0}function oI(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&&ME(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function hc(n,e){return zt(n.prev,n,n.next)<0?zt(n,e,n.next)>=0&&zt(n,n.prev,e)>=0:zt(n,e,n.prev)<0||zt(n,n.next,e)<0}function aI(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 SE(n,e){const t=gg(n.i,n.x,n.y),i=gg(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 By(n,e,t,i){const s=gg(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 dc(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 gg(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function lI(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function Vy(n,e){for(let t=0;tNumber.EPSILON){const le=Math.sqrt($),Me=Math.sqrt(O*O+V*V),Be=W.x-U/le,me=W.y+w/le,Te=C.x-V/Me,Ve=C.y+O/Me,We=((Te-Be)*V-(Ve-me)*O)/(w*V-U*O);I=Be+w*We-G.x,N=me+U*We-G.y;const Se=I*I+N*N;if(Se<=2)return new he(I,N);A=Math.sqrt(Se/2)}else{let le=!1;w>Number.EPSILON?O>Number.EPSILON&&(le=!0):w<-Number.EPSILON?O<-Number.EPSILON&&(le=!0):Math.sign(U)===Math.sign(V)&&(le=!0),le?(I=-U,N=w,A=Math.sqrt($)):(I=w,N=U,A=Math.sqrt($/2))}return new he(I/A,N/A)}const de=[];for(let G=0,W=ee.length,C=W-1,I=G+1;G=0;G--){const W=G/g,C=d*Math.cos(W*Math.PI/2),I=p*Math.sin(W*Math.PI/2)+_;for(let N=0,A=ee.length;N=0;){const I=C;let N=C-1;N<0&&(N=G.length-1);for(let A=0,w=u+g*2;A0)&&d.push(b,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 CE extends An{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ce(16777215),this.specular=new Ce(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Er,this.normalScale=new he(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Oc,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 RE extends An{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ce(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Er,this.normalScale=new he(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 PE extends An{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Er,this.normalScale=new he(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 IE extends An{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Er,this.normalScale=new he(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Oc,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 u_ extends An{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=V1,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 f_ extends An{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 LE extends An{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ce(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Er,this.normalScale=new he(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 DE extends Gn{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 lo(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function OE(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function NE(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 _g(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 h_(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 dI(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,b=f-u;m.evaluate(r),_=m.resultBuffer.slice(y,b)}l==="quaternion"&&new Jn().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&&OE(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()===bf,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}}Ei.prototype.ValueTypeName="";Ei.prototype.TimeBufferType=Float32Array;Ei.prototype.ValueBufferType=Float32Array;Ei.prototype.DefaultInterpolation=Mh;class Ao extends Ei{constructor(e,t,i){super(e,t,i)}}Ao.prototype.ValueTypeName="bool";Ao.prototype.ValueBufferType=Array;Ao.prototype.DefaultInterpolation=sc;Ao.prototype.InterpolantFactoryMethodLinear=void 0;Ao.prototype.InterpolantFactoryMethodSmooth=void 0;class p_ extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}p_.prototype.ValueTypeName="color";class pc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}pc.prototype.ValueTypeName="number";class kE extends Gc{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)Jn.slerpFlat(r,0,o,c-a,o,c,l);return r}}class Wc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}InterpolantFactoryMethodLinear(e){return new kE(this.times,this.values,this.getValueSize(),e)}}Wc.prototype.ValueTypeName="quaternion";Wc.prototype.InterpolantFactoryMethodSmooth=void 0;class Co extends Ei{constructor(e,t,i){super(e,t,i)}}Co.prototype.ValueTypeName="string";Co.prototype.ValueBufferType=Array;Co.prototype.DefaultInterpolation=sc;Co.prototype.InterpolantFactoryMethodLinear=void 0;Co.prototype.InterpolantFactoryMethodSmooth=void 0;class mc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}mc.prototype.ValueTypeName="vector";class gc{constructor(e="",t=-1,i=[],s=ud){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=ri(),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(_I(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(Ei.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(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,h,d,p,_){if(d.length!==0){const g=[],m=[];h_(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(ps[e]!==void 0){ps[e].push({onLoad:t,onProgress:i,onError:s});return}ps[e]=[],ps[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=ps[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:b,value:v})=>{if(b)m.close();else{_+=v.byteLength;const E=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:d});for(let T=0,S=u.length;T{m.error(b)})}}});return new Response(g)}else throw new vI(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const 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=>{Ts.add(e,c);const u=ps[e];delete ps[e];for(let f=0,h=u.length;f{const u=ps[e];if(u===void 0)throw this.manager.itemError(e),c;delete ps[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 yI extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Us(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 Ce().setHex(o.value);break;case"v2":s.uniforms[r].value=new he().fromArray(o.value);break;case"v3":s.uniforms[r].value=new B().fromArray(o.value);break;case"v4":s.uniforms[r].value=new gt().fromArray(o.value);break;case"m3":s.uniforms[r].value=new nt().fromArray(o.value);break;case"m4":s.uniforms[r].value=new Ye().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 he().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 he().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 Od.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:TE,SpriteMaterial:Q0,RawShaderMaterial:wE,ShaderMaterial:ki,PointsMaterial:t_,MeshPhysicalMaterial:AE,MeshStandardMaterial:c_,MeshPhongMaterial:CE,MeshToonMaterial:RE,MeshNormalMaterial:PE,MeshLambertMaterial:IE,MeshDepthMaterial:u_,MeshDistanceMaterial:f_,MeshBasicMaterial:Bs,MeshMatcapMaterial:LE,LineDashedMaterial:DE,LineBasicMaterial:Gn,Material:An};return new t[e]}}class vg{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class YE extends lt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class jE extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Us(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t={},i={};function s(d,p){if(t[p]!==void 0)return t[p];const g=d.interleavedBuffers[p],m=r(d,g.buffer),y=ra(g.type,m),b=new _d(y,g.stride);return b.uuid=g.uuid,t[p]=b,b}function r(d,p){if(i[p]!==void 0)return i[p];const g=d.arrayBuffers[p],m=new Uint32Array(g).buffer;return i[p]=m,m}const o=e.isInstancedBufferGeometry?new YE:new lt,a=e.data.index;if(a!==void 0){const d=ra(a.type,a.array);o.setIndex(new Ct(d,1))}const l=e.data.attributes;for(const d in l){const p=l[d];let _;if(p.isInterleavedBufferAttribute){const g=s(e.data,p.data);_=new Mo(g,p.itemSize,p.offset,p.normalized)}else{const g=ra(p.type,p.array),m=p.isInstancedBufferAttribute?Ta:Ct;_=new m(g,p.itemSize,p.normalized)}p.name!==void 0&&(_.name=p.name),p.usage!==void 0&&_.setUsage(p.usage),o.setAttribute(d,_)}const c=e.data.morphAttributes;if(c)for(const d in c){const p=c[d],_=[];for(let g=0,m=p.length;g0){const l=new m_(t);r=new _c(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){s=new _c(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const g=new Vn;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const m=new Tn;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 aE;break;case"Line":o=new _r(a(e.geometry),l(e.material));break;case"LineLoop":o=new fE(a(e.geometry),l(e.material));break;case"LineSegments":o=new rs(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new hE(a(e.geometry),l(e.material));break;case"Sprite":o=new oE(l(e.material));break;case"Group":o=new oa;break;case"Bone":o=new e_;break;default:o=new dt}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=Ts.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 Ts.add(e,c),t&&t(c),r.manager.itemEnd(e),c}).catch(function(c){s&&s(c),Ts.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});Ts.add(e,l),r.manager.itemStart(e)}}let Gu;class __{static getContext(){return Gu===void 0&&(Gu=new(window.AudioContext||window.webkitAudioContext)),Gu}static setContext(e){Gu=e}}class PI extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Us(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);__.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 jy=new Ye,Ky=new Ye,Gr=new Ye;class II{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Kt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Kt,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,Gr.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(po*t.fov*.5)/t.zoom;let a,l;Ky.elements[12]=-s,jy.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,Gr.elements[0]=2*t.near/(l-a),Gr.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Gr),a=-o*t.aspect-r,l=o*t.aspect-r,Gr.elements[0]=2*t.near/(l-a),Gr.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Gr)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ky),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(jy)}}class KE extends Kt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class Nd{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Zy(),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=Zy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Zy(){return performance.now()}const Wr=new B,Jy=new Jn,LI=new B,Xr=new B;class DI extends dt{constructor(){super(),this.type="AudioListener",this.context=__.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Nd}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(Wr,Jy,LI),Xr.set(0,0,-1).applyQuaternion(Jy),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Wr.x,s),t.positionY.linearRampToValueAtTime(Wr.y,s),t.positionZ.linearRampToValueAtTime(Wr.z,s),t.forwardX.linearRampToValueAtTime(Xr.x,s),t.forwardY.linearRampToValueAtTime(Xr.y,s),t.forwardZ.linearRampToValueAtTime(Xr.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(Wr.x,Wr.y,Wr.z),t.setOrientation(Xr.x,Xr.y,Xr.z,i.x,i.y,i.z)}}class ZE extends dt{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){Jn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Jn.multiplyQuaternionsFlat(e,o,e,t,e,i),Jn.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 v_="\\[\\]\\.:\\/",FI=new RegExp("["+v_+"]","g"),y_="[^"+v_+"]",kI="[^"+v_.replace("\\.","")+"]",BI=/((?:WC+[\/:])*)/.source.replace("WC",y_),zI=/(WCOD+)?/.source.replace("WCOD",kI),VI=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",y_),HI=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",y_),GI=new RegExp("^"+BI+zI+VI+HI+"$"),WI=["material","materials","bones","map"];class XI{constructor(e,t,i){const s=i||mt.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 mt{constructor(e,t,i){this.path=t,this.parsedPath=i||mt.parseTrackName(t),this.node=mt.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 mt.Composite(e,t,i):new mt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(FI,"")}static parseTrackName(e){const t=GI.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);WI.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 mt(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 QE{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:oo,endingEnd:oo};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=B1,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case q0:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case ud: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===z1;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===k1){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=ao,s.endingEnd=ao):(e?s.endingStart=this.zeroSlopeAtStart?ao:oo:s.endingStart=rc,t?s.endingEnd=this.zeroSlopeAtEnd?ao:oo:s.endingEnd=rc)}_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 qI=new Float32Array(1);class YI extends ss{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 JE(mt.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,nb).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 ib=new B,Wu=new B;class sL{constructor(e=new B,t=new B){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){ib.subVectors(e,this.start),Wu.subVectors(this.end,this.start);const i=Wu.dot(Wu);let r=Wu.dot(ib)/i;return t&&(r=Qe(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const sb=new B;class rL extends dt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new lt,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{cb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(cb,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 vL extends rs{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 lt;s.setAttribute("position",new ke(t,3)),s.setAttribute("color",new ke(i,3));const r=new Gn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new Ce,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 yL{constructor(){this.type="ShapePath",this.color=new Ce,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new uc,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 b=0,v=m.length;bNumber.EPSILON){if(M<0&&(S=y[T],x=-x,P=y[E],M=-M),m.yP.y)continue;if(m.y===S.y){if(m.x===S.x)return!0}else{const L=M*(m.x-S.x)-x*(m.y-S.y);if(L===0)return!0;if(L<0)continue;v=!v}}else{if(m.y!==S.y)continue;if(P.x<=m.x&&m.x<=S.x||S.x<=m.x&&m.x<=P.x)return!0}}return v}const s=Qi.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 mo,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 b=0,v=h.length;b0&&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 ML(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 SL(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function bg(n,e,t,i){const s=EL(i);switch(t){case V0:return n*e;case G0:return n*e;case W0:return n*e*2;case ad:return n*e/s.components*s.byteLength;case Nc:return n*e/s.components*s.byteLength;case X0:return n*e*2/s.components*s.byteLength;case ld:return n*e*2/s.components*s.byteLength;case H0:return n*e*3/s.components*s.byteLength;case Bn:return n*e*4/s.components*s.byteLength;case cd:return n*e*4/s.components*s.byteLength;case Sl:case El:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Tl:case wl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Zf:case Qf:return Math.max(n,16)*Math.max(e,8)/4;case Kf:case Jf:return Math.max(n,8)*Math.max(e,8)/2;case eh:case th:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case nh:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case ih:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case sh:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case rh:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case oh:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case ah:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case lh:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case ch:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case uh:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case fh:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case hh:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case dh:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case ph:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case mh:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case gh:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Al:case _h:case vh:return Math.ceil(n/4)*Math.ceil(e/4)*16;case $0:case yh:return Math.ceil(n/4)*Math.ceil(e/4)*8;case bh:case xh:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function EL(n){switch(n){case ns:case k0:return{byteLength:1,components:1};case ya:case B0:case Ua:return{byteLength:2,components:1};case rd:case od:return{byteLength:2,components:4};case Ns:case sd:case Kn:return{byteLength:4,components:1};case z0:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class TL{static contain(e,t){return xL(e,t)}static cover(e,t){return ML(e,t)}static fill(e){return SL(e)}static getByteLength(e,t,i,s){return bg(e,t,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Dc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Dc);/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */function nT(){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 wL(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`,GL=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,WL=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,XL=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,$L=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,qL=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,YL=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,jL=`#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`,KL=`#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`,ZL=`#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`,JL=`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`,QL=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,eD=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,tD=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,nD=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,iD="gl_FragColor = linearToOutputTexel( gl_FragColor );",sD=`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 ); +}`,rD=`#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`,oD=`#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`,aD=`#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`,lD=`#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`,cD=`#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`,uD=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,fD=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,hD=`#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`,dD=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,pD=`#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 +}`,mD=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,gD=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,_D=`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`,vD=`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`,yD=`#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`,bD=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,xD=`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`,MD=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,SD=`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`,ED=`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`,TD=`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 ); +}`,wD=` +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`,AD=`#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`,CD=`#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`,RD=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,PD=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,ID=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,LD=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,DD=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,OD=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,ND=`#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`,UD=`#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`,FD=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,kD=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,BD=`#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`,zD=`#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`,VD=`#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`,HD=`#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`,GD=`#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`,WD=`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;`,XD=`#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`,$D=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,qD=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,YD=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,jD=`#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`,KD=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,ZD=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,JD=`#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`,QD=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,eO=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,tO=`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 ); +}`,nO=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,iO=`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;`,sO=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,rO=`#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`,oO=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,aO=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,lO=`#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`,cO=`#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`,uO=`#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`,fO=`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; +}`,hO=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,dO=`#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`,pO=`#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`,mO=`#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`,gO=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,_O=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,vO=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,yO=`#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; }`,bO=`#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`,xO=`#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`,MO=`#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`,SO=`#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`,EO=`#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`,TO=`#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 wO=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,AO=`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 +}`,CO=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,RO=`#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 +}`,PO=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,IO=`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 +}`,LO=`#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; +}`,DO=`#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 +}`,OO=`#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; +}`,NO=`#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 ); +}`,UO=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,FO=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,kO=`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 +}`,BO=`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 +}`,zO=`#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 +}`,VO=`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 +}`,HO=`#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 +}`,GO=`#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 +}`,WO=`#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; +}`,XO=`#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 +}`,$O=`#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 +}`,qO=`#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 +}`,YO=`#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 +}`,jO=`#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 +}`,KO=`#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 +}`,ZO=`#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 +}`,JO=`#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 +}`,QO=`#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 +}`,eN=`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 +}`,tN=`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 +}`,nN=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,iN=`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 +}`,sN=`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 +}`,rN=`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 +}`,at={alphahash_fragment:AL,alphahash_pars_fragment:CL,alphamap_fragment:RL,alphamap_pars_fragment:PL,alphatest_fragment:IL,alphatest_pars_fragment:LL,aomap_fragment:DL,aomap_pars_fragment:OL,batching_pars_vertex:NL,batching_vertex:UL,begin_vertex:FL,beginnormal_vertex:kL,bsdfs:BL,iridescence_fragment:zL,bumpmap_pars_fragment:VL,clipping_planes_fragment:HL,clipping_planes_pars_fragment:GL,clipping_planes_pars_vertex:WL,clipping_planes_vertex:XL,color_fragment:$L,color_pars_fragment:qL,color_pars_vertex:YL,color_vertex:jL,common:KL,cube_uv_reflection_fragment:ZL,defaultnormal_vertex:JL,displacementmap_pars_vertex:QL,displacementmap_vertex:eD,emissivemap_fragment:tD,emissivemap_pars_fragment:nD,colorspace_fragment:iD,colorspace_pars_fragment:sD,envmap_fragment:rD,envmap_common_pars_fragment:oD,envmap_pars_fragment:aD,envmap_pars_vertex:lD,envmap_physical_pars_fragment:yD,envmap_vertex:cD,fog_vertex:uD,fog_pars_vertex:fD,fog_fragment:hD,fog_pars_fragment:dD,gradientmap_pars_fragment:pD,lightmap_pars_fragment:mD,lights_lambert_fragment:gD,lights_lambert_pars_fragment:_D,lights_pars_begin:vD,lights_toon_fragment:bD,lights_toon_pars_fragment:xD,lights_phong_fragment:MD,lights_phong_pars_fragment:SD,lights_physical_fragment:ED,lights_physical_pars_fragment:TD,lights_fragment_begin:wD,lights_fragment_maps:AD,lights_fragment_end:CD,logdepthbuf_fragment:RD,logdepthbuf_pars_fragment:PD,logdepthbuf_pars_vertex:ID,logdepthbuf_vertex:LD,map_fragment:DD,map_pars_fragment:OD,map_particle_fragment:ND,map_particle_pars_fragment:UD,metalnessmap_fragment:FD,metalnessmap_pars_fragment:kD,morphinstance_vertex:BD,morphcolor_vertex:zD,morphnormal_vertex:VD,morphtarget_pars_vertex:HD,morphtarget_vertex:GD,normal_fragment_begin:WD,normal_fragment_maps:XD,normal_pars_fragment:$D,normal_pars_vertex:qD,normal_vertex:YD,normalmap_pars_fragment:jD,clearcoat_normal_fragment_begin:KD,clearcoat_normal_fragment_maps:ZD,clearcoat_pars_fragment:JD,iridescence_pars_fragment:QD,opaque_fragment:eO,packing:tO,premultiplied_alpha_fragment:nO,project_vertex:iO,dithering_fragment:sO,dithering_pars_fragment:rO,roughnessmap_fragment:oO,roughnessmap_pars_fragment:aO,shadowmap_pars_fragment:lO,shadowmap_pars_vertex:cO,shadowmap_vertex:uO,shadowmask_pars_fragment:fO,skinbase_vertex:hO,skinning_pars_vertex:dO,skinning_vertex:pO,skinnormal_vertex:mO,specularmap_fragment:gO,specularmap_pars_fragment:_O,tonemapping_fragment:vO,tonemapping_pars_fragment:yO,transmission_fragment:bO,transmission_pars_fragment:xO,uv_pars_fragment:MO,uv_pars_vertex:SO,uv_vertex:EO,worldpos_vertex:TO,background_vert:wO,background_frag:AO,backgroundCube_vert:CO,backgroundCube_frag:RO,cube_vert:PO,cube_frag:IO,depth_vert:LO,depth_frag:DO,distanceRGBA_vert:OO,distanceRGBA_frag:NO,equirect_vert:UO,equirect_frag:FO,linedashed_vert:kO,linedashed_frag:BO,meshbasic_vert:zO,meshbasic_frag:VO,meshlambert_vert:HO,meshlambert_frag:GO,meshmatcap_vert:WO,meshmatcap_frag:XO,meshnormal_vert:$O,meshnormal_frag:qO,meshphong_vert:YO,meshphong_frag:jO,meshphysical_vert:KO,meshphysical_frag:ZO,meshtoon_vert:JO,meshtoon_frag:QO,points_vert:eN,points_frag:tN,shadow_vert:nN,shadow_frag:iN,sprite_vert:sN,sprite_frag:rN},we={common:{diffuse:{value:new Ce(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nt},alphaMap:{value:null},alphaMapTransform:{value:new nt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nt}},envmap:{envMap:{value:null},envMapRotation:{value:new nt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nt},normalScale:{value:new he(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ce(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 Ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nt},alphaTest:{value:0},uvTransform:{value:new nt}},sprite:{diffuse:{value:new Ce(16777215)},opacity:{value:1},center:{value:new he(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nt},alphaMap:{value:null},alphaMapTransform:{value:new nt},alphaTest:{value:0}}},Pi={basic:{uniforms:In([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:In([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new Ce(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:In([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:In([we.common,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.roughnessmap,we.metalnessmap,we.fog,we.lights,{emissive:{value:new Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:In([we.common,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.gradientmap,we.fog,we.lights,{emissive:{value:new Ce(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:In([we.common,we.bumpmap,we.normalmap,we.displacementmap,we.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:In([we.points,we.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:In([we.common,we.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:In([we.common,we.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:In([we.common,we.bumpmap,we.normalmap,we.displacementmap,{opacity:{value:1}}]),vertexShader:at.meshnormal_vert,fragmentShader:at.meshnormal_frag},sprite:{uniforms:In([we.sprite,we.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new nt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:at.background_vert,fragmentShader:at.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new nt}},vertexShader:at.backgroundCube_vert,fragmentShader:at.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:In([we.common,we.displacementmap,{referencePosition:{value:new B},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:In([we.lights,we.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};Pi.physical={uniforms:In([Pi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nt},clearcoatNormalScale:{value:new he(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nt},sheen:{value:0},sheenColor:{value:new Ce(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nt},transmissionSamplerSize:{value:new he},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nt},attenuationDistance:{value:0},attenuationColor:{value:new Ce(0)},specularColor:{value:new Ce(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nt},anisotropyVector:{value:new he},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nt}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};const Ku={r:0,b:0,g:0},Yr=new li,oN=new Ye;function aN(n,e,t,i,s,r,o){const a=new Ce(0);let l=r===!0?0:1,c,u,f=null,h=0,d=null;function p(b){let v=b.isScene===!0?b.background:null;return v&&v.isTexture&&(v=(b.backgroundBlurriness>0?t:e).get(v)),v}function _(b){let v=!1;const E=p(b);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(b,v){const E=p(v);E&&(E.isCubeTexture||E.mapping===Na)?(u===void 0&&(u=new $t(new wo(1,1,1),new ki({name:"BackgroundCubeMaterial",uniforms:Ea(Pi.backgroundCube.uniforms),vertexShader:Pi.backgroundCube.vertexShader,fragmentShader:Pi.backgroundCube.fragmentShader,side:zn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,S,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Yr.copy(v.backgroundRotation),Yr.x*=-1,Yr.y*=-1,Yr.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Yr.y*=-1,Yr.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(oN.makeRotationFromEuler(Yr)),u.material.toneMapped=ft.getTransfer(E.colorSpace)!==wt,(f!==E||h!==E.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,f=E,h=E.version,d=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):E&&E.isTexture&&(c===void 0&&(c=new $t(new Ba(2,2),new ki({name:"BackgroundMaterial",uniforms:Ea(Pi.background.uniforms),vertexShader:Pi.background.vertexShader,fragmentShader:Pi.background.fragmentShader,side:Ds,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=E,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=ft.getTransfer(E.colorSpace)!==wt,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(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,v){b.getRGB(Ku,tE(n)),i.buffers.color.setClear(Ku.r,Ku.g,Ku.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(b,v=1){a.set(b),l=v,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(a,l)},render:_,addToRenderList:g,dispose:y}}function lN(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=h(null);let r=s,o=!1;function a(M,L,F,H,Y){let ee=!1;const K=f(H,F,L);r!==K&&(r=K,c(r.object)),ee=d(M,H,F,Y),ee&&p(M,H,F,Y),Y!==null&&e.update(Y,n.ELEMENT_ARRAY_BUFFER),(ee||o)&&(o=!1,v(M,L,F,H),Y!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(Y).buffer))}function l(){return n.createVertexArray()}function c(M){return n.bindVertexArray(M)}function u(M){return n.deleteVertexArray(M)}function f(M,L,F){const H=F.wireframe===!0;let Y=i[M.id];Y===void 0&&(Y={},i[M.id]=Y);let ee=Y[L.id];ee===void 0&&(ee={},Y[L.id]=ee);let K=ee[H];return K===void 0&&(K=h(l()),ee[H]=K),K}function h(M){const L=[],F=[],H=[];for(let Y=0;Y=0){const be=Y[Z];let se=ee[Z];if(se===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(se=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(se=M.instanceColor)),be===void 0||be.attribute!==se||se&&be.data!==se.data)return!0;K++}return r.attributesNum!==K||r.index!==H}function p(M,L,F,H){const Y={},ee=L.attributes;let K=0;const Q=F.getAttributes();for(const Z in Q)if(Q[Z].location>=0){let be=ee[Z];be===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(be=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(be=M.instanceColor));const se={};se.attribute=be,be&&be.data&&(se.data=be.data),Y[Z]=se,K++}r.attributes=Y,r.attributesNum=K,r.index=H}function _(){const M=r.newAttributes;for(let L=0,F=M.length;L=0){let de=Y[Q];if(de===void 0&&(Q==="instanceMatrix"&&M.instanceMatrix&&(de=M.instanceMatrix),Q==="instanceColor"&&M.instanceColor&&(de=M.instanceColor)),de!==void 0){const be=de.normalized,se=de.itemSize,ye=e.get(de);if(ye===void 0)continue;const He=ye.buffer,re=ye.type,ge=ye.bytesPerElement,xe=re===n.INT||re===n.UNSIGNED_INT||de.gpuType===sd;if(de.isInterleavedBufferAttribute){const X=de.data,ae=X.stride,fe=de.offset;if(X.isInstancedInterleavedBuffer){for(let ce=0;ce0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="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),b=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:b,maxFragmentUniforms:v,vertexTextures:E,maxSamples:T}}function fN(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new rr,a=new nt,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,b=y*4;let v=m.clippingState||null;l.value=v,v=u(p,h,b,d);for(let E=0;E!==b;++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 sE(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 aa=4,ub=[.125,.215,.35,.446,.526,.582],io=20,Qp=new Dd,fb=new Ce;let em=null,tm=0,nm=0,im=!1;const eo=(1+Math.sqrt(5))/2,Jo=1/eo,hb=[new B(-eo,Jo,0),new B(eo,Jo,0),new B(-Jo,0,eo),new B(Jo,0,eo),new B(0,eo,-Jo),new B(0,eo,Jo),new B(-1,1,-1),new B(1,1,-1),new B(-1,1,1),new B(1,1,1)],dN=new B;class xg{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=dN}=r;em=this._renderer.getRenderTarget(),tm=this._renderer.getActiveCubeFace(),nm=this._renderer.getActiveMipmapLevel(),im=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=mb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=pb(),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===Os||e.mapping===gr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=mb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=pb());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new $t(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Zu(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Qp)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rio&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${io}`);const m=[];let y=0;for(let S=0;Sb-aa?s-b+aa:0),T=4*(this._cubeSize-v);Zu(t,E,T,3*v,2*v),l.setRenderTarget(t),l.render(f,Qp)}}function pN(n){const e=[],t=[],i=[];let s=n;const r=n-aa+1+ub.length;for(let o=0;on-aa?l=ub[o-n+aa-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),b=new Float32Array(g*p*d),v=new Float32Array(m*p*d);for(let T=0;T2?0:-1,x=[S,P,0,S+2/3,P,0,S+2/3,P+1,0,S,P,0,S+2/3,P+1,0,S,P+1,0];y.set(x,_*p*T),b.set(h,g*p*T);const M=[T,T,T,T,T,T];v.set(M,m*p*T)}const E=new lt;E.setAttribute("position",new Ct(y,_)),E.setAttribute("uv",new Ct(b,g)),E.setAttribute("faceIndex",new Ct(v,m)),e.push(E),s>aa&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function db(n,e,t){const i=new is(n,e,t);return i.texture.mapping=Na,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Zu(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function mN(n,e,t){const i=new Float32Array(io),s=new B(0,1,0);return new ki({name:"SphericalGaussianBlur",defines:{n:io,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:M_(),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:Rs,depthTest:!1,depthWrite:!1})}function pb(){return new ki({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:M_(),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:Rs,depthTest:!1,depthWrite:!1})}function mb(){return new ki({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:M_(),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:Rs,depthTest:!1,depthWrite:!1})}function M_(){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 gN(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===ec||l===tc,u=l===Os||l===gr;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 xg(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 xg(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),S=new Uc(T,v,E,f);S.type=Kn,S.needsUpdate=!0;const P=b*4;for(let M=0;M0)return n;const s=e*t;let r=_b[s];if(r===void 0&&(r=new Float32Array(s),_b[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 sn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}const Eb=new nt;function gU(n){ft._getMatrix(Eb,ft.workingColorSpace,n);const e=`mat3( ${Eb.elements.map(t=>t.toFixed(4))} )`;switch(ft.getTransfer(n)){case oc:return[e,"LinearTransferOETF"];case wt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function Tb(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+` + +`+mU(n.getShaderSource(e),o)}else return s}function _U(n,e){const t=gU(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` +`)}function vU(n,e){let t;switch(e){case I1:t="Linear";break;case L1:t="Reinhard";break;case D1:t="Cineon";break;case nd:t="ACESFilmic";break;case N1:t="AgX";break;case U1:t="Neutral";break;case O1:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ju=new B;function yU(){ft.getLuminanceCoefficients(Ju);const n=Ju.x.toFixed(4),e=Ju.y.toFixed(4),t=Ju.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`)}function bU(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(ml).join(` +`)}function xU(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function MU(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Mg(n){return n.replace(SU,TU)}const EU=new Map;function TU(n,e){let t=at[e];if(t===void 0){const i=EU.get(e);if(i!==void 0)t=at[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 Mg(t)}const wU=/#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 Cb(n){return n.replace(wU,AU)}function AU(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(ml).join(` +`),m.length>0&&(m+=` +`)):(g=[Rb(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(ml).join(` +`),m=[Rb(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!==Zi?"#define TONE_MAPPING":"",t.toneMapping!==Zi?at.tonemapping_pars_fragment:"",t.toneMapping!==Zi?vU("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",at.colorspace_pars_fragment,_U("linearToOutputTexel",t.outputColorSpace),yU(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(ml).join(` +`)),o=Mg(o),o=wb(o,t),o=Ab(o,t),a=Mg(a),a=wb(a,t),a=Ab(a,t),o=Cb(o),a=Cb(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===dg?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===dg?"":"#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 b=y+g+o,v=y+m+a,E=Sb(s,s.VERTEX_SHADER,b),T=Sb(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 S(L){if(n.debug.checkShaderErrors){const F=s.getProgramInfoLog(_).trim(),H=s.getShaderInfoLog(E).trim(),Y=s.getShaderInfoLog(T).trim();let ee=!0,K=!0;if(s.getProgramParameter(_,s.LINK_STATUS)===!1)if(ee=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,_,E,T);else{const Q=Tb(s,E,"vertex"),Z=Tb(s,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,s.VALIDATE_STATUS)+` + +Material Name: `+L.name+` +Material Type: `+L.type+` + +Program Info Log: `+F+` +`+Q+` +`+Z)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(H===""||Y==="")&&(K=!1);K&&(L.diagnostics={runnable:ee,programLog:F,vertexShader:{log:H,prefix:g},fragmentShader:{log:Y,prefix:m}})}s.deleteShader(E),s.deleteShader(T),P=new Sf(s,_),x=MU(s,_)}let P;this.getUniforms=function(){return P===void 0&&S(this),P};let x;this.getAttributes=function(){return x===void 0&&S(this),x};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(_,dU)),M},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=pU++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}let OU=0;class NU{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 UU(e),t.set(e,i)),i}}class UU{constructor(e){this.id=OU++,this.code=e,this.usedTimes=0}}function FU(n,e,t,i,s,r,o){const a=new dd,l=new NU,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 _(x){return c.add(x),x===0?"uv":`uv${x}`}function g(x,M,L,F,H){const Y=F.fog,ee=H.geometry,K=x.isMeshStandardMaterial?F.environment:null,Q=(x.isMeshStandardMaterial?t:e).get(x.envMap||K),Z=Q&&Q.mapping===Na?Q.image.height:null,de=p[x.type];x.precision!==null&&(d=s.getMaxPrecision(x.precision),d!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",d,"instead."));const be=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,se=be!==void 0?be.length:0;let ye=0;ee.morphAttributes.position!==void 0&&(ye=1),ee.morphAttributes.normal!==void 0&&(ye=2),ee.morphAttributes.color!==void 0&&(ye=3);let He,re,ge,xe;if(de){const Tt=Pi[de];He=Tt.vertexShader,re=Tt.fragmentShader}else He=x.vertexShader,re=x.fragmentShader,l.update(x),ge=l.getVertexShaderID(x),xe=l.getFragmentShaderID(x);const X=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),fe=H.isInstancedMesh===!0,ce=H.isBatchedMesh===!0,Ue=!!x.map,k=!!x.matcap,z=!!Q,R=!!x.aoMap,te=!!x.lightMap,G=!!x.bumpMap,W=!!x.normalMap,C=!!x.displacementMap,I=!!x.emissiveMap,N=!!x.metalnessMap,A=!!x.roughnessMap,w=x.anisotropy>0,U=x.clearcoat>0,O=x.dispersion>0,V=x.iridescence>0,$=x.sheen>0,ue=x.transmission>0,le=w&&!!x.anisotropyMap,Me=U&&!!x.clearcoatMap,Be=U&&!!x.clearcoatNormalMap,me=U&&!!x.clearcoatRoughnessMap,Te=V&&!!x.iridescenceMap,Ve=V&&!!x.iridescenceThicknessMap,We=$&&!!x.sheenColorMap,Se=$&&!!x.sheenRoughnessMap,Ze=!!x.specularMap,tt=!!x.specularColorMap,Lt=!!x.specularIntensityMap,q=ue&&!!x.transmissionMap,Pe=ue&&!!x.thicknessMap,oe=!!x.gradientMap,pe=!!x.alphaMap,Le=x.alphaTest>0,Ie=!!x.alphaHash,rt=!!x.extensions;let Vt=Zi;x.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(Vt=n.toneMapping);const yn={shaderID:de,shaderType:x.type,shaderName:x.name,vertexShader:He,fragmentShader:re,defines:x.defines,customVertexShaderID:ge,customFragmentShaderID:xe,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:d,batching:ce,batchingColor:ce&&H._colorsTexture!==null,instancing:fe,instancingColor:fe&&H.instanceColor!==null,instancingMorph:fe&&H.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:X===null?n.outputColorSpace:X.isXRRenderTarget===!0?X.texture.colorSpace:xo,alphaToCoverage:!!x.alphaToCoverage,map:Ue,matcap:k,envMap:z,envMapMode:z&&Q.mapping,envMapCubeUVHeight:Z,aoMap:R,lightMap:te,bumpMap:G,normalMap:W,displacementMap:h&&C,emissiveMap:I,normalMapObjectSpace:W&&x.normalMapType===G1,normalMapTangentSpace:W&&x.normalMapType===Er,metalnessMap:N,roughnessMap:A,anisotropy:w,anisotropyMap:le,clearcoat:U,clearcoatMap:Me,clearcoatNormalMap:Be,clearcoatRoughnessMap:me,dispersion:O,iridescence:V,iridescenceMap:Te,iridescenceThicknessMap:Ve,sheen:$,sheenColorMap:We,sheenRoughnessMap:Se,specularMap:Ze,specularColorMap:tt,specularIntensityMap:Lt,transmission:ue,transmissionMap:q,thicknessMap:Pe,gradientMap:oe,opaque:x.transparent===!1&&x.blending===ho&&x.alphaToCoverage===!1,alphaMap:pe,alphaTest:Le,alphaHash:Ie,combine:x.combine,mapUv:Ue&&_(x.map.channel),aoMapUv:R&&_(x.aoMap.channel),lightMapUv:te&&_(x.lightMap.channel),bumpMapUv:G&&_(x.bumpMap.channel),normalMapUv:W&&_(x.normalMap.channel),displacementMapUv:C&&_(x.displacementMap.channel),emissiveMapUv:I&&_(x.emissiveMap.channel),metalnessMapUv:N&&_(x.metalnessMap.channel),roughnessMapUv:A&&_(x.roughnessMap.channel),anisotropyMapUv:le&&_(x.anisotropyMap.channel),clearcoatMapUv:Me&&_(x.clearcoatMap.channel),clearcoatNormalMapUv:Be&&_(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:me&&_(x.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&_(x.iridescenceMap.channel),iridescenceThicknessMapUv:Ve&&_(x.iridescenceThicknessMap.channel),sheenColorMapUv:We&&_(x.sheenColorMap.channel),sheenRoughnessMapUv:Se&&_(x.sheenRoughnessMap.channel),specularMapUv:Ze&&_(x.specularMap.channel),specularColorMapUv:tt&&_(x.specularColorMap.channel),specularIntensityMapUv:Lt&&_(x.specularIntensityMap.channel),transmissionMapUv:q&&_(x.transmissionMap.channel),thicknessMapUv:Pe&&_(x.thicknessMap.channel),alphaMapUv:pe&&_(x.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(W||w),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ee.attributes.uv&&(Ue||pe),fog:!!Y,useFog:x.fog===!0,fogExp2:!!Y&&Y.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.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:ye,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:Vt,decodeVideoTexture:Ue&&x.map.isVideoTexture===!0&&ft.getTransfer(x.map.colorSpace)===wt,decodeVideoTextureEmissive:I&&x.emissiveMap.isVideoTexture===!0&&ft.getTransfer(x.emissiveMap.colorSpace)===wt,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===Ii,flipSided:x.side===zn,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionClipCullDistance:rt&&x.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(rt&&x.extensions.multiDraw===!0||ce)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return yn.vertexUv1s=c.has(1),yn.vertexUv2s=c.has(2),yn.vertexUv3s=c.has(3),c.clear(),yn}function m(x){const M=[];if(x.shaderID?M.push(x.shaderID):(M.push(x.customVertexShaderID),M.push(x.customFragmentShaderID)),x.defines!==void 0)for(const L in x.defines)M.push(L),M.push(x.defines[L]);return x.isRawShaderMaterial===!1&&(y(M,x),b(M,x),M.push(n.outputColorSpace)),M.push(x.customProgramCacheKey),M.join()}function y(x,M){x.push(M.precision),x.push(M.outputColorSpace),x.push(M.envMapMode),x.push(M.envMapCubeUVHeight),x.push(M.mapUv),x.push(M.alphaMapUv),x.push(M.lightMapUv),x.push(M.aoMapUv),x.push(M.bumpMapUv),x.push(M.normalMapUv),x.push(M.displacementMapUv),x.push(M.emissiveMapUv),x.push(M.metalnessMapUv),x.push(M.roughnessMapUv),x.push(M.anisotropyMapUv),x.push(M.clearcoatMapUv),x.push(M.clearcoatNormalMapUv),x.push(M.clearcoatRoughnessMapUv),x.push(M.iridescenceMapUv),x.push(M.iridescenceThicknessMapUv),x.push(M.sheenColorMapUv),x.push(M.sheenRoughnessMapUv),x.push(M.specularMapUv),x.push(M.specularColorMapUv),x.push(M.specularIntensityMapUv),x.push(M.transmissionMapUv),x.push(M.thicknessMapUv),x.push(M.combine),x.push(M.fogExp2),x.push(M.sizeAttenuation),x.push(M.morphTargetsCount),x.push(M.morphAttributeCount),x.push(M.numDirLights),x.push(M.numPointLights),x.push(M.numSpotLights),x.push(M.numSpotLightMaps),x.push(M.numHemiLights),x.push(M.numRectAreaLights),x.push(M.numDirLightShadows),x.push(M.numPointLightShadows),x.push(M.numSpotLightShadows),x.push(M.numSpotLightShadowsWithMaps),x.push(M.numLightProbes),x.push(M.shadowMapType),x.push(M.toneMapping),x.push(M.numClippingPlanes),x.push(M.numClipIntersection),x.push(M.depthPacking)}function b(x,M){a.disableAll(),M.supportsVertexTextures&&a.enable(0),M.instancing&&a.enable(1),M.instancingColor&&a.enable(2),M.instancingMorph&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),M.dispersion&&a.enable(20),M.batchingColor&&a.enable(21),x.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reverseDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),x.push(a.mask)}function v(x){const M=p[x.type];let L;if(M){const F=Pi[M];L=nE.clone(F.uniforms)}else L=x.uniforms;return L}function E(x,M){let L;for(let F=0,H=u.length;F0?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||BU),i.length>1&&i.sort(h||Pb),s.length>1&&s.sort(h||Pb)}function u(){for(let f=e,h=n.length;f=r.length?(o=new Ib,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function VU(){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 B,color:new Ce};break;case"SpotLight":t={position:new B,direction:new B,color:new Ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new B,color:new Ce,distance:0,decay:0};break;case"HemisphereLight":t={direction:new B,skyColor:new Ce,groundColor:new Ce};break;case"RectAreaLight":t={color:new Ce,position:new B,halfWidth:new B,halfHeight:new B};break}return n[e.id]=t,t}}}function HU(){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 he};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new he};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new he,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let GU=0;function WU(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function XU(n){const e=new VU,t=HU(),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 B);const s=new B,r=new Ye,o=new Ye;function a(c){let u=0,f=0,h=0;for(let x=0;x<9;x++)i.probe[x].set(0,0,0);let d=0,p=0,_=0,g=0,m=0,y=0,b=0,v=0,E=0,T=0,S=0;c.sort(WU);for(let x=0,M=c.length;x0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=we.LTC_FLOAT_1,i.rectAreaLTC2=we.LTC_FLOAT_2):(i.rectAreaLTC1=we.LTC_HALF_1,i.rectAreaLTC2=we.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!==b||P.numSpotShadows!==v||P.numSpotMaps!==E||P.numLightProbes!==S)&&(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=b,i.pointShadowMap.length=b,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=v+E-T,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=S,P.directionalLength=d,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=y,P.numPointShadows=b,P.numSpotShadows=v,P.numSpotMaps=E,P.numLightProbes=S,i.version=GU++)}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 Lb(n),o.push(a)):a=o[r],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const qU=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,YU=`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 jU(n,e,t){let i=new Bc;const s=new he,r=new he,o=new gt,a=new u_({depthPacking:H1}),l=new f_,c={},u=t.maxTextureSize,f={[Ds]:zn,[zn]:Ds,[Ii]:Ii},h=new ki({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new he},radius:{value:4}},vertexShader:qU,fragmentShader:YU}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const p=new lt;p.setAttribute("position",new Ct(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new $t(p,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=N0;let m=this.type;this.render=function(T,S,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||T.length===0)return;const x=n.getRenderTarget(),M=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),F=n.state;F.setBlending(Rs),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const H=m!==$i&&this.type===$i,Y=m===$i&&this.type!==$i;for(let ee=0,K=T.length;eeu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/de.x),s.x=r.x*de.x,Z.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/de.y),s.y=r.y*de.y,Z.mapSize.y=r.y)),Z.map===null||H===!0||Y===!0){const se=this.type!==$i?{minFilter:_n,magFilter:_n}:{};Z.map!==null&&Z.map.dispose(),Z.map=new is(s.x,s.y,se),Z.map.texture.name=Q.name+".shadowMap",Z.camera.updateProjectionMatrix()}n.setRenderTarget(Z.map),n.clear();const be=Z.getViewportCount();for(let se=0;se0||S.map&&S.alphaTest>0){const F=M.uuid,H=S.uuid;let Y=c[F];Y===void 0&&(Y={},c[F]=Y);let ee=Y[H];ee===void 0&&(ee=M.clone(),Y[H]=ee,S.addEventListener("dispose",E)),M=ee}if(M.visible=S.visible,M.wireframe=S.wireframe,x===$i?M.side=S.shadowSide!==null?S.shadowSide:S.side:M.side=S.shadowSide!==null?S.shadowSide:f[S.side],M.alphaMap=S.alphaMap,M.alphaTest=S.alphaTest,M.map=S.map,M.clipShadows=S.clipShadows,M.clippingPlanes=S.clippingPlanes,M.clipIntersection=S.clipIntersection,M.displacementMap=S.displacementMap,M.displacementScale=S.displacementScale,M.displacementBias=S.displacementBias,M.wireframeLinewidth=S.wireframeLinewidth,M.linewidth=S.linewidth,P.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const F=n.properties.get(M);F.light=P}return M}function v(T,S,P,x,M){if(T.visible===!1)return;if(T.layers.test(S.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&M===$i)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);const H=e.update(T),Y=T.material;if(Array.isArray(Y)){const ee=H.groups;for(let K=0,Q=ee.length;K=1):Z.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),K=Q>=2);let de=null,be={};const se=n.getParameter(n.SCISSOR_BOX),ye=n.getParameter(n.VIEWPORT),He=new gt().fromArray(se),re=new gt().fromArray(ye);function ge(q,Pe,oe,pe){const Le=new Uint8Array(4),Ie=n.createTexture();n.bindTexture(q,Ie),n.texParameteri(q,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(q,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let rt=0;rt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new he,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,w){return d?new OffscreenCanvas(A,w):cc("canvas")}function _(A,w,U){let O=1;const V=N(A);if((V.width>U||V.height>U)&&(O=U/Math.max(V.width,V.height)),O<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 $=Math.floor(O*V.width),ue=Math.floor(O*V.height);f===void 0&&(f=p($,ue));const le=w?p($,ue):f;return le.width=$,le.height=ue,le.getContext("2d").drawImage(A,0,0,$,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+V.width+"x"+V.height+") to ("+$+"x"+ue+")."),le}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+V.width+"x"+V.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 b(A,w,U,O,V=!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 $=w;if(w===n.RED&&(U===n.FLOAT&&($=n.R32F),U===n.HALF_FLOAT&&($=n.R16F),U===n.UNSIGNED_BYTE&&($=n.R8)),w===n.RED_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.R8UI),U===n.UNSIGNED_SHORT&&($=n.R16UI),U===n.UNSIGNED_INT&&($=n.R32UI),U===n.BYTE&&($=n.R8I),U===n.SHORT&&($=n.R16I),U===n.INT&&($=n.R32I)),w===n.RG&&(U===n.FLOAT&&($=n.RG32F),U===n.HALF_FLOAT&&($=n.RG16F),U===n.UNSIGNED_BYTE&&($=n.RG8)),w===n.RG_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.RG8UI),U===n.UNSIGNED_SHORT&&($=n.RG16UI),U===n.UNSIGNED_INT&&($=n.RG32UI),U===n.BYTE&&($=n.RG8I),U===n.SHORT&&($=n.RG16I),U===n.INT&&($=n.RG32I)),w===n.RGB_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.RGB8UI),U===n.UNSIGNED_SHORT&&($=n.RGB16UI),U===n.UNSIGNED_INT&&($=n.RGB32UI),U===n.BYTE&&($=n.RGB8I),U===n.SHORT&&($=n.RGB16I),U===n.INT&&($=n.RGB32I)),w===n.RGBA_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.RGBA8UI),U===n.UNSIGNED_SHORT&&($=n.RGBA16UI),U===n.UNSIGNED_INT&&($=n.RGBA32UI),U===n.BYTE&&($=n.RGBA8I),U===n.SHORT&&($=n.RGBA16I),U===n.INT&&($=n.RGBA32I)),w===n.RGB&&U===n.UNSIGNED_INT_5_9_9_9_REV&&($=n.RGB9_E5),w===n.RGBA){const ue=V?oc:ft.getTransfer(O);U===n.FLOAT&&($=n.RGBA32F),U===n.HALF_FLOAT&&($=n.RGBA16F),U===n.UNSIGNED_BYTE&&($=ue===wt?n.SRGB8_ALPHA8:n.RGBA8),U===n.UNSIGNED_SHORT_4_4_4_4&&($=n.RGBA4),U===n.UNSIGNED_SHORT_5_5_5_1&&($=n.RGB5_A1)}return($===n.R16F||$===n.R32F||$===n.RG16F||$===n.RG32F||$===n.RGBA16F||$===n.RGBA32F)&&e.get("EXT_color_buffer_float"),$}function v(A,w){let U;return A?w===null||w===Ns||w===ba?U=n.DEPTH24_STENCIL8:w===Kn?U=n.DEPTH32F_STENCIL8:w===ya&&(U=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):w===null||w===Ns||w===ba?U=n.DEPTH_COMPONENT24:w===Kn?U=n.DEPTH_COMPONENT32F:w===ya&&(U=n.DEPTH_COMPONENT16),U}function E(A,w){return g(A)===!0||A.isFramebufferTexture&&A.minFilter!==_n&&A.minFilter!==en?Math.log2(Math.max(w.width,w.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?w.mipmaps.length:1}function T(A){const w=A.target;w.removeEventListener("dispose",T),P(w),w.isVideoTexture&&u.delete(w)}function S(A){const w=A.target;w.removeEventListener("dispose",S),M(w)}function P(A){const w=i.get(A);if(w.__webglInit===void 0)return;const U=A.source,O=h.get(U);if(O){const V=O[w.__cacheKey];V.usedTimes--,V.usedTimes===0&&x(A),Object.keys(O).length===0&&h.delete(U)}i.remove(A)}function x(A){const w=i.get(A);n.deleteTexture(w.__webglTexture);const U=A.source,O=h.get(U);delete O[w.__cacheKey],o.memory.textures--}function M(A){const w=i.get(A);if(A.depthTexture&&(A.depthTexture.dispose(),i.remove(A.depthTexture)),A.isWebGLCubeRenderTarget)for(let O=0;O<6;O++){if(Array.isArray(w.__webglFramebuffer[O]))for(let V=0;V=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+s.maxTextures),L+=1,A}function Y(A){const w=[];return w.push(A.wrapS),w.push(A.wrapT),w.push(A.wrapR||0),w.push(A.magFilter),w.push(A.minFilter),w.push(A.anisotropy),w.push(A.internalFormat),w.push(A.format),w.push(A.type),w.push(A.generateMipmaps),w.push(A.premultiplyAlpha),w.push(A.flipY),w.push(A.unpackAlignment),w.push(A.colorSpace),w.join()}function ee(A,w){const U=i.get(A);if(A.isVideoTexture&&C(A),A.isRenderTargetTexture===!1&&A.version>0&&U.__version!==A.version){const O=A.image;if(O===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(O.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(U,A,w);return}}t.bindTexture(n.TEXTURE_2D,U.__webglTexture,n.TEXTURE0+w)}function K(A,w){const U=i.get(A);if(A.version>0&&U.__version!==A.version){re(U,A,w);return}t.bindTexture(n.TEXTURE_2D_ARRAY,U.__webglTexture,n.TEXTURE0+w)}function Q(A,w){const U=i.get(A);if(A.version>0&&U.__version!==A.version){re(U,A,w);return}t.bindTexture(n.TEXTURE_3D,U.__webglTexture,n.TEXTURE0+w)}function Z(A,w){const U=i.get(A);if(A.version>0&&U.__version!==A.version){ge(U,A,w);return}t.bindTexture(n.TEXTURE_CUBE_MAP,U.__webglTexture,n.TEXTURE0+w)}const de={[nc]:n.REPEAT,[gi]:n.CLAMP_TO_EDGE,[ic]:n.MIRRORED_REPEAT},be={[_n]:n.NEAREST,[F0]:n.NEAREST_MIPMAP_NEAREST,[sa]:n.NEAREST_MIPMAP_LINEAR,[en]:n.LINEAR,[Ml]:n.LINEAR_MIPMAP_NEAREST,[ji]:n.LINEAR_MIPMAP_LINEAR},se={[W1]:n.NEVER,[K1]:n.ALWAYS,[X1]:n.LESS,[Y0]:n.LEQUAL,[$1]:n.EQUAL,[j1]:n.GEQUAL,[q1]:n.GREATER,[Y1]:n.NOTEQUAL};function ye(A,w){if(w.type===Kn&&e.has("OES_texture_float_linear")===!1&&(w.magFilter===en||w.magFilter===Ml||w.magFilter===sa||w.magFilter===ji||w.minFilter===en||w.minFilter===Ml||w.minFilter===sa||w.minFilter===ji)&&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,de[w.wrapS]),n.texParameteri(A,n.TEXTURE_WRAP_T,de[w.wrapT]),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,de[w.wrapR]),n.texParameteri(A,n.TEXTURE_MAG_FILTER,be[w.magFilter]),n.texParameteri(A,n.TEXTURE_MIN_FILTER,be[w.minFilter]),w.compareFunction&&(n.texParameteri(A,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(A,n.TEXTURE_COMPARE_FUNC,se[w.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===_n||w.minFilter!==sa&&w.minFilter!==ji||w.type===Kn&&e.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||i.get(w).__currentAnisotropy){const U=e.get("EXT_texture_filter_anisotropic");n.texParameterf(A,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,s.getMaxAnisotropy())),i.get(w).__currentAnisotropy=w.anisotropy}}}function He(A,w){let U=!1;A.__webglInit===void 0&&(A.__webglInit=!0,w.addEventListener("dispose",T));const O=w.source;let V=h.get(O);V===void 0&&(V={},h.set(O,V));const $=Y(w);if($!==A.__cacheKey){V[$]===void 0&&(V[$]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,U=!0),V[$].usedTimes++;const ue=V[A.__cacheKey];ue!==void 0&&(V[A.__cacheKey].usedTimes--,ue.usedTimes===0&&x(w)),A.__cacheKey=$,A.__webglTexture=V[$].texture}return U}function re(A,w,U){let O=n.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(O=n.TEXTURE_2D_ARRAY),w.isData3DTexture&&(O=n.TEXTURE_3D);const V=He(A,w),$=w.source;t.bindTexture(O,A.__webglTexture,n.TEXTURE0+U);const ue=i.get($);if($.version!==ue.__version||V===!0){t.activeTexture(n.TEXTURE0+U);const le=ft.getPrimaries(ft.workingColorSpace),Me=w.colorSpace===Ms?null:ft.getPrimaries(w.colorSpace),Be=w.colorSpace===Ms||le===Me?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,w.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,w.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);let me=_(w.image,!1,s.maxTextureSize);me=I(w,me);const Te=r.convert(w.format,w.colorSpace),Ve=r.convert(w.type);let We=b(w.internalFormat,Te,Ve,w.colorSpace,w.isVideoTexture);ye(O,w);let Se;const Ze=w.mipmaps,tt=w.isVideoTexture!==!0,Lt=ue.__version===void 0||V===!0,q=$.dataReady,Pe=E(w,me);if(w.isDepthTexture)We=v(w.format===Ma,w.type),Lt&&(tt?t.texStorage2D(n.TEXTURE_2D,1,We,me.width,me.height):t.texImage2D(n.TEXTURE_2D,0,We,me.width,me.height,0,Te,Ve,null));else if(w.isDataTexture)if(Ze.length>0){tt&&Lt&&t.texStorage2D(n.TEXTURE_2D,Pe,We,Ze[0].width,Ze[0].height);for(let oe=0,pe=Ze.length;oe0){const Le=bg(Se.width,Se.height,w.format,w.type);for(const Ie of w.layerUpdates){const rt=Se.data.subarray(Ie*Le/Se.data.BYTES_PER_ELEMENT,(Ie+1)*Le/Se.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Ie,Se.width,Se.height,1,Te,rt)}w.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Se.width,Se.height,me.depth,Te,Se.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,We,Se.width,Se.height,me.depth,0,Se.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else tt?q&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Se.width,Se.height,me.depth,Te,Ve,Se.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,We,Se.width,Se.height,me.depth,0,Te,Ve,Se.data)}else{tt&&Lt&&t.texStorage2D(n.TEXTURE_2D,Pe,We,Ze[0].width,Ze[0].height);for(let oe=0,pe=Ze.length;oe0){const oe=bg(me.width,me.height,w.format,w.type);for(const pe of w.layerUpdates){const Le=me.data.subarray(pe*oe/me.data.BYTES_PER_ELEMENT,(pe+1)*oe/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,pe,me.width,me.height,1,Te,Ve,Le)}w.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,Te,Ve,me.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,We,me.width,me.height,me.depth,0,Te,Ve,me.data);else if(w.isData3DTexture)tt?(Lt&&t.texStorage3D(n.TEXTURE_3D,Pe,We,me.width,me.height,me.depth),q&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,Te,Ve,me.data)):t.texImage3D(n.TEXTURE_3D,0,We,me.width,me.height,me.depth,0,Te,Ve,me.data);else if(w.isFramebufferTexture){if(Lt)if(tt)t.texStorage2D(n.TEXTURE_2D,Pe,We,me.width,me.height);else{let oe=me.width,pe=me.height;for(let Le=0;Le>=1,pe>>=1}}else if(Ze.length>0){if(tt&&Lt){const oe=N(Ze[0]);t.texStorage2D(n.TEXTURE_2D,Pe,We,oe.width,oe.height)}for(let oe=0,pe=Ze.length;oe0&&Pe++;const pe=N(Te[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Pe,Ze,pe.width,pe.height)}for(let pe=0;pe<6;pe++)if(me){tt?q&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,0,0,Te[pe].width,Te[pe].height,We,Se,Te[pe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,Ze,Te[pe].width,Te[pe].height,0,We,Se,Te[pe].data);for(let Le=0;Le>$),Ve=Math.max(1,w.height>>$);V===n.TEXTURE_3D||V===n.TEXTURE_2D_ARRAY?t.texImage3D(V,$,Me,Te,Ve,w.depth,0,ue,le,null):t.texImage2D(V,$,Me,Te,Ve,0,ue,le,null)}t.bindFramebuffer(n.FRAMEBUFFER,A),W(w)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,O,V,me.__webglTexture,0,G(w)):(V===n.TEXTURE_2D||V>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&V<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,O,V,me.__webglTexture,$),t.bindFramebuffer(n.FRAMEBUFFER,null)}function X(A,w,U){if(n.bindRenderbuffer(n.RENDERBUFFER,A),w.depthBuffer){const O=w.depthTexture,V=O&&O.isDepthTexture?O.type:null,$=v(w.stencilBuffer,V),ue=w.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,le=G(w);W(w)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,le,$,w.width,w.height):U?n.renderbufferStorageMultisample(n.RENDERBUFFER,le,$,w.width,w.height):n.renderbufferStorage(n.RENDERBUFFER,$,w.width,w.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ue,n.RENDERBUFFER,A)}else{const O=w.textures;for(let V=0;V{delete w.__boundDepthTexture,delete w.__depthDisposeCallback,O.removeEventListener("dispose",V)};O.addEventListener("dispose",V),w.__depthDisposeCallback=V}w.__boundDepthTexture=O}if(A.depthTexture&&!w.__autoAllocateDepthBuffer){if(U)throw new Error("target.depthTexture not supported in Cube render targets");ae(w.__webglFramebuffer,A)}else if(U){w.__webglDepthbuffer=[];for(let O=0;O<6;O++)if(t.bindFramebuffer(n.FRAMEBUFFER,w.__webglFramebuffer[O]),w.__webglDepthbuffer[O]===void 0)w.__webglDepthbuffer[O]=n.createRenderbuffer(),X(w.__webglDepthbuffer[O],A,!1);else{const V=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,$=w.__webglDepthbuffer[O];n.bindRenderbuffer(n.RENDERBUFFER,$),n.framebufferRenderbuffer(n.FRAMEBUFFER,V,n.RENDERBUFFER,$)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer===void 0)w.__webglDepthbuffer=n.createRenderbuffer(),X(w.__webglDepthbuffer,A,!1);else{const O=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,V=w.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,V),n.framebufferRenderbuffer(n.FRAMEBUFFER,O,n.RENDERBUFFER,V)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ce(A,w,U){const O=i.get(A);w!==void 0&&xe(O.__webglFramebuffer,A,A.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),U!==void 0&&fe(A)}function Ue(A){const w=A.texture,U=i.get(A),O=i.get(w);A.addEventListener("dispose",S);const V=A.textures,$=A.isWebGLCubeRenderTarget===!0,ue=V.length>1;if(ue||(O.__webglTexture===void 0&&(O.__webglTexture=n.createTexture()),O.__version=w.version,o.memory.textures++),$){U.__webglFramebuffer=[];for(let le=0;le<6;le++)if(w.mipmaps&&w.mipmaps.length>0){U.__webglFramebuffer[le]=[];for(let Me=0;Me0){U.__webglFramebuffer=[];for(let le=0;le0&&W(A)===!1){U.__webglMultisampledFramebuffer=n.createFramebuffer(),U.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,U.__webglMultisampledFramebuffer);for(let le=0;le0)for(let Me=0;Me0)for(let Me=0;Me0){if(W(A)===!1){const w=A.textures,U=A.width,O=A.height;let V=n.COLOR_BUFFER_BIT;const $=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ue=i.get(A),le=w.length>1;if(le)for(let Me=0;Me0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function C(A){const w=o.render.frame;u.get(A)!==w&&(u.set(A,w),A.update())}function I(A,w){const U=A.colorSpace,O=A.format,V=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||U!==xo&&U!==Ms&&(ft.getTransfer(U)===wt?(O!==Bn||V!==ns)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",U)),w}function N(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=F,this.setTexture2D=ee,this.setTexture2DArray=K,this.setTexture3D=Q,this.setTextureCube=Z,this.rebindTextures=ce,this.setupRenderTarget=Ue,this.updateRenderTargetMipmap=k,this.updateMultisampleRenderTarget=te,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=xe,this.useMultisampledRTT=W}function aT(n,e){function t(i,s=Ms){let r;const o=ft.getTransfer(s);if(i===ns)return n.UNSIGNED_BYTE;if(i===rd)return n.UNSIGNED_SHORT_4_4_4_4;if(i===od)return n.UNSIGNED_SHORT_5_5_5_1;if(i===z0)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===k0)return n.BYTE;if(i===B0)return n.SHORT;if(i===ya)return n.UNSIGNED_SHORT;if(i===sd)return n.INT;if(i===Ns)return n.UNSIGNED_INT;if(i===Kn)return n.FLOAT;if(i===Ua)return n.HALF_FLOAT;if(i===V0)return n.ALPHA;if(i===H0)return n.RGB;if(i===Bn)return n.RGBA;if(i===G0)return n.LUMINANCE;if(i===W0)return n.LUMINANCE_ALPHA;if(i===xa)return n.DEPTH_COMPONENT;if(i===Ma)return n.DEPTH_STENCIL;if(i===ad)return n.RED;if(i===Nc)return n.RED_INTEGER;if(i===X0)return n.RG;if(i===ld)return n.RG_INTEGER;if(i===cd)return n.RGBA_INTEGER;if(i===Sl||i===El||i===Tl||i===wl)if(o===wt)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Sl)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===El)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Tl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===wl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Sl)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===El)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Tl)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===wl)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Kf||i===Zf||i===Jf||i===Qf)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===Kf)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Zf)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Jf)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Qf)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===eh||i===th||i===nh)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===eh||i===th)return o===wt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===nh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===ih||i===sh||i===rh||i===oh||i===ah||i===lh||i===ch||i===uh||i===fh||i===hh||i===dh||i===ph||i===mh||i===gh)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===ih)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===sh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===rh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===oh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===ah)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===lh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===ch)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===uh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===fh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===hh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===dh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===ph)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===mh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===gh)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Al||i===_h||i===vh)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===Al)return o===wt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===_h)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===vh)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===$0||i===yh||i===bh||i===xh)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===Al)return r.COMPRESSED_RED_RGTC1_EXT;if(i===yh)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===bh)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===xh)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ba?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const QU=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,eF=` +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 tF{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const s=new Wt,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 ki({vertexShader:QU,fragmentShader:eF,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new $t(new Ba(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class nF extends ss{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 tF,g=t.getContextAttributes();let m=null,y=null;const b=[],v=[],E=new he;let T=null;const S=new Kt;S.viewport=new gt;const P=new Kt;P.viewport=new gt;const x=[S,P],M=new KE;let L=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let ge=b[re];return ge===void 0&&(ge=new Mf,b[re]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(re){let ge=b[re];return ge===void 0&&(ge=new Mf,b[re]=ge),ge.getGripSpace()},this.getHand=function(re){let ge=b[re];return ge===void 0&&(ge=new Mf,b[re]=ge),ge.getHandSpace()};function H(re){const ge=v.indexOf(re.inputSource);if(ge===-1)return;const xe=b[ge];xe!==void 0&&(xe.update(re.inputSource,re.frame,c||o),xe.dispatchEvent({type:re.type,data:re.inputSource}))}function Y(){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",Y),s.removeEventListener("inputsourceschange",ee);for(let re=0;re=0&&(v[X]=null,b[X].disconnect(xe))}for(let ge=0;ge=v.length){v.push(xe),X=fe;break}else if(v[fe]===null){v[fe]=xe,X=fe;break}if(X===-1)break}const ae=b[X];ae&&ae.connect(xe)}}const K=new B,Q=new B;function Z(re,ge,xe){K.setFromMatrixPosition(ge.matrixWorld),Q.setFromMatrixPosition(xe.matrixWorld);const X=K.distanceTo(Q),ae=ge.projectionMatrix.elements,fe=xe.projectionMatrix.elements,ce=ae[14]/(ae[10]-1),Ue=ae[14]/(ae[10]+1),k=(ae[9]+1)/ae[5],z=(ae[9]-1)/ae[5],R=(ae[8]-1)/ae[0],te=(fe[8]+1)/fe[0],G=ce*R,W=ce*te,C=X/(-R+te),I=C*-R;if(ge.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(I),re.translateZ(C),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 N=ce+C,A=Ue+C,w=G-I,U=W+(X-I),O=k*Ue/A*N,V=z*Ue/A*N;re.projectionMatrix.makePerspective(w,U,O,V,N,A),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}}function de(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,xe=re.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(xe=_.depthFar)),M.near=P.near=S.near=ge,M.far=P.far=S.far=xe,(L!==M.near||F!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,F=M.far),S.layers.mask=re.layers.mask|2,P.layers.mask=re.layers.mask|4,M.layers.mask=S.layers.mask|P.layers.mask;const X=re.parent,ae=M.cameras;de(M,X);for(let fe=0;fe0&&(g.alphaTest.value=m.alphaTest);const y=e.get(m),b=y.envMap,v=y.envMapRotation;b&&(g.envMap.value=b,jr.copy(v),jr.x*=-1,jr.y*=-1,jr.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(jr.y*=-1,jr.z*=-1),g.envMapRotation.value.setFromMatrix4(iF.makeRotationFromEuler(jr)),g.flipEnvMap.value=b.isCubeTexture&&b.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,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*y,g.scale.value=b*.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===zn&&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 rF(n,e,t,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,b){const v=b.program;i.uniformBlockBinding(y,v)}function c(y,b){let v=s[y.id];v===void 0&&(p(y),v=u(y),s[y.id]=v,y.addEventListener("dispose",g));const E=b.program;i.updateUBOMapping(y,E);const T=e.render.frame;r[y.id]!==T&&(h(y),r[y.id]=T)}function u(y){const b=f();y.__bindingPointIndex=b;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,b,v),v}function f(){for(let y=0;y0&&(v+=E-T),y.__size=v,y.__cache={},this}function _(y){const b={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(b.boundary=4,b.storage=4):y.isVector2?(b.boundary=8,b.storage=8):y.isVector3||y.isColor?(b.boundary=16,b.storage=12):y.isVector4?(b.boundary=16,b.storage=16):y.isMatrix3?(b.boundary=48,b.storage=48):y.isMatrix4?(b.boundary=64,b.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),b}function g(y){const b=y.target;b.removeEventListener("dispose",g);const v=o.indexOf(b.__bindingPointIndex);o.splice(v,1),n.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function m(){for(const y in s)n.deleteBuffer(s[y]);o=[],s={},r={}}return{bind:l,update:c,dispose:m}}class Ef{constructor(e={}){const{canvas:t=J1(),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=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Zi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let E=!1;this._outputColorSpace=Nn;let T=0,S=0,P=null,x=-1,M=null;const L=new gt,F=new gt;let H=null;const Y=new Ce(0);let ee=0,K=t.width,Q=t.height,Z=1,de=null,be=null;const se=new gt(0,0,K,Q),ye=new gt(0,0,K,Q);let He=!1;const re=new Bc;let ge=!1,xe=!1;const X=new Ye,ae=new Ye,fe=new B,ce=new gt,Ue={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let k=!1;function z(){return P===null?Z:1}let R=i;function te(D,j){return t.getContext(D,j)}try{const D={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${Dc}`),t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",Le,!1),t.addEventListener("webglcontextcreationerror",Ie,!1),R===null){const j="webgl2";if(R=te(j,D),R===null)throw te(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let G,W,C,I,N,A,w,U,O,V,$,ue,le,Me,Be,me,Te,Ve,We,Se,Ze,tt,Lt,q;function Pe(){G=new _N(R),G.init(),tt=new aT(R,G),W=new uN(R,G,e,tt),C=new ZU(R,G),W.reverseDepthBuffer&&h&&C.buffers.depth.setReversed(!0),I=new bN(R),N=new kU,A=new JU(R,G,C,N,W,tt,I),w=new hN(v),U=new gN(v),O=new wL(R),Lt=new lN(R,O),V=new vN(R,O,I,Lt),$=new MN(R,V,O,I),We=new xN(R,W,A),me=new fN(N),ue=new FU(v,w,U,G,W,Lt,me),le=new sF(v,N),Me=new zU,Be=new $U(G),Ve=new aN(v,w,U,C,$,d,l),Te=new jU(v,$,W),q=new rF(R,I,W,C),Se=new cN(R,G,I),Ze=new yN(R,G,I),I.programs=ue.programs,v.capabilities=W,v.extensions=G,v.properties=N,v.renderLists=Me,v.shadowMap=Te,v.state=C,v.info=I}Pe();const oe=new nF(v,R);this.xr=oe,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const D=G.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=G.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(D){D!==void 0&&(Z=D,this.setSize(K,Q,!1))},this.getSize=function(D){return D.set(K,Q)},this.setSize=function(D,j,ne=!0){if(oe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}K=D,Q=j,t.width=Math.floor(D*Z),t.height=Math.floor(j*Z),ne===!0&&(t.style.width=D+"px",t.style.height=j+"px"),this.setViewport(0,0,D,j)},this.getDrawingBufferSize=function(D){return D.set(K*Z,Q*Z).floor()},this.setDrawingBufferSize=function(D,j,ne){K=D,Q=j,Z=ne,t.width=Math.floor(D*ne),t.height=Math.floor(j*ne),this.setViewport(0,0,D,j)},this.getCurrentViewport=function(D){return D.copy(L)},this.getViewport=function(D){return D.copy(se)},this.setViewport=function(D,j,ne,ie){D.isVector4?se.set(D.x,D.y,D.z,D.w):se.set(D,j,ne,ie),C.viewport(L.copy(se).multiplyScalar(Z).round())},this.getScissor=function(D){return D.copy(ye)},this.setScissor=function(D,j,ne,ie){D.isVector4?ye.set(D.x,D.y,D.z,D.w):ye.set(D,j,ne,ie),C.scissor(F.copy(ye).multiplyScalar(Z).round())},this.getScissorTest=function(){return He},this.setScissorTest=function(D){C.setScissorTest(He=D)},this.setOpaqueSort=function(D){de=D},this.setTransparentSort=function(D){be=D},this.getClearColor=function(D){return D.copy(Ve.getClearColor())},this.setClearColor=function(){Ve.setClearColor(...arguments)},this.getClearAlpha=function(){return Ve.getClearAlpha()},this.setClearAlpha=function(){Ve.setClearAlpha(...arguments)},this.clear=function(D=!0,j=!0,ne=!0){let ie=0;if(D){let J=!1;if(P!==null){const ve=P.texture.format;J=ve===cd||ve===ld||ve===Nc}if(J){const ve=P.texture.type,Re=ve===ns||ve===Ns||ve===ya||ve===ba||ve===rd||ve===od,Oe=Ve.getClearColor(),Fe=Ve.getClearAlpha(),Je=Oe.r,Ke=Oe.g,Ge=Oe.b;Re?(p[0]=Je,p[1]=Ke,p[2]=Ge,p[3]=Fe,R.clearBufferuiv(R.COLOR,0,p)):(_[0]=Je,_[1]=Ke,_[2]=Ge,_[3]=Fe,R.clearBufferiv(R.COLOR,0,_))}else ie|=R.COLOR_BUFFER_BIT}j&&(ie|=R.DEPTH_BUFFER_BIT),ne&&(ie|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.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",pe,!1),t.removeEventListener("webglcontextrestored",Le,!1),t.removeEventListener("webglcontextcreationerror",Ie,!1),Ve.dispose(),Me.dispose(),Be.dispose(),N.dispose(),w.dispose(),U.dispose(),$.dispose(),Lt.dispose(),q.dispose(),ue.dispose(),oe.dispose(),oe.removeEventListener("sessionstart",iv),oe.removeEventListener("sessionend",sv),Ir.stop()};function pe(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),E=!0}function Le(){console.log("THREE.WebGLRenderer: Context Restored."),E=!1;const D=I.autoReset,j=Te.enabled,ne=Te.autoUpdate,ie=Te.needsUpdate,J=Te.type;Pe(),I.autoReset=D,Te.enabled=j,Te.autoUpdate=ne,Te.needsUpdate=ie,Te.type=J}function Ie(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function rt(D){const j=D.target;j.removeEventListener("dispose",rt),Vt(j)}function Vt(D){yn(D),N.remove(D)}function yn(D){const j=N.get(D).programs;j!==void 0&&(j.forEach(function(ne){ue.releaseProgram(ne)}),D.isShaderMaterial&&ue.releaseShaderCache(D))}this.renderBufferDirect=function(D,j,ne,ie,J,ve){j===null&&(j=Ue);const Re=J.isMesh&&J.matrixWorld.determinant()<0,Oe=kA(D,j,ne,ie,J);C.setMaterial(ie,Re);let Fe=ne.index,Je=1;if(ie.wireframe===!0){if(Fe=V.getWireframeAttribute(ne),Fe===void 0)return;Je=2}const Ke=ne.drawRange,Ge=ne.attributes.position;let pt=Ke.start*Je,bt=(Ke.start+Ke.count)*Je;ve!==null&&(pt=Math.max(pt,ve.start*Je),bt=Math.min(bt,(ve.start+ve.count)*Je)),Fe!==null?(pt=Math.max(pt,0),bt=Math.min(bt,Fe.count)):Ge!=null&&(pt=Math.max(pt,0),bt=Math.min(bt,Ge.count));const qt=bt-pt;if(qt<0||qt===1/0)return;Lt.setup(J,ie,Oe,ne,Fe);let Ht,_t=Se;if(Fe!==null&&(Ht=O.get(Fe),_t=Ze,_t.setIndex(Ht)),J.isMesh)ie.wireframe===!0?(C.setLineWidth(ie.wireframeLinewidth*z()),_t.setMode(R.LINES)):_t.setMode(R.TRIANGLES);else if(J.isLine){let Xe=ie.linewidth;Xe===void 0&&(Xe=1),C.setLineWidth(Xe*z()),J.isLineSegments?_t.setMode(R.LINES):J.isLineLoop?_t.setMode(R.LINE_LOOP):_t.setMode(R.LINE_STRIP)}else J.isPoints?_t.setMode(R.POINTS):J.isSprite&&_t.setMode(R.TRIANGLES);if(J.isBatchedMesh)if(J._multiDrawInstances!==null)xf("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),_t.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))_t.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else{const Xe=J._multiDrawStarts,hn=J._multiDrawCounts,xt=J._multiDrawCount,wi=Fe?O.get(Fe).bytesPerElement:1,Do=N.get(ie).currentProgram.getUniforms();for(let ti=0;ti{function ve(){if(ie.forEach(function(Re){N.get(Re).currentProgram.isReady()&&ie.delete(Re)}),ie.size===0){J(D);return}setTimeout(ve,10)}G.get("KHR_parallel_shader_compile")!==null?ve():setTimeout(ve,10)})};let Ti=null;function os(D){Ti&&Ti(D)}function iv(){Ir.stop()}function sv(){Ir.start()}const Ir=new nT;Ir.setAnimationLoop(os),typeof self<"u"&&Ir.setContext(self),this.setAnimationLoop=function(D){Ti=D,oe.setAnimationLoop(D),D===null?Ir.stop():Ir.start()},oe.addEventListener("sessionstart",iv),oe.addEventListener("sessionend",sv),this.render=function(D,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;if(D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),oe.enabled===!0&&oe.isPresenting===!0&&(oe.cameraAutoUpdate===!0&&oe.updateCamera(j),j=oe.getCamera()),D.isScene===!0&&D.onBeforeRender(v,D,j,P),m=Be.get(D,b.length),m.init(j),b.push(m),ae.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),re.setFromProjectionMatrix(ae),xe=this.localClippingEnabled,ge=me.init(this.clippingPlanes,xe),g=Me.get(D,y.length),g.init(),y.push(g),oe.enabled===!0&&oe.isPresenting===!0){const ve=v.xr.getDepthSensingMesh();ve!==null&&rp(ve,j,-1/0,v.sortObjects)}rp(D,j,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(de,be),k=oe.enabled===!1||oe.isPresenting===!1||oe.hasDepthSensing()===!1,k&&Ve.addToRenderList(g,D),this.info.render.frame++,ge===!0&&me.beginShadows();const ne=m.state.shadowsArray;Te.render(ne,D,j),ge===!0&&me.endShadows(),this.info.autoReset===!0&&this.info.reset();const ie=g.opaque,J=g.transmissive;if(m.setupLights(),j.isArrayCamera){const ve=j.cameras;if(J.length>0)for(let Re=0,Oe=ve.length;Re0&&ov(ie,J,D,j),k&&Ve.render(D),rv(g,D,j);P!==null&&S===0&&(A.updateMultisampleRenderTarget(P),A.updateRenderTargetMipmap(P)),D.isScene===!0&&D.onAfterRender(v,D,j),Lt.resetDefaultState(),x=-1,M=null,b.pop(),b.length>0?(m=b[b.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 rp(D,j,ne,ie){if(D.visible===!1)return;if(D.layers.test(j.layers)){if(D.isGroup)ne=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(j);else if(D.isLight)m.pushLight(D),D.castShadow&&m.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||re.intersectsSprite(D)){ie&&ce.setFromMatrixPosition(D.matrixWorld).applyMatrix4(ae);const Re=$.update(D),Oe=D.material;Oe.visible&&g.push(D,Re,Oe,ne,ce.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||re.intersectsObject(D))){const Re=$.update(D),Oe=D.material;if(ie&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),ce.copy(D.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),ce.copy(Re.boundingSphere.center)),ce.applyMatrix4(D.matrixWorld).applyMatrix4(ae)),Array.isArray(Oe)){const Fe=Re.groups;for(let Je=0,Ke=Fe.length;Je0&&eu(J,j,ne),ve.length>0&&eu(ve,j,ne),Re.length>0&&eu(Re,j,ne),C.buffers.depth.setTest(!0),C.buffers.depth.setMask(!0),C.buffers.color.setMask(!0),C.setPolygonOffset(!1)}function ov(D,j,ne,ie){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[ie.id]===void 0&&(m.state.transmissionRenderTarget[ie.id]=new is(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?Ua:ns,minFilter:ji,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ft.workingColorSpace}));const ve=m.state.transmissionRenderTarget[ie.id],Re=ie.viewport||L;ve.setSize(Re.z*v.transmissionResolutionScale,Re.w*v.transmissionResolutionScale);const Oe=v.getRenderTarget();v.setRenderTarget(ve),v.getClearColor(Y),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),k&&Ve.render(ne);const Fe=v.toneMapping;v.toneMapping=Zi;const Je=ie.viewport;if(ie.viewport!==void 0&&(ie.viewport=void 0),m.setupLightsView(ie),ge===!0&&me.setGlobalState(v.clippingPlanes,ie),eu(D,ne,ie),A.updateMultisampleRenderTarget(ve),A.updateRenderTargetMipmap(ve),G.has("WEBGL_multisampled_render_to_texture")===!1){let Ke=!1;for(let Ge=0,pt=j.length;Ge0),Ge=!!ne.morphAttributes.position,pt=!!ne.morphAttributes.normal,bt=!!ne.morphAttributes.color;let qt=Zi;ie.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(qt=v.toneMapping);const Ht=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,_t=Ht!==void 0?Ht.length:0,Xe=N.get(ie),hn=m.state.lights;if(ge===!0&&(xe===!0||D!==M)){const Cn=D===M&&ie.id===x;me.setState(ie,D,Cn)}let xt=!1;ie.version===Xe.__version?(Xe.needsLights&&Xe.lightsStateVersion!==hn.state.version||Xe.outputColorSpace!==Oe||J.isBatchedMesh&&Xe.batching===!1||!J.isBatchedMesh&&Xe.batching===!0||J.isBatchedMesh&&Xe.batchingColor===!0&&J.colorTexture===null||J.isBatchedMesh&&Xe.batchingColor===!1&&J.colorTexture!==null||J.isInstancedMesh&&Xe.instancing===!1||!J.isInstancedMesh&&Xe.instancing===!0||J.isSkinnedMesh&&Xe.skinning===!1||!J.isSkinnedMesh&&Xe.skinning===!0||J.isInstancedMesh&&Xe.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&Xe.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&Xe.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&Xe.instancingMorph===!1&&J.morphTexture!==null||Xe.envMap!==Fe||ie.fog===!0&&Xe.fog!==ve||Xe.numClippingPlanes!==void 0&&(Xe.numClippingPlanes!==me.numPlanes||Xe.numIntersection!==me.numIntersection)||Xe.vertexAlphas!==Je||Xe.vertexTangents!==Ke||Xe.morphTargets!==Ge||Xe.morphNormals!==pt||Xe.morphColors!==bt||Xe.toneMapping!==qt||Xe.morphTargetsCount!==_t)&&(xt=!0):(xt=!0,Xe.__version=ie.version);let wi=Xe.currentProgram;xt===!0&&(wi=tu(ie,j,J));let Do=!1,ti=!1,Xa=!1;const Nt=wi.getUniforms(),ci=Xe.uniforms;if(C.useProgram(wi.program)&&(Do=!0,ti=!0,Xa=!0),ie.id!==x&&(x=ie.id,ti=!0),Do||M!==D){C.buffers.depth.getReversed()?(X.copy(D.projectionMatrix),q3(X),Y3(X),Nt.setValue(R,"projectionMatrix",X)):Nt.setValue(R,"projectionMatrix",D.projectionMatrix),Nt.setValue(R,"viewMatrix",D.matrixWorldInverse);const Wn=Nt.map.cameraPosition;Wn!==void 0&&Wn.setValue(R,fe.setFromMatrixPosition(D.matrixWorld)),W.logarithmicDepthBuffer&&Nt.setValue(R,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Nt.setValue(R,"isOrthographic",D.isOrthographicCamera===!0),M!==D&&(M=D,ti=!0,Xa=!0)}if(J.isSkinnedMesh){Nt.setOptional(R,J,"bindMatrix"),Nt.setOptional(R,J,"bindMatrixInverse");const Cn=J.skeleton;Cn&&(Cn.boneTexture===null&&Cn.computeBoneTexture(),Nt.setValue(R,"boneTexture",Cn.boneTexture,A))}J.isBatchedMesh&&(Nt.setOptional(R,J,"batchingTexture"),Nt.setValue(R,"batchingTexture",J._matricesTexture,A),Nt.setOptional(R,J,"batchingIdTexture"),Nt.setValue(R,"batchingIdTexture",J._indirectTexture,A),Nt.setOptional(R,J,"batchingColorTexture"),J._colorsTexture!==null&&Nt.setValue(R,"batchingColorTexture",J._colorsTexture,A));const ui=ne.morphAttributes;if((ui.position!==void 0||ui.normal!==void 0||ui.color!==void 0)&&We.update(J,ne,wi),(ti||Xe.receiveShadow!==J.receiveShadow)&&(Xe.receiveShadow=J.receiveShadow,Nt.setValue(R,"receiveShadow",J.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(ci.envMap.value=Fe,ci.flipEnvMap.value=Fe.isCubeTexture&&Fe.isRenderTargetTexture===!1?-1:1),ie.isMeshStandardMaterial&&ie.envMap===null&&j.environment!==null&&(ci.envMapIntensity.value=j.environmentIntensity),ti&&(Nt.setValue(R,"toneMappingExposure",v.toneMappingExposure),Xe.needsLights&&BA(ci,Xa),ve&&ie.fog===!0&&le.refreshFogUniforms(ci,ve),le.refreshMaterialUniforms(ci,ie,Z,Q,m.state.transmissionRenderTarget[D.id]),Sf.upload(R,lv(Xe),ci,A)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Sf.upload(R,lv(Xe),ci,A),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Nt.setValue(R,"center",J.center),Nt.setValue(R,"modelViewMatrix",J.modelViewMatrix),Nt.setValue(R,"normalMatrix",J.normalMatrix),Nt.setValue(R,"modelMatrix",J.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const Cn=ie.uniformsGroups;for(let Wn=0,op=Cn.length;Wn0&&A.useMultisampledRTT(D)===!1?J=N.get(D).__webglMultisampledFramebuffer:Array.isArray(Ke)?J=Ke[ne]:J=Ke,L.copy(D.viewport),F.copy(D.scissor),H=D.scissorTest}else L.copy(se).multiplyScalar(Z).floor(),F.copy(ye).multiplyScalar(Z).floor(),H=He;if(ne!==0&&(J=VA),C.bindFramebuffer(R.FRAMEBUFFER,J)&&ie&&C.drawBuffers(D,J),C.viewport(L),C.scissor(F),C.setScissorTest(H),ve){const Fe=N.get(D.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+j,Fe.__webglTexture,ne)}else if(Re){const Fe=N.get(D.texture),Je=j;R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,Fe.__webglTexture,ne,Je)}else if(D!==null&&ne!==0){const Fe=N.get(D.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Fe.__webglTexture,ne)}x=-1},this.readRenderTargetPixels=function(D,j,ne,ie,J,ve,Re){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Oe=N.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Re!==void 0&&(Oe=Oe[Re]),Oe){C.bindFramebuffer(R.FRAMEBUFFER,Oe);try{const Fe=D.texture,Je=Fe.format,Ke=Fe.type;if(!W.textureFormatReadable(Je)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!W.textureTypeReadable(Ke)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=D.width-ie&&ne>=0&&ne<=D.height-J&&R.readPixels(j,ne,ie,J,tt.convert(Je),tt.convert(Ke),ve)}finally{const Fe=P!==null?N.get(P).__webglFramebuffer:null;C.bindFramebuffer(R.FRAMEBUFFER,Fe)}}},this.readRenderTargetPixelsAsync=async function(D,j,ne,ie,J,ve,Re){if(!(D&&D.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Oe=N.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Re!==void 0&&(Oe=Oe[Re]),Oe)if(j>=0&&j<=D.width-ie&&ne>=0&&ne<=D.height-J){C.bindFramebuffer(R.FRAMEBUFFER,Oe);const Fe=D.texture,Je=Fe.format,Ke=Fe.type;if(!W.textureFormatReadable(Je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!W.textureTypeReadable(Ke))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ge=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,Ge),R.bufferData(R.PIXEL_PACK_BUFFER,ve.byteLength,R.STREAM_READ),R.readPixels(j,ne,ie,J,tt.convert(Je),tt.convert(Ke),0);const pt=P!==null?N.get(P).__webglFramebuffer:null;C.bindFramebuffer(R.FRAMEBUFFER,pt);const bt=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await $3(R,bt,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,Ge),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,ve),R.deleteBuffer(Ge),R.deleteSync(bt),ve}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(D,j=null,ne=0){const ie=Math.pow(2,-ne),J=Math.floor(D.image.width*ie),ve=Math.floor(D.image.height*ie),Re=j!==null?j.x:0,Oe=j!==null?j.y:0;A.setTexture2D(D,0),R.copyTexSubImage2D(R.TEXTURE_2D,ne,0,0,Re,Oe,J,ve),C.unbindTexture()};const HA=R.createFramebuffer(),GA=R.createFramebuffer();this.copyTextureToTexture=function(D,j,ne=null,ie=null,J=0,ve=null){ve===null&&(J!==0?(xf("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ve=J,J=0):ve=0);let Re,Oe,Fe,Je,Ke,Ge,pt,bt,qt;const Ht=D.isCompressedTexture?D.mipmaps[ve]:D.image;if(ne!==null)Re=ne.max.x-ne.min.x,Oe=ne.max.y-ne.min.y,Fe=ne.isBox3?ne.max.z-ne.min.z:1,Je=ne.min.x,Ke=ne.min.y,Ge=ne.isBox3?ne.min.z:0;else{const ui=Math.pow(2,-J);Re=Math.floor(Ht.width*ui),Oe=Math.floor(Ht.height*ui),D.isDataArrayTexture?Fe=Ht.depth:D.isData3DTexture?Fe=Math.floor(Ht.depth*ui):Fe=1,Je=0,Ke=0,Ge=0}ie!==null?(pt=ie.x,bt=ie.y,qt=ie.z):(pt=0,bt=0,qt=0);const _t=tt.convert(j.format),Xe=tt.convert(j.type);let hn;j.isData3DTexture?(A.setTexture3D(j,0),hn=R.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(A.setTexture2DArray(j,0),hn=R.TEXTURE_2D_ARRAY):(A.setTexture2D(j,0),hn=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,j.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,j.unpackAlignment);const xt=R.getParameter(R.UNPACK_ROW_LENGTH),wi=R.getParameter(R.UNPACK_IMAGE_HEIGHT),Do=R.getParameter(R.UNPACK_SKIP_PIXELS),ti=R.getParameter(R.UNPACK_SKIP_ROWS),Xa=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,Ht.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,Ht.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Je),R.pixelStorei(R.UNPACK_SKIP_ROWS,Ke),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Ge);const Nt=D.isDataArrayTexture||D.isData3DTexture,ci=j.isDataArrayTexture||j.isData3DTexture;if(D.isDepthTexture){const ui=N.get(D),Cn=N.get(j),Wn=N.get(ui.__renderTarget),op=N.get(Cn.__renderTarget);C.bindFramebuffer(R.READ_FRAMEBUFFER,Wn.__webglFramebuffer),C.bindFramebuffer(R.DRAW_FRAMEBUFFER,op.__webglFramebuffer);for(let Lr=0;Lr{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return vr(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const rm=new WeakMap,aF=(...n)=>{var e;const t=n[0],i=(e=wn())==null?void 0:e.proxy;if(i==null&&!Cc())throw new Error("injectLocal must be called in setup");return i&&rm.has(i)&&t in rm.get(i)?rm.get(i)[t]:mn(...n)},Sg=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const lF=n=>typeof n<"u",cF=n=>n!=null,uF=Object.prototype.toString,fF=n=>uF.call(n)==="[object Object]",Eg=()=>{};function hF(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 dF(n,e={}){let t,i,s=Eg;const r=l=>{clearTimeout(l),s(),s=Eg};let o;return l=>{const c=it(n),u=it(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 Db(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function pF(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function mF(n){return wn()}function Il(n){return Array.isArray(n)?n:[n]}function gF(n,e=200,t={}){return hF(dF(e,t),n)}function Ob(n,e=200,t={}){const i=et(n.value),s=gF(()=>{i.value=n.value},e,t);return $e(n,()=>s()),i}function _F(n,e={}){if(!Pt(n))return aS(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=S0(()=>({get(){return n.value[i]},set(s){var r;if((r=it(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 dn=it;function S_(n,e=!0,t){mF()?Hn(n,t):e?n():Sr(n)}function vF(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t;let r=null;const o=De(!1);function a(){r&&(clearInterval(r),r=null)}function l(){o.value=!1,a()}function c(){const u=it(e);u<=0||(o.value=!0,s&&n(),a(),o.value&&(r=setInterval(n,u)))}if(i&&Sg&&c(),Pt(e)||typeof e=="function"){const u=$e(e,()=>{o.value&&Sg&&c()});vr(u)}return vr(l),{isActive:o,pause:l,resume:c}}function lT(n,e,t){return $e(n,e,{...t,immediate:!0})}const zs=Sg?window:void 0;function Di(n){var e;const t=it(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Eo(...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=Ee(()=>{const a=Il(it(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=lT(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Di(c)))!=null?l:[zs].filter(c=>c!=null),Il(it(s.value?n[1]:n[0])),Il(Ot(s.value?n[2]:n[1])),it(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=fF(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 vr(t),o}function yF(){const n=De(!1),e=wn();return e&&Hn(()=>{n.value=!0},e),n}function Fd(n){const e=yF();return Ee(()=>(e.value,!!n()))}function bF(n,e,t={}){const{window:i=zs,...s}=t;let r;const o=Fd(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const h=it(n),d=Il(h).map(Di).filter(cF);return new Set(d)}),c=$e(()=>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 vr(f),{isSupported:o,stop:f,takeRecords:u}}function E_(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:s=zs,once:r=!1}=e,o=De(!1),a=Ee(()=>i?1e3/it(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=De(typeof i=="number"),o=De(),a=De(!1),l=c=>{a.value=c.matches};return Rc(()=>{if(r.value){r.value=!s.value;const c=it(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>=Db(h[1])),d&&p&&(p=i<=Db(d[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(it(n)),a.value=o.value.matches)}),Eo(o,"change",l,{passive:!0}),Ee(()=>a.value)}function SF(n){return JSON.parse(JSON.stringify(n))}function EF(n={}){const{window:e=zs}=n,t=De(1),i=cT(()=>`(resolution: ${t.value}dppx)`,n);let s=Eg;return e&&(s=lT(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:xi(t),stop:s}}function uT(n,e,t={}){const{window:i=zs,...s}=t;let r;const o=Fd(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const f=it(n);return Array.isArray(f)?f.map(h=>Di(h)):[Di(f)]}),c=$e(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 vr(u),{isSupported:o,stop:u}}function TF(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=De(0),l=De(0),c=De(0),u=De(0),f=De(0),h=De(0),d=De(0),p=De(0);function _(){const m=Di(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 uT(n,g),$e(()=>Di(n),m=>!m&&g()),bF(n,g,{attributeFilter:["style","class"]}),s&&Eo("scroll",g,{capture:!0,passive:!0}),i&&Eo("resize",g,{passive:!0}),S_(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function wF(n,e={width:0,height:0},t={}){const{window:i=zs,box:s="content-box"}=t,r=Ee(()=>{var f,h;return(h=(f=Di(n))==null?void 0:f.namespaceURI)==null?void 0:h.includes("svg")}),o=De(e.width),a=De(e.height),{stop:l}=uT(n,([f])=>{const h=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&r.value){const d=Di(n);if(d){const p=d.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(h){const d=Il(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);S_(()=>{const f=Di(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=$e(()=>Di(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 AF(n){var e;const t=De(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 E_(()=>{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 CF(n={}){const e=et(),t=Fd(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;vF(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const fT={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},RF=Object.keys(fT);function PF(n={}){const{target:e=zs}=n,t=De(!1),i=et(n.initialValue||{});Object.assign(i.value,fT,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=pF(r,RF,!1))};if(e){const r={passive:!0};Eo(e,["pointerdown","pointermove","pointerup"],s,r),Eo(e,"pointerleave",()=>t.value=!1,r)}return{..._F(i),isInside:t}}function hG(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=wn(),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=b=>a?typeof a=="function"?a(b):SF(b):b,m=()=>lF(n[e])?g(n[e]):f,y=b=>{h?h(b)&&p(_,b):p(_,b)};if(l){const b=m(),v=et(b);let E=!1;return $e(()=>n[e],T=>{E||(E=!0,v.value=g(T),Sr(()=>E=!1))}),$e(v,T=>{!E&&(T!==n[e]||u)&&y(T)},{deep:u}),v}else return Ee({get(){return m()},set(b){y(b)}})}function IF(n={}){const{window:e=zs,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=De(t),l=De(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(),S_(c);const u={passive:!0};if(Eo("resize",c,u),e&&o==="visual"&&e.visualViewport&&Eo(e.visualViewport,"resize",c,u),s){const f=cT("(orientation: portrait)");$e(f,()=>c())}return{width:a,height:l}}var LF=Object.defineProperty,DF=(n,e,t)=>e in n?LF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Nb=(n,e,t)=>DF(n,typeof e!="symbol"?e+"":e,t);const OF="@tresjs/core",NF="module",UF="4.3.3",FF="pnpm@9.15.5",kF="Declarative ThreeJS using Vue Components",BF="Alvaro Saburido (https://github.com/alvarosabu/)",zF="MIT",VF={type:"git",url:"git+https://github.com/Tresjs/tres.git"},HF=["vue","3d","threejs","three","threejs-vue"],GF=!1,WF={".":{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"},"./*":"./*"},XF="./dist/tres.js",$F="./dist/tres.js",qF="./dist/index.d.ts",YF=["*.d.ts","dist"],jF={access:"public"},KF={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"},ZF={three:">=0.133",vue:">=3.4"},JF={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},QF={"@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"},ek={name:OF,type:NF,version:UF,packageManager:FF,description:kF,author:BF,license:zF,repository:VF,keywords:HF,sideEffects:GF,exports:WF,main:XF,module:$F,types:qF,files:YF,publishConfig:jF,scripts:KF,peerDependencies:ZF,dependencies:JF,devDependencies:QF};class tk extends $t{constructor(...e){super(...e),Nb(this,"type","HightlightMesh"),Nb(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 Tg(n){return typeof n>"u"}function wh(n){return Array.isArray(n)}function nk(n){return typeof n=="number"}function hT(n){return typeof n=="string"}function so(n){return typeof n=="function"}function Vs(n){return n===Object(n)&&!wh(n)&&!so(n)}function cr(n){return Vs(n)&&"isObject3D"in n&&!!n.isObject3D}function Ub(n){return Vs(n)&&"isCamera"in n&&!!n.isCamera}function ik(n){return Vs(n)&&"isBufferGeometry"in n&&!!n.isBufferGeometry}function sk(n){return Vs(n)&&"isMaterial"in n&&!!n.isMaterial}function rk(n){return Vs(n)&&"isLight"in n&&!!n.isLight}function ok(n){return Vs(n)&&"isFog"in n&&!!n.isFog}function ak(n){return Vs(n)&&"isScene"in n&&!!n.isScene}function Qu(n){return cr(n)||ik(n)||sk(n)||ok(n)}function lk(n){return Vs(n)&&!!n.isPrimitive}const dT=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],dT(n[t],e[t]));return Object.assign(n||{},e),n},ck="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",uk=dk(ck);function Fb(n){return n&&n.nodeType===1}function ef(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const fk=/\B([A-Z])/g;function hk(n){return n.replace(fk,"-$1").toLowerCase()}function dk(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const kb=(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)},pk=(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 pT(n,e){if(Fb(n)&&Fb(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)||!pT(n[s],e[s]))return!1;return!0}function mk(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;lmT(i)),!(n instanceof gd)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(s=>Bb(s)):i.material&&Bb(i.material)}}function yk(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const Vb=/-\d+$/;function bk(n,e,t){if(hT(t)){if(Vb.test(t)){const r=t.replace(Vb,""),{target:o,key:a}=wg(n,r);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>Tg(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:s}=wg(n,t);e.__tres.previousAttach=i[s],i[s]=Aa(e)}else e.__tres.previousAttach=t(n,e)}function xk(n,e,t){var i,s,r;if(hT(t)){const{target:o,key:a}=wg(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 to(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 gT(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 Mk(n,e,t){var i;if(!so(n.setPixelRatio))return;let s=0;if(t&&wh(t)){const r=t;if(r.length>=2){const[o,a]=r;s=K0.clamp(e,o,a)}}else nk(t)?s=t:s=e;s!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(s)}function Sk(n,e,t,i,s){const r=[...e.__tres.objects],o=Aa(e);if(n=Aa(n),o===n)return!0;const a=to(n,e.__tres??{},s),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of r)_T(u,s),vT(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 Aa(n){return lk(n)?(n.object.__tres=n.__tres,n.object):n}function _T(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&&yk(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?xk(o,n,n.__tres.attach):((r=(s=n.parent)==null?void 0:s.remove)==null||r.call(s,Aa(n)),n.parent=null)}function vT(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),gT(n)}const Ek=({sizes:n})=>{const e=et([]),t=Ee(()=>e.value[0]),i=o=>{const a=o instanceof Fc?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(Ub(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},r=o=>{if(Ub(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return Rc(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof Kt||Tk(o))&&(o instanceof Kt?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())})}),ts(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:s,deregisterCamera:r,setCameraActive:i}};function Tk(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Ah="[TresJS ▲ ■ ●] ";function wk(...n){typeof n[0]=="string"?n[0]=Ah+n[0]:n.unshift(Ah),console.error(...n)}function Ak(...n){typeof n[0]=="string"?n[0]=Ah+n[0]:n.unshift(Ah),console.warn(...n)}function Ck(n,e){}function yT(){return{logError:wk,logWarning:Ak,logMessage:Ck}}const Ag=et({}),Cg=n=>Object.assign(Ag.value,n);function om(){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 vr(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 Rk(){let n=!0,e=!0,t=!1;const i=new Nd(!1),s=et(i.running),r=et(!1);let o;const a=K0.generateUUID();let l=null;const c=om(),u=om(),f=om();T();let h={};function d(S){h=S}function p(S,P,x=0){switch(P){case"before":return c.on(S,x);case"render":return l||(l=S),u.dispose(),u.on(S);case"after":return f.on(S,x)}}function _(){e&&(e=!1,T(),E())}function g(){e=!0,T(),cancelAnimationFrame(o)}function m(){t=!1,T()}function y(){t=!0,T()}function b(){r.value=!0}function v(){r.value=!1}function E(){if(!n){o=requestAnimationFrame(E);return}const S=i.getDelta(),P=i.getElapsedTime(),x={camera:Ot(h.camera),scene:Ot(h.scene),renderer:Ot(h.renderer),raycaster:Ot(h.raycaster),controls:Ot(h.controls),invalidate:h.invalidate,advance:h.advance},M={delta:S,elapsed:P,clock:i,...x};s.value&&c.trigger(M),r.value||(u.count?u.trigger(M):l&&l(M)),s.value&&f.trigger(M),o=requestAnimationFrame(E)}function T(){const S=!e&&!t;i.running!==S&&(i.running?i.stop():i.start()),s.value=i.running}return{loopId:a,register:(S,P,x)=>p(S,P,x),start:_,stop:g,pause:y,resume:m,pauseRender:b,resumeRender:v,isRenderPaused:r,isActive:s,setContext:d,setReady:S=>n=S}}function T_(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 Pk(n){return(n/1024).toFixed(2)}const Ik=Number.parseInt(Dc.replace("dev",""));function Lk(n){return n instanceof Ce?n:Array.isArray(n)?new Ce(...n):new Ce(n)}const tf={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Nn,toneMapping:nd,toneMappingExposure:3,shadowMap:{enabled:!0,type:U0}},flat:{toneMapping:Zi,toneMappingExposure:1}};function Dk({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:s,advance:r}}){const o=Ee(()=>({alpha:dn(e.alpha)??!0,depth:dn(e.depth),canvas:Di(n),context:dn(e.context),stencil:dn(e.stencil),antialias:dn(e.antialias)??!0,precision:dn(e.precision),powerPreference:dn(e.powerPreference),premultipliedAlpha:dn(e.premultipliedAlpha),preserveDrawingBuffer:dn(e.preserveDrawingBuffer),logarithmicDepthBuffer:dn(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:dn(e.failIfMajorPerformanceCaveat)})),a=De(new Ef(o.value));function l(){e.renderMode==="on-demand"&&s()}$e(o,()=>{a.value.dispose(),a.value=new Ef(o.value),l()}),$e([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),$e(()=>e.clearColor,l);const{pixelRatio:c}=EF(),{logError:u}=yT(),f=(()=>{const d=new Ef,p={shadowMap:{enabled:d.shadowMap.enabled,type:d.shadowMap.type},toneMapping:d.toneMapping,toneMappingExposure:d.toneMappingExposure,outputColorSpace:d.outputColorSpace};return d.dispose(),p})(),h=dn(e.renderMode);return h==="on-demand"&&s(),h==="manual"&&setTimeout(()=>{r()},100),Rc(()=>{const d=dn(e.preset);d&&(d in tf||u(`Renderer Preset must be one of these: ${Object.keys(tf).join(", ")}`),dT(a.value,tf[d])),Mk(a.value,c.value,dn(e.dpr)),h==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,y)=>{const b=dn(m),v=()=>{if(d)return kb(tf[d],y)};if(b!==void 0)return b;const E=v();return E!==void 0?E:kb(f,y)},_=(m,y)=>pk(a.value,y,p(m,y));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??nd,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),Ik<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?Lk(g):new Ce(0))}),ts(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function Ok(n,e,t=10){const i=dn(n)?IF():wF(Ee(()=>dn(e).parentElement)),s=xi(Ob(i.width,t)),r=xi(Ob(i.height,t)),o=Ee(()=>s.value/r.value);return{height:r,width:s,aspectRatio:o}}const Nk=(n,e)=>{const t=Ee(()=>e.renderer.value.domElement),i=De([]),{x:s,y:r}=PF({target:t});let o=0;const{width:a,height:l,top:c,left:u}=TF(t),f=({x:se,y:ye})=>{if(t.value)return{x:(se-u.value)/a.value*2-1,y:-((ye-c.value)/l.value)*2+1}},h=({x:se,y:ye})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new he(se,ye),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},d=se=>{const ye=f({x:(se==null?void 0:se.clientX)??s.value,y:(se==null?void 0:se.clientY)??r.value});return ye?h(ye)||[]:[]},p=pi(),_=pi(),g=pi(),m=pi(),y=pi(),b=pi(),v=pi(),E=pi();function T(se){const ye={};for(const He in se)typeof He!="function"&&(ye[He]=se[He]);return ye}const S=(se,ye)=>{var He,re,ge;const xe=T(ye),X=new B(ye==null?void 0:ye.clientX,ye==null?void 0:ye.clientY,0).unproject((He=e.camera)==null?void 0:He.value);se.trigger({...xe,intersections:i.value,unprojectedPoint:X,ray:(re=e.raycaster)==null?void 0:re.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:ye,delta:o,stopPropagating:!1})};let P;const x=se=>{d(se),S(g,se),P=se},M=()=>{P&&x(P)};let L,F,H;const Y=se=>{var ye;L=(ye=i.value[0])==null?void 0:ye.object,o=0,F=new he((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),S(y,se)};let ee,K=!1;const Q=se=>{var ye,He,re;se instanceof PointerEvent&&(i.value.length===0&&S(b,se),L===((ye=i.value[0])==null?void 0:ye.object)&&(H=new he((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),o=F==null?void 0:F.distanceTo(H),se.button===0?(S(p,se),ee===((He=i.value[0])==null?void 0:He.object)?K=!0:(ee=(re=i.value[0])==null?void 0:re.object,K=!1)):se.button===2&&S(v,se)),S(m,se))},Z=se=>{K&&(S(_,se),ee=void 0,K=!1)},de=se=>S(g,se),be=se=>S(E,se);return t.value.addEventListener("pointerup",Q),t.value.addEventListener("pointerdown",Y),t.value.addEventListener("pointermove",x),t.value.addEventListener("pointerleave",de),t.value.addEventListener("dblclick",Z),t.value.addEventListener("wheel",be),ts(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",Q),t.value.removeEventListener("pointerdown",Y),t.value.removeEventListener("pointermove",x),t.value.removeEventListener("pointerleave",de),t.value.removeEventListener("dblclick",Z),t.value.removeEventListener("wheel",be))}),{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=>b.on(se).off,onWheel:se=>E.on(se).off,forceUpdate:M}};function am(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function Uk(n,e,t){var i;const s=De(),r=De();n&&(s.value=n),e&&(r.value=e);const o=x=>{var M;return((M=x.__tres)==null?void 0:M.eventCount)>0},a=x=>{var M;return((M=x.children)==null?void 0:M.some(L=>a(L)))||o(x)},l=De(((i=s.value)==null?void 0:i.children).filter(a)||[]);function c(x,M){const L=[],F=()=>M.stopPropagating=!0;M.stopPropagation=F;for(const H of M==null?void 0:M.intersections){if(M.stopPropagating)return;M={...M,...H};const{object:Y}=H;M.eventObject=Y,am(Y[x],M),L.push(Y);let ee=Y.parent;for(;ee!==null&&!M.stopPropagating&&!L.includes(ee);)M.eventObject=ee,am(ee[x],M),L.push(ee),ee=ee.parent;const K=hk(x.slice(2));t(K,{intersection:H,event:M})}}const{onClick:u,onDblClick:f,onContextMenu:h,onPointerMove:d,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:y}=Nk(l,e);_(x=>c("onPointerUp",x)),p(x=>c("onPointerDown",x)),u(x=>c("onClick",x)),f(x=>c("onDoubleClick",x)),h(x=>c("onContextMenu",x)),m(x=>c("onWheel",x));let b=[];d(x=>{const M=x.intersections.map(({object:F})=>F),L=x.intersections;b.forEach(({object:F})=>{M.includes(F)||(x.intersections=b,c("onPointerLeave",x),c("onPointerOut",x))}),x.intersections=L,x.intersections.forEach(({object:F})=>{b.includes(F)||(c("onPointerEnter",x),c("onPointerOver",x))}),c("onPointerMove",x),b=x.intersections});const v=[];g(x=>{const M=()=>x.stopPropagating=!0;x.stopPropagation=M,v.forEach(L=>{x.stopPropagating||(x.eventObject=L,am(L.onPointerMissed,x))}),t("pointer-missed",{event:x})});function E(x){Qu(x)&&cr(x)&&l.value.push(x)}function T(x){if(Qu(x)&&cr(x)){const M=l.value.indexOf(x);M>-1&&l.value.splice(M,1)}}function S(x){Qu(x)&&cr(x)&&x.onPointerMissed&&v.push(x)}function P(x){if(Qu(x)&&cr(x)){const M=v.indexOf(x);M>-1&&v.splice(M,1)}}return e.eventManager={forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:S,deregisterPointerMissedObject:P},{forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:S,deregisterPointerMissedObject:P}}function Fk(n,e,t=100){t=t<=0?100:t;const i=pi(),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 lm=new WeakMap;function kk(n){if(n=n||bT(),lm.has(n))return lm.get(n);const e=100,t=Date.now(),i=Fk(()=>{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 lm.set(n,i),i}function Bk({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:s}){const r=De(n),o=Ok(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=Ek({sizes:o}),h={mode:et(i.renderMode||"always"),priority:et(0),frames:et(0),maxFrames:60,canBeInvalidated:Ee(()=>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:_}=Dk({canvas:e,options:i,contextParts:{sizes:o,render:h,invalidate:d,advance:p}}),g={sizes:o,scene:r,camera:a,cameras:xi(l),renderer:_,raycaster:De(new eT),controls:et(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:h,advance:p,extend:Cg,invalidate:d,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:Rk()};fr("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}=kk(g);g.loop.setReady(!1),g.loop.start(),m(()=>{s("ready",g),g.loop.setReady(!0),Uk(n,g,s)}),ts(()=>{y(),g.loop.stop()});const b=100,v=AF({every:b}),{isSupported:E,memory:T}=CF({interval:b}),S=160;let P=performance.now();const x=({timestamp:H})=>{g.scene.value&&(g.perf.memory.allocatedMem=T_(g.scene.value)),H-P>=b&&(P=H,g.perf.fps.accumulator.push(v.value),g.perf.fps.accumulator.length>S&&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>S&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce((Y,ee)=>Y+ee,0)/g.perf.memory.accumulator.length))};let M=0;const L=1,{pause:F}=E_(({delta:H})=>{window.__TRES__DEVTOOLS__&&(x({timestamp:performance.now()}),M+=H,M>=L&&(window.__TRES__DEVTOOLS__.cb(g),M=0))},{immediate:!0});return ts(()=>{F()}),g}function bT(){const n=mn("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function dG(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:s,controls:r,invalidate:o,advance:a}=bT();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 zk=pi(),Vk=pi(),xT=pi(),Ll=new Nd;let Tf=0,wf=0;E_(()=>{zk.trigger({delta:Tf,elapsed:wf,clock:Ll}),Vk.trigger({delta:Tf,elapsed:wf,clock:Ll}),xT.trigger({delta:Tf,elapsed:wf,clock:Ll})},{immediate:!1});xT.on(()=>{Tf=Ll.getDelta(),wf=Ll.getElapsedTime()});function Hk(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:Hb}=yT(),Gb=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],Gk=n=>{const e=n.scene.value;function t(c,u,f,h){if(h||(h={}),h.args||(h.args=[]),c==="template"||uk(c))return null;let d=c.replace("Tres",""),p;if(c==="primitive"){(!Vs(h.object)||Pt(h.object))&&Hb("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),d=h.object.type;const _={};p=Hk(h.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,y,b)=>{Sk(g,y,b,{patchProp:r,remove:s,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=Ag.value[d];_||Hb(`${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=to(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:to(c,{},n),_=u.__tres?u:to(u,{},n);c=Aa(p),u=Aa(_),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?bk(_,p,p.__tres.attach):cr(c)&&cr(_)&&(_.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=Tg(u)?"default":u;const _=(d=c.__tres)==null?void 0:d.dispose;Tg(_)||(_===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)),_T(c,n),vT(c,n),m&&!ak(c)){if(so(u))u(c);else if(so(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),to(c,{attach:h},n),v&&i(c,v);return}if(u==="dispose"){c.__tres||(c=to(c,{},n)),c.__tres.dispose=h;return}if(cr(c)&&g==="blocks-pointer-events"){h||h===""?c[g]=h:delete c[g];return}Gb.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=ef(g),y=_==null?void 0:_[m];if(g==="args"){const v=c,E=f??[],T=h??[],S=((p=c.__tres)==null?void 0:p.type)||c.type;S&&E.length&&!mk(E,T)&&(_=Object.assign(v,new Ag.value[S](...h)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(ef(g),new Ct(...h));return}if(g.includes("-")&&y===void 0){const v=g.split("-");y=v.reduce((E,T)=>E[ef(T)],_),g=v.pop(),m=g,y!=null&&y.set||(_=v.reduce((E,T)=>E[ef(T)],_))}let b=h;if(b===""&&(b=!0),so(y)){Gb.includes(u)||(wh(b)?c[m](...b):c[m](b)),m.startsWith("on")&&so(b)&&(_[m]=b);return}!(y!=null&&y.set)&&!so(y)?_[m]=b:y.constructor===b.constructor&&y!=null&&y.copy?y==null||y.copy(b):wh(b)?y.set(...b):!y.isColor&&y.setScalar?y.setScalar(b):y.set(b),gT(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=to(new dt,{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 Wk(){return MT().__VUE_DEVTOOLS_GLOBAL_HOOK__}function MT(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Xk=typeof Proxy=="function",$k="devtools-plugin:setup",qk="plugin:settings:set";let ol,Rg;function Yk(){var n;return ol!==void 0||(typeof window<"u"&&window.performance?(ol=!0,Rg=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(ol=!0,Rg=globalThis.perf_hooks.performance):ol=!1),ol}function jk(){return Yk()?Rg.now():Date.now()}class Kk{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 jk()}},t&&t.on(qk,(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 Zk(n,e){const t=n,i=MT(),s=Wk(),r=Xk&&t.enableEarlyProxy;if(s&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))s.emit($k,n,e);else{const o=r?new Kk(t,s):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function Jk(n,e){const t=`▲ ■ ●${n}`;typeof Wb=="function"?Wb(t,e):console.log(t)}function Wb(n,e){throw new Error(n+e)}const ST=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=T_(n);return t>0&&e.tags.push({label:`${Pk(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(rk(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new Ce(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 ET(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const s=ST(i);e.children.push(s),ET(i,s,t)})}const Qk=[],al="tres:inspector",eB=bi({sceneGraph:null});function tB(n,e){Zk({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:Qk,app:n},t=>{typeof t.now!="function"&&Jk("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:al,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(al)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(r=>{if(r.inspectorId===al){const o=ST(e.scene.value);ET(e.scene.value,o,r.filter),eB.sceneGraph=o,r.rootNodes=[o]}});let i=null,s=null;t.on.getInspectorState(r=>{var o;if(r.inspectorId===al){const[a]=e.scene.value.getObjectsByProperty("uuid",r.nodeId);if(!a)return;if(s&&i&&i.parent&&s.remove(i),a.isMesh){const l=_k(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:T_(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===al&&gk(e.scene.value,r.nodeId,r.path,r.state.value)})})}const nB=["data-scene","data-tres"],iB=fn({__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=A0(),o=et(),a=De(new gd),l=wn();Cg(oF);const c=(p,_=!1)=>fn({setup(){var g;const m=(g=wn())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const y={};function b(v){v&&(v.parent&&b(v.parent),v.provides&&Object.assign(y,v.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(b(l.parent),Reflect.ownKeys(y).forEach(v=>{fr(v,y[v])})),fr("useTres",p),fr("extend",Cg),typeof window<"u"&&tB(m==null?void 0:m.app,p),()=>Ls(jt,null,_?[]:r.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=GS(Gk(p));m(Ls(g),a.value)},f=(p,_=!1)=>{mT(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},h=De(null);e({context:h,dispose:()=>f(h.value,!0)});const d=()=>{f(h.value),u(h.value,!0)};return Hn(()=>{const p=o;h.value=Bk({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 b=()=>{const v=new Kt(45,window.innerWidth/window.innerHeight,.1,1e3);v.position.set(3,3,3),v.lookAt(0,0,0),_(v);const E=Rc(()=>{m.value.length>=2&&(v.removeFromParent(),y(v),E==null||E())})};$e(()=>i.camera,(v,E)=>{v&&_(v),E&&(E.removeFromParent(),y(E))},{immediate:!0}),g.value||b()}),ts(d),(p,_)=>(gn(),vi("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:Oa(p.$attrs.class),"data-tres":`tresjs ${Ot(ek).version}`,style:Si({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,nB))}}),sB={install(n){n.component("TresCanvas",iB)}};function cm(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 Pg(n,e,t=".",i){if(!cm(e))return Pg(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]]:cm(o)&&cm(s[r])?s[r]=Pg(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function rB(n){return(...e)=>e.reduce((t,i)=>Pg(t,i,"",n),{})}const TT=rB();function Ar(n){return Xh()?(_0(n),!0):!1}function Xb(){const n=new Set,e=r=>{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return Ar(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const um=new WeakMap,oB=(...n)=>{var e;const t=n[0],i=(e=wn())==null?void 0:e.proxy;if(i==null&&!Cc())throw new Error("injectLocal must be called in setup");return i&&um.has(i)&&t in um.get(i)?um.get(i)[t]:mn(...n)},Xc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const wT=n=>n!=null,aB=Object.prototype.toString,Ch=n=>aB.call(n)==="[object Object]",es=()=>{},lB=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function AT(...n){if(n.length!==1)return lS(...n);const e=n[0];return typeof e=="function"?xi(S0(()=>({get:e,set:es}))):et(e)}function w_(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 CT=n=>n();function RT(n,e={}){let t,i,s=es;const r=l=>{clearTimeout(l),s(),s=es};let o;return l=>{const c=it(n),u=it(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 cB(...n){let e=0,t,i=!0,s=es,r,o,a,l,c;!Pt(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=es)};return h=>{const d=it(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 uB(n=CT,e={}){const{initialState:t="active"}=e,i=AT(t==="active");function s(){i.value=!1}function r(){i.value=!0}const o=(...a)=>{i.value&&n(...a)};return{isActive:xi(i),pause:s,resume:r,eventFilter:o}}function fB(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 hB(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 Dl(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function Ol(n){return Array.isArray(n)?n:[n]}function PT(n){return wn()}function IT(n,e=200,t={}){return w_(RT(e,t),n)}function dB(n,e=200,t=!1,i=!0,s=!1){return w_(cB(e,t,i,s),n)}function LT(n,e,t={}){const{eventFilter:i=CT,...s}=t;return $e(n,w_(i,e),s)}function pB(n,e,t={}){const{eventFilter:i,initialState:s="active",...r}=t,{eventFilter:o,pause:a,resume:l,isActive:c}=uB(i,{initialState:s});return{stop:LT(n,e,{...r,eventFilter:o}),pause:a,resume:l,isActive:c}}function Va(n,e=!0,t){PT()?Hn(n,t):e?n():Sr(n)}function mB(n,e){PT()&&ts(n,e)}function gB(n,e,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t,r=De(!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)},it(e))}return i&&(r.value=!0,Xc&&c()),Ar(l),{isPending:xi(r),start:c,stop:l}}function pG(n,e,t={}){const{debounce:i=0,maxWait:s=void 0,...r}=t;return LT(n,e,{...r,eventFilter:RT(i,{maxWait:s})})}function _B(n,e,t){return $e(n,e,{...t,immediate:!0})}const Qn=Xc?window:void 0,vB=Xc?window.document:void 0,A_=Xc?window.navigator:void 0;function oi(n){var e;const t=it(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Ft(...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=Ee(()=>{const a=Ol(it(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=_B(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>oi(c)))!=null?l:[Qn].filter(c=>c!=null),Ol(it(s.value?n[1]:n[0])),Ol(Ot(s.value?n[2]:n[1])),it(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=Ch(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 Ar(t),o}function yB(){const n=De(!1),e=wn();return e&&Hn(()=>{n.value=!0},e),n}function Ro(n){const e=yB();return Ee(()=>(e.value,!!n()))}function DT(n,e,t={}){const{window:i=Qn,...s}=t;let r;const o=Ro(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const h=it(n),d=Ol(h).map(oi).filter(wT);return new Set(d)}),c=$e(()=>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 Ar(f),{isSupported:o,stop:f,takeRecords:u}}const bB=Symbol("vueuse-ssr-width");function OT(){const n=Cc()?oB(bB,null):null;return typeof n=="number"?n:void 0}function ro(n,e={}){const{window:t=Qn,ssrWidth:i=OT()}=e,s=Ro(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=De(typeof i=="number"),o=De(),a=De(!1),l=c=>{a.value=c.matches};return Rc(()=>{if(r.value){r.value=!s.value;const c=it(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>=Dl(h[1])),d&&p&&(p=i<=Dl(d[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(it(n)),a.value=o.value.matches)}),Ft(o,"change",l,{passive:!0}),Ee(()=>a.value)}const mG={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function gG(n,e={}){function t(d,p){let _=it(n[it(d)]);return p!=null&&(_=hB(_,p)),typeof _=="number"&&(_=`${_}px`),_}const{window:i=Qn,strategy:s="min-width",ssrWidth:r=OT()}=e,o=typeof r=="number",a=o?De(!1):{value:!0};o&&Va(()=>a.value=!!i);function l(d,p){return!a.value&&o?d==="min"?r>=Dl(p):r<=Dl(p):i?i.matchMedia(`(${d}-width: ${p})`).matches:!1}const c=d=>ro(()=>`(min-width: ${t(d)})`,e),u=d=>ro(()=>`(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],Dl(t(p))]).sort((p,_)=>p[2]-_[2]);return Ee(()=>d.filter(([,p])=>p.value).map(([p])=>p))}return Object.assign(f,{greaterOrEqual:c,smallerOrEqual:u,greater(d){return ro(()=>`(min-width: ${t(d,.1)})`,e)},smaller(d){return ro(()=>`(max-width: ${t(d,-.1)})`,e)},between(d,p){return ro(()=>`(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 Ee(()=>d.value.length===0?"":d.value.at(s==="min-width"?-1:0))}})}function Ig(n,e={}){const{controls:t=!1,navigator:i=A_}=e,s=Ro(()=>i&&"permissions"in i),r=De(),o=typeof n=="string"?{name:n}:n,a=De(),l=()=>{var u,f;a.value=(f=(u=r.value)==null?void 0:u.state)!=null?f:"prompt"};Ft(r,"change",l,{passive:!0});const c=fB(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 ut(r.value)}});return c(),t?{state:a,isSupported:s,query:c}:a}function _G(n={}){const{navigator:e=A_,read:t=!1,source:i,copiedDuring:s=1500,legacy:r=!1}=n,o=Ro(()=>e&&"clipboard"in e),a=Ig("clipboard-read"),l=Ig("clipboard-write"),c=Ee(()=>o.value||r),u=De(""),f=De(!1),h=gB(()=>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&&Ft(["copy","cut"],d,{passive:!0});async function p(y=it(i)){if(c.value&&y!=null){let b=!(o.value&&m(l.value));if(!b)try{await e.clipboard.writeText(y)}catch{b=!0}b&&_(y),u.value=y,f.value=!0,h.start()}}function _(y){const b=document.createElement("textarea");b.value=y??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}function g(){var y,b,v;return(v=(b=(y=document==null?void 0:document.getSelection)==null?void 0:y.call(document))==null?void 0:b.toString())!=null?v:""}function m(y){return y==="granted"||y==="prompt"}return{isSupported:c,text:u,copied:f,copy:p}}const nf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sf="__vueuse_ssr_handlers__",xB=MB();function MB(){return sf in nf||(nf[sf]=nf[sf]||{}),nf[sf]}function NT(n,e){return xB[n]||e}function SB(n){return ro("(prefers-color-scheme: dark)",n)}function EB(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 TB={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()}},$b="vueuse-storage";function UT(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=Qn,eventFilter:h,onError:d=L=>{console.error(L)},initOnMounted:p}=i,_=(u?De:et)(typeof e=="function"?e():e),g=Ee(()=>it(n));if(!t)try{t=NT("getDefaultStorage",()=>{var L;return(L=Qn)==null?void 0:L.localStorage})()}catch(L){d(L)}if(!t)return _;const m=it(e),y=EB(m),b=(s=i.serializer)!=null?s:TB[y],{pause:v,resume:E}=pB(_,()=>S(_.value),{flush:r,deep:o,eventFilter:h});$e(g,()=>x(),{flush:r}),f&&a&&Va(()=>{t instanceof Storage?Ft(f,"storage",x,{passive:!0}):Ft(f,$b,M),p&&x()}),p||x();function T(L,F){if(f){const H={key:g.value,oldValue:L,newValue:F,storageArea:t};f.dispatchEvent(t instanceof Storage?new StorageEvent("storage",H):new CustomEvent($b,{detail:H}))}}function S(L){try{const F=t.getItem(g.value);if(L==null)T(F,null),t.removeItem(g.value);else{const H=b.write(L);F!==H&&(t.setItem(g.value,H),T(F,H))}}catch(F){d(F)}}function P(L){const F=L?L.newValue:t.getItem(g.value);if(F==null)return l&&m!=null&&t.setItem(g.value,b.write(m)),m;if(!L&&c){const H=b.read(F);return typeof c=="function"?c(H,m):y==="object"&&!Array.isArray(H)?{...m,...H}:H}else return typeof F!="string"?F:b.read(F)}function x(L){if(!(L&&L.storageArea!==t)){if(L&&L.key==null){_.value=m;return}if(!(L&&L.key!==g.value)){v();try{(L==null?void 0:L.newValue)!==b.write(_.value)&&(_.value=P(L))}catch(F){d(F)}finally{L?Sr(E):E()}}}}function M(L){x(L.detail)}return _}const wB="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function AB(n={}){const{selector:e="html",attribute:t="class",initialValue:i="auto",window:s=Qn,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=SB({window:s}),d=Ee(()=>h.value?"dark":"light"),p=l||(o==null?AT(i):UT(o,i,r,{window:s,listenToStorageChanges:a})),_=Ee(()=>p.value==="auto"?d.value:p.value),g=NT("updateHTMLAttrs",(v,E,T)=>{const S=typeof v=="string"?s==null?void 0:s.document.querySelector(v):oi(v);if(!S)return;const P=new Set,x=new Set;let M=null;if(E==="class"){const F=T.split(/\s/g);Object.values(f).flatMap(H=>(H||"").split(/\s/g)).filter(Boolean).forEach(H=>{F.includes(H)?P.add(H):x.add(H)})}else M={key:E,value:T};if(P.size===0&&x.size===0&&M===null)return;let L;u&&(L=s.document.createElement("style"),L.appendChild(document.createTextNode(wB)),s.document.head.appendChild(L));for(const F of P)S.classList.add(F);for(const F of x)S.classList.remove(F);M&&S.setAttribute(M.key,M.value),u&&(s.getComputedStyle(L).opacity,document.head.removeChild(L))});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)}$e(_,y,{flush:"post",immediate:!0}),Va(()=>y(_.value));const b=Ee({get(){return c?p.value:_.value},set(v){p.value=v}});return Object.assign(b,{store:p,system:d,state:_})}function rf(n,e,t={}){const{window:i=Qn,initialValue:s,observe:r=!1}=t,o=De(s),a=Ee(()=>{var c;return oi(e)||((c=i==null?void 0:i.document)==null?void 0:c.documentElement)});function l(){var c;const u=it(n),f=it(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&&DT(a,l,{attributeFilter:["style","class"],window:i}),$e([a,()=>it(n)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),l()},{immediate:!0}),$e([o,a],([c,u])=>{const f=it(n);u!=null&&u.style&&f&&(c==null?u.style.removeProperty(f):u.style.setProperty(f,c))},{immediate:!0}),o}function CB(n={}){const{valueDark:e="dark",valueLight:t=""}=n,i=AB({...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=Ee(()=>i.system.value);return Ee({get(){return i.value==="dark"},set(o){const a=o?"dark":"light";s.value===a?i.value="auto":i.value=a}})}function RB(n={}){const{navigator:e=A_,requestPermissions:t=!1,constraints:i={audio:!0,video:!0},onUpdated:s}=n,r=et([]),o=Ee(()=>r.value.filter(p=>p.kind==="videoinput")),a=Ee(()=>r.value.filter(p=>p.kind==="audioinput")),l=Ee(()=>r.value.filter(p=>p.kind==="audiooutput")),c=Ro(()=>e&&e.mediaDevices&&e.mediaDevices.enumerateDevices),u=De(!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}=Ig(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(),Ft(e.mediaDevices,"devicechange",h,{passive:!0}),h()),{devices:r,ensurePermissions:d,permissionGranted:u,videoInputs:o,audioInputs:a,audioOutputs:l,isSupported:c}}function PB(n,e,t={}){const{window:i=Qn,...s}=t;let r;const o=Ro(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const f=it(n);return Array.isArray(f)?f.map(h=>oi(h)):[oi(f)]}),c=$e(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 Ar(u),{isSupported:o,stop:u}}function vG(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=De(0),l=De(0),c=De(0),u=De(0),f=De(0),h=De(0),d=De(0),p=De(0);function _(){const m=oi(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 PB(n,g),$e(()=>oi(n),m=>!m&&g()),DT(n,g,{attributeFilter:["style","class"]}),s&&Ft("scroll",g,{capture:!0,passive:!0}),i&&Ft("resize",g,{passive:!0}),Va(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function IB(n,e,t={}){const{root:i,rootMargin:s="0px",threshold:r=0,window:o=Qn,immediate:a=!0}=t,l=Ro(()=>o&&"IntersectionObserver"in o),c=Ee(()=>{const p=it(n);return Ol(p).map(oi).filter(wT)});let u=es;const f=De(a),h=l.value?$e(()=>[c.value,oi(i),f.value],([p,_])=>{if(u(),!f.value||!p.length)return;const g=new IntersectionObserver(e,{root:oi(_),rootMargin:s,threshold:r});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=es}},{immediate:a,flush:"post"}):es,d=()=>{u(),h(),f.value=!1};return Ar(d),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:d}}const LB={multiple:!0,accept:"*",reset:!1,directory:!1};function DB(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 yG(n={}){const{document:e=vB}=n,t=et(DB(n.initialFiles)),{on:i,trigger:s}=Xb(),{on:r,trigger:o}=Xb();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={...LB,...n,...u};a.multiple=f.multiple,a.accept=f.accept,a.webkitdirectory=f.directory,lB(f,"capture")&&(a.capture=f.capture),f.reset&&l(),a.click()};return{files:xi(t),open:c,reset:l,onCancel:r,onChange:i}}const qb=1;function bG(n,e={}){const{throttle:t=0,idle:i=200,onStop:s=es,onScroll:r=es,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:a={capture:!1,passive:!0},behavior:l="auto",window:c=Qn,onError:u=S=>{console.error(S)}}=e,f=De(0),h=De(0),d=Ee({get(){return f.value},set(S){_(S,void 0)}}),p=Ee({get(){return h.value},set(S){_(void 0,S)}});function _(S,P){var x,M,L,F;if(!c)return;const H=it(n);if(!H)return;(L=H instanceof Document?c.document.body:H)==null||L.scrollTo({top:(x=it(P))!=null?x:p.value,left:(M=it(S))!=null?M:d.value,behavior:it(l)});const Y=((F=H==null?void 0:H.document)==null?void 0:F.documentElement)||(H==null?void 0:H.documentElement)||H;d!=null&&(f.value=Y.scrollLeft),p!=null&&(h.value=Y.scrollTop)}const g=De(!1),m=bi({left:!0,right:!1,top:!0,bottom:!1}),y=bi({left:!1,right:!1,top:!1,bottom:!1}),b=S=>{g.value&&(g.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,s(S))},v=IT(b,t+i),E=S=>{var P;if(!c)return;const x=((P=S==null?void 0:S.document)==null?void 0:P.documentElement)||(S==null?void 0:S.documentElement)||oi(S),{display:M,flexDirection:L,direction:F}=getComputedStyle(x),H=F==="rtl"?-1:1,Y=x.scrollLeft;y.left=Yf.value;const ee=Math.abs(Y*H)<=(o.left||0),K=Math.abs(Y*H)+x.clientWidth>=x.scrollWidth-(o.right||0)-qb;M==="flex"&&L==="row-reverse"?(m.left=K,m.right=ee):(m.left=ee,m.right=K),f.value=Y;let Q=x.scrollTop;S===c.document&&!Q&&(Q=c.document.body.scrollTop),y.top=Qh.value;const Z=Math.abs(Q)<=(o.top||0),de=Math.abs(Q)+x.clientHeight>=x.scrollHeight-(o.bottom||0)-qb;M==="flex"&&L==="column-reverse"?(m.top=de,m.bottom=Z):(m.top=Z,m.bottom=de),h.value=Q},T=S=>{var P;if(!c)return;const x=(P=S.target.documentElement)!=null?P:S.target;E(x),g.value=!0,v(S),r(S)};return Ft(n,"scroll",t?dB(T,t,!0,!1):T,a),Va(()=>{try{const S=it(n);if(!S)return;E(S)}catch(S){u(S)}}),Ft(n,"scrollend",b,a),{x:d,y:p,isScrolling:g,arrivedState:m,directions:y,measure(){const S=it(n);c&&S&&E(S)}}}function ms(n,e,t={}){const{window:i=Qn}=t;return UT(n,e,i==null?void 0:i.localStorage,t)}function xG(n){const e=De(),t=()=>{e.value&&URL.revokeObjectURL(e.value),e.value=void 0};return $e(()=>it(n),i=>{t(),i&&(e.value=URL.createObjectURL(i))},{immediate:!0}),Ar(t),xi(e)}const Yb="--vueuse-safe-area-top",jb="--vueuse-safe-area-right",Kb="--vueuse-safe-area-bottom",Zb="--vueuse-safe-area-left";function MG(){const n=De(""),e=De(""),t=De(""),i=De("");if(Xc){const r=rf(Yb),o=rf(jb),a=rf(Kb),l=rf(Zb);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(),Ft("resize",IT(s),{passive:!0})}function s(){n.value=of(Yb),e.value=of(jb),t.value=of(Kb),i.value=of(Zb)}return{top:n,right:e,bottom:t,left:i,update:s}}function of(n){return getComputedStyle(document.documentElement).getPropertyValue(n)}function SG(n,e,t){const{window:i=Qn}={},s=et(null),r=De(),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},Ar(()=>{r.value&&r.value.terminate()})),{data:s,post:o,terminate:a,worker:r}}function EG(n={}){const{window:e=Qn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=De(t),l=De(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(),Va(c);const u={passive:!0};if(Ft("resize",c,u),e&&o==="visual"&&e.visualViewport&&Ft(e.visualViewport,"resize",c,u),s){const f=ro("(orientation: portrait)");$e(f,()=>c())}return{width:a,height:l}}const FT=1/60*1e3,OB=typeof performance<"u"?()=>performance.now():()=>Date.now(),kT=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(OB()),FT);function NB(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]=NB(()=>vc=!0),n),{}),Og=$c.reduce((n,e)=>{const t=kd[e];return n[e]=(i,s=!1,r=!1)=>(vc||BB(),t.schedule(i,s,r)),n},{}),FB=$c.reduce((n,e)=>(n[e]=kd[e].cancel,n),{});$c.reduce((n,e)=>(n[e]=()=>kd[e].process(da),n),{});const kB=n=>kd[n].process(da),BT=n=>{vc=!1,da.delta=Lg?FT:Math.max(Math.min(n-da.timestamp,UB),1),da.timestamp=n,Dg=!0,$c.forEach(kB),Dg=!1,vc&&(Lg=!1,kT(BT))},BB=()=>{vc=!0,Lg=!0,Dg||kT(BT)},zT=()=>da;function VT(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),Qb=.001,zB=.01,VB=10,HB=.05,GB=1;function WB({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let s,r,o=1-e;o=Ng(HB,GB,o),n=Ng(zB,VB,n/1e3),o<1?(s=c=>{const u=c*o,f=u*n,h=u-t,d=Ug(c,o),p=Math.exp(-f);return Qb-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),_=Ug(Math.pow(c,2),o);return(-s(c)+Qb>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=$B(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 XB=12;function $B(n,e,t){let i=t;for(let s=1;sn[t]!==void 0)}function jB(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!ex(n,YB)&&ex(n,qB)){const t=WB(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function C_(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:s}=n,r=VT(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:h}=jB(r),d=tx,p=tx;function _(){const g=u?-(u/1e3):0,m=t-e,y=l/(2*Math.sqrt(a*c)),b=Math.sqrt(a/c)/1e3;if(s===void 0&&(s=Math.min(Math.abs(t-e)/100,.4)),y<1){const v=Ug(b,y);d=E=>{const T=Math.exp(-y*b*E);return t-T*((g+y*b*m)/v*Math.sin(v*E)+m*Math.cos(v*E))},p=E=>{const T=Math.exp(-y*b*E);return y*b*T*(Math.sin(v*E)*(g+y*b*m)/v+m*Math.cos(v*E))-T*(Math.cos(v*E)*(g+y*b*m)-v*m*Math.sin(v*E))}}else if(y===1)d=v=>t-Math.exp(-b*v)*(m+(g+b*m)*v);else{const v=b*Math.sqrt(y*y-1);d=E=>{const T=Math.exp(-y*b*E),S=Math.min(v*E,300);return t-T*((g+y*b*m)*Math.sinh(S)+v*m*Math.cosh(S))/v}}}return _(),{next:g=>{const m=d(g);if(h)o.done=g>=f;else{const y=p(g)*1e3,b=Math.abs(y)<=i,v=Math.abs(t-m)<=s;o.done=b&&v}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}C_.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const tx=n=>0,HT=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},R_=(n,e,t)=>-t*n+t*e+n,GT=(n,e)=>t=>Math.max(Math.min(t,e),n),Nl=n=>n%1?Number(n.toFixed(5)):n,yc=/(-)?([\d]*\.?[\d])+/g,Fg=/(#[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,KB=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qc(n){return typeof n=="string"}const Yc={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},Ul=Object.assign(Object.assign({},Yc),{transform:GT(0,1)}),af=Object.assign(Object.assign({},Yc),{default:1}),P_=n=>({test:e=>qc(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Kr=P_("deg"),Fl=P_("%"),ot=P_("px"),nx=Object.assign(Object.assign({},Fl),{parse:n=>Fl.parse(n)/100,transform:n=>Fl.transform(n*100)}),I_=(n,e)=>t=>!!(qc(t)&&KB.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),WT=(n,e,t)=>i=>{if(!qc(i))return i;const[s,r,o,a]=i.match(yc);return{[n]:parseFloat(s),[e]:parseFloat(r),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},co={test:I_("hsl","hue"),parse:WT("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Fl.transform(Nl(e))+", "+Fl.transform(Nl(t))+", "+Nl(Ul.transform(i))+")"},ZB=GT(0,255),fm=Object.assign(Object.assign({},Yc),{transform:n=>Math.round(ZB(n))}),ur={test:I_("rgb","red"),parse:WT("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+fm.transform(n)+", "+fm.transform(e)+", "+fm.transform(t)+", "+Nl(Ul.transform(i))+")"};function JB(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 kg={test:I_("#"),parse:JB,transform:ur.transform},qn={test:n=>ur.test(n)||kg.test(n)||co.test(n),parse:n=>ur.test(n)?ur.parse(n):co.test(n)?co.parse(n):kg.parse(n),transform:n=>qc(n)?n:n.hasOwnProperty("red")?ur.transform(n):co.transform(n)},XT="${c}",$T="${n}";function QB(n){var e,t,i,s;return isNaN(n)&&qc(n)&&((t=(e=n.match(yc))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((s=(i=n.match(Fg))===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)>0}function qT(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(Fg);i&&(t=i.length,n=n.replace(Fg,XT),e.push(...i.map(qn.parse)));const s=n.match(yc);return s&&(n=n.replace(yc,$T),e.push(...s.map(Yc.parse))),{values:e,numColors:t,tokenised:n}}function YT(n){return qT(n).values}function jT(n){const{values:e,numColors:t,tokenised:i}=qT(n),s=e.length;return r=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function t4(n){const e=YT(n);return jT(n)(e.map(e4))}const jc={test:QB,parse:YT,createTransformer:jT,getAnimatableNone:t4},n4=new Set(["brightness","contrast","saturate","opacity"]);function i4(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(yc)||[];if(!i)return n;const s=t.replace(i,"");let r=n4.has(e)?1:0;return i!==t&&(r*=100),e+"("+r+s+")"}const s4=/([a-z-]*)\(.*?\)/g,Bg=Object.assign(Object.assign({},jc),{getAnimatableNone:n=>{const e=n.match(s4);return e?e.map(i4).join(" "):n}});function hm(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 ix({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=hm(l,a,n+1/3),r=hm(l,a,n),o=hm(l,a,n-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const r4=(n,e,t)=>{const i=n*n,s=e*e;return Math.sqrt(Math.max(0,t*(s-i)+i))},o4=[kg,ur,co],sx=n=>o4.find(e=>e.test(n)),KT=(n,e)=>{let t=sx(n),i=sx(e),s=t.parse(n),r=i.parse(e);t===co&&(s=ix(s),t=ur),i===co&&(r=ix(r),i=ur);const o=Object.assign({},s);return a=>{for(const l in o)l!=="alpha"&&(o[l]=r4(s[l],r[l],a));return o.alpha=R_(s.alpha,r.alpha,a),t.transform(o)}},a4=n=>typeof n=="number",l4=(n,e)=>t=>e(n(t)),ZT=(...n)=>n.reduce(l4);function JT(n,e){return a4(n)?t=>R_(n,e,t):qn.test(n)?KT(n,e):ew(n,e)}const QT=(n,e)=>{const t=[...n],i=t.length,s=n.map((r,o)=>JT(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]=JT(n[s],e[s]));return s=>{for(const r in i)t[r]=i[r](s);return t}};function rx(n){const e=jc.parse(n),t=e.length;let i=0,s=0,r=0;for(let o=0;o{const t=jc.createTransformer(e),i=rx(n),s=rx(e);return i.numHSL===s.numHSL&&i.numRGB===s.numRGB&&i.numNumbers>=s.numNumbers?ZT(QT(i.parsed,s.parsed),t):o=>`${o>0?e:n}`},u4=(n,e)=>t=>R_(n,e,t);function f4(n){if(typeof n=="number")return u4;if(typeof n=="string")return qn.test(n)?KT:ew;if(Array.isArray(n))return QT;if(typeof n=="object")return c4}function h4(n,e,t){const i=[],s=t||f4(n[0]),r=n.length-1;for(let o=0;ot(HT(n,e,i))}function p4(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=HT(n[r],n[r+1],s);return e[r](a)}}function tw(n,e,{clamp:t=!0,ease:i,mixer:s}={}){const r=n.length;Jb(r===e.length),Jb(!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=h4(e,i,s),a=r===2?d4(n,o):p4(n,o);return t?l=>a(Ng(n[0],n[r-1],l)):a}const Bd=n=>e=>1-n(1-e),L_=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,m4=n=>e=>Math.pow(e,n),nw=n=>e=>e*e*((n+1)*e-n),g4=n=>{const e=nw(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},iw=1.525,_4=4/11,v4=8/11,y4=9/10,sw=n=>n,D_=m4(2),b4=Bd(D_),rw=L_(D_),ow=n=>1-Math.sin(Math.acos(n)),aw=Bd(ow),x4=L_(aw),O_=nw(iw),M4=Bd(O_),S4=L_(O_),E4=g4(iw),T4=4356/361,w4=35442/1805,A4=16061/1805,Rh=n=>{if(n===1||n===0)return n;const e=n*n;return n<_4?7.5625*e:nn<.5?.5*(1-Rh(1-n*2)):.5*Rh(n*2-1)+.5;function P4(n,e){return n.map(()=>e||rw).splice(0,n.length-1)}function I4(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function L4(n,e){return n.map(t=>t*e)}function Af({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=L4(i&&i.length===o.length?i:I4(o),s);function l(){return tw(a,o,{ease:Array.isArray(t)?t:P4(o,t)})}let c=l();return{next:u=>(r.value=c(u),r.done=u>=s,r),flipTarget:()=>{o.reverse(),c=l()}}}function D4({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 ox={keyframes:Af,spring:C_,decay:D4};function O4(n){if(Array.isArray(n.to))return Af;if(ox[n.type])return ox[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Af:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?C_:Af}function lw(n,e,t=0){return n-e-t}function N4(n,e,t=0,i=!0){return i?lw(e+-n,e,t):e-(n-e)+t}function U4(n,e,t,i){return i?n>=e+t:n<=-t}const F4=n=>{const e=({delta:t})=>n(t);return{start:()=>Og.update(e,!0),stop:()=>FB.update(e)}};function cw(n){var e,t,{from:i,autoplay:s=!0,driver:r=F4,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:h,onRepeat:d,onUpdate:p}=n,_=VT(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,y=0,b=_.duration,v,E=!1,T=!0,S;const P=O4(_);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(S=tw([0,100],[i,g],{clamp:!1}),i=0,g=100);const x=P(Object.assign(Object.assign({},_),{from:i,to:g}));function M(){y++,l==="reverse"?(T=y%2===0,o=N4(o,b,c,T)):(o=lw(o,b,c),l==="mirror"&&x.flipTarget()),E=!1,d&&d()}function L(){m.stop(),h&&h()}function F(Y){if(T||(Y=-Y),o+=Y,!E){const ee=x.next(Math.max(0,o));v=ee.value,S&&(v=S(v)),E=T?ee.done:o<=0}p==null||p(v),E&&(y===0&&(b??(b=o)),y{f==null||f(),m.stop()}}}function uw(n,e){return e?n*(1e3/e):0}function k4({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 _(b){return t!==void 0&&bi}function g(b){return t===void 0?i:i===void 0||Math.abs(t-b){var E;f==null||f(v),(E=b.onUpdate)===null||E===void 0||E.call(b,v)},onComplete:h,onStop:d}))}function y(b){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},b))}if(_(n))y({from:n,velocity:e,to:g(n)});else{let b=s*e+n;typeof c<"u"&&(b=c(b));const v=g(b),E=v===t?-1:1;let T,S;const P=x=>{T=S,S=x,e=uw(x-T,zT().delta),(E===1&&x>v||E===-1&&xp==null?void 0:p.stop()}}const fw=(n,e)=>1-3*e+3*n,hw=(n,e)=>3*e-6*n,dw=n=>3*n,Ph=(n,e,t)=>((fw(e,t)*n+hw(e,t))*n+dw(e))*n,pw=(n,e,t)=>3*fw(e,t)*n*n+2*hw(e,t)*n+dw(e),B4=1e-7,z4=10;function V4(n,e,t,i,s){let r,o,a=0;do o=e+(t-e)/2,r=Ph(o,i,s)-n,r>0?t=o:e=o;while(Math.abs(r)>B4&&++a=G4?W4(o,f,n,t):h===0?f:V4(o,a,a+lf,n,t)}return o=>o===0||o===1?o:Ph(r(o),e,i)}const Is={},dm={};class $4{constructor(){fi(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 ax(n){return!Number.isNaN(Number.parseFloat(n))}class q4{constructor(e){fi(this,"current");fi(this,"prev");fi(this,"timeDelta",0);fi(this,"lastUpdated",0);fi(this,"updateSubscribers",new $4);fi(this,"stopAnimation");fi(this,"canTrackVelocity",!1);fi(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=zT();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),Og.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});fi(this,"scheduleVelocityCheck",()=>Og.postRender(this.velocityCheck));fi(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=ax(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=ax(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?uw(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 Y4(n){return new q4(n)}const{isArray:j4}=Array;function K4(){const n=et({}),e=i=>{const s=r=>{n.value[r]&&(n.value[r].stop(),n.value[r].destroy(),delete n.value[r])};i?j4(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=Y4(s);return o.onChange(a=>r[i]=a),n.value[i]=o,o};return mB(e),{motionValues:n,get:t,stop:e}}function Z4(n){return Array.isArray(n)}function Zr(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function pm(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function J4(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function mm(){return{type:"keyframes",ease:"linear",duration:300}}function Q4(n){return{type:"keyframes",duration:800,values:n}}const lx={default:J4,x:Zr,y:Zr,z:Zr,rotate:Zr,rotateX:Zr,rotateY:Zr,rotateZ:Zr,scaleX:pm,scaleY:pm,scale:pm,backgroundColor:mm,color:mm,opacity:mm};function mw(n,e){let t;return Z4(e)?t=Q4:t=lx[n]||lx.default,{to:e,...t(e)}}const cx={...Yc,transform:Math.round},gw={color:qn,backgroundColor:qn,outlineColor:qn,fill:qn,stroke:qn,borderColor:qn,borderTopColor:qn,borderRightColor:qn,borderBottomColor:qn,borderLeftColor:qn,borderWidth:ot,borderTopWidth:ot,borderRightWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRadius:ot,radius:ot,borderTopLeftRadius:ot,borderTopRightRadius:ot,borderBottomRightRadius:ot,borderBottomLeftRadius:ot,width:ot,maxWidth:ot,height:ot,maxHeight:ot,size:ot,top:ot,right:ot,bottom:ot,left:ot,padding:ot,paddingTop:ot,paddingRight:ot,paddingBottom:ot,paddingLeft:ot,margin:ot,marginTop:ot,marginRight:ot,marginBottom:ot,marginLeft:ot,rotate:Kr,rotateX:Kr,rotateY:Kr,rotateZ:Kr,scale:af,scaleX:af,scaleY:af,scaleZ:af,skew:Kr,skewX:Kr,skewY:Kr,distance:ot,translateX:ot,translateY:ot,translateZ:ot,x:ot,y:ot,z:ot,perspective:ot,transformPerspective:ot,opacity:Ul,originX:nx,originY:nx,originZ:ot,zIndex:cx,filter:Bg,WebkitFilter:Bg,fillOpacity:Ul,strokeOpacity:Ul,numOctaves:cx},N_=n=>gw[n];function zg(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function e5(n,e){let t=N_(n);return t!==Bg&&(t=jc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const t5={linear:sw,easeIn:D_,easeInOut:rw,easeOut:b4,circIn:ow,circInOut:x4,circOut:aw,backIn:O_,backInOut:S4,backOut:M4,anticipate:E4,bounceIn:C4,bounceInOut:R4,bounceOut:Rh};function ux(n){if(Array.isArray(n)){const[e,t,i,s]=n;return X4(e,t,i,s)}else if(typeof n=="string")return t5[n];return n}function n5(n){return Array.isArray(n)&&typeof n[0]!="number"}function fx(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&jc.test(e)&&!e.startsWith("url("))}function i5(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function s5({ease:n,times:e,delay:t,...i}){const s={...i};return e&&(s.offset=e),n&&(s.ease=n5(n)?n.map(ux):ux(n)),t&&(s.elapsed=-t),s}function r5(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),i5(e),o5(n)||(n={...n,...mw(t,e.to)}),{...e,...s5(n)}}function o5({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:s,...r}){return!!Object.keys(r).length}function a5(n,e){return n[e]||n.default||n}function l5(n,e,t,i,s){const r=a5(i,n);let o=r.from===null||r.from===void 0?e.get():r.from;const a=fx(n,t);o==="none"&&a&&typeof t=="string"&&(o=e5(n,t));const l=fx(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"?k4({...h,...r}):cw({...r5(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 c5(){const{motionValues:n,stop:e,get:t}=K4();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=l5(s,u,r,a,l);u.start(f)}}}function u5(n,e={},{motionValues:t,push:i,stop:s}=c5()){const r=Ot(e),o=et(!1);$e(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||mw(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=Ch(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 U_=typeof window<"u",f5=()=>U_&&(window.onpointerdown===null||(Is==null?void 0:Is.TEST)),h5=()=>U_&&(window.ontouchstart===null||(Is==null?void 0:Is.TEST)),d5=()=>U_&&(window.onmousedown===null||(Is==null?void 0:Is.TEST));function p5({target:n,state:e,variants:t,apply:i}){const s=Ot(t),r=et(!1),o=et(!1),a=et(!1),l=Ee(()=>{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=Ee(()=>{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&&(Ft(n,"mouseenter",()=>r.value=!0),Ft(n,"mouseleave",()=>{r.value=!1,o.value=!1})),s.tapped&&(d5()&&(Ft(n,"mousedown",()=>o.value=!0),Ft(n,"mouseup",()=>o.value=!1)),f5()&&(Ft(n,"pointerdown",()=>o.value=!0),Ft(n,"pointerup",()=>o.value=!1)),h5()&&(Ft(n,"touchstart",()=>o.value=!0),Ft(n,"touchend",()=>o.value=!1))),s.focused&&(Ft(n,"focus",()=>a.value=!0),Ft(n,"blur",()=>a.value=!1)),$e([r,o,a],()=>{i(c.value)})}function m5({set:n,target:e,variants:t,variant:i}){const s=Ot(t);$e(()=>e,()=>{s&&(s.initial&&(n("initial"),i.value="initial"),s.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function g5({state:n,apply:e}){$e(n,t=>{t&&e(t)},{immediate:!0})}function _w({target:n,variants:e,variant:t}){const i=Ot(e);i&&(i.visible||i.visibleOnce)&&IB(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 _5(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&m5(n),e.syncVariants&&g5(n),e.visibilityHooks&&_w(n),e.eventListeners&&p5(n)}function vw(n={}){const e=bi({...n}),t=et({});return $e(e,()=>{const i={};for(const[s,r]of Object.entries(e)){const o=N_(s),a=zg(r,o);i[s]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function F_(n,e){$e(()=>oi(n),t=>{t&&e(t)},{immediate:!0})}const v5={x:"translateX",y:"translateY",z:"translateZ"};function yw(n={},e=!0){const t=bi({...n}),i=et("");return $e(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=>zg(l,ot)).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=N_(a),u=zg(l,c);r+=`${v5[a]||a}(${u}) `}e&&!o&&(r+="translateZ(0px) "),i.value=r.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const y5=["","X","Y","Z"],b5=["perspective","translate","scale","rotate","skew"],bw=["transformPerspective","x","y","z"];b5.forEach(n=>{y5.forEach(e=>{const t=n+e;bw.push(t)})});const x5=new Set(bw);function k_(n){return x5.has(n)}const M5=new Set(["originX","originY","originZ"]);function xw(n){return M5.has(n)}function S5(n){const e={},t={};return Object.entries(n).forEach(([i,s])=>{k_(i)||xw(i)?e[i]=s:t[i]=s}),{transform:e,style:t}}function zd(n){const{transform:e,style:t}=S5(n),{transform:i}=yw(e),{style:s}=vw(t);return i.value&&(s.value.transform=i.value),s.value}function E5(n,e){let t,i;const{state:s,style:r}=vw();return F_(n,o=>{i=o;for(const a of Object.keys(gw))o.style[a]===null||o.style[a]===""||k_(a)||xw(a)||(s[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(s)}),$e(r,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:s}}function T5(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 w5(n,e){Object.entries(T5(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 A5(n,e){let t,i;const{state:s,transform:r}=yw();return F_(n,o=>{i=o,o.style.transform&&w5(s,o.style.transform),t&&(o.style.transform=t),e&&e(s)}),$e(r,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:s}}function C5(n){return Object.entries(n)}function R5(n,e){const t=bi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:s}=E5(n,i),{transform:r}=A5(n,i);return $e(t,o=>{C5(o).forEach(([a,l])=>{const c=k_(a)?r:s;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),F_(n,()=>e),{motionProperties:t,style:s,transform:r}}function P5(n={}){const e=Ot(n),t=et();return{state:Ee(()=>{if(t.value)return e[t.value]}),variant:t}}function Mw(n,e={},t){const{motionProperties:i}=R5(n),{variant:s,state:r}=P5(e),o=u5(i,e),a={target:n,variant:s,variants:e,state:r,motionProperties:i,...o};return _5(a,t),a}const Sw=["delay","duration"],I5=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...Sw];function L5(n){return Sw.includes(n)}function D5(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&Ch(t.variants)&&(e.value={...e.value,...t.variants});for(let i of I5)if(!(!t||!t[i])){if(L5(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(Ch(t[i])){const s=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=s}}}}function gm(n,e=!1){return{created:(s,r,o)=>{const a=r.value&&typeof r.value=="string"?r.value:o.key;a&&dm[a]&&dm[a].stop();const l=e?structuredClone(ut(n)||{}):n||{},c=et(l);typeof r.value=="object"&&(c.value=r.value),D5(o,c);const f=Mw(s,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});s.motionInstance=f,a&&(dm[a]=f)},mounted:(s,r,o)=>{s.motionInstance&&_w(s.motionInstance)},getSSRProps(s,r){let{initial:o}=s.value||r&&(r==null?void 0:r.props)||{};o=Ot(o);const a=TT({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:zd(a)}}}}const O5={initial:{opacity:0},enter:{opacity:1}},N5={initial:{opacity:0},visible:{opacity:1}},U5={initial:{opacity:0},visibleOnce:{opacity:1}},F5={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},k5={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},B5={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},z5={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},V5={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},H5={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},G5={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},W5={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},X5={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},$5={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},q5={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Y5={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},j5={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},K5={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Z5={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},J5={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Q5={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},ez={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},tz={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},nz={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},iz={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},sz={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},rz={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},oz={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},az={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},lz={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},cz={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Ih={__proto__:null,fade:O5,fadeVisible:N5,fadeVisibleOnce:U5,pop:F5,popVisible:k5,popVisibleOnce:B5,rollBottom:j5,rollLeft:z5,rollRight:G5,rollTop:$5,rollVisibleBottom:K5,rollVisibleLeft:V5,rollVisibleOnceBottom:Z5,rollVisibleOnceLeft:H5,rollVisibleOnceRight:X5,rollVisibleOnceTop:Y5,rollVisibleRight:W5,rollVisibleTop:q5,slideBottom:az,slideLeft:J5,slideRight:tz,slideTop:sz,slideVisibleBottom:lz,slideVisibleLeft:Q5,slideVisibleOnceBottom:cz,slideVisibleOnceLeft:ez,slideVisibleOnceRight:iz,slideVisibleOnceTop:oz,slideVisibleRight:nz,slideVisibleTop:rz};function uz(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 Ew=Symbol(""),Tw={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 fz(n){return Object.prototype.toString.call(n)==="[object Object]"}function Vg(n){if(Array.isArray(n))return n.map(Vg);if(fz(n)){const e={};for(const t in n)e[t]=Vg(n[t]);return e}return n}function ww(n){const e=bi({}),t=mn(Ew,{}),i=Ee(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(ut(t)[n.preset]):n.preset in Ih?structuredClone(Ih[n.preset]):{}),s=Ee(()=>({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=Ee(()=>{const l=TT({},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(Vg(o.value),l.props);return l.props.onVnodeMounted=({el:d})=>{e[c]=Mw(d,f)},l.props.onVnodeUpdated=({el:d})=>{const p=zd(e[c].state);for(const[_,g]of Object.entries(p))d.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const hz=fn({name:"Motion",props:{...Tw,is:{type:[String,Object],default:"div"}},setup(n){const e=A0(),{motionConfig:t,setNodeInstance:i}=ww(n);return()=>{const s=zd(t.value.initial||{}),r=Ls(n.is,void 0,e);return i(r,0,s),r}}}),dz=fn({name:"MotionGroup",props:{...Tw,is:{type:[String,Object],required:!1}},setup(n){const e=A0(),{motionConfig:t,setNodeInstance:i}=ww(n);return()=>{var o;const s=zd(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,b=i.easing;return g.offsetWidth,a(function(v){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,y,b)),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),b;return l(g,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(b=_.querySelector(i.spinnerSelector),b&&d(b)),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,S=v.charAt(0).toUpperCase()+v.slice(1),P;T--;)if(P=p[T]+S,P in E)return P;return v}function y(v){return v=g(v),_[v]||(_[v]=m(v))}function b(v,E,T){E=y(E),v.style[E]=T}return function(v,E){var T=arguments,S,P;if(T.length==2)for(S in E)P=E[S],P!==void 0&&E.hasOwnProperty(S)&&b(v,S,P);else b(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})}(Rf)),Rf.exports}var vz=_z();const Aw=mz(vz);/*! + * pinia v3.0.1 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let Cw;const Vd=n=>Cw=n,Rw=Symbol();function Hg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var kl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(kl||(kl={}));function yz(){const n=g0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=M0({install(r){Vd(s),s._a=r,r.provide(Rw,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 Pw=()=>{};function dx(n,e,t,i=Pw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&Xh()&&_0(s),s}function Qo(n,...e){n.slice().forEach(t=>{t(...e)})}const bz=n=>n(),px=Symbol(),_m=Symbol();function Gg(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];Hg(s)&&Hg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Cs(i)?n[t]=Gg(s,i):n[t]=i}return n}const xz=Symbol();function Mz(n){return!Hg(n)||!n.hasOwnProperty(xz)}const{assign:er}=Object;function Sz(n){return!!(Pt(n)&&n.effect)}function Ez(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=aS(t.state.value[n]);return er(u,r,Object.keys(o||{}).reduce((f,h)=>(f[h]=M0(Ee(()=>{Vd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=Iw(n,c,e,t,i,!0),l}function Iw(n,e,t={},i,s,r){let o;const a=er({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),et({});let _;function g(P){let x;c=u=!1,typeof P=="function"?(P(i.state.value[n]),x={type:kl.patchFunction,storeId:n,events:d}):(Gg(i.state.value[n],P),x={type:kl.patchObject,payload:P,storeId:n,events:d});const M=_=Symbol();Sr().then(()=>{_===M&&(c=!0)}),u=!0,Qo(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(L=>{er(L,M)})}:Pw;function y(){o.stop(),f=[],h=[],i._s.delete(n)}const b=(P,x="")=>{if(px in P)return P[_m]=x,P;const M=function(){Vd(i);const L=Array.from(arguments),F=[],H=[];function Y(Q){F.push(Q)}function ee(Q){H.push(Q)}Qo(h,{args:L,name:M[_m],store:E,after:Y,onError:ee});let K;try{K=P.apply(this&&this.$id===n?this:E,L)}catch(Q){throw Qo(H,Q),Q}return K instanceof Promise?K.then(Q=>(Qo(F,Q),Q)).catch(Q=>(Qo(H,Q),Promise.reject(Q))):(Qo(F,K),K)};return M[px]=!0,M[_m]=x,M},v={_p:i,$id:n,$onAction:dx.bind(null,h),$patch:g,$reset:m,$subscribe(P,x={}){const M=dx(f,P,x.detached,()=>L()),L=o.run(()=>$e(()=>i.state.value[n],F=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:kl.direct,events:d},F)},er({},l,x)));return M},$dispose:y},E=bi(v);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||bz)(()=>i._e.run(()=>(o=g0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Sz(x)||Cs(x))r||(p&&Mz(x)&&(Pt(x)?x.value=p[P]:Gg(x,p[P])),i.state.value[n][P]=x);else if(typeof x=="function"){const M=b(x,P);S[P]=M,a.actions[P]=x}}return er(E,S),er(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{er(x,P)})}}),i._p.forEach(P=>{er(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 Tz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Cc();return o=o||(l?mn(Rw,null):null),o&&Vd(o),o=Cw,o._s.has(n)||(s?Iw(n,e,i,o):Ez(n,i,o)),o._s.get(n)}return r.$id=n,r}function wz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Ee({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Cs(s))&&(t[i]=lS(n,i))}return t}const Az=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>ct(()=>import("./default-Bh41rP52.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>ct(()=>import("./stage-U4jEVKpb.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 ta=typeof document<"u";function Lw(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Cz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&Lw(n.default)}const Mt=Object.assign;function vm(n,e){const t={};for(const i in e){const s=e[i];t[i]=Bi(s)?s.map(n):n(s)}return t}const Bl=()=>{},Bi=Array.isArray,Dw=/#/g,Rz=/&/g,Pz=/\//g,Iz=/=/g,Lz=/\?/g,Ow=/\+/g,Dz=/%5B/g,Oz=/%5D/g,Nw=/%5E/g,Nz=/%60/g,Uw=/%7B/g,Uz=/%7C/g,Fw=/%7D/g,Fz=/%20/g;function B_(n){return encodeURI(""+n).replace(Uz,"|").replace(Dz,"[").replace(Oz,"]")}function kz(n){return B_(n).replace(Uw,"{").replace(Fw,"}").replace(Nw,"^")}function Wg(n){return B_(n).replace(Ow,"%2B").replace(Fz,"+").replace(Dw,"%23").replace(Rz,"%26").replace(Nz,"`").replace(Uw,"{").replace(Fw,"}").replace(Nw,"^")}function Bz(n){return Wg(n).replace(Iz,"%3D")}function zz(n){return B_(n).replace(Dw,"%23").replace(Lz,"%3F")}function Vz(n){return n==null?"":zz(n).replace(Pz,"%2F")}function bc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const Hz=/\/$/,Gz=n=>n.replace(Hz,"");function ym(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=qz(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:bc(o)}}function Wz(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function mx(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function Xz(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ca(e.matched[i],t.matched[s])&&kw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ca(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function kw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!$z(n[t],e[t]))return!1;return!0}function $z(n,e){return Bi(n)?gx(n,e):Bi(e)?gx(e,n):n===e}function gx(n,e){return Bi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function qz(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 Js={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var xc;(function(n){n.pop="pop",n.push="push"})(xc||(xc={}));var zl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(zl||(zl={}));function Yz(n){if(!n)if(ta){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),Gz(n)}const jz=/^[^#]+#/;function Kz(n,e){return n.replace(jz,"#")+e}function Zz(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 Hd=()=>({left:window.scrollX,top:window.scrollY});function Jz(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=Zz(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 _x(n,e){return(history.state?history.state.position-e:-1)+n}const Xg=new Map;function Qz(n,e){Xg.set(n,e)}function eV(n){const e=Xg.get(n);return Xg.delete(n),e}let tV=()=>location.protocol+"//"+location.host;function Bw(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),mx(l,"")}return mx(t,n)+i+s}function nV(n,e,t,i){let s=[],r=[],o=null;const a=({state:h})=>{const d=Bw(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:xc.pop,direction:g?g>0?zl.forward:zl.back:zl.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(Mt({},h.state,{scroll:Hd()}),"")}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 vx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?Hd():null}}function iV(n){const{history:e,location:t}=window,i={value:Bw(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:tV()+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=Mt({},e.state,vx(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=Mt({},s.value,e.state,{forward:l,scroll:Hd()});r(u.current,u,!0);const f=Mt({},vx(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 sV(n){n=Yz(n);const e=iV(n),t=nV(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Mt({location:"",base:n,go:i,createHref:Kz.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 rV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),sV(n)}function oV(n){return typeof n=="string"||n&&typeof n=="object"}function zw(n){return typeof n=="string"||typeof n=="symbol"}const Vw=Symbol("");var yx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(yx||(yx={}));function Ra(n,e){return Mt(new Error,{type:n,[Vw]:!0},e)}function gs(n,e){return n instanceof Error&&Vw in n&&(e==null||!!(n.type&e))}const bx="[^/]+?",aV={sensitive:!1,strict:!1,start:!0,end:!0},lV=/[.+*?^${}()[\]/\\]/g;function cV(n,e){const t=Mt({},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 Hw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const fV={type:0,value:""},hV=/[a-zA-Z0-9_]/;function dV(n){if(!n)return[[]];if(n==="/")return[[fV]];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(b)}:Bl}function o(f){if(zw(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=vV(f,t);t.splice(h,0,f),f.record.name&&!Ex(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 Ra(1,{location:f});g=d.record.name,p=Mt(Mx(h.params,d.keys.filter(b=>!b.optional).concat(d.parent?d.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Mx(f.params,d.keys.map(b=>b.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(b=>b.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(b=>b.re.test(h.path)),!d)throw Ra(1,{location:f,currentLocation:h});g=d.record.name,p=Mt({},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:_V(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 Mx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Sx(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:gV(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 gV(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 Ex(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function _V(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Tx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function vV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Hw(n,e[r])<0?i=r:t=r+1}const s=yV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function yV(n){let e=n;for(;e=e.parent;)if(Gw(e)&&Hw(n,e)===0)return e}function Gw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function bV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Wg(r)):[i&&Wg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function xV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Bi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const MV=Symbol(""),Ax=Symbol(""),Gd=Symbol(""),z_=Symbol(""),$g=Symbol("");function ll(){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 or(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(Ra(4,{from:t,to:e})):h instanceof Error?l(h):oV(h)?l(Ra(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 bm(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(Lw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(or(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=Cz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&or(d,t,i,o,a,s)()}))}}return r}function Cx(n){const e=mn(Gd),t=mn(z_),i=Ee(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Ee(()=>{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(Ca.bind(null,u));if(h>-1)return h;const d=Rx(l[c-2]);return c>1&&Rx(u)===d&&f[f.length-1].path!==d?f.findIndex(Ca.bind(null,l[c-2])):h}),r=Ee(()=>s.value>-1&&AV(t.params,i.value.params)),o=Ee(()=>s.value>-1&&s.value===t.matched.length-1&&kw(t.params,i.value.params));function a(l={}){if(wV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Bl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Ee(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function SV(n){return n.length===1?n[0]:n}const EV=fn({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:Cx,setup(n,{slots:e}){const t=bi(Cx(n)),{options:i}=mn(Gd),s=Ee(()=>({[Px(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Px(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&SV(e.default(t));return n.custom?r:Ls("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),TV=EV;function wV(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 AV(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(!Bi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Rx(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Px=(n,e,t)=>n??e??t,CV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=mn($g),s=Ee(()=>n.route||i.value),r=mn(Ax,0),o=Ee(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Ee(()=>s.value.matched[o.value]);fr(Ax,Ee(()=>o.value+1)),fr(MV,a),fr($g,s);const l=et();return $e(()=>[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||!Ca(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 Ix(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=Ls(h,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Ix(t.default,{Component:g,route:c})||g}}});function Ix(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const Ww=CV;function RV(n){const e=mV(n.routes,n),t=n.parseQuery||bV,i=n.stringifyQuery||wx,s=n.history,r=ll(),o=ll(),a=ll(),l=De(Js);let c=Js;ta&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vm.bind(null,X=>""+X),f=vm.bind(null,Vz),h=vm.bind(null,bc);function d(X,ae){let fe,ce;return zw(X)?(fe=e.getRecordMatcher(X),ce=ae):ce=X,e.addRoute(ce,fe)}function p(X){const ae=e.getRecordMatcher(X);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(X=>X.record)}function g(X){return!!e.getRecordMatcher(X)}function m(X,ae){if(ae=Mt({},ae||l.value),typeof X=="string"){const R=ym(t,X,ae.path),te=e.resolve({path:R.path},ae),G=s.createHref(R.fullPath);return Mt(R,te,{params:h(te.params),hash:bc(R.hash),redirectedFrom:void 0,href:G})}let fe;if(X.path!=null)fe=Mt({},X,{path:ym(t,X.path,ae.path).path});else{const R=Mt({},X.params);for(const te in R)R[te]==null&&delete R[te];fe=Mt({},X,{params:f(R)}),ae.params=f(ae.params)}const ce=e.resolve(fe,ae),Ue=X.hash||"";ce.params=u(h(ce.params));const k=Wz(i,Mt({},X,{hash:kz(Ue),path:ce.path})),z=s.createHref(k);return Mt({fullPath:k,hash:Ue,query:i===wx?xV(X.query):X.query||{}},ce,{redirectedFrom:void 0,href:z})}function y(X){return typeof X=="string"?ym(t,X,l.value.path):Mt({},X)}function b(X,ae){if(c!==X)return Ra(8,{from:ae,to:X})}function v(X){return S(X)}function E(X){return v(Mt(y(X),{replace:!0}))}function T(X){const ae=X.matched[X.matched.length-1];if(ae&&ae.redirect){const{redirect:fe}=ae;let ce=typeof fe=="function"?fe(X):fe;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Mt({query:X.query,hash:X.hash,params:ce.path!=null?{}:X.params},ce)}}function S(X,ae){const fe=c=m(X),ce=l.value,Ue=X.state,k=X.force,z=X.replace===!0,R=T(fe);if(R)return S(Mt(y(R),{state:typeof R=="object"?Mt({},Ue,R.state):Ue,force:k,replace:z}),ae||fe);const te=fe;te.redirectedFrom=ae;let G;return!k&&Xz(i,ce,fe)&&(G=Ra(16,{to:te,from:ce}),se(ce,ce,!0,!1)),(G?Promise.resolve(G):M(te,ce)).catch(W=>gs(W)?gs(W,2)?W:be(W):Z(W,te,ce)).then(W=>{if(W){if(gs(W,2))return S(Mt({replace:z},y(W.to),{state:typeof W.to=="object"?Mt({},Ue,W.to.state):Ue,force:k}),ae||te)}else W=F(te,ce,!0,z,Ue);return L(te,ce,W),W})}function P(X,ae){const fe=b(X,ae);return fe?Promise.reject(fe):Promise.resolve()}function x(X){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(X):X()}function M(X,ae){let fe;const[ce,Ue,k]=PV(X,ae);fe=bm(ce.reverse(),"beforeRouteLeave",X,ae);for(const R of ce)R.leaveGuards.forEach(te=>{fe.push(or(te,X,ae))});const z=P.bind(null,X,ae);return fe.push(z),xe(fe).then(()=>{fe=[];for(const R of r.list())fe.push(or(R,X,ae));return fe.push(z),xe(fe)}).then(()=>{fe=bm(Ue,"beforeRouteUpdate",X,ae);for(const R of Ue)R.updateGuards.forEach(te=>{fe.push(or(te,X,ae))});return fe.push(z),xe(fe)}).then(()=>{fe=[];for(const R of k)if(R.beforeEnter)if(Bi(R.beforeEnter))for(const te of R.beforeEnter)fe.push(or(te,X,ae));else fe.push(or(R.beforeEnter,X,ae));return fe.push(z),xe(fe)}).then(()=>(X.matched.forEach(R=>R.enterCallbacks={}),fe=bm(k,"beforeRouteEnter",X,ae,x),fe.push(z),xe(fe))).then(()=>{fe=[];for(const R of o.list())fe.push(or(R,X,ae));return fe.push(z),xe(fe)}).catch(R=>gs(R,8)?R:Promise.reject(R))}function L(X,ae,fe){a.list().forEach(ce=>x(()=>ce(X,ae,fe)))}function F(X,ae,fe,ce,Ue){const k=b(X,ae);if(k)return k;const z=ae===Js,R=ta?history.state:{};fe&&(ce||z?s.replace(X.fullPath,Mt({scroll:z&&R&&R.scroll},Ue)):s.push(X.fullPath,Ue)),l.value=X,se(X,ae,fe,z),be()}let H;function Y(){H||(H=s.listen((X,ae,fe)=>{if(!ge.listening)return;const ce=m(X),Ue=T(ce);if(Ue){S(Mt(Ue,{replace:!0,force:!0}),ce).catch(Bl);return}c=ce;const k=l.value;ta&&Qz(_x(k.fullPath,fe.delta),Hd()),M(ce,k).catch(z=>gs(z,12)?z:gs(z,2)?(S(Mt(y(z.to),{force:!0}),ce).then(R=>{gs(R,20)&&!fe.delta&&fe.type===xc.pop&&s.go(-1,!1)}).catch(Bl),Promise.reject()):(fe.delta&&s.go(-fe.delta,!1),Z(z,ce,k))).then(z=>{z=z||F(ce,k,!1),z&&(fe.delta&&!gs(z,8)?s.go(-fe.delta,!1):fe.type===xc.pop&&gs(z,20)&&s.go(-1,!1)),L(ce,k,z)}).catch(Bl)}))}let ee=ll(),K=ll(),Q;function Z(X,ae,fe){be(X);const ce=K.list();return ce.length?ce.forEach(Ue=>Ue(X,ae,fe)):console.error(X),Promise.reject(X)}function de(){return Q&&l.value!==Js?Promise.resolve():new Promise((X,ae)=>{ee.add([X,ae])})}function be(X){return Q||(Q=!X,Y(),ee.list().forEach(([ae,fe])=>X?fe(X):ae()),ee.reset()),X}function se(X,ae,fe,ce){const{scrollBehavior:Ue}=n;if(!ta||!Ue)return Promise.resolve();const k=!fe&&eV(_x(X.fullPath,0))||(ce||!fe)&&history.state&&history.state.scroll||null;return Sr().then(()=>Ue(X,ae,k)).then(z=>z&&Jz(z)).catch(z=>Z(z,X,ae))}const ye=X=>s.go(X);let He;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:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:K.add,isReady:de,install(X){const ae=this;X.component("RouterLink",TV),X.component("RouterView",Ww),X.config.globalProperties.$router=ae,Object.defineProperty(X.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),ta&&!He&&l.value===Js&&(He=!0,v(s.location).catch(Ue=>{}));const fe={};for(const Ue in Js)Object.defineProperty(fe,Ue,{get:()=>l.value[Ue],enumerable:!0});X.provide(Gd,ae),X.provide(z_,sS(fe)),X.provide($g,l);const ce=X.unmount;re.add(X),X.unmount=function(){re.delete(X),re.size<1&&(c=Js,H&&H(),H=null,l.value=Js,He=!1,Q=!1),ce()}}};function xe(X){return X.reduce((ae,fe)=>ae.then(()=>x(fe)),Promise.resolve())}return ge}function PV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oCa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ca(c,l))||s.push(l))}return[t,i,s]}function IV(){return mn(Gd)}function AG(n){return mn(z_)}const LV=[{path:"/",name:"/",component:()=>ct(()=>import("./index-DCgZ1otg.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,1,2,15,16,17])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>ct(()=>import("./_...all_-D0bo-J_D.js"),[])},{path:"/audio",name:"/audio",component:()=>ct(()=>import("./audio-CnQLgRPc.js"),[])},{path:"/devtools",children:[{path:"image",name:"/devtools/image",component:()=>ct(()=>import("./image-sQ7wa3Pp.js"),__vite__mapDeps([18,19]))}]},{path:"/queue",name:"/queue",component:()=>ct(()=>import("./queue-2N0dKXI3.js"),__vite__mapDeps([20,8]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>ct(()=>import("./index-BdXRtjBk.js"),__vite__mapDeps([21,4,5,22,16,23])),meta:{stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>ct(()=>import("./index-DiIZdg1G.js"),__vite__mapDeps([24,25,26,13,27,28,10,5,11,7,6,16])),meta:{stageTransition:{name:"slide"}}},{path:":id",name:"/settings/airi-card/[id]",component:()=>ct(()=>import("./_id_-DD5Yu2WU.js"),__vite__mapDeps([29,25,4,10,5,11,7,6,30,14,13]))}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>ct(()=>import("./index-D2jND_zI.js"),__vite__mapDeps([31,22,4,5,30,14,13,32,33,16,34])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>ct(()=>import("./index-_0NCz_E2.js"),[])}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>ct(()=>import("./index-B7xgUlCR.js"),__vite__mapDeps([35,22,12,4,5,30,14,13,32,33,16,36])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>ct(()=>import("./index-E_an0jlT.js"),__vite__mapDeps([37,4,5,38,39,22,33,16])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>ct(()=>import("./consciousness-BAeO6vIi.js"),__vite__mapDeps([40,41,42,26,13,27,28,4,5,11,7,16])),meta:{stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>ct(()=>import("./memory-long-term-xs6JztMh.js"),[])},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>ct(()=>import("./memory-short-term-VxuYhEO8.js"),[])},{path:"speech",name:"/settings/modules/speech",component:()=>ct(()=>import("./speech-Cin2zufB.js"),__vite__mapDeps([43,44,45,46,27,41,42,26,13,28,4,5,7,6,16,47])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>ct(()=>import("./index-m5xEO3nx.js"),__vite__mapDeps([48,22,4,5,7,38,39,33,16])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>ct(()=>import("./anthropic-e6mHsga1.js"),__vite__mapDeps([49,4,5,7,50,14,13,46,27,51,52,53]))},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>ct(()=>import("./cloudflare-workers-ai-CQRVl7Sv.js"),__vite__mapDeps([54,4,5,7,46,27,51,52,53]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>ct(()=>import("./deepseek-gWAOZ6Io.js"),__vite__mapDeps([55,4,5,7,50,14,13,46,27,51,52,53]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>ct(()=>import("./elevenlabs-CbE-A_Z6.js"),__vite__mapDeps([56,4,5,7,6,57,44,45,50,14,13,46,27,51,52]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>ct(()=>import("./fireworks-ai-D9hKrVV7.js"),__vite__mapDeps([58,4,5,7,50,14,13,46,27,51,52,53]))},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>ct(()=>import("./microsoft-speech-DxHKvU9d.js"),__vite__mapDeps([59,46,27,4,5,7,6,57,44,45,50,14,13,51,52]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>ct(()=>import("./mistral-ai-fThv8auK.js"),__vite__mapDeps([60,4,5,7,50,14,13,46,27,51,52,53]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>ct(()=>import("./moonshot-ai-nB1DlMEd.js"),__vite__mapDeps([61,4,5,7,50,14,13,46,27,51,52,53]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>ct(()=>import("./novita-ai-DlllHYS3.js"),__vite__mapDeps([62,4,5,7,50,14,13,46,27,51,52,53]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>ct(()=>import("./ollama-CoKkn-rf.js"),__vite__mapDeps([63,27,4,5,7,50,14,13,46,52,53]))},{path:"openai",name:"/settings/providers/openai",component:()=>ct(()=>import("./openai-DOQ7jvcz.js"),__vite__mapDeps([64,4,5,7,50,14,13,46,27,51,52,53]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>ct(()=>import("./openrouter-ai-C74OiWQd.js"),__vite__mapDeps([65,4,5,7,50,14,13,46,27,51,52,53]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>ct(()=>import("./together-ai-Bsm7LTTc.js"),__vite__mapDeps([66,4,5,7,50,14,13,46,27,51,52,53]))},{path:"xai",name:"/settings/providers/xai",component:()=>ct(()=>import("./xai-DhNcKb7x.js"),__vite__mapDeps([67,4,5,7,50,14,13,46,27,51,52,53]))}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>ct(()=>import("./filter-message-CElyApsm.js"),[])},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>ct(()=>import("./delays-CeBiNvEk.js"),__vite__mapDeps([68,9,5,8,4,15]))},{path:"emotions",name:"/test/queues/emotions",component:()=>ct(()=>import("./emotions-DyG_d_3u.js"),__vite__mapDeps([69,9,5,8,4]))},{path:"messages",name:"/test/queues/messages",component:()=>ct(()=>import("./messages-RPEwvPZ2.js"),__vite__mapDeps([70,9,5,8,4]))}]}]}],Xw=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},DV={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},OV=n=>Xw(DV[n.toLowerCase()],6),NV=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,UV=n=>{let e;return(e=n.match(NV))?Xw(parseInt(e[1],16),e[1].length):void 0},hr="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Vl=`${hr}%`,V_=`(?:${hr}%|${hr})`,FV=`(?:${hr}(deg|grad|rad|turn)|${hr})`,Pa="\\s*,\\s*",kV=new RegExp(`^rgba?\\(\\s*${hr}${Pa}${hr}${Pa}${hr}\\s*(?:,\\s*${V_}\\s*)?\\)$`),BV=new RegExp(`^rgba?\\(\\s*${Vl}${Pa}${Vl}${Pa}${Vl}\\s*(?:,\\s*${V_}\\s*)?\\)$`),zV=n=>{let e={mode:"rgb"},t;if(t=n.match(kV))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(BV))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},VV=(n,e)=>n===void 0?void 0:typeof n!="object"?ZV(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,$w=(n="rgb")=>e=>(e=VV(e,n))!==void 0?e.mode===n?e:Yi[e.mode][n]?Yi[e.mode][n](e):n==="rgb"?Yi[e.mode].rgb(e):Yi.rgb[n](Yi[e.mode].rgb(e)):void 0,Yi={},qw={},Lh=[],Yw={},HV=n=>n,Et=n=>(Yi[n.mode]={...Yi[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Yi[e]||(Yi[e]={}),Yi[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=HV)}),qw[n.mode]=n,(n.parse||[]).forEach(e=>{WV(e,n.mode)}),$w(n.mode)),GV=n=>qw[n],WV=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Yw[n]=e}else typeof n=="function"&&Lh.indexOf(n)<0&&Lh.push(n)},qg=/[^\x00-\x7F]|[a-zA-Z_]/,XV=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let qe=0;function cf(n){let e=n[qe],t=n[qe+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[qe+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Yg(n){if(qe>=n.length)return!1;let e=n[qe];if(qg.test(e))return!0;if(e==="-"){if(n.length-qe<2)return!1;let t=n[qe+1];return!!(t==="-"||qg.test(t))}return!1}const $V={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function cl(n){let e="";if((n[qe]==="-"||n[qe]==="+")&&(e+=n[qe++]),e+=uf(n),n[qe]==="."&&/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n)),(n[qe]==="e"||n[qe]==="E")&&((n[qe+1]==="-"||n[qe+1]==="+")&&/\d/.test(n[qe+2])?e+=n[qe++]+n[qe++]+uf(n):/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n))),Yg(n)){let t=Dh(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*$V[t]}:void 0}return n[qe]==="%"?(qe++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function uf(n){let e="";for(;/\d/.test(n[qe]);)e+=n[qe++];return e}function Dh(n){let e="";for(;qe4)){if(t.length===4){if(t[3].type!==_e.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:_e.None,value:void 0}),t.every(s=>s.type!==_e.Alpha)?t:void 0}}function KV(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==_e.Function)return;let i=jw(n,e);if(i)return i.unshift(t.value),i}const ZV=n=>{if(typeof n!="string")return;const e=YV(n),t=e?KV(e,!0):void 0;let i,s=0,r=Lh.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,e6=(n,e,t)=>n+t*(e-n),t6=n=>{let e=[];for(let t=0;te=>{let t=t6(e);return i=>{let s=i*t.length,r=i>=1?t.length-1:Math.max(Math.floor(s),0),o=t[r];return o===void 0?void 0:n(o[0],o[1],s-r)}},Ae=n6(e6),on=n=>{let e=!1,t=n.map(i=>i!==void 0?(e=!0,i):1);return e?t:n},Ha={mode:"rgb",channels:["r","g","b","alpha"],parse:[JV,UV,zV,OV,QV,"srgb"],serialize:"srgb",interpolate:{r:Ae,g:Ae,b:Ae,alpha:{use:Ae,fixup:on}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},xm=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Lx=n=>{let e=xm(n.r),t=xm(n.g),i=xm(n.b),s={mode:"xyz65",x:.5766690429101305*e+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*e+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*e+.0706888525358272*t+.9913375368376386*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},Mm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(n),Dx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"a98",r:Mm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:Mm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:Mm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},Sm=(n=0)=>{const e=Math.abs(n);return e<=.04045?n/12.92:(Math.sign(n)||1)*Math.pow((e+.055)/1.055,2.4)},Ga=({r:n,g:e,b:t,alpha:i})=>{let s={mode:"lrgb",r:Sm(n),g:Sm(e),b:Sm(t)};return i!==void 0&&(s.alpha=i),s},Po=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz65",x:.4123907992659593*e+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*e+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*e+.119194779794626*t+.9505321522496607*i};return s!==void 0&&(r.alpha=s),r},Em=(n=0)=>{const e=Math.abs(n);return e>.0031308?(Math.sign(n)||1)*(1.055*Math.pow(e,1/2.4)-.055):n*12.92},Wa=({r:n,g:e,b:t,alpha:i},s="rgb")=>{let r={mode:s,r:Em(n),g:Em(e),b:Em(t)};return i!==void 0&&(r.alpha=i),r},Io=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*3.2409699419045226-e*1.537383177570094-.4986107602930034*t,g:n*-.9692436362808796+e*1.8759675015077204+.0415550574071756*t,b:n*.0556300796969936-e*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(s.alpha=i),s},i6={...Ha,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>Dx(Po(n)),xyz65:Dx},toMode:{rgb:n=>Io(Lx(n)),xyz65:Lx}},vn=n=>(n=n%360)<0?n+360:n,s6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=vn(t);return i===0||n[i-1]===void 0?r:e(r-vn(s[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),Hs=n=>s6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),ln=[-.14861,1.78277,-.29227,-.90649,1.97294,0],r6=Math.PI/180,o6=180/Math.PI;let Ox=ln[3]*ln[4],Nx=ln[1]*ln[4],Ux=ln[1]*ln[2]-ln[0]*ln[3];const a6=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(Ux*t+n*Ox-e*Nx)/(Ux+Ox-Nx),r=t-s,o=(ln[4]*(e-s)-ln[2]*r)/ln[3],a={mode:"cubehelix",l:s,s:s===0||s===1?void 0:Math.sqrt(r*r+o*o)/(ln[4]*s*(1-s))};return a.s&&(a.h=Math.atan2(o,r)*o6-120),i!==void 0&&(a.alpha=i),a},l6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*r6,t===void 0&&(t=0);let r=e===void 0?0:e*t*(1-t),o=Math.cos(n),a=Math.sin(n);return s.r=t+r*(ln[0]*o+ln[1]*a),s.g=t+r*(ln[2]*o+ln[3]*a),s.b=t+r*(ln[4]*o+ln[5]*a),i!==void 0&&(s.alpha=i),s},Wd=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=vn(n.h),i=vn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},c6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=vn(n.h),i=vn(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},Xd=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=vn(n.h),i=vn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},Gs=n=>{let e=n.reduce((i,s)=>{if(s!==void 0){let r=s*Math.PI/180;i.sin+=Math.sin(r),i.cos+=Math.cos(r)}return i},{sin:0,cos:0}),t=Math.atan2(e.sin,e.cos)*180/Math.PI;return t<0?360+t:t},u6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:a6},toMode:{rgb:l6},interpolate:{h:{use:Ae,fixup:Hs},s:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Wd},average:{h:Gs}},yr=({l:n,a:e,b:t,alpha:i},s="lch")=>{e===void 0&&(e=0),t===void 0&&(t=0);let r=Math.sqrt(e*e+t*t),o={mode:s,l:n,c:r};return r&&(o.h=vn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},br=({l:n,c:e,h:t,alpha:i},s="lab")=>{t===void 0&&(t=0);let r={mode:s,l:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Kw=Math.pow(29,3)/Math.pow(3,3),Zw=Math.pow(6,3)/Math.pow(29,3),Jt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},pa={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Tm=n=>Math.pow(n,3)>Zw?Math.pow(n,3):(116*n-16)/Kw;const Jw=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz65",x:Tm(r)*pa.X,y:Tm(s)*pa.Y,z:Tm(o)*pa.Z};return i!==void 0&&(a.alpha=i),a},$d=n=>Io(Jw(n)),wm=n=>n>Zw?Math.cbrt(n):(Kw*n+16)/116,Qw=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=wm(n/pa.X),r=wm(e/pa.Y),o=wm(t/pa.Z),a={mode:"lab65",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},qd=n=>{let e=Qw(Po(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Oh=1,eA=1,Mc=26/180*Math.PI,Nh=Math.cos(Mc),Uh=Math.sin(Mc),tA=100/Math.log(139/100),jg=({l:n,c:e,h:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"lab65",l:(Math.exp(n*Oh/tA)-1)/.0039},r=(Math.exp(.0435*e*eA*Oh)-1)/.075,o=r*Math.cos(t/180*Math.PI-Mc),a=r*Math.sin(t/180*Math.PI-Mc);return s.a=o*Nh-a/.83*Uh,s.b=o*Uh+a/.83*Nh,i!==void 0&&(s.alpha=i),s},Kg=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=e*Nh+t*Uh,r=.83*(t*Nh-e*Uh),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:tA/Oh*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*eA*Oh)};return a.c&&(a.h=vn((Math.atan2(r,s)+Mc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},Fx=n=>jg(yr(n,"dlch")),kx=n=>br(Kg(n),"dlab"),f6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Fx,rgb:n=>$d(Fx(n))},fromMode:{lab65:kx,rgb:n=>kx(qd(n))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},h6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:jg,dlab:n=>br(n,"dlab"),rgb:n=>$d(jg(n))},fromMode:{lab65:Kg,dlab:n=>yr(n,"dlch"),rgb:n=>Kg(qd(n))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Ae,c:Ae,h:{use:Ae,fixup:Hs},alpha:{use:Ae,fixup:on}},difference:{h:Xd},average:{h:Gs}};function d6({h:n,s:e,i:t,alpha:i}){n=vn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1-e)};break;case 1:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1+e*(3/(2-s)-1)),b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t*(1+e*(3/(2-s)-1)),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;case 3:r={r:t*(1-e),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1+e*(3/(2-s)-1))};break;case 4:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3/(2-s)-1))};break;case 5:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function p6({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsi",s:n+e+t===0?0:1-3*r/(n+e+t),i:(n+e+t)/3};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e{switch(e){case"deg":return+n;case"rad":return n/Math.PI*180;case"grad":return n/10*9;case"turn":return n*360}},y6=new RegExp(`^hsla?\\(\\s*${FV}${Pa}${Vl}${Pa}${Vl}\\s*(?:,\\s*${V_}\\s*)?\\)$`),b6=n=>{let e=n.match(y6);if(!e)return;let t={mode:"hsl"};return e[3]!==void 0?t.h=+e[3]:e[1]!==void 0&&e[2]!==void 0&&(t.h=v6(e[1],e[2])),e[4]!==void 0&&(t.s=Math.min(Math.max(0,e[4]/100),1)),e[5]!==void 0&&(t.l=Math.min(Math.max(0,e[5]/100),1)),e[6]!==void 0?t.alpha=Math.max(0,Math.min(1,e[6]/100)):e[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+e[7]))),t};function x6(n,e){if(!e||e[0]!=="hsl"&&e[0]!=="hsla")return;const t={mode:"hsl"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.s=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.l=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const nA={mode:"hsl",toMode:{rgb:g6},fromMode:{rgb:_6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[x6,b6],serialize:n=>`hsl(${n.h!==void 0?n.h:"none"} ${n.s!==void 0?n.s*100+"%":"none"} ${n.l!==void 0?n.l*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Hs},s:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Wd},average:{h:Gs}};function iA({h:n,s:e,v:t,alpha:i}){n=vn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t,g:t*(1-e*s),b:t*(1-e)};break;case 1:r={r:t*(1-e*s),g:t,b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t,b:t*(1-e*s)};break;case 3:r={r:t*(1-e),g:t*(1-e*s),b:t};break;case 4:r={r:t*(1-e*s),g:t*(1-e),b:t};break;case 5:r={r:t,g:t*(1-e),b:t*(1-e*s)};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function sA({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsv",s:s===0?0:1-r/s,v:s};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e1){let s=e+t;e/=s,t/=s}return iA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function S6(n){let e=sA(n);if(e===void 0)return;let t=e.s!==void 0?e.s:0,i=e.v!==void 0?e.v:0,s={mode:"hwb",w:(1-t)*i,b:1-i};return e.h!==void 0&&(s.h=e.h),e.alpha!==void 0&&(s.alpha=e.alpha),s}function E6(n,e){if(!e||e[0]!=="hwb")return;const t={mode:"hwb"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.w=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.b=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const T6={mode:"hwb",toMode:{rgb:M6},fromMode:{rgb:S6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[E6],serialize:n=>`hwb(${n.h!==void 0?n.h:"none"} ${n.w!==void 0?n.w*100+"%":"none"} ${n.b!==void 0?n.b*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Hs},w:Ae,b:Ae,alpha:{use:Ae,fixup:on}},difference:{h:c6},average:{h:Gs}},oA=203,Yd=.1593017578125,aA=78.84375,jd=.8359375,Kd=18.8515625,Zd=18.6875;function Am(n){if(n<0)return 0;const e=Math.pow(n,1/aA);return 1e4*Math.pow(Math.max(0,e-jd)/(Kd-Zd*e),1/Yd)}function Cm(n){if(n<0)return 0;const e=Math.pow(n/1e4,Yd);return Math.pow((jd+Kd*e)/(1+Zd*e),aA)}const Rm=n=>Math.max(n/oA,0),Bx=({i:n,t:e,p:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Am(n+.008609037037932761*e+.11102962500302593*t),r=Am(n-.00860903703793275*e-.11102962500302599*t),o=Am(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Rm(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Rm(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Rm(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Pm=(n=0)=>Math.max(n*oA,0),zx=({x:n,y:e,z:t,alpha:i})=>{const s=Pm(n),r=Pm(e),o=Pm(t),a=Cm(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Cm(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Cm(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,h=4.378173828125*a-4.24560546875*l-.132568359375*c,d={mode:"itp",i:u,t:f,p:h};return i!==void 0&&(d.alpha=i),d},w6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Bx,rgb:n=>Io(Bx(n))},fromMode:{xyz65:zx,rgb:n=>zx(Po(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Ae,t:Ae,p:Ae,alpha:{use:Ae,fixup:on}}},A6=134.03437499999998,C6=16295499532821565e-27,Im=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Yd);return Math.pow((jd+Kd*e)/(1+Zd*e),A6)},Lm=(n=0)=>Math.max(n*203,0),lA=({x:n,y:e,z:t,alpha:i})=>{n=Lm(n),e=Lm(e),t=Lm(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=Im(.41478972*s+.579999*r+.014648*t),a=Im(-.20151*s+1.120649*r+.0531008*t),l=Im(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-C6,a:3.524*o-4.066708*a+.542708*l,b:.199076*o+1.096799*a-1.295875*l};return i!==void 0&&(u.alpha=i),u},R6=134.03437499999998,Vx=16295499532821565e-27,Dm=n=>{if(n<0)return 0;let e=Math.pow(n,1/R6);return 1e4*Math.pow((jd-e)/(Zd*e-Kd),1/Yd)},Om=n=>n/203,cA=({j:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+Vx)/(.44+.56*(n+Vx)),r=Dm(s+.13860504*e+.058047316*t),o=Dm(s-.13860504*e-.058047316*t),a=Dm(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:Om(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:Om(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:Om(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},uA=n=>{let e=lA(Po(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},fA=n=>Io(cA(n)),P6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:uA,xyz65:lA},toMode:{rgb:fA,xyz65:cA},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},Hx=({j:n,a:e,b:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"jch",j:n,c:s};return s&&(r.h=vn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Gx=({j:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"jab",j:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},I6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Gx,rgb:n=>fA(Gx(n))},fromMode:{rgb:n=>Hx(uA(n)),jab:Hx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Ae,fixup:Hs},c:Ae,j:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xd},average:{h:Gs}},Jd=Math.pow(29,3)/Math.pow(3,3),H_=Math.pow(6,3)/Math.pow(29,3);let Nm=n=>Math.pow(n,3)>H_?Math.pow(n,3):(116*n-16)/Jd;const G_=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz50",x:Nm(r)*Jt.X,y:Nm(s)*Jt.Y,z:Nm(o)*Jt.Z};return i!==void 0&&(a.alpha=i),a},Kc=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*3.1341359569958707-e*1.6173863321612538-.4906619460083532*t,g:n*-.978795502912089+e*1.916254567259524+.03344273116131949*t,b:n*.07195537988411677-e*.2289768264158322+1.405386058324125*t});return i!==void 0&&(s.alpha=i),s},hA=n=>Kc(G_(n)),Zc=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz50",x:.436065742824811*e+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*e+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*e+.09708128566574634*t+.7140993584005155*i};return s!==void 0&&(r.alpha=s),r},Um=n=>n>H_?Math.cbrt(n):(Jd*n+16)/116,W_=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Um(n/Jt.X),r=Um(e/Jt.Y),o=Um(t/Jt.Z),a={mode:"lab",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},dA=n=>{let e=W_(Zc(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e};function L6(n,e){if(!e||e[0]!=="lab")return;const t={mode:"lab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.value),100)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*125/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*125/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const X_={mode:"lab",toMode:{xyz50:G_,rgb:hA},fromMode:{xyz50:W_,rgb:dA},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[L6],serialize:n=>`lab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{l:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},D6={...X_,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Jw,rgb:$d},fromMode:{xyz65:Qw,rgb:qd},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function O6(n,e){if(!e||e[0]!=="lch")return;const t={mode:"lch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*150/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const $_={mode:"lch",toMode:{lab:br,rgb:n=>hA(br(n))},fromMode:{rgb:n=>yr(dA(n)),lab:yr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[O6],serialize:n=>`lch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Hs},c:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xd},average:{h:Gs}},N6={...$_,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>br(n,"lab65"),rgb:n=>$d(br(n,"lab65"))},fromMode:{rgb:n=>yr(qd(n),"lch65"),lab65:n=>yr(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},pA=({l:n,u:e,v:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"lchuv",l:n,c:s};return s&&(r.h=vn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},mA=({l:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"luv",l:n,u:e?e*Math.cos(t/180*Math.PI):0,v:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},gA=(n,e,t)=>4*n/(n+15*e+3*t),_A=(n,e,t)=>9*e/(n+15*e+3*t),U6=gA(Jt.X,Jt.Y,Jt.Z),F6=_A(Jt.X,Jt.Y,Jt.Z),k6=n=>n<=H_?Jd*n:116*Math.cbrt(n)-16,Zg=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=k6(e/Jt.Y),r=gA(n,e,t),o=_A(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-U6),o=13*s*(o-F6));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},B6=(n,e,t)=>4*n/(n+15*e+3*t),z6=(n,e,t)=>9*e/(n+15*e+3*t),V6=B6(Jt.X,Jt.Y,Jt.Z),H6=z6(Jt.X,Jt.Y,Jt.Z),Jg=({l:n,u:e,v:t,alpha:i})=>{if(n===void 0&&(n=0),n===0)return{mode:"xyz50",x:0,y:0,z:0};e===void 0&&(e=0),t===void 0&&(t=0);let s=e/(13*n)+V6,r=t/(13*n)+H6,o=Jt.Y*(n<=8?n/Jd:Math.pow((n+16)/116,3)),a=o*(9*s)/(4*r),l=o*(12-3*s-20*r)/(4*r),c={mode:"xyz50",x:a,y:o,z:l};return i!==void 0&&(c.alpha=i),c},G6=n=>pA(Zg(Zc(n))),W6=n=>Kc(Jg(mA(n))),X6={mode:"lchuv",toMode:{luv:mA,rgb:W6},fromMode:{rgb:G6,luv:pA},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Ae,fixup:Hs},c:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xd},average:{h:Gs}},$6={...Ha,mode:"lrgb",toMode:{rgb:Wa},fromMode:{rgb:Ga},parse:["srgb-linear"],serialize:"srgb-linear"},q6={mode:"luv",toMode:{xyz50:Jg,rgb:n=>Kc(Jg(n))},fromMode:{xyz50:Zg,rgb:n=>Zg(Zc(n))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:Ae,u:Ae,v:Ae,alpha:{use:Ae,fixup:on}}},vA=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.cbrt(.41222147079999993*n+.5363325363*e+.0514459929*t),r=Math.cbrt(.2119034981999999*n+.6806995450999999*e+.1073969566*t),o=Math.cbrt(.08830246189999998*n+.2817188376*e+.6299787005000002*t),a={mode:"oklab",l:.2104542553*s+.793617785*r-.0040720468*o,a:1.9779984951*s-2.428592205*r+.4505937099*o,b:.0259040371*s+.7827717662*r-.808675766*o};return i!==void 0&&(a.alpha=i),a},Qd=n=>{let e=vA(Ga(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Jc=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.pow(n*.9999999984505198+.39633779217376786*e+.2158037580607588*t,3),r=Math.pow(n*1.0000000088817609-.10556134232365635*e-.06385417477170591*t,3),o=Math.pow(n*1.0000000546724108-.08948418209496575*e-1.2914855378640917*t,3),a={mode:"lrgb",r:4.076741661347994*s-3.307711590408193*r+.230969928729428*o,g:-1.2684380040921763*s+2.6097574006633715*r-.3413193963102197*o,b:-.004196086541837188*s-.7034186144594493*r+1.7076147009309444*o};return i!==void 0&&(a.alpha=i),a},ep=n=>Wa(Jc(n));function Qg(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Fh(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function Y6(n,e){let t,i,s,r,o,a,l,c;-1.88170328*n-.80936493*e>1?(t=1.19086277,i=1.76576728,s=.59662641,r=.75515197,o=.56771245,a=4.0767416621,l=-3.3077115913,c=.2309699292):1.81444104*n-1.19445276*e>1?(t=.73956515,i=-.45954404,s=.08285427,r=.1254107,o=.14503204,a=-1.2684380046,l=2.6097574011,c=-.3413193965):(t=1.35733652,i=-.00915799,s=-1.1513021,r=-.50559606,o=.00692167,a=-.0041960863,l=-.7034186147,c=1.707614701);let u=t+i*n+s*e+r*n*n+o*n*e,f=.3963377774*n+.2158037573*e,h=-.1055613458*n-.0638541728*e,d=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*h,g=1+u*d,m=p*p*p,y=_*_*_,b=g*g*g,v=3*f*p*p,E=3*h*_*_,T=3*d*g*g,S=6*f*f*p,P=6*h*h*_,x=6*d*d*g,M=a*m+l*y+c*b,L=a*v+l*E+c*T,F=a*S+l*P+c*x;u=u-M*L/(L*L-.5*M*F)}return u}function q_(n,e){let t=Y6(n,e),i=Jc({l:1,a:t*n,b:t*e}),s=Math.cbrt(1/Math.max(i.r,i.g,i.b)),r=s*t;return[s,r]}function j6(n,e,t,i,s,r=null){r||(r=q_(n,e));let o;if((t-s)*r[1]-(r[0]-s)*i<=0)o=r[1]*s/(i*r[0]+r[1]*(s-t));else{o=r[1]*(s-1)/(i*(r[0]-1)+r[1]*(s-t));{let a=t-s,l=i,c=.3963377774*n+.2158037573*e,u=-.1055613458*n-.0638541728*e,f=-.0894841775*n-1.291485548*e,h=a+l*c,d=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,y=_+g*u,b=_+g*f,v=m*m*m,E=y*y*y,T=b*b*b,S=3*h*m*m,P=3*d*y*y,x=3*p*b*b,M=6*h*h*m,L=6*d*d*y,F=6*p*p*b,H=4.0767416621*v-3.3077115913*E+.2309699292*T-1,Y=4.0767416621*S-3.3077115913*P+.2309699292*x,ee=4.0767416621*M-3.3077115913*L+.2309699292*F,K=Y/(Y*Y-.5*H*ee),Q=-H*K,Z=-1.2684380046*v+2.6097574011*E-.3413193965*T-1,de=-1.2684380046*S+2.6097574011*P-.3413193965*x,be=-1.2684380046*M+2.6097574011*L-.3413193965*F,se=de/(de*de-.5*Z*be),ye=-Z*se,He=-.0041960863*v-.7034186147*E+1.707614701*T-1,re=-.0041960863*S-.7034186147*P+1.707614701*x,ge=-.0041960863*M-.7034186147*L+1.707614701*F,xe=re/(re*re-.5*He*ge),X=-He*xe;Q=K>=0?Q:1e6,ye=se>=0?ye:1e6,X=xe>=0?X:1e6,o+=Math.min(Q,Math.min(ye,X))}}}return o}function Y_(n,e,t=null){t||(t=q_(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function yA(n,e,t){let i=q_(e,t),s=j6(e,t,n,1,n,i),r=Y_(e,t,i),o=.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),a=.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e)))),l=s/Math.min(n*r[0],(1-n)*r[1]),c=n*o,u=(1-n)*a,f=.9*l*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(u*u*u*u))));return c=n*.4,u=(1-n)*.8,[Math.sqrt(1/(1/(c*c)+1/(u*u))),f,s]}function Wx(n){const e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s={mode:"okhsl",l:Qg(e)};n.alpha!==void 0&&(s.alpha=n.alpha);let r=Math.sqrt(t*t+i*i);if(!r)return s.s=0,s;let[o,a,l]=yA(e,t/r,i/r),c;if(rWx(Qd(n))},toMode:{oklab:Xx,rgb:n=>ep(Xx(n))}};function $x(n){let e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s=Math.sqrt(t*t+i*i),r=s?t/s:1,o=s?i/s:1,[a,l]=Y_(r,o),c=.5,u=1-c/a,f=l/(s+e*l),h=f*e,d=f*s,p=Fh(h),_=d*p/h,g=Jc({l:p,a:r*_,b:o*_}),m=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));e=e/m,s=s/m*Qg(e)/e,e=Qg(e);const y={mode:"okhsv",s:s?(c+l)*d/(l*c+l*u*d):0,v:e?e/h:0};return y.s&&(y.h=vn(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(y.alpha=n.alpha),y}function qx(n){const e={mode:"oklab"};n.alpha!==void 0&&(e.alpha=n.alpha);const t=n.h!==void 0?n.h:0,i=n.s!==void 0?n.s:0,s=n.v!==void 0?n.v:0,r=Math.cos(t/180*Math.PI),o=Math.sin(t/180*Math.PI),[a,l]=Y_(r,o),c=.5,u=1-c/a,f=1-i*c/(c+l-l*u*i),h=i*l*c/(c+l-l*u*i),d=Fh(f),p=h*d/f,_=Jc({l:d,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Fh(s*f),y=h*m/f;return e.l=m*g,e.a=y*r*g,e.b=y*o*g,e}const Z6={...rA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:$x,rgb:n=>$x(Qd(n))},toMode:{oklab:qx,rgb:n=>ep(qx(n))}};function J6(n,e){if(!e||e[0]!=="oklab")return;const t={mode:"oklab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*.4/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*.4/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const Q6={...X_,mode:"oklab",toMode:{lrgb:Jc,rgb:ep},fromMode:{lrgb:vA,rgb:Qd},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[J6],serialize:n=>`oklab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`};function eH(n,e){if(!e||e[0]!=="oklch")return;const t={mode:"oklch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*.4/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const tH={...$_,mode:"oklch",toMode:{oklab:n=>br(n,"oklab"),rgb:n=>ep(br(n,"oklab"))},fromMode:{rgb:n=>yr(Qd(n),"oklch"),oklab:n=>yr(n,"oklch")},parse:[eH],serialize:n=>`oklch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},Yx=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz65",x:.486570948648216*e+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*e+.6917385218365062*t+.079286914093745*i,z:0*e+.0451133818589026*t+1.043944368900976*i};return s!==void 0&&(r.alpha=s),r},jx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*2.4934969119414263-e*.9313836179191242-.402710784450717*t,g:n*-.8294889695615749+e*1.7626640603183465+.0236246858419436*t,b:n*.0358458302437845-e*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(s.alpha=i),s},nH={...Ha,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>jx(Po(n)),xyz65:jx},toMode:{rgb:n=>Io(Yx(n)),xyz65:Yx}},Fm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},Kx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"prophoto",r:Fm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:Fm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:Fm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},km=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},Zx=n=>{let e=km(n.r),t=km(n.g),i=km(n.b),s={mode:"xyz50",x:.7977666449006423*e+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*e+.7118352342418731*t+899369387256e-16*i,z:0*e+0*t+.8251046025104602*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},iH={...Ha,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Kx,rgb:n=>Kx(Zc(n))},toMode:{xyz50:Zx,rgb:n=>Kc(Zx(n))}},Jx=1.09929682680944,sH=.018053968510807,Bm=n=>{const e=Math.abs(n);return e>sH?(Math.sign(n)||1)*(Jx*Math.pow(e,.45)-(Jx-1)):4.5*n},Qx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"rec2020",r:Bm(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:Bm(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:Bm(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},eM=1.09929682680944,rH=.018053968510807,zm=(n=0)=>{let e=Math.abs(n);return e{let e=zm(n.r),t=zm(n.g),i=zm(n.b),s={mode:"xyz65",x:.6369580483012911*e+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*e+.6779980715188708*t+.059301716469862*i,z:0*e+.0280726930490874*t+1.0609850577107909*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},oH={...Ha,mode:"rec2020",fromMode:{xyz65:Qx,rgb:n=>Qx(Po(n))},toMode:{xyz65:tM,rgb:n=>Io(tM(n))},parse:["rec2020"],serialize:"rec2020"},go=.0037930732552754493,bA=Math.cbrt(go),Vm=n=>Math.cbrt(n)-bA,aH=n=>{const{r:e,g:t,b:i,alpha:s}=Ga(n),r=Vm(.3*e+.622*t+.078*i+go),o=Vm(.23*e+.692*t+.078*i+go),a=Vm(.2434226892454782*e+.2047674442449682*t+.5518098665095535*i+go),l={mode:"xyb",x:(r-o)/2,y:(r+o)/2,b:a-(r+o)/2};return s!==void 0&&(l.alpha=s),l},Hm=n=>Math.pow(n+bA,3),lH=({x:n,y:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Hm(n+e)-go,r=Hm(e-n)-go,o=Hm(t+e)-go,a=Wa({r:11.031566904639861*s-9.866943908131562*r-.16462299650829934*o,g:-3.2541473810744237*s+4.418770377582723*r-.16462299650829934*o,b:-3.6588512867136815*s+2.7129230459360922*r+1.9459282407775895*o});return i!==void 0&&(a.alpha=i),a},cH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:lH},fromMode:{rgb:aH},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Ae,y:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},uH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Kc,lab:W_},fromMode:{rgb:Zc,lab:G_},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Ae,y:Ae,z:Ae,alpha:{use:Ae,fixup:on}}},fH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz50",x:1.0479298208405488*e+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*e+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*e+.0150551448965779*t+.7518742899580008*i};return s!==void 0&&(r.alpha=s),r},hH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz65",x:.9554734527042182*e-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*e+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*e-.0205076964334779*t+1.3303659366080753*i};return s!==void 0&&(r.alpha=s),r},dH={mode:"xyz65",toMode:{rgb:Io,xyz50:fH},fromMode:{rgb:Po,xyz50:hH},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:Ae,y:Ae,z:Ae,alpha:{use:Ae,fixup:on}}},pH=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"yiq",y:.29889531*n+.58662247*e+.11448223*t,i:.59597799*n-.2741761*e-.32180189*t,q:.21147017*n-.52261711*e+.31114694*t};return i!==void 0&&(s.alpha=i),s},mH=({y:n,i:e,q:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"rgb",r:n+.95608445*e+.6208885*t,g:n-.27137664*e-.6486059*t,b:n-1.10561724*e+1.70250126*t};return i!==void 0&&(s.alpha=i),s},gH={mode:"yiq",toMode:{rgb:mH},fromMode:{rgb:pH},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Ae,i:Ae,q:Ae,alpha:{use:Ae,fixup:on}}};Et(i6);Et(u6);Et(f6);Et(h6);Et(m6);Et(nA);Et(rA);Et(T6);Et(w6);Et(P6);Et(I6);Et(X_);Et(D6);Et($_);Et(N6);Et(X6);Et($6);Et(q6);Et(K6);Et(Z6);Et(Q6);Et(tH);Et(nH);Et(iH);Et(oH);Et(Ha);Et(cH);Et(uH);Et(dH);Et(gH);const e0=178.17,_H=$w("oklch"),nM=n=>{var e;return n?(e=_H(n))==null?void 0:e.h:e0},vH=Tz("settings",()=>{const n=et(),e=ms("settings/language","en-US"),t=ms("settings/stage/view/model-renderer","2d"),i=ms("settings/audio/input","true"),s=Ee(()=>{var E;return(E=n.value)==null?void 0:E.deviceId}),{audioInputs:r}=RB({constraints:{audio:!0},requestPermissions:!0}),o=et(),a=et("/assets/live2d/models/hiyori_pro_zh.zip"),l=et("url"),c=et(!1),u=ms("settings/live2d/position",{x:0,y:0}),f=et({group:"Idle",index:0}),h=et([]),d=ms("settings/live2d/motion-map",{}),p=ms("settings/disable-transitions",!0),_=ms("settings/use-page-specific-transitions",!0),g=ms("settings/theme/colors/hue",e0),m=ms("settings/theme/colors/hue-dynamic",!1);function y(E=e0){g.value=E,m.value=!1}function b(E){y(nM(E))}function v(E){if(m.value)return!1;const T=nM(E);if(!T)return!1;const S=Math.abs(T-g.value);return S<.01||S>359.99}return $e(i,E=>{E==="false"&&(n.value=void 0),E==="true"&&(n.value=r.value[0])}),$e(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])},{immediate:!0}),{live2dModelFile:o,live2dModelUrl:a,live2dLoadSource:l,live2dCurrentMotion:f,live2dPosition:u,availableLive2dMotions:h,live2dMotionMap:d,loadingLive2dModel:c,disableTransitions:p,usePageSpecificTransitions:_,language:e,stageView:t,themeColorsHue:g,themeColorsHueDynamic:m,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:y,applyPrimaryColorFrom:b,isColorSelectedForPrimary:v}}),yH=fn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>t.value.primaryColor||"#666"),s=Ee(()=>t.value.secondaryColor||"#ccc");return Hn(()=>{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)=>(gn(),vi("div",{class:"stage-transition-3",style:Si({zIndex:t.value.zIndex||100})},null,4))}}),Lo=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},bH=Lo(yH,[["__scopeId","data-v-df576df0"]]),xH=fn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return Hn(()=>{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 gn(),vi("div",{class:"circle-expansion-transition",style:Si({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(gn(!0),vi(jt,null,t2(t.value,(o,a)=>(gn(),vi("div",{key:a}))),128))],4)}}}),MH=Lo(xH,[["__scopeId","data-v-0c29056c"]]),SH=fn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Ee(()=>`fantasy-fall-${t.value}`);return Hn(()=>{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 gn(),vi("div",{class:Oa(["fantasy-fall-transition",i.value]),style:Si({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),EH=Lo(SH,[["__scopeId","data-v-e62bf496"]]),TH=fn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Hn(()=>{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 gn(),vi("div",{class:"stage-transition-4",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[O2('
',5)]),4)}}}),wH=Lo(TH,[["__scopeId","data-v-6d1179fc"]]),AH=fn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return $e([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)}),Hn(()=>{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 gn(),vi("div",{class:"stage-transition-1",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),CH=Lo(AH,[["__scopeId","data-v-bf1d1566"]]),RH=fn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return Hn(()=>{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 gn(),vi("div",{class:"stage-transition-2",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),PH=Lo(RH,[["__scopeId","data-v-8ff7120f"]]),IH=fn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return Hn(()=>{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 gn(),vi("div",{class:"rectangle-rotate-transition",style:Si({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[ir("div",{class:"rectangle rectangle-rotate-1"},[ir("div")],-1),ir("div",{class:"rectangle rectangle-rotate-2"},[ir("div")],-1),ir("div",{class:"rectangle rectangle-rotate-3"},[ir("div")],-1)]),4)}}}),LH=Lo(IH,[["__scopeId","data-v-f4b1dc64"]]),DH=fn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(n){const e=n,t=IV(),i=et(!1),s=et(),r=et(""),o=et(),a=De({slide:{component:CH,duration:2700},"slope-slide":{component:PH,duration:2700},arrow:{component:bH,duration:2700},"multiple-blocks-reveal":{component:wH,duration:2800},"fantasy-fall":{component:EH,duration:2700},"rectangles-rotate":{component:LH,duration:2700},"bubble-wave-out":{component:MH,duration:1e3}}),l=et([]);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(e.disableTransitions){_();return}if(typeof d.meta.stageTransition!="object"){_();return}const g=d.meta.stageTransition;if(e.usePageSpecificTransitions&&g.pageSpecificAvailable){_();return}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),h(g,_)}),(d,p)=>(gn(),vi(jt,null,[n2(d.$slots,"default"),i.value?(gn(),vi(jt,{key:0},[a.value[r.value]?(gn(),Yl(e2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Rv("",!0)],64)):Rv("",!0)],64))}});/*! + * shared v11.1.2 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */const kh=typeof window<"u",Cr=(n,e=!1)=>e?Symbol.for(n):Symbol(n),OH=(n,e,t)=>NH({l:n,k:e,s:t}),NH=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Zt=n=>typeof n=="number"&&isFinite(n),UH=n=>K_(n)==="[object Date]",Bh=n=>K_(n)==="[object RegExp]",tp=n=>ht(n)&&Object.keys(n).length===0,un=Object.assign,FH=Object.create,Rt=(n=null)=>FH(n);let iM;const j_=()=>iM||(iM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Rt());function sM(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const kH=Object.prototype.hasOwnProperty;function Oi(n,e){return kH.call(n,e)}const tn=Array.isArray,kt=n=>typeof n=="function",Ne=n=>typeof n=="string",Bt=n=>typeof n=="boolean",yt=n=>n!==null&&typeof n=="object",BH=n=>yt(n)&&kt(n.then)&&kt(n.catch),xA=Object.prototype.toString,K_=n=>xA.call(n),ht=n=>K_(n)==="[object Object]",zH=n=>n==null?"":tn(n)||ht(n)&&n.toString===xA?JSON.stringify(n,null,2):String(n);function Z_(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function VH(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const ff=n=>!yt(n)||tn(n);function Pf(n,e){if(ff(n)||ff(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__"&&(yt(i[r])&&!yt(s[r])&&(s[r]=Array.isArray(i[r])?[]:Rt()),ff(s[r])||ff(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 HH(n,e,t){return{line:n,column:e,offset:t}}function t0(n,e,t){return{start:n,end:e}}const At={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},GH=17;function np(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 WH(n){throw n}const _s=" ",XH="\r",Ln=` +`,$H="\u2028",qH="\u2029";function YH(n){const e=n;let t=0,i=1,s=1,r=0;const o=S=>e[S]===XH&&e[S+1]===Ln,a=S=>e[S]===Ln,l=S=>e[S]===qH,c=S=>e[S]===$H,u=S=>o(S)||a(S)||l(S)||c(S),f=()=>t,h=()=>i,d=()=>s,p=()=>r,_=S=>o(S)||l(S)||c(S)?Ln:e[S],g=()=>_(t),m=()=>_(t+r);function y(){return r=0,u(t)&&(i++,s=0),o(t)&&t++,t++,s++,e[t]}function b(){return o(t+r)&&r++,r++,e[t+r]}function v(){t=0,i=1,s=1,r=0}function E(S=0){r=S}function T(){const S=t+r;for(;S!==t;)y();r=0}return{index:f,line:h,column:d,peekOffset:p,charAt:_,currentChar:g,currentPeek:m,next:y,peek:b,reset:v,resetPeek:E,skipToPeek:T}}const Qs=void 0,jH=".",rM="'",KH="tokenizer";function ZH(n,e={}){const t=e.location!==!1,i=YH(n),s=()=>i.index(),r=()=>HH(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(C,I,N,...A){const w=c();if(I.column+=N,I.offset+=N,u){const U=t?t0(w.startLoc,I):null,O=np(C,U,{domain:KH,args:A});u(O)}}function h(C,I,N){C.endLoc=r(),C.currentType=I;const A={type:I};return t&&(A.loc=t0(C.startLoc,C.endLoc)),N!=null&&(A.value=N),A}const d=C=>h(C,13);function p(C,I){return C.currentChar()===I?(C.next(),I):(f(At.EXPECTED_TOKEN,r(),0,I),"")}function _(C){let I="";for(;C.currentPeek()===_s||C.currentPeek()===Ln;)I+=C.currentPeek(),C.peek();return I}function g(C){const I=_(C);return C.skipToPeek(),I}function m(C){if(C===Qs)return!1;const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I===95}function y(C){if(C===Qs)return!1;const I=C.charCodeAt(0);return I>=48&&I<=57}function b(C,I){const{currentType:N}=I;if(N!==2)return!1;_(C);const A=m(C.currentPeek());return C.resetPeek(),A}function v(C,I){const{currentType:N}=I;if(N!==2)return!1;_(C);const A=C.currentPeek()==="-"?C.peek():C.currentPeek(),w=y(A);return C.resetPeek(),w}function E(C,I){const{currentType:N}=I;if(N!==2)return!1;_(C);const A=C.currentPeek()===rM;return C.resetPeek(),A}function T(C,I){const{currentType:N}=I;if(N!==7)return!1;_(C);const A=C.currentPeek()===".";return C.resetPeek(),A}function S(C,I){const{currentType:N}=I;if(N!==8)return!1;_(C);const A=m(C.currentPeek());return C.resetPeek(),A}function P(C,I){const{currentType:N}=I;if(!(N===7||N===11))return!1;_(C);const A=C.currentPeek()===":";return C.resetPeek(),A}function x(C,I){const{currentType:N}=I;if(N!==9)return!1;const A=()=>{const U=C.currentPeek();return U==="{"?m(C.peek()):U==="@"||U==="|"||U===":"||U==="."||U===_s||!U?!1:U===Ln?(C.peek(),A()):L(C,!1)},w=A();return C.resetPeek(),w}function M(C){_(C);const I=C.currentPeek()==="|";return C.resetPeek(),I}function L(C,I=!0){const N=(w=!1,U="")=>{const O=C.currentPeek();return O==="{"||O==="@"||!O?w:O==="|"?!(U===_s||U===Ln):O===_s?(C.peek(),N(!0,_s)):O===Ln?(C.peek(),N(!0,Ln)):!0},A=N();return I&&C.resetPeek(),A}function F(C,I){const N=C.currentChar();return N===Qs?Qs:I(N)?(C.next(),N):null}function H(C){const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I>=48&&I<=57||I===95||I===36}function Y(C){return F(C,H)}function ee(C){const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I>=48&&I<=57||I===95||I===36||I===45}function K(C){return F(C,ee)}function Q(C){const I=C.charCodeAt(0);return I>=48&&I<=57}function Z(C){return F(C,Q)}function de(C){const I=C.charCodeAt(0);return I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102}function be(C){return F(C,de)}function se(C){let I="",N="";for(;I=Z(C);)N+=I;return N}function ye(C){let I="";for(;;){const N=C.currentChar();if(N==="{"||N==="}"||N==="@"||N==="|"||!N)break;if(N===_s||N===Ln)if(L(C))I+=N,C.next();else{if(M(C))break;I+=N,C.next()}else I+=N,C.next()}return I}function He(C){g(C);let I="",N="";for(;I=K(C);)N+=I;return C.currentChar()===Qs&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),N}function re(C){g(C);let I="";return C.currentChar()==="-"?(C.next(),I+=`-${se(C)}`):I+=se(C),C.currentChar()===Qs&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),I}function ge(C){return C!==rM&&C!==Ln}function xe(C){g(C),p(C,"'");let I="",N="";for(;I=F(C,ge);)I==="\\"?N+=X(C):N+=I;const A=C.currentChar();return A===Ln||A===Qs?(f(At.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),A===Ln&&(C.next(),p(C,"'")),N):(p(C,"'"),N)}function X(C){const I=C.currentChar();switch(I){case"\\":case"'":return C.next(),`\\${I}`;case"u":return ae(C,I,4);case"U":return ae(C,I,6);default:return f(At.UNKNOWN_ESCAPE_SEQUENCE,r(),0,I),""}}function ae(C,I,N){p(C,I);let A="";for(let w=0;w{const A=C.currentChar();return A==="{"||A==="@"||A==="|"||A==="("||A===")"||!A||A===_s?N:(N+=A,C.next(),I(N))};return I("")}function z(C){g(C);const I=p(C,"|");return g(C),I}function R(C,I){let N=null;switch(C.currentChar()){case"{":return I.braceNest>=1&&f(At.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),C.next(),N=h(I,2,"{"),g(C),I.braceNest++,N;case"}":return I.braceNest>0&&I.currentType===2&&f(At.EMPTY_PLACEHOLDER,r(),0),C.next(),N=h(I,3,"}"),I.braceNest--,I.braceNest>0&&g(C),I.inLinked&&I.braceNest===0&&(I.inLinked=!1),N;case"@":return I.braceNest>0&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),N=te(C,I)||d(I),I.braceNest=0,N;default:{let w=!0,U=!0,O=!0;if(M(C))return I.braceNest>0&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),N=h(I,1,z(C)),I.braceNest=0,I.inLinked=!1,N;if(I.braceNest>0&&(I.currentType===4||I.currentType===5||I.currentType===6))return f(At.UNTERMINATED_CLOSING_BRACE,r(),0),I.braceNest=0,G(C,I);if(w=b(C,I))return N=h(I,4,He(C)),g(C),N;if(U=v(C,I))return N=h(I,5,re(C)),g(C),N;if(O=E(C,I))return N=h(I,6,xe(C)),g(C),N;if(!w&&!U&&!O)return N=h(I,12,ce(C)),f(At.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,N.value),g(C),N;break}}return N}function te(C,I){const{currentType:N}=I;let A=null;const w=C.currentChar();switch((N===7||N===8||N===11||N===9)&&(w===Ln||w===_s)&&f(At.INVALID_LINKED_FORMAT,r(),0),w){case"@":return C.next(),A=h(I,7,"@"),I.inLinked=!0,A;case".":return g(C),C.next(),h(I,8,".");case":":return g(C),C.next(),h(I,9,":");default:return M(C)?(A=h(I,1,z(C)),I.braceNest=0,I.inLinked=!1,A):T(C,I)||P(C,I)?(g(C),te(C,I)):S(C,I)?(g(C),h(I,11,Ue(C))):x(C,I)?(g(C),w==="{"?R(C,I)||A:h(I,10,k(C))):(N===7&&f(At.INVALID_LINKED_FORMAT,r(),0),I.braceNest=0,I.inLinked=!1,G(C,I))}}function G(C,I){let N={type:13};if(I.braceNest>0)return R(C,I)||d(I);if(I.inLinked)return te(C,I)||d(I);switch(C.currentChar()){case"{":return R(C,I)||d(I);case"}":return f(At.UNBALANCED_CLOSING_BRACE,r(),0),C.next(),h(I,3,"}");case"@":return te(C,I)||d(I);default:{if(M(C))return N=h(I,1,z(C)),I.braceNest=0,I.inLinked=!1,N;if(L(C))return h(I,0,ye(C));break}}return N}function W(){const{currentType:C,offset:I,startLoc:N,endLoc:A}=l;return l.lastType=C,l.lastOffset=I,l.lastStartLoc=N,l.lastEndLoc=A,l.offset=s(),l.startLoc=r(),i.currentChar()===Qs?h(l,13):G(i,l)}return{nextToken:W,currentOffset:s,currentPosition:r,context:c}}const JH="parser",QH=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function e8(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 t8(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,y,b,v,...E){const T=m.currentPosition();if(T.offset+=v,T.column+=v,t){const S=e?t0(b,T):null,P=np(y,S,{domain:JH,args:E});t(P)}}function s(m,y,b){const v={type:m};return e&&(v.start=y,v.end=y,v.loc={start:b,end:b}),v}function r(m,y,b,v){e&&(m.end=y,m.loc&&(m.loc.end=b))}function o(m,y){const b=m.context(),v=s(3,b.offset,b.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function a(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:E}=b,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 b=m.context(),{lastOffset:v,lastStartLoc:E}=b,T=s(4,v,E);return T.key=y,m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function c(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:E}=b,T=s(9,v,E);return T.value=y.replace(QH,e8),m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function u(m){const y=m.nextToken(),b=m.context(),{lastOffset:v,lastStartLoc:E}=b,T=s(8,v,E);return y.type!==11?(i(m,At.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),T.value="",r(T,v,E),{nextConsumeToken:y,node:T}):(y.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Gi(y)),T.value=y.value||"",r(T,m.currentOffset(),m.currentPosition()),{node:T})}function f(m,y){const b=m.context(),v=s(7,b.offset,b.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function h(m){const y=m.context(),b=s(6,y.offset,y.startLoc);let v=m.nextToken();if(v.type===8){const E=u(m);b.modifier=E.node,v=E.nextConsumeToken||m.nextToken()}switch(v.type!==9&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),v=m.nextToken(),v.type===2&&(v=m.nextToken()),v.type){case 10:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=f(m,v.value||"");break;case 4:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=l(m,v.value||"");break;case 5:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=a(m,v.value||"");break;case 6:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=c(m,v.value||"");break;default:{i(m,At.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),b.key=T,r(b,E.offset,E.startLoc),{nextConsumeToken:v,node:b}}}return r(b,m.currentOffset(),m.currentPosition()),{node:b}}function d(m){const y=m.context(),b=y.currentType===1?m.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,E=s(2,b,v);E.items=[];let T=null;do{const x=T||m.nextToken();switch(T=null,x.type){case 0:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),E.items.push(o(m,x.value||""));break;case 5:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),E.items.push(a(m,x.value||""));break;case 4:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),E.items.push(l(m,x.value||""));break;case 6:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),E.items.push(c(m,x.value||""));break;case 7:{const M=h(m);E.items.push(M.node),T=M.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const S=y.currentType===1?y.lastOffset:m.currentOffset(),P=y.currentType===1?y.lastEndLoc:m.currentPosition();return r(E,S,P),E}function p(m,y,b,v){const E=m.context();let T=v.items.length===0;const S=s(1,y,b);S.cases=[],S.cases.push(v);do{const P=d(m);T||(T=P.items.length===0),S.cases.push(P)}while(E.currentType!==13);return T&&i(m,At.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),r(S,m.currentOffset(),m.currentPosition()),S}function _(m){const y=m.context(),{offset:b,startLoc:v}=y,E=d(m);return y.currentType===13?E:p(m,b,v,E)}function g(m){const y=ZH(m,un({},n)),b=y.context(),v=s(0,b.offset,b.startLoc);return e&&v.loc&&(v.loc.source=m),v.body=_(y),n.onCacheKey&&(v.cacheKey=n.onCacheKey(m)),b.currentType!==13&&i(y,At.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,m[b.offset]||""),r(v,y.currentOffset(),y.currentPosition()),v}return{parse:g}}function Gi(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 n8(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:r=>(t.helpers.add(r),r)}}function oM(n,e){for(let t=0;taM(t)),n}function aM(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 o8(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),Ia(n,e.key),e.modifier?(n.push(", "),Ia(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function a8(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=Ne(e.mode)?e.mode:"normal",i=Ne(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=r8(n,{filename:i,breakLineCode:s,needIndent:r});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(r),o.length>0&&(a.push(`const { ${Z_(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),Ia(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 f8(n,e={}){const t=un({},e),i=!!t.jit,s=!!t.minify,r=t.optimize==null?!0:t.optimize,a=t8(t).parse(n);return i?(r&&s8(a),s&&na(a),{ast:a,code:""}):(i8(a,t),u8(a,t))}/*! + * core-base v11.1.2 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */function h8(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(j_().__INTLIFY_PROD_DEVTOOLS__=!1)}function Gm(n){return t=>d8(t,n)}function d8(n,e){const t=m8(e);if(t==null)throw Sc(0);if(Q_(t)===1){const r=_8(t);return n.plural(r.reduce((o,a)=>[...o,lM(n,a)],[]))}else return lM(n,t)}const p8=["b","body"];function m8(n){return Rr(n,p8)}const g8=["c","cases"];function _8(n){return Rr(n,g8,[])}function lM(n,e){const t=y8(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=x8(e).reduce((s,r)=>[...s,n0(n,r)],[]);return n.normalize(i)}}const v8=["s","static"];function y8(n){return Rr(n,v8)}const b8=["i","items"];function x8(n){return Rr(n,b8,[])}function n0(n,e){const t=Q_(e);switch(t){case 3:return hf(e,t);case 9:return hf(e,t);case 4:{const i=e;if(Oi(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Oi(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Sc(t)}case 5:{const i=e;if(Oi(i,"i")&&Zt(i.i))return n.interpolate(n.list(i.i));if(Oi(i,"index")&&Zt(i.index))return n.interpolate(n.list(i.index));throw Sc(t)}case 6:{const i=e,s=T8(i),r=A8(i);return n.linked(n0(n,r),s?n0(n,s):void 0,n.type)}case 7:return hf(e,t);case 8:return hf(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const M8=["t","type"];function Q_(n){return Rr(n,M8)}const S8=["v","value"];function hf(n,e){const t=Rr(n,S8);if(t)return t;throw Sc(e)}const E8=["m","modifier"];function T8(n){return Rr(n,E8)}const w8=["k","key"];function A8(n){const e=Rr(n,w8);if(e)return e;throw Sc(6)}function Rr(n,e,t){for(let i=0;in;let df=Rt();function La(n){return yt(n)&&Q_(n)===0&&(Oi(n,"b")||Oi(n,"body"))}function R8(n,e={}){let t=!1;const i=e.onError||WH;return e.onError=s=>{t=!0,i(s)},{...f8(n,e),detectError:t}}function P8(n,e){if(Ne(n)){Bt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||C8)(n),s=df[i];if(s)return s;const{ast:r,detectError:o}=R8(n,{...e,location:!1,jit:!0}),a=Gm(r);return o?a:df[i]=a}else{const t=n.cacheKey;if(t){const i=df[t];return i||(df[t]=Gm(n))}else return Gm(n)}}let Ec=null;function I8(n){Ec=n}function L8(n,e,t){Ec&&Ec.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const D8=O8("function:translate");function O8(n){return e=>Ec&&Ec.emit(n,e)}const ws={INVALID_ARGUMENT:GH,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},N8=24;function As(n){return np(n,null,void 0)}function ev(n,e){return e.locale!=null?cM(e.locale):cM(n.locale)}let Wm;function cM(n){if(Ne(n))return n;if(kt(n)){if(n.resolvedOnce&&Wm!=null)return Wm;if(n.constructor.name==="Function"){const e=n();if(BH(e))throw As(ws.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Wm=e}else throw As(ws.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw As(ws.NOT_SUPPORT_LOCALE_TYPE)}function U8(n,e,t){return[...new Set([t,...tn(e)?e:yt(e)?Object.keys(e):Ne(e)?[e]:[t]])]}function MA(n,e,t){const i=Ne(t)?t:zh,s=n;s.__localeChainCache||(s.__localeChainCache=new Map);let r=s.__localeChainCache.get(i);if(!r){r=[];let o=[t];for(;tn(o);)o=uM(r,o,e);const a=tn(e)||!ht(e)?e:e.default?e.default:null;o=Ne(a)?[a]:a,tn(o)&&uM(r,o,!1),s.__localeChainCache.set(i,r)}return r}function uM(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=G8(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=H8(r),f=Pr[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 fM=new Map;function X8(n,e){return yt(n)?n[e]:null}function $8(n,e){if(!yt(n))return null;let t=fM.get(e);if(t||(t=W8(e),t&&fM.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 Y8(){return{upper:(n,e)=>e==="text"&&Ne(n)?n.toUpperCase():e==="vnode"&&yt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&Ne(n)?n.toLowerCase():e==="vnode"&&yt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&Ne(n)?dM(n):e==="vnode"&&yt(n)&&"__v_isVNode"in n?dM(n.children):n}}let SA;function j8(n){SA=n}let EA;function K8(n){EA=n}let TA;function Z8(n){TA=n}let wA=null;const J8=n=>{wA=n},Q8=()=>wA;let AA=null;const pM=n=>{AA=n},e9=()=>AA;let mM=0;function t9(n={}){const e=kt(n.onWarn)?n.onWarn:VH,t=Ne(n.version)?n.version:q8,i=Ne(n.locale)||kt(n.locale)?n.locale:zh,s=kt(i)?zh:i,r=tn(n.fallbackLocale)||ht(n.fallbackLocale)||Ne(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,o=ht(n.messages)?n.messages:Xm(s),a=ht(n.datetimeFormats)?n.datetimeFormats:Xm(s),l=ht(n.numberFormats)?n.numberFormats:Xm(s),c=un(Rt(),n.modifiers,Y8()),u=n.pluralRules||Rt(),f=kt(n.missing)?n.missing:null,h=Bt(n.missingWarn)||Bh(n.missingWarn)?n.missingWarn:!0,d=Bt(n.fallbackWarn)||Bh(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,_=!!n.unresolving,g=kt(n.postTranslation)?n.postTranslation:null,m=ht(n.processor)?n.processor:null,y=Bt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,b=!!n.escapeParameter,v=kt(n.messageCompiler)?n.messageCompiler:SA,E=kt(n.messageResolver)?n.messageResolver:EA||X8,T=kt(n.localeFallbacker)?n.localeFallbacker:TA||U8,S=yt(n.fallbackContext)?n.fallbackContext:void 0,P=n,x=yt(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,M=yt(P.__numberFormatters)?P.__numberFormatters:new Map,L=yt(P.__meta)?P.__meta:{};mM++;const F={version:t,cid:mM,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:b,messageCompiler:v,messageResolver:E,localeFallbacker:T,fallbackContext:S,onWarn:e,__meta:L};return F.datetimeFormats=a,F.numberFormats=l,F.__datetimeFormatters=x,F.__numberFormatters=M,__INTLIFY_PROD_DEVTOOLS__&&L8(F,t,L),F}const Xm=n=>({[n]:Rt()});function tv(n,e,t,i,s){const{missing:r,onWarn:o}=n;if(r!==null){const a=r(n,t,e,s);return Ne(a)?a:e}else return e}function ul(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function n9(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function i9(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{CA.includes(l)?o[l]=t[l]:r[l]=t[l]}),Ne(i)?r.locale=i:ht(i)&&(o=i),ht(s)&&(o=s),[r.key||"",a,r,o]}function _M(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__datetimeFormatters.has(r)&&i.__datetimeFormatters.delete(r)}}function vM(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:s,onWarn:r,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=s0(...e),h=Bt(u.missingWarn)?u.missingWarn:n.missingWarn;Bt(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const d=!!u.part,p=ev(n,u),_=o(n,s,p);if(!Ne(l)||l==="")return new Intl.NumberFormat(p,f).format(c);let g={},m,y=null;const b="number format";for(let T=0;T<_.length&&(m=_[T],g=t[m]||{},y=g[l],!ht(y));T++)tv(n,l,m,h,b);if(!ht(y)||!Ne(m))return i?ip:l;let v=`${m}__${l}`;tp(f)||(v=`${v}__${JSON.stringify(f)}`);let E=a.get(v);return E||(E=new Intl.NumberFormat(m,un({},y,f)),a.set(v,E)),d?E.formatToParts(c):E.format(c)}const RA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function s0(...n){const[e,t,i,s]=n,r=Rt();let o=Rt();if(!Zt(e))throw As(ws.INVALID_ARGUMENT);const a=e;return Ne(t)?r.key=t:ht(t)&&Object.keys(t).forEach(l=>{RA.includes(l)?o[l]=t[l]:r[l]=t[l]}),Ne(i)?r.locale=i:ht(i)&&(o=i),ht(s)&&(o=s),[r.key||"",a,r,o]}function yM(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__numberFormatters.has(r)&&i.__numberFormatters.delete(r)}}const s9=n=>n,r9=n=>"",o9="text",a9=n=>n.length===0?"":Z_(n),l9=zH;function bM(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function c9(n){const e=Zt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(Zt(n.named.count)||Zt(n.named.n))?Zt(n.named.count)?n.named.count:Zt(n.named.n)?n.named.n:e:e}function u9(n,e){e.count||(e.count=n),e.n||(e.n=n)}function f9(n={}){const e=n.locale,t=c9(n),i=yt(n.pluralRules)&&Ne(e)&&kt(n.pluralRules[e])?n.pluralRules[e]:bM,s=yt(n.pluralRules)&&Ne(e)&&kt(n.pluralRules[e])?bM:void 0,r=m=>m[i(t,m.length,s)],o=n.list||[],a=m=>o[m],l=n.named||Rt();Zt(n.pluralIndex)&&u9(t,l);const c=m=>l[m];function u(m,y){const b=kt(n.messages)?n.messages(m,!!y):yt(n.messages)?n.messages[m]:!1;return b||(n.parent?n.parent.message(m):r9)}const f=m=>n.modifiers?n.modifiers[m]:s9,h=ht(n.processor)&&kt(n.processor.normalize)?n.processor.normalize:a9,d=ht(n.processor)&&kt(n.processor.interpolate)?n.processor.interpolate:l9,p=ht(n.processor)&&Ne(n.processor.type)?n.processor.type:o9,g={list:a,named:c,plural:r,linked:(m,...y)=>{const[b,v]=y;let E="text",T="";y.length===1?yt(b)?(T=b.modifier||T,E=b.type||E):Ne(b)&&(T=b||T):y.length===2&&(Ne(b)&&(T=b||T),Ne(v)&&(E=v||E));const S=u(m,!0)(g),P=E==="vnode"&&tn(S)&&T?S[0]:S;return T?f(T)(P,E):P},message:u,type:p,interpolate:d,normalize:h,values:un(Rt(),o,l)};return g}const xM=()=>"",mi=n=>kt(n);function MM(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:r,fallbackLocale:o,messages:a}=n,[l,c]=r0(...e),u=Bt(c.missingWarn)?c.missingWarn:n.missingWarn,f=Bt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,h=Bt(c.escapeParameter)?c.escapeParameter:n.escapeParameter,d=!!c.resolvedMessage,p=Ne(c.default)||Bt(c.default)?Bt(c.default)?r?l:()=>l:c.default:t?r?l:()=>l:null,_=t||p!=null&&(Ne(p)||kt(p)),g=ev(n,c);h&&h9(c);let[m,y,b]=d?[l,g,a[g]||Rt()]:PA(n,l,g,o,f,u),v=m,E=l;if(!d&&!(Ne(v)||La(v)||mi(v))&&_&&(v=p,E=v),!d&&(!(Ne(v)||La(v)||mi(v))||!Ne(y)))return s?ip:l;let T=!1;const S=()=>{T=!0},P=mi(v)?v:IA(n,l,y,v,E,S);if(T)return v;const x=m9(n,y,b,c),M=f9(x),L=d9(n,P,M),F=i?i(L,l):L;if(__INTLIFY_PROD_DEVTOOLS__){const H={timestamp:Date.now(),key:Ne(l)?l:mi(v)?v.key:"",locale:y||(mi(v)?v.locale:""),format:Ne(v)?v:mi(v)?v.source:"",message:F};H.meta=un({},n.__meta,Q8()||{}),D8(H)}return F}function h9(n){tn(n.list)?n.list=n.list.map(e=>Ne(e)?sM(e):e):yt(n.named)&&Object.keys(n.named).forEach(e=>{Ne(n.named[e])&&(n.named[e]=sM(n.named[e]))})}function PA(n,e,t,i,s,r){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Rt(),h,d=null;const p="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,p9(n,t,s,i,a,r));return l.locale=t,l.key=e,l.source=i,l}function d9(n,e,t){return e(t)}function r0(...n){const[e,t,i]=n,s=Rt();if(!Ne(e)&&!Zt(e)&&!mi(e)&&!La(e))throw As(ws.INVALID_ARGUMENT);const r=Zt(e)?String(e):(mi(e),e);return Zt(t)?s.plural=t:Ne(t)?s.default=t:ht(t)&&!tp(t)?s.named=t:tn(t)&&(s.list=t),Zt(i)?s.plural=i:Ne(i)?s.default=i:ht(i)&&un(s,i),[r,s]}function p9(n,e,t,i,s,r){return{locale:e,key:t,warnHtmlMessage:s,onError:o=>{throw r&&r(o),o},onCacheKey:o=>OH(e,t,o)}}function m9(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]=PA(u||n,d,e,a,l,c);_=o(g,d)}if(Ne(_)||La(_)){let g=!1;const y=IA(n,d,e,_,d,()=>{g=!0});return g?xM:y}else return mi(_)?_:xM}};return n.processor&&(h.processor=n.processor),i.list&&(h.list=i.list),i.named&&(h.named=i.named),Zt(i.plural)&&(h.pluralIndex=i.plural),h}h8();/*! + * vue-i18n v11.1.2 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */const g9="11.1.2";function _9(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(j_().__INTLIFY_PROD_DEVTOOLS__=!1)}const Mi={UNEXPECTED_RETURN_TYPE:N8,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 zi(n,...e){return np(n,null,void 0)}const o0=Cr("__translateVNode"),a0=Cr("__datetimeParts"),l0=Cr("__numberParts"),v9=Cr("__setPluralRules"),y9=Cr("__injectWithOption"),c0=Cr("__dispose");function Tc(n){if(!yt(n))return n;for(const e in n)if(Oi(n,e))if(!e.includes("."))yt(n[e])&&Tc(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]||Rt(),Pf(c,o[l])):Pf(c,o)}else Ne(a)&&Pf(JSON.parse(a),o)}),s==null&&r)for(const a in o)Oi(o,a)&&Tc(o[a]);return o}function DA(n){return n.type}function b9(n,e,t){let i=yt(e.messages)?e.messages:Rt();"__i18nGlobal"in t&&(i=LA(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(r=>{n.mergeLocaleMessage(r,i[r])});{if(yt(e.datetimeFormats)){const r=Object.keys(e.datetimeFormats);r.length&&r.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(yt(e.numberFormats)){const r=Object.keys(e.numberFormats);r.length&&r.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function SM(n){return pn(Ic,null,n,0)}const EM="__INTLIFY_META__",TM=()=>[],x9=()=>!1;let wM=0;function AM(n){return(e,t,i,s)=>n(t,i,wn()||void 0,s)}const M9=()=>{const n=wn();let e=null;return n&&(e=DA(n)[EM])?{[EM]:e}:null};function OA(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,r=kh?et:De;let o=Bt(n.inheritLocale)?n.inheritLocale:!0;const a=r(e&&o?e.locale.value:Ne(n.locale)?n.locale:zh),l=r(e&&o?e.fallbackLocale.value:Ne(n.fallbackLocale)||tn(n.fallbackLocale)||ht(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=r(LA(a.value,n)),u=r(ht(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=r(ht(n.numberFormats)?n.numberFormats:{[a.value]:{}});let h=e?e.missingWarn:Bt(n.missingWarn)||Bh(n.missingWarn)?n.missingWarn:!0,d=e?e.fallbackWarn:Bt(n.fallbackWarn)||Bh(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:Bt(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=kt(n.missing)?n.missing:null,m=kt(n.missing)?AM(n.missing):null,y=kt(n.postTranslation)?n.postTranslation:null,b=e?e.warnHtmlMessage:Bt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,v=!!n.escapeParameter;const E=e?e.modifiers:ht(n.modifiers)?n.modifiers:{};let T=n.pluralRules||e&&e.pluralRules,S;S=(()=>{i&&pM(null);const O={version:g9,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:b,escapeParameter:v,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};O.datetimeFormats=u.value,O.numberFormats=f.value,O.__datetimeFormatters=ht(S)?S.__datetimeFormatters:void 0,O.__numberFormatters=ht(S)?S.__numberFormatters:void 0;const V=t9(O);return i&&pM(V),V})(),ul(S,a.value,l.value);function x(){return[a.value,l.value,c.value,u.value,f.value]}const M=Ee({get:()=>a.value,set:O=>{S.locale=O,a.value=O}}),L=Ee({get:()=>l.value,set:O=>{S.fallbackLocale=O,l.value=O,ul(S,a.value,O)}}),F=Ee(()=>c.value),H=Ee(()=>u.value),Y=Ee(()=>f.value);function ee(){return kt(y)?y:null}function K(O){y=O,S.postTranslation=O}function Q(){return g}function Z(O){O!==null&&(m=AM(O)),g=O,S.missing=m}const de=(O,V,$,ue,le,Me)=>{x();let Be;try{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=e?e9():void 0),Be=O(S)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=void 0)}if($!=="translate exists"&&Zt(Be)&&Be===ip||$==="translate exists"&&!Be){const[me,Te]=V();return e&&p?ue(e):le(me)}else{if(Me(Be))return Be;throw zi(Mi.UNEXPECTED_RETURN_TYPE)}};function be(...O){return de(V=>Reflect.apply(MM,null,[V,...O]),()=>r0(...O),"translate",V=>Reflect.apply(V.t,V,[...O]),V=>V,V=>Ne(V))}function se(...O){const[V,$,ue]=O;if(ue&&!yt(ue))throw zi(Mi.INVALID_ARGUMENT);return be(V,$,un({resolvedMessage:!0},ue||{}))}function ye(...O){return de(V=>Reflect.apply(gM,null,[V,...O]),()=>i0(...O),"datetime format",V=>Reflect.apply(V.d,V,[...O]),()=>hM,V=>Ne(V))}function He(...O){return de(V=>Reflect.apply(vM,null,[V,...O]),()=>s0(...O),"number format",V=>Reflect.apply(V.n,V,[...O]),()=>hM,V=>Ne(V))}function re(O){return O.map(V=>Ne(V)||Zt(V)||Bt(V)?SM(String(V)):V)}const xe={normalize:re,interpolate:O=>O,type:"vnode"};function X(...O){return de(V=>{let $;const ue=V;try{ue.processor=xe,$=Reflect.apply(MM,null,[ue,...O])}finally{ue.processor=null}return $},()=>r0(...O),"translate",V=>V[o0](...O),V=>[SM(V)],V=>tn(V))}function ae(...O){return de(V=>Reflect.apply(vM,null,[V,...O]),()=>s0(...O),"number format",V=>V[l0](...O),TM,V=>Ne(V)||tn(V))}function fe(...O){return de(V=>Reflect.apply(gM,null,[V,...O]),()=>i0(...O),"datetime format",V=>V[a0](...O),TM,V=>Ne(V)||tn(V))}function ce(O){T=O,S.pluralRules=T}function Ue(O,V){return de(()=>{if(!O)return!1;const $=Ne(V)?V:a.value,ue=R($),le=S.messageResolver(ue,O);return La(le)||mi(le)||Ne(le)},()=>[O],"translate exists",$=>Reflect.apply($.te,$,[O,V]),x9,$=>Bt($))}function k(O){let V=null;const $=MA(S,l.value,a.value);for(let ue=0;ue<$.length;ue++){const le=c.value[$[ue]]||{},Me=S.messageResolver(le,O);if(Me!=null){V=Me;break}}return V}function z(O){const V=k(O);return V??(e?e.tm(O)||{}:{})}function R(O){return c.value[O]||{}}function te(O,V){if(s){const $={[O]:V};for(const ue in $)Oi($,ue)&&Tc($[ue]);V=$[O]}c.value[O]=V,S.messages=c.value}function G(O,V){c.value[O]=c.value[O]||{};const $={[O]:V};if(s)for(const ue in $)Oi($,ue)&&Tc($[ue]);V=$[O],Pf(V,c.value[O]),S.messages=c.value}function W(O){return u.value[O]||{}}function C(O,V){u.value[O]=V,S.datetimeFormats=u.value,_M(S,O,V)}function I(O,V){u.value[O]=un(u.value[O]||{},V),S.datetimeFormats=u.value,_M(S,O,V)}function N(O){return f.value[O]||{}}function A(O,V){f.value[O]=V,S.numberFormats=f.value,yM(S,O,V)}function w(O,V){f.value[O]=un(f.value[O]||{},V),S.numberFormats=f.value,yM(S,O,V)}wM++,e&&kh&&($e(e.locale,O=>{o&&(a.value=O,S.locale=O,ul(S,a.value,l.value))}),$e(e.fallbackLocale,O=>{o&&(l.value=O,S.fallbackLocale=O,ul(S,a.value,l.value))}));const U={id:wM,locale:M,fallbackLocale:L,get inheritLocale(){return o},set inheritLocale(O){o=O,O&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,ul(S,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:F,get modifiers(){return E},get pluralRules(){return T||{}},get isGlobal(){return i},get missingWarn(){return h},set missingWarn(O){h=O,S.missingWarn=h},get fallbackWarn(){return d},set fallbackWarn(O){d=O,S.fallbackWarn=d},get fallbackRoot(){return p},set fallbackRoot(O){p=O},get fallbackFormat(){return _},set fallbackFormat(O){_=O,S.fallbackFormat=_},get warnHtmlMessage(){return b},set warnHtmlMessage(O){b=O,S.warnHtmlMessage=O},get escapeParameter(){return v},set escapeParameter(O){v=O,S.escapeParameter=O},t:be,getLocaleMessage:R,setLocaleMessage:te,mergeLocaleMessage:G,getPostTranslationHandler:ee,setPostTranslationHandler:K,getMissingHandler:Q,setMissingHandler:Z,[v9]:ce};return U.datetimeFormats=H,U.numberFormats=Y,U.rt=se,U.te=Ue,U.tm=z,U.d=ye,U.n=He,U.getDateTimeFormat=W,U.setDateTimeFormat=C,U.mergeDateTimeFormat=I,U.getNumberFormat=N,U.setNumberFormat=A,U.mergeNumberFormat=w,U[y9]=t,U[o0]=X,U[a0]=fe,U[l0]=ae,U}const nv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function S9({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===jt?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},Rt())}function NA(){return jt}const E9=fn({name:"i18n-t",props:un({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>Zt(n)||!isNaN(n)}},nv),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||sp({useScope:n.scope,__useComponent:!0});return()=>{const r=Object.keys(t).filter(f=>f!=="_"),o=Rt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=Ne(n.plural)?+n.plural:n.plural);const a=S9(e,r),l=s[o0](n.keypath,a,o),c=un(Rt(),i),u=Ne(n.tag)||yt(n.tag)?n.tag:NA();return Ls(u,c,l)}}}),CM=E9;function T9(n){return tn(n)&&!Ne(n[0])}function UA(n,e,t,i){const{slots:s,attrs:r}=e;return()=>{const o={part:!0};let a=Rt();n.locale&&(o.locale=n.locale),Ne(n.format)?o.key=n.format:yt(n.format)&&(Ne(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((h,d)=>t.includes(d)?un(Rt(),h,{[d]:n.format[d]}):h,Rt()));const l=i(n.value,o,a);let c=[o.key];tn(l)?c=l.map((h,d)=>{const p=s[h.type],_=p?p({[h.type]:h.value,index:d,parts:l}):[h.value];return T9(_)&&(_[0].key=`${h.type}-${d}`),_}):Ne(l)&&(c=[l]);const u=un(Rt(),r),f=Ne(n.tag)||yt(n.tag)?n.tag:NA();return Ls(f,u,c)}}const w9=fn({name:"i18n-n",props:un({value:{type:Number,required:!0},format:{type:[String,Object]}},nv),setup(n,e){const t=n.i18n||sp({useScope:n.scope,__useComponent:!0});return UA(n,e,RA,(...i)=>t[l0](...i))}}),RM=w9;function A9(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 C9(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw zi(Mi.UNEXPECTED_ERROR);const c=A9(n,a.$),u=PM(l);return[Reflect.apply(c.t,c,[...IM(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);kh&&n.global===c&&(o.__i18nWatcher=$e(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{kh&&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=PM(a);o.textContent=Reflect.apply(l.t,l,[...IM(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function PM(n){if(Ne(n))return{path:n};if(ht(n)){if(!("path"in n))throw zi(Mi.REQUIRED_VALUE,"path");return n}else throw zi(Mi.INVALID_VALUE)}function IM(n){const{path:e,locale:t,args:i,choice:s,plural:r}=n,o={},a=i||{};return Ne(t)&&(o.locale=t),Zt(s)&&(o.plural=s),Zt(r)&&(o.plural=r),[e,a,o]}function R9(n,e,...t){const i=ht(t[0])?t[0]:{};(Bt(i.globalInstall)?i.globalInstall:!0)&&([CM.name,"I18nT"].forEach(r=>n.component(r,CM)),[RM.name,"I18nN"].forEach(r=>n.component(r,RM)),[DM.name,"I18nD"].forEach(r=>n.component(r,DM))),n.directive("t",C9(e))}const P9=Cr("global-vue-i18n");function I9(n={}){const e=Bt(n.globalInjection)?n.globalInjection:!0,t=new Map,[i,s]=L9(n),r=Cr("");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),ht(f[0])){const p=f[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let h=null;e&&(h=z9(u,c.global)),R9(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 sp(n={}){const e=wn();if(e==null)throw zi(Mi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw zi(Mi.NOT_INSTALLED);const t=D9(e),i=N9(t),s=DA(e),r=O9(n,s);if(r==="global")return b9(i,n,s),i;if(r==="parent"){let l=U9(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=un({},n);"__i18n"in s&&(l.__i18n=s.__i18n),i&&(l.__root=i),a=OA(l),o.__composerExtend&&(a[c0]=o.__composerExtend(a)),k9(o,e,a),o.__setInstance(e,a)}return a}function L9(n,e){const t=g0(),i=t.run(()=>OA(n));if(i==null)throw zi(Mi.UNEXPECTED_ERROR);return[t,i]}function D9(n){const e=mn(n.isCE?P9:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw zi(n.isCE?Mi.NOT_INSTALLED_WITH_PROVIDE:Mi.UNEXPECTED_ERROR);return e}function O9(n,e){return tp(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function N9(n){return n.mode==="composition"?n.global:n.global.__composer}function U9(n,e,t=!1){let i=null;const s=e.root;let r=F9(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 F9(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function k9(n,e,t){Hn(()=>{},e),ts(()=>{const i=t;n.__deleteInstance(e);const s=i[c0];s&&(s(),delete i[c0])},e)}const B9=["locale","fallbackLocale","availableLocales"],LM=["t","rt","d","n","tm","te"];function z9(n,e){const t=Object.create(null);return B9.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r)throw zi(Mi.UNEXPECTED_ERROR);const o=Pt(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,LM.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r||!r.value)throw zi(Mi.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,r)}),()=>{delete n.config.globalProperties.$i18n,LM.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const V9=fn({name:"i18n-d",props:un({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},nv),setup(n,e){const t=n.i18n||sp({useScope:n.scope,__useComponent:!0});return UA(n,e,CA,(...i)=>t[a0](...i))}}),DM=V9;_9();j8(P8);K8($8);Z8(MA);if(__INTLIFY_PROD_DEVTOOLS__){const n=j_();n.__INTLIFY__=!0,I8(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const H9=fn({__name:"App",setup(n){const e=sp(),t=wz(vH()),i=CB(),s=Ee(()=>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=Ee(()=>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=Ee(()=>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=Ee(()=>[s.value,r.value,o.value,i.value?"#121212":"#FFFFFF"]);return $e(t.language,()=>{e.locale.value=t.language.value}),$e(t.themeColorsHue,()=>{document.documentElement.style.setProperty("--theme-colors-hue",t.themeColorsHue.value.toString())},{immediate:!0}),$e(t.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle("dynamic-hue",t.themeColorsHueDynamic.value)},{immediate:!0}),(l,c)=>(gn(),Yl(Ot(DH),{"primary-color":s.value,"secondary-color":r.value,"tertiary-color":o.value,colors:a.value,"z-index":100,"disable-transitions":Ot(t).disableTransitions.value,"use-page-specific-transitions":Ot(t).usePageSpecificTransitions.value},{default:mS(()=>[pn(Ot(Ww))]),_:1},8,["primary-color","secondary-color","tertiary-color","colors","disable-transitions","use-page-specific-transitions"]))}}),$m=n=>n&&typeof n=="object"&&!Array.isArray(n),u0=(n,...e)=>{if(!e.length)return n;const t=e.shift();if($m(n)&&$m(t))for(const i in t)$m(t[i])?(n[i]||Object.assign(n,{[i]:{}}),u0(n[i],t[i])):Object.assign(n,{[i]:t[i]});return u0(n,...e)},FA=u0({},{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"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"Some pages will have their own transitions, this will override the stage transitions"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Use Page Specific 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"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"Edit motion map"}}},"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"}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"Activate"}},active:{t:0,b:{t:2,i:[{t:3}],s:"Active"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"Cancel"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"Card not found"}},character:{t:0,b:{t:2,i:[{t:3}],s:"Character"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness / Model"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"created by"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"Creator Notes"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"Delete"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"Delete Card"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"Are you sure you want to delete this card?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"Use Airi character card presets"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"Description"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"Personality"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"Post-History Instructions"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"Scenario"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Model"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Voice"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"System Prompt"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi Card"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"Upload"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"Where memories got stored, and organized"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Memory"}}},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:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"Stop"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"Please select a voice"}}}},"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"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter SSML text..."}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enable to input raw SSML instead of plain text"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Use Custom SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Speech"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}}},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"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API Key Input"}}}}},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:{anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"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"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"Tune the pitch of synthesized speech (e.g., sharper or coarser)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Pitch"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the speed of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the volume of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Volume"}}}}}},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"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech Service region"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Region"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure Speech"}}},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"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},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"}},"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:"Color Scheme"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"Developer"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi Green"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"The default greenish theme color, brought by Airi to you!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Default Color"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Beige"}},{t:0,b:{t:2,i:[{t:3}],s:"Ash Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Light Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Ivory"}},{t:0,b:{t:2,i:[{t:3}],s:"Olive Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Grey"}}],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"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Sky Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Mist"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Moss Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Water Lily"}},{t:0,b:{t:2,i:[{t:3}],s:"Wheat"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Sage"}}],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"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Tan"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Umber"}},{t:0,b:{t:2,i:[{t:3}],s:"Coffee"}},{t:0,b:{t:2,i:[{t:3}],s:"Bronze"}},{t:0,b:{t:2,i:[{t:3}],s:"Gold"}},{t:0,b:{t:2,i:[{t:3}],s:"Mustard"}},{t:0,b:{t:2,i:[{t:3}],s:"Amber"}}],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"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Nordic Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ice"}},{t:0,b:{t:2,i:[{t:3}],s:"Fjord"}},{t:0,b:{t:2,i:[{t:3}],s:"Steel"}},{t:0,b:{t:2,i:[{t:3}],s:"Glacier"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate"}},{t:0,b:{t:2,i:[{t:3}],s:"Cloud"}},{t:0,b:{t:2,i:[{t:3}],s:"Stone"}}],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"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Rosy Dawn"}},{t:0,b:{t:2,i:[{t:3}],s:"Chinese Red"}},{t:0,b:{t:2,i:[{t:3}],s:"Smoky Brown"}},{t:0,b:{t:2,i:[{t:3}],s:"Bamboo Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Dark Purple"}},{t:0,b:{t:2,i:[{t:3}],s:"Golden Yellow"}},{t:0,b:{t:2,i:[{t:3}],s:"Azure Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ochre"}}],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"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme Presets"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Appearance"}}}},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:"是否开启舞台动画"}}},"use-page-specific-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}},description:{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:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},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:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"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:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{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"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},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:{anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"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"}}},common:{fields:{field:{pitch:{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:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},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"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},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"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},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:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{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:"外观"}}}},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:"等待中"}}}}}),G9=I9({locale:W9(),fallbackLocale:"en",messages:FA});function W9(){const n=localStorage.getItem("settings/language"),e=Object.keys(FA);return n&&e.includes(n)?n:"en"}const X9=yz(),$9=Az(LV);let Qc;Qc=RV({routes:$9,history:rV()});Qc.beforeEach((n,e)=>{n.path!==e.path&&Aw.start()});Qc.afterEach(()=>{Aw.done()});Qc.isReady().then(async()=>{}).catch(()=>{});ER(H9).use(pz).use(WR).use(Qc).use(X9).use(G9).use(sB).mount("#app");export{ki as $,K9 as A,gR as B,Rv as C,aC as D,aS as E,bT as F,De as G,ts as H,ss as I,he as J,Fa as K,rr as L,XR as M,mt as N,Dd as O,Kt as P,Jn as Q,Ww as R,tL as S,$R as T,Mh as U,B as V,Ce as W,lt as X,_d as Y,dG as Z,Mo as _,ir as a,SI as a$,zn as a0,nE as a1,jn as a2,li as a3,Ye as a4,Vn as a5,gt as a6,sL as a7,Tn as a8,K0 as a9,lg as aA,iL as aB,b_ as aC,Ef as aD,F0 as aE,sa as aF,en as aG,Ml as aH,ji as aI,nc as aJ,ic as aK,yL as aL,e3 as aM,n3 as aN,t3 as aO,ei as aP,vg as aQ,Us as aR,AE as aS,xo as aT,Nn as aU,VE as aV,HE as aW,GE as aX,cE as aY,Ta as aZ,dt as a_,Ba as aa,A0 as ab,nG as ac,Pt as ad,fG as ae,Rc as af,Ii as ag,Xh as ah,_0 as ai,Dc as aj,$t as ak,wo as al,is as am,Ua as an,Zi as ao,yd as ap,Wt as aq,Bn as ar,Ct as as,sc as at,gd as au,Bs as av,Ji as aw,_n as ax,gi as ay,wE as az,pn as b,mn as b$,RI as b0,t_ as b1,An as b2,Gn as b3,c_ as b4,lE as b5,rs as b6,_r as b7,fE as b8,hE as b9,_R as bA,aG as bB,CB as bC,_G as bD,IV as bE,AG as bF,D2 as bG,ms as bH,sG as bI,oG as bJ,vR as bK,Kv as bL,yG as bM,xG as bN,$w as bO,IT as bP,pG as bQ,e0 as bR,j9 as bS,Y9 as bT,L2 as bU,N2 as bV,cG as bW,wn as bX,Z9 as bY,pf as bZ,ai as b_,oa as ba,vd as bb,gc as bc,e_ as bd,mc as be,pc as bf,Wc as bg,ft as bh,Ds as bi,Gc as bj,YI as bk,iB as bl,mz as bm,Lo as bn,TV as bo,TT as bp,Ig as bq,lS as br,Va as bs,SG as bt,bG as bu,Sr as bv,eG as bw,jt as bx,t2 as by,RB as bz,vi as c,tG as c0,e2 as c1,J9 as c2,Ls as c3,xi as c4,Fn as c5,dr as c6,iG as c7,rG as c8,bi as c9,g0 as ca,AS as cb,S0 as cc,fr as cd,Di as ce,dn as cf,hG as cg,uG as ch,TG as ci,_c as cj,Er as ck,we as cl,nt as cm,y3 as cn,eL as co,vL as cp,ct as cq,wG as cr,lG as cs,fn as d,Ot as e,Tz as f,et as g,Ee as h,gG as i,EG as j,vG as k,Hn as l,n2 as m,Si as n,gn as o,mG as p,sp as q,Q9 as r,wz as s,ut as t,MG as u,vH as v,$e as w,Yl as x,mS as y,Oa as z};